|
| 1 | +# Contributing Guide |
| 2 | + |
| 3 | +## Adding a New Game Recipe |
| 4 | + |
| 5 | +### Structure |
| 6 | +Each game recipe lives in `games/{publisher}/{game}/`: |
| 7 | + |
| 8 | +``` |
| 9 | +games/ |
| 10 | + rockstar/ |
| 11 | + fivem/ |
| 12 | + Dockerfile |
| 13 | + start.sh |
| 14 | + recipe.json |
| 15 | + README.md |
| 16 | + .dockerignore |
| 17 | +``` |
| 18 | + |
| 19 | +### Required Files |
| 20 | + |
| 21 | +1. **Dockerfile** - Alpine-based container image (keep it minimal) |
| 22 | +2. **start.sh** - Server startup script with configuration handling |
| 23 | +3. **recipe.json** - Pterodactyl egg definition (PTDL_v2 format) |
| 24 | +4. **README.md** - Quick start and usage guide |
| 25 | +5. **.dockerignore** - Exclude unnecessary files from build context |
| 26 | + |
| 27 | +### Checklist |
| 28 | + |
| 29 | +- [ ] Create directory structure `games/{publisher}/{game}/` |
| 30 | +- [ ] Add Dockerfile using Alpine base |
| 31 | +- [ ] Create start.sh with environment variable handling |
| 32 | +- [ ] Define recipe.json with proper Pterodactyl format |
| 33 | +- [ ] Write clear README with examples |
| 34 | +- [ ] Add game to matrix in `games.yml`: |
| 35 | + ```yaml |
| 36 | + matrix: |
| 37 | + game: |
| 38 | + - minecraft |
| 39 | + - rockstar/fivem |
| 40 | + - rockstar/redm # your new game here |
| 41 | + ``` |
| 42 | +- [ ] Push to develop branch (triggers workflow test) |
| 43 | +- [ ] Verify build succeeds in Actions |
| 44 | +
|
| 45 | +### Code Standards |
| 46 | +
|
| 47 | +- **Dockerfile**: Use Alpine 3.20, create non-root user, include health checks |
| 48 | +- **start.sh**: Validate inputs, map Pterodactyl variables, use bash `set -e` |
| 49 | +- **Environment Variables**: Support both new and legacy variable names for backward compatibility |
| 50 | +- **Logging**: Output errors with clear prefixes (ERROR, WARN) |
| 51 | + |
| 52 | +### Testing |
| 53 | + |
| 54 | +1. Build locally: `docker build -f games/{publisher}/{game}/Dockerfile -t test .` |
| 55 | +2. Run container with env vars: `docker run -e KEY=value test` |
| 56 | +3. Verify server starts and responds to health checks |
| 57 | + |
| 58 | +## Updating Go Recipe Versions |
| 59 | + |
| 60 | +Add versions to the matrix in `go.yml`: |
| 61 | + |
| 62 | +```yaml |
| 63 | +matrix: |
| 64 | + version: |
| 65 | + - "1.14" |
| 66 | + - "1.15" # add here |
| 67 | +``` |
| 68 | + |
| 69 | +Then create `golang/{version}/Dockerfile`. |
| 70 | + |
| 71 | +## Pull Requests |
| 72 | + |
| 73 | +- Keep commits focused and descriptive |
| 74 | +- Reference issues when applicable |
| 75 | +- Test changes locally before pushing |
| 76 | +- Expect workflows to run on develop branch automatically |
| 77 | + |
| 78 | +## Questions? |
| 79 | + |
| 80 | +Open an issue with the `question` label. |
0 commit comments