Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
@@ -108,8 +108,6 @@ AUTHENTIK_S3_BACKUP_BUCKET=hivegrid-authentik-backups
|
||||
AUTHENTIK_S3_BACKUP_ACCESS_KEY=replace-me
|
||||
AUTHENTIK_S3_BACKUP_SECRET_KEY=replace-me
|
||||
|
||||
# Optional: GPG recipient fingerprint to encrypt the backups with before
|
||||
# upload. If left empty, backup.sh falls back to AES256-symmetric with
|
||||
# AUTHENTIK_SECRET_KEY as passphrase (better than plaintext, but rotate
|
||||
# carefully — losing the key destroys the backup readability).
|
||||
AUTHENTIK_BACKUP_GPG_RECIPIENT=
|
||||
# Required: dedicated GPG recipient fingerprint for backup encryption. Never
|
||||
# reuse AUTHENTIK_SECRET_KEY or another runtime secret as backup key material.
|
||||
AUTHENTIK_BACKUP_GPG_RECIPIENT=replace-me-with-dedicated-backup-recipient
|
||||
@@ -14,7 +14,7 @@
|
||||
# in the background. Re-uses postgres16-client (matches the postgres:16-alpine
|
||||
# pin in docker-compose.yml).
|
||||
|
||||
FROM alpine:3.20
|
||||
FROM alpine:3.20@sha256:d9e853e87e55526f6b2917df91a2115c36dd7c696a35be12163d44e6e2a4b6bc
|
||||
|
||||
# --- Runtime deps ------------------------------------------------------------
|
||||
# postgresql16-client -> pg_dump
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
# 2. tar of /media (Authentik media volume, mounted into this container)
|
||||
# 3. SECRETS-MANIFEST.txt listing the env-var names that MUST be backed up
|
||||
# out-of-band (Coolify-Vault export)
|
||||
# 4. GPG-encrypt all three artifacts (recipient OR AES256 fallback)
|
||||
# 4. GPG-encrypt all three artifacts to a dedicated backup recipient
|
||||
# 5. Upload to S3 under s3://<bucket>/authentik/YYYY-MM-DD/
|
||||
#
|
||||
# Env (sourced from the Compose service `environment` block, which itself
|
||||
@@ -19,8 +19,7 @@
|
||||
# AUTHENTIK_S3_BACKUP_BUCKET target bucket name
|
||||
# AUTHENTIK_S3_BACKUP_ACCESS_KEY S3 access key
|
||||
# AUTHENTIK_S3_BACKUP_SECRET_KEY S3 secret key
|
||||
# AUTHENTIK_SECRET_KEY fallback symmetric passphrase for GPG
|
||||
# AUTHENTIK_BACKUP_GPG_RECIPIENT optional GPG recipient fingerprint
|
||||
# AUTHENTIK_BACKUP_GPG_RECIPIENT required dedicated GPG recipient fingerprint
|
||||
#
|
||||
# AUTHENTIK_PG_HOST default "postgresql" (compose service name)
|
||||
# AUTHENTIK_PG_PORT default 5432
|
||||
@@ -44,6 +43,7 @@ shopt -s inherit_errexit 2>/dev/null || true
|
||||
: "${AUTHENTIK_S3_BACKUP_ACCESS_KEY:?AUTHENTIK_S3_BACKUP_ACCESS_KEY is required}"
|
||||
: "${AUTHENTIK_S3_BACKUP_SECRET_KEY:?AUTHENTIK_S3_BACKUP_SECRET_KEY is required}"
|
||||
: "${AUTHENTIK_POSTGRESQL__PASSWORD:?AUTHENTIK_POSTGRESQL__PASSWORD is required}"
|
||||
: "${AUTHENTIK_BACKUP_GPG_RECIPIENT:?AUTHENTIK_BACKUP_GPG_RECIPIENT is required}"
|
||||
|
||||
TODAY="$(date -u +%Y-%m-%d)"
|
||||
NOW="$(date -u +%Y-%m-%dT%H-%M-%SZ)"
|
||||
@@ -135,16 +135,9 @@ EOF
|
||||
encrypt() {
|
||||
local src="$1"
|
||||
local dst="${src}.gpg"
|
||||
if [[ -n "${AUTHENTIK_BACKUP_GPG_RECIPIENT:-}" ]]; then
|
||||
log "encrypting ${src##*/} to GPG recipient ${AUTHENTIK_BACKUP_GPG_RECIPIENT}"
|
||||
gpg --batch --yes --trust-model always --recipient "${AUTHENTIK_BACKUP_GPG_RECIPIENT}" \
|
||||
--output "${dst}" --encrypt "${src}"
|
||||
else
|
||||
log "encrypting ${src##*/} symmetrically (AES256) with AUTHENTIK_SECRET_KEY"
|
||||
gpg --batch --yes --symmetric --cipher-algo AES256 \
|
||||
--passphrase "${AUTHENTIK_SECRET_KEY:?AUTHENTIK_SECRET_KEY missing for symmetric fallback}" \
|
||||
--output "${dst}" "${src}"
|
||||
fi
|
||||
log "encrypting ${src##*/} to the dedicated backup GPG recipient"
|
||||
gpg --batch --yes --trust-model always --recipient "${AUTHENTIK_BACKUP_GPG_RECIPIENT}" \
|
||||
--output "${dst}" --encrypt "${src}"
|
||||
rm -f "${src}"
|
||||
printf "%s" "${dst}"
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ volumes:
|
||||
services:
|
||||
# --- Postgres 16 ---------------------------------------------------------
|
||||
postgresql:
|
||||
image: postgres:16-alpine
|
||||
image: postgres:16-alpine@sha256:57c72fd2a128e416c7fcc499958864df5301e940bca0a56f58fddf30ffc07777
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- authentik-net
|
||||
@@ -67,7 +67,7 @@ services:
|
||||
|
||||
# --- Redis 7 -------------------------------------------------------------
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
image: redis:7-alpine@sha256:6ab0b6e7381779332f97b8ca76193e45b0756f38d4c0dcda72dbb3c32061ab99
|
||||
command: --save 60 1 --loglevel warning
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
@@ -83,7 +83,7 @@ services:
|
||||
|
||||
# --- Authentik server (web/api/HTTP) ------------------------------------
|
||||
server:
|
||||
image: ghcr.io/goauthentik/server:2026.2.3
|
||||
image: ghcr.io/goauthentik/server:2026.2.3@sha256:7806ae1ae3423624fe90331e8b3dcca0afc155fac890c696dd92ddac6dc3a384
|
||||
restart: unless-stopped
|
||||
command: server
|
||||
networks:
|
||||
@@ -147,7 +147,7 @@ services:
|
||||
|
||||
# --- Authentik worker (background jobs, blueprint apply, email) ---------
|
||||
worker:
|
||||
image: ghcr.io/goauthentik/server:2026.2.3
|
||||
image: ghcr.io/goauthentik/server:2026.2.3@sha256:7806ae1ae3423624fe90331e8b3dcca0afc155fac890c696dd92ddac6dc3a384
|
||||
restart: unless-stopped
|
||||
command: worker
|
||||
networks:
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
# Cap Standalone env for staging/prod. Copy to `.env` next to the compose file,
|
||||
# chmod 600, and replace every CHANGE_ME value.
|
||||
|
||||
CAP_IMAGE=tiago2/cap:3.1.5
|
||||
CAP_IMAGE=tiago2/cap:3.1.5@sha256:97455d85b5517172397c7053837d377c72ded6250777928d5435c3eab2f58779
|
||||
ADMIN_KEY=CHANGE_ME_RANDOM_MIN_32_CHARS
|
||||
REDIS_URL=redis://valkey:6379
|
||||
REDIS_PREFIX=hivegrid:cap:
|
||||
# Both supplied compose stacks use a dedicated Valkey instance. Keep this empty:
|
||||
# Cap 3.1.5 does not prefix HMSET during site-key creation, so a non-empty
|
||||
# prefix creates dashboard entries that the challenge endpoint cannot read.
|
||||
REDIS_PREFIX=
|
||||
|
||||
# Serve widget.js and WASM from the self-hosted Cap instance instead of jsDelivr.
|
||||
ENABLE_ASSETS_SERVER=true
|
||||
@@ -13,7 +16,7 @@ WASM_VERSION=0.0.7
|
||||
|
||||
# Comma-separated browser origins allowed to generate/redeem challenges.
|
||||
# Staging example:
|
||||
# CORS_ORIGIN=https://staging-app.hivegrid.de,https://staging-api.hivegrid.de
|
||||
# CORS_ORIGIN=https://staging-app.hivegrid.de,https://staging-api.hivegrid.de,https://staging.hivegrid.de,https://staging-portal.hivegrid.de
|
||||
# Production example:
|
||||
# CORS_ORIGIN=https://app.hivegrid.de,https://admin.hivegrid.de,https://api.hivegrid.de
|
||||
CORS_ORIGIN=
|
||||
|
||||
@@ -30,9 +30,16 @@ Traefik can reach it without publishing Cap directly to the public interface.
|
||||
3. Create `/opt/cap/.env` from `.env.example`, set `ADMIN_KEY`, and set:
|
||||
|
||||
```env
|
||||
CORS_ORIGIN=https://staging-app.hivegrid.de,https://staging-api.hivegrid.de,https://staging.hivegrid.de
|
||||
CORS_ORIGIN=https://staging-app.hivegrid.de,https://staging-api.hivegrid.de,https://staging.hivegrid.de,https://staging-portal.hivegrid.de
|
||||
REDIS_PREFIX=
|
||||
```
|
||||
|
||||
The supplied stack owns its Valkey instance exclusively. Keep
|
||||
`REDIS_PREFIX` empty with Cap 3.1.5: its site-key creation path does not
|
||||
prefix `HMSET`, while the challenge path prefixes reads. A non-empty value
|
||||
therefore creates keys that are visible in the dashboard but always return
|
||||
`404` from `/<sitekey>/challenge`.
|
||||
|
||||
4. Start Cap:
|
||||
|
||||
```sh
|
||||
@@ -48,7 +55,9 @@ Traefik can reach it without publishing Cap directly to the public interface.
|
||||
|
||||
6. Open `https://captcha-staging.hivegrid.de`, log in with `ADMIN_KEY`, and
|
||||
create site keys for `login`, `forms`, and `booking`. Keep each public
|
||||
sitekey and its matching site secret.
|
||||
sitekey and its matching site secret. Before rolling them out, prove that
|
||||
`POST /<sitekey>/challenge` returns `200` for every key and includes the
|
||||
requesting staging origin in `Access-Control-Allow-Origin`.
|
||||
|
||||
7. Set the staging web app env:
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ volumes:
|
||||
|
||||
services:
|
||||
cap:
|
||||
image: ${CAP_IMAGE:-tiago2/cap:3.1.5}
|
||||
image: ${CAP_IMAGE:-tiago2/cap:3.1.5@sha256:97455d85b5517172397c7053837d377c72ded6250777928d5435c3eab2f58779}
|
||||
restart: unless-stopped
|
||||
env_file: [.env]
|
||||
expose:
|
||||
@@ -23,7 +23,7 @@ services:
|
||||
condition: service_healthy
|
||||
|
||||
valkey:
|
||||
image: valkey/valkey:9-alpine
|
||||
image: valkey/valkey:9-alpine@sha256:ee91f7a174ac4d6a6b0685b3a60e321f0a9dbbb691f9b0e285be2ba1d1be8328
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- cap-valkey-data:/data
|
||||
|
||||
@@ -18,7 +18,7 @@ volumes:
|
||||
|
||||
services:
|
||||
cap:
|
||||
image: ${CAP_IMAGE:-tiago2/cap:3.1.5}
|
||||
image: ${CAP_IMAGE:-tiago2/cap:3.1.5@sha256:97455d85b5517172397c7053837d377c72ded6250777928d5435c3eab2f58779}
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
cap-net:
|
||||
@@ -33,7 +33,7 @@ services:
|
||||
condition: service_healthy
|
||||
|
||||
valkey:
|
||||
image: valkey/valkey:9-alpine
|
||||
image: valkey/valkey:9-alpine@sha256:ee91f7a174ac4d6a6b0685b3a60e321f0a9dbbb691f9b0e285be2ba1d1be8328
|
||||
restart: unless-stopped
|
||||
networks: [cap-net]
|
||||
volumes:
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
services:
|
||||
grafana:
|
||||
image: grafana/grafana-oss:11.4.0
|
||||
image: grafana/grafana-oss:11.4.0@sha256:d8ea37798ccc41061a62ab080f2676dda6bf7815558499f901bdb0f533a456fb
|
||||
container_name: hivegrid-grafana
|
||||
restart: unless-stopped
|
||||
user: "472:472"
|
||||
@@ -35,7 +35,7 @@ services:
|
||||
# Lightweight no-op service that fails compose-up early if the shared
|
||||
# network is missing. Cheaper than letting grafana retry indefinitely.
|
||||
waitfornet:
|
||||
image: alpine:3
|
||||
image: alpine:3@sha256:28bd5fe8b56d1bd048e5babf5b10710ebe0bae67db86916198a6eec434943f8b
|
||||
command: ["true"]
|
||||
networks:
|
||||
- observability
|
||||
|
||||
@@ -66,4 +66,6 @@ and logs a warning — login brute-force is still covered by `auth-rate-limit` +
|
||||
|
||||
- Only `mcaptcha-pg-data` holds state (account + sitekeys + stats); the cache is ephemeral.
|
||||
- mCaptcha terminates no TLS; Caddy must sit in front.
|
||||
- Images are `:latest` — pin to a released tag before relying on it long-term.
|
||||
- Application and cache images keep their upstream aliases for readability but
|
||||
are pinned to reviewed multi-architecture manifest digests in Compose. Update
|
||||
the alias and digest together during an intentional upgrade.
|
||||
@@ -24,7 +24,7 @@ volumes:
|
||||
|
||||
services:
|
||||
mcaptcha:
|
||||
image: mcaptcha/mcaptcha:latest
|
||||
image: mcaptcha/mcaptcha:latest@sha256:e94486fe8ae2549977d4245fd48c0cf53ea03092b8412bc283e8dd1c3ca27717
|
||||
restart: unless-stopped
|
||||
networks: [mcaptcha-net]
|
||||
env_file: [.env]
|
||||
@@ -37,7 +37,7 @@ services:
|
||||
condition: service_started
|
||||
|
||||
mcaptcha_postgres:
|
||||
image: postgres:16-alpine
|
||||
image: postgres:16-alpine@sha256:57c72fd2a128e416c7fcc499958864df5301e940bca0a56f58fddf30ffc07777
|
||||
restart: unless-stopped
|
||||
networks: [mcaptcha-net]
|
||||
environment:
|
||||
@@ -53,6 +53,6 @@ services:
|
||||
retries: 10
|
||||
|
||||
mcaptcha_redis:
|
||||
image: mcaptcha/cache:latest
|
||||
image: mcaptcha/cache:latest@sha256:56cb11d8cffb04c00dc6008c08d795a61cdacaab388cababa3c52cfc2ec6cc7a
|
||||
restart: unless-stopped
|
||||
networks: [mcaptcha-net]
|
||||
@@ -1,10 +1,12 @@
|
||||
# Prometheus — HiveGrid
|
||||
|
||||
Scrapes `/metrics` from the three HiveGrid apps every 15s.
|
||||
Scrapes the HiveGrid runtime metrics every 15s. The web core/admin process and
|
||||
the separately deployed portal process each have their own process-local
|
||||
registry and therefore their own scrape target.
|
||||
|
||||
## Files
|
||||
|
||||
- `prometheus.yml` — scrape jobs (api / worker / web)
|
||||
- `prometheus.yml` — scrape jobs (api / worker / web-core / web-portal)
|
||||
- `docker-compose.yml` — Coolify-friendly compose stack
|
||||
- `secrets/metrics_token` — bearer token (chmod 600, do NOT commit)
|
||||
|
||||
@@ -23,19 +25,27 @@ docker network create hivegrid-observability
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
Then expose `prometheus.saas-ctrl.com` via Coolify's proxy with
|
||||
**basic-auth or Cloudflare-Access** in front — Prometheus has no
|
||||
built-in auth and ships internal state.
|
||||
Prometheus is deliberately reachable only as `prometheus:9090` on the
|
||||
`hivegrid-observability` Docker network. It has no host-port binding and no
|
||||
lifecycle HTTP endpoint. Use Grafana for dashboards; temporary operator access
|
||||
must use an authenticated tunnel rather than public ingress.
|
||||
|
||||
## Verifying scrape targets
|
||||
|
||||
```sh
|
||||
curl -s -H "Authorization: Bearer $(cat secrets/metrics_token)" \
|
||||
https://api.hivegrid.de/metrics | head -20
|
||||
|
||||
curl -s -H "Authorization: Bearer $(cat secrets/metrics_token)" \
|
||||
https://app.hivegrid.de/api/metrics | head -20
|
||||
|
||||
curl -s -H "Authorization: Bearer $(cat secrets/metrics_token)" \
|
||||
https://portal.hivegrid.de/api/metrics | head -20
|
||||
```
|
||||
|
||||
The Prometheus UI at `https://prometheus.saas-ctrl.com/targets`
|
||||
should list all three jobs as **UP**.
|
||||
Through an authenticated operator tunnel, the Prometheus `/targets` view should
|
||||
list all four jobs as **UP**. Do not also scrape `admin.hivegrid.de`: admin and
|
||||
core share the same process-local registry, so doing so would double-count.
|
||||
|
||||
## Cardinality budget
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
services:
|
||||
prometheus:
|
||||
image: prom/prometheus:v3.6.0
|
||||
image: prom/prometheus:v3.6.0@sha256:76947e7ef22f8a698fc638f706685909be425dbe09bd7a2cd7aca849f79b5f64
|
||||
container_name: hivegrid-prometheus
|
||||
restart: unless-stopped
|
||||
user: "65534:65534"
|
||||
@@ -24,14 +24,12 @@ services:
|
||||
- --storage.tsdb.retention.time=30d
|
||||
- --web.console.libraries=/usr/share/prometheus/console_libraries
|
||||
- --web.console.templates=/usr/share/prometheus/consoles
|
||||
- --web.enable-lifecycle
|
||||
- --web.external-url=https://prometheus.saas-ctrl.com
|
||||
volumes:
|
||||
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
||||
- ./secrets:/etc/prometheus/secrets:ro
|
||||
- prometheus-data:/prometheus
|
||||
ports:
|
||||
- "9090:9090"
|
||||
expose:
|
||||
- "9090"
|
||||
networks:
|
||||
- observability
|
||||
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
# Targets:
|
||||
# * api — apps/api admin metrics surface (port 3201 default)
|
||||
# * worker — apps/worker admin server (port 9101 default; 9100 is health-probe)
|
||||
# * web — apps/web SSR resource route on /api/metrics
|
||||
# * web-core — apps/web core SSR resource route on /api/metrics
|
||||
# * web-portal — apps/web portal SSR resource route on /api/metrics
|
||||
#
|
||||
# Operator deploys this on the Hetzner staging server alongside Sentry.
|
||||
|
||||
@@ -62,20 +63,32 @@ scrape_configs:
|
||||
labels:
|
||||
service: worker
|
||||
|
||||
- job_name: hivegrid-web
|
||||
- job_name: hivegrid-web-core
|
||||
metrics_path: /api/metrics
|
||||
scheme: https
|
||||
authorization:
|
||||
type: Bearer
|
||||
credentials_file: /etc/prometheus/secrets/metrics_token
|
||||
static_configs:
|
||||
# /api/metrics is admin-only — the resource route is mounted on
|
||||
# the admin host. Scraping the tenant-facing host returns 404 by
|
||||
# design. Use admin.<domain> for staging; in prod set to
|
||||
# admin.<prod-domain>.
|
||||
- targets: ["admin.hivegrid.de"]
|
||||
# Core and admin share one process-local registry. Scrape exactly one
|
||||
# host so counters are not duplicated.
|
||||
- targets: ["app.hivegrid.de"]
|
||||
labels:
|
||||
service: web
|
||||
runtime_surface: core
|
||||
|
||||
- job_name: hivegrid-web-portal
|
||||
metrics_path: /api/metrics
|
||||
scheme: https
|
||||
authorization:
|
||||
type: Bearer
|
||||
credentials_file: /etc/prometheus/secrets/metrics_token
|
||||
static_configs:
|
||||
# Portal runs in its own process and therefore has a separate registry.
|
||||
- targets: ["portal.hivegrid.de"]
|
||||
labels:
|
||||
service: web
|
||||
runtime_surface: portal
|
||||
|
||||
# When promoting to production, also scrape the production targets behind
|
||||
# their own bearer-token. Add scrape_configs entries with environment=production.
|
||||
@@ -46,7 +46,6 @@ SENTRY_S3_BACKUP_BUCKET=hivegrid-sentry-backups
|
||||
SENTRY_S3_BACKUP_ACCESS_KEY=replace-me
|
||||
SENTRY_S3_BACKUP_SECRET_KEY=replace-me
|
||||
|
||||
# Optional: GPG recipient fingerprint to encrypt the tarballs with before upload.
|
||||
# If left empty, backup.sh falls back to AES256 with the SENTRY_SECRET_KEY as
|
||||
# symmetric passphrase (still better than plaintext, but rotate carefully).
|
||||
SENTRY_BACKUP_GPG_RECIPIENT=
|
||||
# Required: dedicated GPG recipient fingerprint for backup encryption. Never
|
||||
# reuse SENTRY_SECRET_KEY or another runtime secret as backup key material.
|
||||
SENTRY_BACKUP_GPG_RECIPIENT=replace-me-with-dedicated-backup-recipient
|
||||
@@ -54,7 +54,7 @@ See `docs/observability/sentry-selfhost.md` (full deploy + upgrade + backup
|
||||
runbook). High-level:
|
||||
|
||||
1. Copy `.env.example` → `.env`, fill secrets (Coolify-Vault).
|
||||
2. Run `./install.sh` (clones upstream at pinned tag, applies overlays,
|
||||
2. Run `./install.sh` (fetches the immutable upstream commit, applies overlays,
|
||||
installs).
|
||||
3. In Coolify, attach this stack to the `sentry.saas-ctrl.com` domain.
|
||||
4. Smoke-test per `## Test Requirements` in
|
||||
@@ -62,7 +62,8 @@ runbook). High-level:
|
||||
|
||||
## Versioning
|
||||
|
||||
- Upstream pin: `getsentry/self-hosted` tag **`25.12.1`** (see `UPSTREAM.md` for
|
||||
- Upstream pin: `getsentry/self-hosted` tag **`25.12.1`**, commit
|
||||
**`5c9794c9b1fda551f38515f85d56ec298371d060`** (see `UPSTREAM.md` for
|
||||
rationale — skipping the buggy `25.12.0` migration release; staying on the
|
||||
v25.x LTS-ish line until we manually qualify v26.x).
|
||||
- GlitchTip alternative pin: `glitchtip/glitchtip:v6.1.6`.
|
||||
@@ -6,6 +6,7 @@
|
||||
| --- | --- |
|
||||
| Upstream repo | <https://github.com/getsentry/self-hosted> |
|
||||
| Pinned git tag | **`25.12.1`** |
|
||||
| Pinned commit | **`5c9794c9b1fda551f38515f85d56ec298371d060`** |
|
||||
| Release line | `v25.x` (LTS-ish; we treat the v25.x line as our long-term track until v26.x is qualified) |
|
||||
| Why not `25.12.0` | `25.12.0` shipped a known migration bug in the `snuba-api` migration step that aborts the installer mid-way; `25.12.1` is the hotfix. |
|
||||
| Why not `26.x` | v26.x is the current major and introduces breaking schema changes (Snuba consumers + ClickHouse-table renames). We intentionally trail one major behind to land changes after they have been hot-fixed in the wild. |
|
||||
@@ -37,21 +38,22 @@ at deploy time inside our own wrapper. Our repository only contains the
|
||||
- `install.sh` — wrapper that clones upstream + applies overlays + invokes
|
||||
the upstream installer
|
||||
|
||||
## Clone strategy (what `install.sh` does)
|
||||
## Fetch strategy (what `install.sh` does)
|
||||
|
||||
The wrapper performs the equivalent of:
|
||||
The tag is release metadata only. The wrapper executes the immutable commit
|
||||
that the tag resolved to when this pin was reviewed:
|
||||
|
||||
```bash
|
||||
# Clone exactly the pinned tag into infra/sentry/upstream/self-hosted/,
|
||||
# shallow + single-branch to keep the working tree lean.
|
||||
git clone \
|
||||
--branch 25.12.1 \
|
||||
--depth 1 \
|
||||
--single-branch \
|
||||
https://github.com/getsentry/self-hosted.git \
|
||||
infra/sentry/upstream/self-hosted
|
||||
git -C infra/sentry/upstream/self-hosted init
|
||||
git -C infra/sentry/upstream/self-hosted remote add origin https://github.com/getsentry/self-hosted.git
|
||||
git -C infra/sentry/upstream/self-hosted fetch --depth 1 origin 5c9794c9b1fda551f38515f85d56ec298371d060
|
||||
git -C infra/sentry/upstream/self-hosted checkout --detach 5c9794c9b1fda551f38515f85d56ec298371d060
|
||||
```
|
||||
|
||||
The installer then compares `rev-parse HEAD` with the pinned commit and aborts
|
||||
on any mismatch. Moving or replacing the upstream tag therefore cannot change
|
||||
the executed installer.
|
||||
|
||||
After cloning, the wrapper:
|
||||
|
||||
1. Copies `infra/sentry/docker-compose.override.yml` →
|
||||
@@ -74,7 +76,8 @@ repo for a fresh checkout but stays empty until the first `install.sh` run.
|
||||
|
||||
To upgrade to a newer `25.x.y` patch:
|
||||
|
||||
1. Update the tag in this file (`UPSTREAM.md`) and in `install.sh`.
|
||||
1. Resolve and review the new tag, then update both tag and immutable commit in
|
||||
this file (`UPSTREAM.md`) and in `install.sh`.
|
||||
2. Read upstream release notes for any `sentry.conf.py` migrations and
|
||||
sync our overlay if upstream renamed/removed any setting we override.
|
||||
3. On staging, run `./install.sh` again. The upstream installer is
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
# in the background. Re-uses the upstream Postgres + ClickHouse client tools
|
||||
# at versions matching the Sentry stack (Postgres 14, ClickHouse 23.8).
|
||||
|
||||
FROM alpine:3.20
|
||||
FROM alpine:3.20@sha256:d9e853e87e55526f6b2917df91a2115c36dd7c696a35be12163d44e6e2a4b6bc
|
||||
|
||||
# --- Runtime deps ------------------------------------------------------------
|
||||
# postgresql-client -> pg_dump
|
||||
|
||||
@@ -11,8 +11,7 @@
|
||||
# SENTRY_S3_BACKUP_BUCKET target bucket name
|
||||
# SENTRY_S3_BACKUP_ACCESS_KEY S3 access key
|
||||
# SENTRY_S3_BACKUP_SECRET_KEY S3 secret key
|
||||
# SENTRY_SECRET_KEY fallback symmetric passphrase for GPG
|
||||
# SENTRY_BACKUP_GPG_RECIPIENT optional GPG recipient fingerprint
|
||||
# SENTRY_BACKUP_GPG_RECIPIENT required dedicated GPG recipient fingerprint
|
||||
#
|
||||
# SENTRY_PG_HOST default "postgres" (upstream service name)
|
||||
# SENTRY_PG_PORT default 5432
|
||||
@@ -44,6 +43,7 @@ shopt -s inherit_errexit 2>/dev/null || true
|
||||
: "${SENTRY_S3_BACKUP_BUCKET:?SENTRY_S3_BACKUP_BUCKET is required}"
|
||||
: "${SENTRY_S3_BACKUP_ACCESS_KEY:?SENTRY_S3_BACKUP_ACCESS_KEY is required}"
|
||||
: "${SENTRY_S3_BACKUP_SECRET_KEY:?SENTRY_S3_BACKUP_SECRET_KEY is required}"
|
||||
: "${SENTRY_BACKUP_GPG_RECIPIENT:?SENTRY_BACKUP_GPG_RECIPIENT is required}"
|
||||
|
||||
TODAY="$(date -u +%Y-%m-%d)"
|
||||
NOW="$(date -u +%Y-%m-%dT%H-%M-%SZ)"
|
||||
@@ -120,16 +120,9 @@ log "clickhouse archive size: $(du -h "${CH_DUMP_FILE}" | cut -f1)"
|
||||
encrypt() {
|
||||
local src="$1"
|
||||
local dst="${src}.gpg"
|
||||
if [[ -n "${SENTRY_BACKUP_GPG_RECIPIENT:-}" ]]; then
|
||||
log "encrypting ${src##*/} to GPG recipient ${SENTRY_BACKUP_GPG_RECIPIENT}"
|
||||
gpg --batch --yes --trust-model always --recipient "${SENTRY_BACKUP_GPG_RECIPIENT}" \
|
||||
--output "${dst}" --encrypt "${src}"
|
||||
else
|
||||
log "encrypting ${src##*/} symmetrically (AES256) with SENTRY_SECRET_KEY"
|
||||
gpg --batch --yes --symmetric --cipher-algo AES256 \
|
||||
--passphrase "${SENTRY_SECRET_KEY:?SENTRY_SECRET_KEY missing for symmetric fallback}" \
|
||||
--output "${dst}" "${src}"
|
||||
fi
|
||||
log "encrypting ${src##*/} to the dedicated backup GPG recipient"
|
||||
gpg --batch --yes --trust-model always --recipient "${SENTRY_BACKUP_GPG_RECIPIENT}" \
|
||||
--output "${dst}" --encrypt "${src}"
|
||||
rm -f "${src}"
|
||||
printf "%s" "${dst}"
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# infra/sentry/install.sh
|
||||
#
|
||||
# Wrapper around the upstream getsentry/self-hosted installer pinned at
|
||||
# 25.12.1 (see UPSTREAM.md). Run this script on the staging Hetzner host
|
||||
# the immutable commit behind 25.12.1 (see UPSTREAM.md). Run this script on the staging Hetzner host
|
||||
# from the repository root or from `infra/sentry/`:
|
||||
#
|
||||
# cd infra/sentry && ./install.sh
|
||||
@@ -19,6 +19,7 @@ shopt -s inherit_errexit 2>/dev/null || true
|
||||
# -----------------------------------------------------------------------------
|
||||
UPSTREAM_REPO="https://github.com/getsentry/self-hosted.git"
|
||||
UPSTREAM_TAG="25.12.1"
|
||||
UPSTREAM_COMMIT="5c9794c9b1fda551f38515f85d56ec298371d060"
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
UPSTREAM_DIR="${SCRIPT_DIR}/upstream/self-hosted"
|
||||
@@ -65,30 +66,28 @@ set +a
|
||||
: "${SENTRY_BASE_URL:?SENTRY_BASE_URL must be set in .env}"
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Step 1: clone upstream at pinned tag (or update if already cloned)
|
||||
# Step 1: fetch and check out the immutable upstream commit
|
||||
# -----------------------------------------------------------------------------
|
||||
mkdir -p "${SCRIPT_DIR}/upstream"
|
||||
|
||||
if [[ ! -d "${UPSTREAM_DIR}/.git" ]]; then
|
||||
log "cloning upstream getsentry/self-hosted @ ${UPSTREAM_TAG}"
|
||||
git clone \
|
||||
--branch "${UPSTREAM_TAG}" \
|
||||
--depth 1 \
|
||||
--single-branch \
|
||||
"${UPSTREAM_REPO}" \
|
||||
"${UPSTREAM_DIR}"
|
||||
log "initializing upstream getsentry/self-hosted @ ${UPSTREAM_COMMIT} (${UPSTREAM_TAG})"
|
||||
mkdir -p "${UPSTREAM_DIR}"
|
||||
git -C "${UPSTREAM_DIR}" init --quiet
|
||||
git -C "${UPSTREAM_DIR}" remote add origin "${UPSTREAM_REPO}"
|
||||
else
|
||||
log "upstream clone exists; fetching tag ${UPSTREAM_TAG}"
|
||||
git -C "${UPSTREAM_DIR}" fetch --depth 1 origin "refs/tags/${UPSTREAM_TAG}:refs/tags/${UPSTREAM_TAG}"
|
||||
git -C "${UPSTREAM_DIR}" checkout --quiet "tags/${UPSTREAM_TAG}"
|
||||
log "upstream clone exists; resetting canonical origin"
|
||||
git -C "${UPSTREAM_DIR}" remote set-url origin "${UPSTREAM_REPO}"
|
||||
fi
|
||||
|
||||
# Sanity-check the checked-out tag matches.
|
||||
ACTUAL_TAG="$(git -C "${UPSTREAM_DIR}" describe --tags --exact-match 2>/dev/null || echo unknown)"
|
||||
if [[ "${ACTUAL_TAG}" != "${UPSTREAM_TAG}" ]]; then
|
||||
die "upstream checkout is at '${ACTUAL_TAG}', expected '${UPSTREAM_TAG}'"
|
||||
git -C "${UPSTREAM_DIR}" fetch --depth 1 origin "${UPSTREAM_COMMIT}"
|
||||
git -C "${UPSTREAM_DIR}" checkout --quiet --detach "${UPSTREAM_COMMIT}"
|
||||
|
||||
ACTUAL_COMMIT="$(git -C "${UPSTREAM_DIR}" rev-parse --verify HEAD)"
|
||||
if [[ "${ACTUAL_COMMIT}" != "${UPSTREAM_COMMIT}" ]]; then
|
||||
die "upstream checkout is at '${ACTUAL_COMMIT}', expected '${UPSTREAM_COMMIT}'"
|
||||
fi
|
||||
log "upstream pinned at ${ACTUAL_TAG}"
|
||||
log "upstream pinned at ${ACTUAL_COMMIT} (${UPSTREAM_TAG})"
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Step 2: apply our overlay files
|
||||
|
||||
Reference in new issue
Block a user