Skip to content

cdlus/giscus-proxy

Repository files navigation

giscus-proxy

Minimal proxy for the public giscus widget so you can embed it from your own origin.

Deploy on Railway Deploy to Render Deploy with Vercel Deploy to Netlify Deploy to Heroku Deploy to Koyeb

Endpoints

  • GET /widgethttps://giscus.app/en/widget (with optional replacements via rep=)
  • GET /en/widgethttps://giscus.app/en/widget (alias)
  • All other paths are proxied unchanged to https://giscus.app/<same-path>

Configure

  • HOST (default 0.0.0.0) and PORT (default 8080)
  • Or set ADDR (e.g. :8080 or 127.0.0.1:8080). ADDR beats HOST/PORT.

Run locally

go run ./cmd/giscus-proxy
# or with custom port
PORT=9000 go run ./cmd/giscus-proxy

Docker

Build and run:

docker build -t giscus-proxy:latest .
docker run --rm -p 8080:8080 -e PORT=8080 giscus-proxy:latest

Override port:

docker run --rm -p 9000:9000 -e PORT=9000 giscus-proxy:latest

Deploy to Railway

  1. Create a new service from this repo.
  2. Railway detects the Dockerfile automatically.
  3. Set variables:
    • PORT = 8080 (Railway injects PORT; our app reads it)
    • Optional: HOST = 0.0.0.0
  4. Expose the service; Railway gives you a public URL.

Health check path: /widget.


Deploy to Vercel

The repository ships with a serverless handler under api/index.go and a vercel.json rewrite that forwards every request to it. Deploying through the "Deploy with Vercel" button or via vercel deploy builds a Go Serverless Function, so no Docker support is required. Once deployed, the instance exposes the same routes described above.

You can set HOST, PORT, or ADDR environment variables if you want to run the binary locally with vercel dev, but they are not required for production deployments on Vercel.


Deploy to a generic VPS

Option A: Docker on VPS

git clone <this-repo>
cd giscus-proxy
docker build -t giscus-proxy:latest .
docker run -d --name giscus-proxy \
  -p 8080:8080 \
  -e HOST=0.0.0.0 -e PORT=8080 \
  --restart unless-stopped \
  giscus-proxy:latest

Put a reverse proxy in front (Caddy / Nginx / Traefik) if you want HTTPS and a domain.

About

A proxy for giscus

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published