[GH-ISSUE #272] Document HTTPS support via SERVER_CERT_PATH/SERVER_KEY_PATH #985

Open
opened 2026-04-19 13:35:54 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @fabriziosorgente on GitHub (Apr 19, 2026).
Original GitHub issue: https://github.com/RayLabsHQ/gitea-mirror/issues/272

The application supports native HTTPS out of the box through @astrojs/node, but this is not documented in the project.

@astrojs/node v10 reads two environment variables at runtime in standalone.ts:

if (process.env.SERVER_CERT_PATH && process.env.SERVER_KEY_PATH) {
    httpServer = https.createServer({
        key: fs.readFileSync(process.env.SERVER_KEY_PATH),
        cert: fs.readFileSync(process.env.SERVER_CERT_PATH),
    }, listener);
}

When both variables are set, the server starts as a real HTTPS server.

To deploy gitea-mirror in HTTPS, add this to your .env or systemd service:

SERVER_CERT_PATH=/path/to/cert.pem
SERVER_KEY_PATH=/path/to/key.pem
PORT=443
BETTER_AUTH_URL=https://your-domain.com
BETTER_AUTH_TRUSTED_ORIGINS=https://your-domain.com

SERVER_CERT_PATH and SERVER_KEY_PATH are not mentioned in the documentation. I suggest to add a HTTPS section to docs/ENVIRONMENT_VARIABLES.md documenting these two variables.

Originally created by @fabriziosorgente on GitHub (Apr 19, 2026). Original GitHub issue: https://github.com/RayLabsHQ/gitea-mirror/issues/272 The application supports native HTTPS out of the box through `@astrojs/node`, but this is not documented in the project. `@astrojs/node` v10 reads two environment variables at runtime in [standalone.ts](https://github.com/withastro/astro/blob/refs/tags/@astrojs/node@10.0.1/packages/integrations/node/src/standalone.ts): ```ts if (process.env.SERVER_CERT_PATH && process.env.SERVER_KEY_PATH) { httpServer = https.createServer({ key: fs.readFileSync(process.env.SERVER_KEY_PATH), cert: fs.readFileSync(process.env.SERVER_CERT_PATH), }, listener); } ``` When both variables are set, the server starts as a real HTTPS server. To deploy gitea-mirror in HTTPS, add this to your `.env` or systemd service: ``` SERVER_CERT_PATH=/path/to/cert.pem SERVER_KEY_PATH=/path/to/key.pem PORT=443 BETTER_AUTH_URL=https://your-domain.com BETTER_AUTH_TRUSTED_ORIGINS=https://your-domain.com ``` `SERVER_CERT_PATH` and `SERVER_KEY_PATH` are not mentioned in the documentation. I suggest to add a HTTPS section to `docs/ENVIRONMENT_VARIABLES.md` documenting these two variables.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea-mirror#985