Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
## Description
<!-- Describe your changes in detail -->

## Type of Change
<!-- Mark the relevant option with an 'x' -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- [ ] Dependency update

## Related Issues
<!-- Link to related issues, e.g., "Fixes #123" or "Relates to #456" -->

## Testing
<!-- Describe how you tested your changes -->

### Test Environment
- [ ] Docker
- [ ] Podman (rootless)
- [ ] Docker Compose
- [ ] Other: ___________

### Platforms Tested
- [ ] linux/amd64
- [ ] linux/arm64

### Test Scenarios
- [ ] Standard volume mount
- [ ] NFS volume mount
- [ ] Custom PUID/PGID
- [ ] SELinux enabled
- [ ] Other: ___________

### Test Results
```
# Paste relevant test output or logs
```

## Test Images
<!-- Automated test images will be built and commented on this PR -->
Once the build completes, test images will be available:
- `netbootxyz/netbootxyz:pr-{number}`
- `ghcr.io/netbootxyz/netbootxyz:pr-{number}`

See the auto-generated comment below for pull and test commands.

## Checklist
- [ ] My code follows the style of this project
- [ ] I have tested my changes locally
- [ ] I have tested the automated PR build image
- [ ] I have updated documentation (if applicable)
- [ ] My changes generate no new errors or warnings
- [ ] I have added comments to complex code sections

## Additional Notes
<!-- Any additional information that reviewers should know -->
94 changes: 85 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on:
branches:
- master
workflow_dispatch:
inputs:
tag_suffix:
description: 'Optional tag suffix (e.g., "test-feature")'
required: false
default: ''

jobs:
build:
Expand Down Expand Up @@ -39,6 +44,21 @@ jobs:
WEBAPP_RELEASE=$(curl -sX GET "https://api.github.com/repos/netbootxyz/webapp/releases/latest" | jq -r '. | .tag_name')
echo "WEBAPP_RELEASE=${WEBAPP_RELEASE}" >> $GITHUB_ENV

- name: Determine tag strategy
id: tags
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "TAG_SUFFIX=pr-${{ github.event.number }}" >> $GITHUB_ENV
echo "IS_PR=true" >> $GITHUB_ENV
elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
if [ -n "${{ github.event.inputs.tag_suffix }}" ]; then
echo "TAG_SUFFIX=test-${{ github.event.inputs.tag_suffix }}" >> $GITHUB_ENV
else
echo "TAG_SUFFIX=test-$(date +'%Y%m%d-%H%M%S')" >> $GITHUB_ENV
fi
echo "IS_PR=false" >> $GITHUB_ENV
fi

- name: Build and push PR test image
Copy link

Copilot AI Dec 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The step name "Build and push PR test image" is misleading as this step now handles both pull request and workflow_dispatch events (for test images). Consider renaming to something more generic like "Build and push test image".

Suggested change
- name: Build and push PR test image
- name: Build and push test image

Copilot uses AI. Check for mistakes.
uses: docker/build-push-action@v6
with:
Expand All @@ -48,26 +68,82 @@ jobs:
platforms: linux/amd64,linux/arm64
build-args: |
WEBAPP_VERSION=${{ env.WEBAPP_RELEASE }}
VERSION=pr-${{ github.event.number }}
VERSION=${{ env.TAG_SUFFIX }}
BUILD_DATE=$(date +'%Y-%m-%dT%H:%M:%S')
tags: |
netbootxyz/netbootxyz:pr-${{ github.event.number }}
netbootxyz/netbootxyz:pr-${{ github.event.number }}-${{ github.sha }}
ghcr.io/netbootxyz/netbootxyz:pr-${{ github.event.number }}
ghcr.io/netbootxyz/netbootxyz:pr-${{ github.event.number }}-${{ github.sha }}
netbootxyz/netbootxyz:${{ env.TAG_SUFFIX }}
netbootxyz/netbootxyz:${{ env.TAG_SUFFIX }}-${{ github.sha }}
ghcr.io/netbootxyz/netbootxyz:${{ env.TAG_SUFFIX }}
ghcr.io/netbootxyz/netbootxyz:${{ env.TAG_SUFFIX }}-${{ github.sha }}
labels: |
org.opencontainers.image.title=netbootxyz
org.opencontainers.image.description=netboot.xyz PR test image
org.opencontainers.image.version=pr-${{ github.event.number }}
org.opencontainers.image.description=netboot.xyz test image
org.opencontainers.image.version=${{ env.TAG_SUFFIX }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.source=https://github.com/netbootxyz/docker-netbootxyz

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@0.33.1
with:
image-ref: 'ghcr.io/netbootxyz/netbootxyz:pr-${{ github.event.number }}'
image-ref: 'ghcr.io/netbootxyz/netbootxyz:${{ env.TAG_SUFFIX }}'
format: 'table'
exit-code: '1'
exit-code: '0'
Copy link

Copilot AI Dec 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the Trivy exit-code from '1' to '0' means that the workflow will no longer fail when CRITICAL or HIGH severity vulnerabilities are found. This significantly weakens security posture for test images. Consider if this change is intentional, or if there should be a conditional exit-code based on the event type (e.g., fail for PRs but warn for manual dispatches).

Copilot uses AI. Check for mistakes.
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'

- name: Comment on PR with test instructions
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
const comment = `## 🚀 Test Image Built Successfully!

Your PR test images have been published and are ready for testing:

### Docker Hub
\`\`\`bash
docker pull netbootxyz/netbootxyz:pr-${{ github.event.number }}
\`\`\`

### GitHub Container Registry
\`\`\`bash
docker pull ghcr.io/netbootxyz/netbootxyz:pr-${{ github.event.number }}
\`\`\`

### Quick Test Commands

**Standard Docker:**
\`\`\`bash
docker run -d \\
--name netbootxyz-test \\
-e PUID=1000 \\
-e PGID=1000 \\
-p 3000:3000 \\
-p 69:69/udp \\
-p 8080:80 \\
-v /local/path/config:/config \\
netbootxyz/netbootxyz:pr-${{ github.event.number }}
\`\`\`

### Platforms
- ✅ linux/amd64
- ✅ linux/arm64

### Check Logs
\`\`\`bash
docker logs -f netbootxyz-test
\`\`\`

---
📦 **SHA:** \`${{ github.sha }}\`
🏷️ **Webapp Version:** \`${{ env.WEBAPP_RELEASE }}\`
`;

github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});

3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ LABEL org.opencontainers.image.title="netboot.xyz" \
maintainer="antonym"

# Install runtime dependencies and configure system in a single layer
RUN apk --initdb add --no-cache alpine-baselayout busybox
RUN apk add --no-cache \
# Core utilities
bash \
Expand Down Expand Up @@ -91,7 +92,7 @@ EXPOSE 80
EXPOSE 3000

# Copy configuration files and scripts
COPY --chown=root:root root/ /
COPY root/ /

# Make scripts executable
RUN chmod +x /start.sh /init.sh /healthcheck.sh /usr/local/bin/dnsmasq-wrapper.sh
Expand Down
Loading