fix: upgrade Go to 1.25.6 and add quick_start.sh docs to fix plugin compatibility#1419
fix: upgrade Go to 1.25.6 and add quick_start.sh docs to fix plugin compatibility#1419
Conversation
- Update docker/Dockerfile.base: GO_VERSION and GOTOOLCHAIN to 1.25.6 - Update go.mod files to go 1.25.6 with toolchain go1.25.6: - nhp/go.mod - endpoints/go.mod - examples/server_plugin/basic/go.mod - examples/server_plugin/authenticator/go.mod - examples/server_plugin/oidc/go.mod - Update docs/nhp_quick_start.md: - Add quick_start.sh script usage documentation - Simplify manual rebuild commands section - Update Go version reference to 1.25.6 - Mark option 1 as recommended for first-time users This change aligns Docker builds with CI/CD pipeline (Go 1.25.6), resolving the "plugin was built with a different version of package internal/goarch" error caused by Go version mismatch between main program and plugins.
There was a problem hiding this comment.
🚨 Changes Requested - Found 4 issue(s) that must be addressed
1. 🔴 CRITICAL: Inconsistent Go Versions Across Dockerfiles
docker/Dockerfile.app:29 still uses Go 1.21.2 while all other components have been upgraded to 1.25.6:
- docker/Dockerfile.base:7 →
GO_VERSION=1.25.6✅ - docker/Dockerfile.app:29 →
GO_VERSION=1.21.2❌
This inconsistency defeats the purpose of this PR (fixing plugin compatibility). The web-app will be built with Go 1.21.2, causing potential plugin incompatibilities when interacting with nhp-server/nhp-ac built with Go 1.25.6.
Impact: Plugin loading failures, ABI mismatches, runtime crashes
Fix: Update docker/Dockerfile.app line 29 to ENV GO_VERSION=1.25.6
2. 🔴 CRITICAL: web-app/go.mod Not Updated
docker/web-app/go.mod:3 still requires go 1.24.2, while all other modules have been upgraded:
- nhp/go.mod →
go 1.25.6✅ - endpoints/go.mod →
go 1.25.6✅ - examples/*/go.mod →
go 1.25.6✅ - docker/web-app/go.mod →
go 1.24.2❌
Impact: Build inconsistencies, potential runtime issues
Fix: Update docker/web-app/go.mod to require go 1.25.6 and add toolchain go1.25.6
3. 🟡 SECURITY: Cosign Version Downgrade Without Justification
endpoints/go.mod:19 downgrades github.com/sigstore/cosign/v2 from v2.6.2 → v2.2.4
This is a major version downgrade (4 minor versions) without explanation in the PR description. The PR title mentions "plugin compatibility" but doesn't explain why a security-critical dependency needs to be downgraded.
Concerns:
- Cosign is used for supply chain security and artifact verification
- Version 2.2.4 is significantly older and may contain known vulnerabilities
- No explanation provided for this change
- Downgrading security dependencies requires explicit justification
Required Actions:
- Explain why this downgrade is necessary
- Verify no CVEs exist for v2.2.4 that are fixed in v2.6.2
- Consider if there's an alternative solution that doesn't require downgrading
4. ⚠️ TEST COVERAGE: Tests Removed from Docker Builds
The PR removes test from build commands in 3 Dockerfiles:
- docker/Dockerfile.server:9:
make init serverd plugins test→make init serverd plugins - docker/Dockerfile.ac:8:
make init acd test→make init acd - docker/Dockerfile.agent:9:
make init agentd test→make init agentd
Note: docker/Dockerfile.db:9 still runs tests
While removing tests from Docker builds can improve build speed, this change:
- Is not mentioned in the PR description
- Reduces confidence that Docker images are correctly built
- May hide build-time test failures
Recommendation: Either:
- Explain this decision in the PR description, OR
- Keep tests in the Docker build process, OR
- Ensure CI runs these tests separately before Docker images are built
5. ℹ️ Shell Script Quality (Minor)
docker/quick_start.sh:164,186 - The cleanup functions use a potentially risky grep pattern:
docker images | grep -E "^(opennhp|docker)" | awk '{print $3}' | xargs -r docker rmiThe pattern ^(opennhp|docker) will match ANY image starting with "docker", which could accidentally remove unrelated Docker images (e.g., docker-registry, dockerhub-images, etc.)
Recommendation: Use more specific patterns like ^(opennhp|docker_) or list images explicitly by name.
Summary
Must Fix:
- Update docker/Dockerfile.app to use Go 1.25.6
- Update docker/web-app/go.mod to require go 1.25.6
- Justify the cosign downgrade or revert it
Should Address:
4. Explain test removal from Docker builds
5. Improve shell script cleanup safety
The Go version inconsistencies are blockers - they directly contradict the PR's stated goal of fixing plugin compatibility.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #1419 +/- ##
=====================================
Coverage 0.57% 0.57%
=====================================
Files 87 87
Lines 12535 12535
=====================================
Hits 72 72
Misses 12457 12457
Partials 6 6
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Add golang.org/x/oauth2 and github.com/coreos/go-oidc/v3 as direct dependencies in endpoints/go.mod to ensure plugin compatibility. Go plugins require all packages (including internal packages) to be at the exact same version between main program and plugins. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ Approved - Code looks good
I've thoroughly reviewed PR #1419 and found the changes to be well-implemented. This PR successfully addresses Go plugin compatibility issues by upgrading to Go 1.25.6 and adds helpful tooling for Docker development.
Summary of Changes
- Go version upgrade: All go.mod files updated from 1.24.x to 1.25.6 with toolchain directive
- Plugin dependency fix: Added oauth2 and go-oidc as direct dependencies in endpoints/go.mod
- Docker improvements:
- Base image updated to Go 1.25.6 with GOTOOLCHAIN enforcement
- APT_MIRROR build arg added for China users
- Removed test runs from build stages (faster builds)
- New quick_start.sh script: Interactive menu for Docker operations
- Documentation updates: Comprehensive guide for the quick_start.sh script
Code Quality Assessment
✅ Security: No vulnerabilities detected
- Shell script properly quotes variables and handles user input safely
- read command used with proper prompts
- No arbitrary command execution risks
✅ Logic: Implementation is sound
- Shell script has proper error handling (set -e)
- Docker version checks before operations
- Confirmation prompts for destructive operations
- GOPROXY and APT_MIRROR environment variables properly handled
✅ No Breaking Changes
- Go version upgrade is forward-compatible
- Existing Docker compose commands still work
- Added dependencies (oauth2, go-oidc) were already transitive deps
✅ Best Practices
- Shell script follows good practices (local variables, functions, error handling)
- Dockerfile changes align with multi-stage build patterns
- GOTOOLCHAIN=go1.25.6 ensures plugin compatibility across builds
- Documentation is thorough and well-organized
Minor Observations (Non-blocking)
-
docker/quick_start.sh:164: The grep pattern
^(opennhp|docker)might catch unintended images. Consider making it more specific if needed in future. -
docker/quick_start.sh:80, 220: docker build and docker stop commands could benefit from explicit error messages when they fail, though the current approach with
|| trueis acceptable for cleanup operations. -
Dockerfile test removal: Removing
testfrom build stages (lines 8, 9 in Dockerfile.ac, Dockerfile.agent, Dockerfile.server) improves build speed but means tests won't run during Docker builds. This is fine if CI handles testing separately.
Recommendation
This PR successfully resolves the plugin compatibility issues and adds valuable developer tooling. The changes are well-documented and don't introduce any security, compatibility, or logic issues.
Approved! ✅
Add blank import of cloud.google.com/go/auth/oauth2adapt to ensure the oauth2/internal package is built consistently with the main program. This resolves the "plugin was built with a different version of package golang.org/x/oauth2/internal" error. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🚨 Changes Requested - Found 3 issue(s) that must be addressed
Critical Issues
1. Security: Cosign Version Downgrade (endpoints/go.mod:19)
Severity: HIGH
The PR downgrades github.com/sigstore/cosign/v2 from v2.6.2 to v2.2.4. This is a significant downgrade of a security-critical library used for signature verification.
- Issue: Downgrading security libraries can reintroduce known vulnerabilities and should be avoided unless absolutely necessary
- Risk: cosign is used for cryptographic operations and package signing - any security flaws in older versions could compromise the integrity of the system
- Action Required: Please provide justification for this downgrade. If it's for plugin compatibility, consider upgrading to match the latest version instead of downgrading
2. Breaking Change: Tests Removed from Docker Builds
Severity: MEDIUM-HIGH
Tests are removed from build processes in multiple Dockerfiles:
-
docker/Dockerfile.ac:10- Changed frommake init acd testtomake init acd -
docker/Dockerfile.agent:36- Changed frommake init agentd testtomake init agentd -
docker/Dockerfile.server:119- Changed frommake init serverd plugins testtomake init serverd plugins -
Issue: Removing tests from the build pipeline means Docker images are built without validation, increasing the risk of shipping broken builds
-
Risk: This is a significant reduction in quality assurance - bugs may not be caught until deployment
-
Action Required: Please explain why tests were removed. If build time is a concern, consider:
- Running tests in a separate CI stage
- Using multi-stage builds to cache test results
- Running tests only on tagged releases
3. Bug: Shell Script Command Injection Risk (docker/quick_start.sh:80, 77)
Severity: LOW-MEDIUM
The build_base() function uses unquoted variable expansion in docker build command:
docker build $build_args- Issue: If
$GOPROXYor$APT_MIRRORcontain spaces or special characters, the command could break or behave unexpectedly - Risk: While the variables are controlled in this script, it's a shell scripting best practice to quote variable expansions
- Fix: Should be:
docker build $build_args(this one is actually okay since it needs word splitting for multiple args), but line 77 should construct args more carefully
Same issue exists in other functions that use docker compose build without proper quoting of service names.
Minor Observations
Positive Changes
- ✅ Good: Go version upgrade to 1.25.6 addresses plugin compatibility
- ✅ Good: Adding
oauth2adaptimport fixes dependency consistency - ✅ Good:
APT_MIRRORsupport improves build experience in China - ✅ Good: Interactive script with
quick_start.shimproves developer experience - ✅ Good: Comprehensive documentation updates in
docs/nhp_quick_start.md
Code Quality
- The shell script is well-structured with confirmation prompts for destructive operations
- CORS validation in the OIDC plugin properly uses an allowlist
- State validation in OIDC plugin correctly prevents CSRF attacks
Required Actions Before Approval
- Justify or revert the cosign downgrade - This is the most critical issue
- Restore tests in Docker builds OR explain the removal - Quality assurance concern
- Consider fixing shell quoting - Minor bug but good practice
The rest of the changes look good. Once these concerns are addressed, I'll be happy to approve.
Remove go.sum from .gitignore and commit all go.sum files to repository. This ensures CI/CD pipeline uses the same dependency versions as local Docker builds, preventing plugin compatibility issues caused by independent go mod tidy runs regenerating different go.sum files. Root cause: When go.sum was ignored, CI cloned fresh code without go.sum, causing each module to resolve dependencies independently during "make init", leading to different internal package versions. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🚨 Changes Requested - Found 3 issue(s) that must be addressed
Critical Issues
1. Tests Removed from Docker Builds (Category: Quality/CI)
Location: Multiple Dockerfiles
docker/Dockerfile.ac:8: Removedtestfrommake init acd testdocker/Dockerfile.agent:9: Removedtestfrommake init agentd testdocker/Dockerfile.server:9: Removedtestfrommake init serverd plugins test
Issue: Tests are being skipped during Docker image builds. This means broken code could be deployed in Docker images even if it fails tests.
Impact: Defeats the purpose of having tests in the build pipeline. Container images could ship with broken functionality that would have been caught by tests.
Recommendation: Keep the tests in the Docker build process. If build time is a concern:
- Run tests in parallel with builds
- Add a separate CI job that runs tests outside Docker
- Use Docker layer caching to avoid re-running tests unnecessarily
2. Downgraded cosign Dependency (Category: Security)
Location: endpoints/go.mod:19
-github.com/sigstore/cosign/v2 v2.6.2
+github.com/sigstore/cosign/v2 v2.2.4Issue: Cosign is being downgraded from v2.6.2 to v2.2.4 without explanation. This is a 4 minor version downgrade of a security-critical signing tool.
Risk: May reintroduce fixed security vulnerabilities or bugs from older versions.
Required Action:
- Explain why this downgrade is necessary
- Review the cosign changelog between v2.2.4 and v2.6.2 for security fixes
- If this is for plugin compatibility, document it in the commit message
3. Unquoted Variable Expansion in Shell Script (Category: Security)
Location: docker/quick_start.sh:80
docker build $build_argsIssue: The $build_args variable is not quoted, which can cause word splitting and globbing issues if any arguments contain spaces or special characters.
Risk: While low risk in this specific case (controlled environment variables), it's a shell scripting anti-pattern that can lead to unexpected behavior.
Fix:
docker build $build_args # Current (unsafe)
eval "docker build $build_args" # Better for complex argsOr restructure to build the command properly with an array.
Minor Issues (FYI)
4. Broad Regex Pattern in Clean Commands
Location: docker/quick_start.sh:164,186
The pattern ^(opennhp|docker) will match ANY image starting with "docker" (e.g., docker/getting-started, dockersamples/*). This could accidentally remove unrelated Docker images.
Suggestion: Use more specific patterns like ^opennhp- or ^docker_ (with underscore for compose project).
5. Missing Toolchain Directive
Location: endpoints/go.mod:4
Good job adding toolchain go1.25.6 to endpoints/go.mod! However, verify all other modules have this too for consistency.
Positive Changes
✅ Committing go.sum files - excellent fix for dependency consistency
✅ Adding oauth2adapt blank import for plugin compatibility - clever workaround
✅ Go version upgrade to 1.25.6 - keeps dependencies current
✅ APT_MIRROR support for China users - thoughtful internationalization
✅ Interactive quick_start.sh script - great developer experience improvement
Summary
The plugin compatibility fixes are well-designed, but removing tests from Docker builds is a significant regression that could mask bugs in production images. Please restore the test executions in the Dockerfiles before merging.
…atibility - Revert oauth2/go-oidc from direct to indirect deps in endpoints - Restore cosign to v2.6.2 (was incorrectly downgraded to v2.2.4) - Remove oauth2adapt from oidc plugin (not needed) - Add go.work generation in CI for consistent dependency resolution - Change make init to use go mod download instead of go mod tidy This restores the dependency configuration closer to commit 8e79045 which was working correctly, while adding go.work sync in CI to ensure all modules use consistent dependency versions. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Changed module name from github.com/OpenNHP/opennhp/examples/server_plugin to github.com/OpenNHP/opennhp/examples/oidc_plugin to avoid conflict with basic plugin in go.work workspace. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🚨 Changes Requested - Found 6 issue(s) that must be addressed
Critical Issues
1. SECURITY RISK: Removed Tests from Docker Builds ⚠️
Files: docker/Dockerfile.server:9, docker/Dockerfile.ac:8, docker/Dockerfile.agent:9
The PR removes test from the Docker build commands:
-RUN cd /nhp-server && make init serverd plugins test+RUN cd /nhp-server && make init serverd plugins
Impact: This bypasses test execution during Docker builds, potentially allowing broken code to be deployed. Tests are a critical safety check and should NOT be removed from CI/CD pipelines.
Recommendation: Restore the test target to all Dockerfiles, or provide strong justification for why tests should be skipped during builds.
2. CRITICAL: Unsigned Commits 🔐
Per CLAUDE.md: "All commits must be signed with a verified GPG or SSH key. Unsigned commits will fail CI checks."
All commits in this PR show verified: null, indicating they are NOT signed. This violates the project's strict signing requirement.
Action Required:
# Sign all commits
git rebase --exec 'git commit --amend --no-edit -S' HEAD~6
git push --force-with-lease3. CRITICAL: .gitignore Change Breaks Dependency Management 📦
File: .gitignore:17-18
The PR changes:
-go.sum
+go.work
+go.work.sumProblem: The old .gitignore was ignoring go.sum files (which MUST be committed for reproducible builds). This PR correctly commits go.sum files but the diff suggests go.sum was previously ignored. This is a breaking reversal of a bad practice.
Actually Good: Upon closer inspection, the PR DOES commit go.sum files (nhp/go.sum, endpoints/go.sum, etc.), which is correct. The .gitignore change from ignoring go.sum to ignoring go.work is proper.
Status: ✅ Actually correct - this fixes a previous issue
4. Shell Script: Command Injection Risk 🐛
File: docker/quick_start.sh:164, 186, 189, 192
Lines using xargs without proper quoting:
docker images | grep -E "^(opennhp|docker)" | awk '{print $3}' | xargs -r docker rmi 2>/dev/null || trueIssue: While -r flag prevents running with no input, the grep pattern "^(opennhp|docker)" is too broad and could accidentally match unintended images (e.g., any image starting with "docker").
Recommendation: Make the pattern more specific:
docker images | grep -E "^(opennhp-|docker_opennhp)" | awk '{print $3}' | xargs -r docker rmi 2>/dev/null || true5. PR Description Not Filled Out 📝
The PR template is completely unfilled:
- Summary: "Brief description of changes."
- Type of Change: No boxes checked
- Related Issues: "Fixes #"
- Testing: No boxes checked
- Checklist: No boxes checked
Required: Fill out the template with:
- Actual summary of Go version upgrade and dependency fixes
- Check "Bug fix" and "CI/CD improvement"
- Update testing status
- Check completed checklist items
6. Workflow: go.work.sum Not Committed 🔄
File: .github/workflows/deploy-demo.yml:282
The workflow runs go work sync which generates go.work.sum, but this file should be gitignored (which the PR does correctly). However, the workflow should clean it up:
# After go work sync, add cleanup
go work sync
rm -f go.work go.work.sum # Clean up workspace filesMinor Issues
7. Inconsistent Error Handling in quick_start.sh
Lines 164, 186 use || true to suppress errors, which is fine for cleanup operations, but the script should validate that at least some expected images exist before cleanup.
Positive Changes ✅
- Go 1.25.6 Upgrade: Proper version pinning for plugin compatibility
- go.sum Files Committed: Correctly ensures reproducible builds
- Makefile Improvements: Separation of
init(download) andtidy(update) is excellent - Docker Mirror Support: China mirror support is well-implemented
- Shell Script Quality: Generally well-structured with
set -e, user confirmations, and proper error messages
Summary
Please address the unsigned commits and test removal from Dockerfiles before this can be merged. The shell script grep pattern should be tightened, and the PR description must be completed.
The go.work approach doesn't work because different modules have replace directives pointing to different relative paths: - endpoints: ../nhp - plugins: ../../../nhp These conflict in a unified workspace. Reverting to the original build approach and relying on the other fixes: - Restored cosign to v2.6.2 - Restored oauth2/go-oidc to indirect - Using go mod download instead of go mod tidy Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Changes Requested - Found 4 critical issues that must be addressed before merge.
SECURITY ISSUE 1: APT_MIRROR Command Injection (HIGH)
Files: All Dockerfiles (base:14-18, server:17-21, ac, agent, app)
Problem: APT_MIRROR build arg used in sed without validation
Fix: Add validation before sed commands
SECURITY ISSUE 2: Overly Broad Grep Patterns (MEDIUM)
File: docker/quick_start.sh lines 164, 186, 189, 192
Problem: Pattern matching too broad - could remove unrelated docker resources
Fix: Use docker filters or docker compose down -v --rmi local
BUG 3: Tests Removed from Docker Builds
Files: Dockerfile.server:9, Dockerfile.ac, Dockerfile.agent
Problem: Removed test from make command - broken code could ship in images
Fix: Restore tests OR document why removed with compensating controls
DOCUMENTATION ISSUE 4: Undocumented Breaking Changes
Missing from PR description:
- go.sum now tracked in git (reverses .gitignore policy)
- make init changed (now go mod download not go mod tidy)
- OIDC plugin module renamed
Fix: Check Breaking change box and document in PR description
POSITIVES: Great work on error handling, user prompts, documentation, go.sum locking, GOTOOLCHAIN pinning, go.work support!
Please fix items 1-4 before merge. Core functionality is excellent - these are security hardening improvements.
🚨 Critical Security Issues Found1. Command Injection in quick_start.sh:80Unquoted variable expansion in docker build command allows potential injection. 2. Overly Broad grep Pattern (lines 164, 186)Pattern matches ANY image starting with 'docker' - could delete unintended images from docker.io, docker.elastic.co, etc. High Priority3. APT Mirror sed vulnerability (Dockerfiles)Using pipe delimiter in sed - could break with special chars. 4. Tests removed from Docker buildsDockerfiles no longer run tests. Are they in CI? Medium Priority5. Makefile error handlingFor loops need subshell to prevent wrong-directory execution. 6. rebuild_and_restart_service bypasses composeShould use 'docker compose up -d --force-recreate' Positives✅ Go 1.25.6 upgrade Please fix critical issues #1 and #2 before merge. |
Align Go versions across all Docker components: - docker/Dockerfile.app: 1.21.2 → 1.25.6 - docker/web-app/go.mod: 1.24.2 → 1.25.6 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🚨 Changes Requested - Found 1 critical security issue
1. Command Injection Vulnerability (Security)
Location: docker/quick_start.sh:80
Issue: Unquoted variable expansion in docker build $build_args allows potential command injection if environment variables or build args contain special characters or spaces.
# Line 80 - VULNERABLE
docker build $build_argsThe $build_args variable is constructed dynamically and passed to docker without quotes, which can lead to word splitting and glob expansion. While the current code controls the values, this is a dangerous pattern.
Recommendation: Always quote variable expansions:
docker build ${build_args} # Better: use arrayOr better yet, use an array for build arguments:
local build_args=(--no-cache -t opennhp-base:latest -f Dockerfile.base ..)
if [ "$USE_CHINA_MIRROR" = true ]; then
build_args+=(--build-arg "GOPROXY=$GOPROXY" --build-arg "APT_MIRROR=$APT_MIRROR")
fi
docker build "${build_args[@]}"Additional Observations (Not blocking, but worth noting)
Go Version Alignment
The PR correctly upgrades Go to 1.25.6 across all modules and Docker images, which should resolve plugin compatibility issues. The use of GOTOOLCHAIN=go1.25.6 in docker/Dockerfile.base:63 is good practice.
Removed Test from Docker Build
docker/Dockerfile.server:9 removes the test target from the build command. This appears to be intentional (reverting to original state), but consider whether tests should run during CI instead.
Makefile Changes
The split between make init (download) and make tidy (modify go.sum) is a good improvement for reproducible builds. However, the Makefile loops in lines 100-112 could fail silently if cd fails. Consider adding set -e or checking return codes.
Shell Script Patterns
Lines 164, 186, 189, 192 in quick_start.sh use piped commands with xargs -r. The -r flag prevents execution with empty input, which is good. However, ensure the grep patterns won't accidentally match unintended images/volumes/networks in production.
Summary
This PR addresses a real issue with Go version consistency for plugin compatibility. The main concern is the command injection vulnerability in the quick_start script that must be fixed before merging. Other changes look reasonable.
Use bash array instead of string concatenation for docker build arguments to prevent word splitting and glob expansion vulnerabilities. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💬 Comment - Found 2 issues for improvement
Thank you for this PR upgrading Go to 1.25.6 and adding the quick_start.sh utility.
✅ What Looks Good
- Security Fix Applied: Command injection in quick_start.sh properly fixed (commit 6c160c7) - changed from string concat to array usage
- Consistent Go Version: 1.25.6 set across Dockerfiles, go.mod files, and CI/CD
- Dependency Updates: All go.sum files properly updated (1798 additions)
- Makefile Improvements: Split init/tidy targets is cleaner
⚠️ Issues Found
1. Tests Removed from Docker Builds (Performance/Quality)
docker/Dockerfile.server:9, docker/Dockerfile.ac:8, docker/Dockerfile.agent:9 all remove test execution:
- Before: make init serverd plugins test
- After: make init serverd plugins
Concern: Docker images can now be built with broken code. This trades safety for speed.
Recommendation: Add SKIP_TESTS build arg or document why removed and ensure CI tests run.
2. Incomplete PR Description (Documentation)
Template not filled in - no type checked, no testing info, no related issues.
Recommendation: Complete description explaining why 1.25.6 specifically, what testing was done, any breaking changes.
Summary
Core changes are solid. Security fix is proper. Main concerns are removing tests from builds and incomplete documentation.
Rename plugin modules to follow consistent naming convention: - authenticator: examples/authenticator_plugin → examples/server_plugin/authenticator - basic: examples/server_plugin → examples/server_plugin/basic - oidc: examples/oidc_plugin → examples/server_plugin/oidc Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🚨 Changes Requested - Found 4 critical/high issues that must be addressed
I have reviewed this PR and found several security vulnerabilities and bugs that need to be fixed before merging.
Critical Issues (Must Fix)
1. 🔴 Command Injection Vulnerability in APT_MIRROR Variable
Files: All Dockerfiles (Dockerfile.base:15-17, Dockerfile.ac, Dockerfile.server, Dockerfile.app)
Severity: HIGH - Security Vulnerability
The APT_MIRROR variable is used in sed commands without proper escaping:
sed -i "s|ports.ubuntu.com|${APT_MIRROR}|g" /etc/apt/sources.listProblem: If APT_MIRROR contains pipe characters | or other special characters, the sed command will fail or could be exploited for command injection.
Fix: Change the delimiter from | to a safer character like #:
sed -i "s#ports.ubuntu.com#${APT_MIRROR}#g" /etc/apt/sources.list && \
sed -i "s#archive.ubuntu.com#${APT_MIRROR}#g" /etc/apt/sources.list && \
sed -i "s#security.ubuntu.com#${APT_MIRROR}#g" /etc/apt/sources.listOr better yet, validate/sanitize the APT_MIRROR input first.
2. 🔴 Dangerous Docker Image Deletion Pattern
File: docker/quick_start.sh:164, 186
Severity: HIGH - Data Loss Risk
docker images | grep -E "^(opennhp|docker)" | awk '{print $3}' | xargs -r docker rmi 2>/dev/null || trueProblem: The pattern ^(opennhp|docker) matches ANY image starting with "docker", including:
- docker.io/library/ubuntu
- docker.elastic.co/elasticsearch
- dockerhub-proxy.example.com/anything
This could accidentally delete important third-party images from Docker registries.
Fix: Use more specific patterns:
docker images | grep -E "^(opennhp-|docker_)" | awk '{print $3}' | xargs -r docker rmi 2>/dev/null || trueOr better yet, use explicit image names or docker compose down with --rmi flag.
3. 🟡 Makefile Shell Execution Bug
File: Makefile:100-112
Severity: MEDIUM - Logic Error
The for loops in the init target do not use subshells for cd commands, which could leave the shell in the wrong directory if an error occurs:
cd "$$dir" && go mod download && cd - > /dev/nullFix: Use subshells to prevent directory pollution:
(cd "$$dir" && go mod download) || true4. 🟡 Tests Removed from Docker Builds
Files: Dockerfile.ac:8, Dockerfile.agent:9, Dockerfile.server:9
Severity: MEDIUM - Quality Concern
The PR removes test from Docker build commands:
-RUN cd /nhp-server && make init serverd plugins test
+RUN cd /nhp-server && make init serverd pluginsQuestion: Are tests now run in CI instead? If not, this is a breaking change that reduces quality assurance. Please confirm tests are still being executed somewhere in the pipeline.
Minor Issues (Nice to Have)
5. quick_start.sh:220 - Bypassing Docker Compose
The rebuild_and_restart_service function manually stops/removes containers instead of using docker compose:
docker stop "$service" 2>/dev/null || true
docker rm "$service" 2>/dev/null || trueSuggestion: Use docker compose built-in functionality:
docker compose up -d --force-recreate --no-deps "$service"Positive Changes ✅
- Upgrading to Go 1.25.6 for plugin compatibility is the right approach
- Tracking go.sum files resolves dependency consistency issues
- China mirror support improves UX for users in that region
- User confirmations for destructive operations are good
- Separating
init(go mod download) fromtidy(go mod tidy) is a smart improvement
Recommendation
Please address the 4 critical/high issues (especially #1 and #2 which are security concerns) before merging. Once fixed, I will be happy to approve.
will fix later with other features
Summary
Brief description of changes.
Type of Change
Related Issues
Fixes #
Testing
Checklist