Skip to content

Commit

Permalink
Add: Development setup docs and additional GitHub files
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterVinter committed Nov 17, 2024
1 parent e7b7c99 commit 7de4137
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Auto detect text files and perform LF normalization
* text=auto

# PowerShell files
*.ps1 text eol=crlf
*.psm1 text eol=crlf
*.psd1 text eol=crlf

# Batch files
*.cmd text eol=crlf
*.bat text eol=crlf

# Documentation
*.md text
*.txt text
*.yml text
*.yaml text
38 changes: 38 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,44 @@ We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.
- Coding standards
- Development process

## Development Setup

### Prerequisites for Development
- Windows 10/11
- PowerShell 5.1 or higher
- Docker Desktop for Windows
- Git
- Your favorite code editor (VS Code recommended)

### Development Environment Setup
1. Clone the repository
```bash
git clone https://github.com/PeterVinter/docker-graceful-shutdown-for-windows.git
cd docker-graceful-shutdown-for-windows
```

2. Set up PowerShell execution policy (if needed)
```powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
```

3. Test the scripts
```cmd
shutdownallcontainers.cmd -test
```

### Code Style Guidelines
- Use clear, descriptive variable names
- Add comments for complex logic
- Follow [PowerShell Best Practices](https://docs.microsoft.com/en-us/powershell/scripting/developer/cmdlet/cmdlet-development-guidelines)

### Testing
Before submitting changes:
1. Run the script with `-test` parameter
2. Test with various container configurations
3. Verify proper error handling
4. Check script performance

## License

MIT License - Feel free to modify and distribute
61 changes: 61 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Security Policy

## Supported Versions

This project is currently under active development. We provide security updates for the following versions:

| Version | Supported |
| ------- | ------------------ |
| 1.x.x | :white_check_mark: |

## Reporting a Vulnerability

If you discover a security vulnerability within this project, please follow these steps:

1. **Do Not** open a public issue
2. Send a private email to [your-email@example.com] (replace with your email)
3. Include:
- A description of the vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (if any)

You can expect:
- Acknowledgment of your report within 48 hours
- Regular updates on the progress
- Credit in the security advisory (unless you prefer to remain anonymous)

## Security Best Practices

When using this utility:

1. **Run with Appropriate Permissions**
- Use minimal required permissions
- Avoid running as root/admin unless necessary

2. **Environment Security**
- Keep Docker up to date
- Keep PowerShell up to date
- Use latest Windows security updates

3. **Script Verification**
- Always verify script signatures
- Download only from official repository
- Check script contents before execution

## Security Features

This utility includes several security measures:

1. **Safe Container Shutdown**
- Graceful shutdown to prevent data corruption
- Proper cleanup of resources

2. **Error Handling**
- Secure error messages
- No sensitive information in logs
- Proper exit codes

## Audit Logging

The script provides basic logging of shutdown operations. Consider enabling Docker's audit logging for additional security monitoring.

0 comments on commit 7de4137

Please sign in to comment.