Skip to content

feat: read the listen port from GEO_PORT - #13

Merged
ChiragAgg5k merged 2 commits into
appwrite:mainfrom
ChiragAgg5k:feat/geo-port
Nov 5, 2026
Merged

ChiragAgg5k merged 2 commits into
appwrite:mainfrom
ChiragAgg5k:feat/geo-port

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Port 80 is hard-coded, so the server can't run as a non-root user where low ports are privileged (ip_unprivileged_port_start=1024).

port: (string) System::getEnv('GEO_PORT', '80'),

The default stays 80. The image HEALTHCHECK reads the same variable.

Tested with a local build, uid 82, --cap-drop ALL, no-new-privileges, ip_unprivileged_port_start=1024:

GEO_PORT Result
unset bind fails, as on the released image
8080 /v1/health 200, /v1/ips/8.8.8.8 returns the US record

The E2E job covers both: the default through compose, and GEO_PORT=8081 as uid 82 with all capabilities dropped.

Port 80 needs root on hosts that keep low ports privileged, so a non-root container could not start. The default stays 80.
@hansi-codes

hansi-codes Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

The Geo server now reads its listener port from GEO_PORT, while retaining port 80 as the default, and the Docker health check probes that configured port. The CI workflow also exercises a non-root container listening on a non-default port.

Latest changes: The new CI step starts the image as UID 82 with all capabilities dropped and GEO_PORT=8081, then checks its health endpoint on port 8081.

Verdict New comments Fixed Still open
✅ Approved 0 1 0
📂 Walkthrough · 3
File Change
src/Geo/Server/Server.php Configures the server listener from GEO_PORT, defaulting to port 80.
Dockerfile Makes the image health check probe the port specified by GEO_PORT, defaulting to port 80.
.github/workflows/tests.yml Adds a CI check that verifies the server responds on a non-default port when run as a non-root user without capabilities.
✅ Fixed since the last review · 1
  • Cover the non-default listener port in E2E tests · src/Geo/Server/Server.php:42

Reviewed the commits since fa8743c · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

hansi-codes[bot]
hansi-codes Bot previously approved these changes Nov 5, 2026

@hansi-codes hansi-codes Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Tier A · Looks good to merge. Summary

Comment thread src/Geo/Server/Server.php Resolved
The E2E stack only starts the default port, so it would pass if GEO_PORT stopped controlling the listener.

@hansi-codes hansi-codes Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Tier S · Looks good to merge. Summary

@ChiragAgg5k
ChiragAgg5k merged commit dfc3ff6 into appwrite:main Nov 5, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant