FFFF
Skip to content

brudnak/rancher-milestone-radar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Issue Report Web App

This version is implemented in Go with server-rendered HTML and HTMX for form submissions.

Local run

go run ./cmd/server

Open http://127.0.0.1:8080.

Config

Editable in the UI:

  • milestone
  • repository
  • label
  • two GitHub logins
  • optional GitHub token for the current request only

Optional server defaults:

  • DEFAULT_TARGET_REPO
  • DEFAULT_TARGET_LABEL
  • DEFAULT_USER_A
  • DEFAULT_USER_B
  • HOST
  • PORT
  • GITHUB_TOKEN or GH_TOKEN

Copy .env.example to a real env file on the server and fill in GITHUB_TOKEN if you want higher GitHub API limits.

Useful commands

make test
make build
make build-linux
make run

Deploying to Linode

This app is designed to run on a small Ubuntu Linode with:

  1. systemd keeping the Go binary alive
  2. Caddy reverse proxying to 127.0.0.1:8080
  3. a server-side env file at /etc/issue-report.env

The easiest path is:

  1. create the Linode
  2. install packages on the server
  3. create the env file
  4. run the deploy script from your local machine

1. Create the Linode

  • Use Ubuntu 24.04 LTS or another recent Ubuntu release.
  • Add your SSH key during provisioning if possible.
  • Make note of the public IP.

2. SSH into the server

From your local machine:

ssh root@YOUR_LINODE_IP

3. Install required packages on the server

Run this on the Linode:

apt update
apt install -y caddy rsync

4. Create the app user and directories

Run this on the Linode:

useradd --system --home /opt/issue-report --shell /usr/sbin/nologin issue-report || true
mkdir -p /opt/issue-report/bin /opt/issue-report/public /opt/issue-report/deploy
chown -R issue-report:issue-report /opt/issue-report

5. Create the environment file

Run this on the Linode:

cat >/etc/issue-report.env <<'EOF'
HOST=127.0.0.1
PORT=8080
DEFAULT_TARGET_REPO=rancher/rancher
DEFAULT_TARGET_LABEL=team/frameworks
DEFAULT_USER_A=brudnak
DEFAULT_USER_B=fillipehmeireles
GITHUB_TOKEN=your_server_side_token_here
EOF
chmod 600 /etc/issue-report.env

Notes:

  • GITHUB_TOKEN is optional for public repos, but recommended to avoid rate limits.
  • HOST=127.0.0.1 is correct because Caddy will proxy local traffic to the app.

6. Open the firewall

If you are using ufw, run this on the Linode:

ufw allow OpenSSH
ufw allow 80/tcp
ufw allow 443/tcp
ufw --force enable
ufw status

7. Deploy from your local machine

From your project directory on your local machine:

DEPLOY_HOST=YOUR_LINODE_IP DEPLOY_USER=root ./scripts/deploy-linode.sh

If you already have a domain pointed at the Linode, use:

DEPLOY_HOST=YOUR_LINODE_IP DEPLOY_DOMAIN=report.example.com DEPLOY_USER=root ./scripts/deploy-linode.sh

What the deploy script does:

  1. builds the Linux binary locally
  2. copies the binary plus public/ and deploy/ to /opt/issue-report
  3. installs the systemd unit at /etc/systemd/system/issue-report.service
  4. generates /etc/caddy/Caddyfile
  5. enables and restarts the app
  6. reloads Caddy

8. Verify the deployment

Run these on the Linode:

systemctl status issue-report --no-pager
systemctl status caddy --no-pager
curl http://127.0.0.1:8080/healthz

If you deployed by IP:

curl http://YOUR_LINODE_IP/healthz

If you deployed with a domain:

curl https://report.example.com/healthz

9. Useful troubleshooting commands

Run these on the Linode:

journalctl -u issue-report -n 100 --no-pager
journalctl -u caddy -n 100 --no-pager
systemctl restart issue-report
systemctl reload caddy
caddy validate --config /etc/caddy/Caddyfile

10. Updating the app later

From your local machine, after pulling or editing the repo:

DEPLOY_HOST=YOUR_LINODE_IP DEPLOY_USER=root ./scripts/deploy-linode.sh

Or with a domain:

DEPLOY_HOST=YOUR_LINODE_IP DEPLOY_DOMAIN=report.example.com DEPLOY_USER=root ./scripts/deploy-linode.sh

That is enough for normal updates. You do not need to manually copy files if you use the deploy script.

11. IP vs domain

Both work:

  • If you set DEPLOY_DOMAIN, Caddy serves the app on that hostname and can manage HTTPS normally.
  • If you omit DEPLOY_DOMAIN, the script configures Caddy for http://YOUR_LINODE_IP, which is fine for internal review or early testing.

For anything long-lived, use a real domain.

12. Manual layout on the server

After deployment, the server should roughly look like this:

/opt/issue-report/
  bin/issue-report
  public/
  deploy/

/etc/issue-report.env
/etc/systemd/system/issue-report.service
/etc/caddy/Caddyfile

Health check

The app exposes:

GET /healthz

It returns 200 OK with ok.

Notes

  • This app does not need GitHub CLI on the server.
  • It talks directly to the GitHub API.
  • For a public repo, the app works without a token, but rate limits are lower.
  • The deploy helper lives at scripts/deploy-linode.sh.
  • The systemd unit template is deploy/issue-report.service.

Token safety

  • A token in server-side environment variables is the safe deployment model.
  • A token embedded in browser JavaScript or committed into the repo is not safe.
  • Because this targets a public repo, no token is strictly required, but GitHub rate limits are lower without one.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

0