Commit Graph

41 Commits

Author SHA1 Message Date
wmantly b11bf24a9e Merge branch 'master' into ops/install-idempotent-symlinks 2026-07-10 13:27:29 -04:00
wmantly 0cca3730fb Make install.sh CI/CD-friendly: deterministic force-sync to remote
The installer is meant to be run by CI/CD with no human writes on prod, so
updates should mirror the repo exactly rather than refuse on local drift:

- Replace `git pull --ff-only` with fetch + `checkout -B origin/$BRANCH` +
  `reset --hard` + `clean -fd` so the box always matches origin/$BRANCH.
- Set GIT_TERMINAL_PROMPT=0 so a missing/expired credential fails fast in CI
  instead of hanging on a prompt.
- npm ci --omit=dev (lockfile, production-only) with a plain-install fallback.
- Allow REPO_URL / REPO_DIR / BRANCH to be overridden from the environment.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-10 13:23:31 -04:00
wmantly ec168411bf Make ops/install.sh idempotent and symlink config from the repo
Rework the installer so it doubles as an updater:

- Idempotent throughout: `install -d` for dirs, apt source lists rewritten
  in place, `gpg --dearmor --yes`, fallback cert generated only if missing,
  repo cloned or fast-forwarded, and `ln -sfn` symlinks.
- Config is now symlinked straight from the checked-out repo instead of
  wget-ing raw files from GitHub. /etc/openresty/{nginx.conf,autossl.conf,
  sites-enabled/000-proxy}, the targetinfo.lua lualib, and the systemd unit
  all point at $REPO_DIR/ops, so an update is just `git pull` + reload with
  no re-copying. This also drops the external t42-common raw-file
  dependency (autossl.conf / proxy.conf now come from this repo).
- Validate `openresty -t` before reloading so a bad config can't take the
  proxy down; reload if running else restart.
- Fix prior bugs: stray `curl sudo apt-get update`, duplicate openssl cert
  line, and `cd ../nodejs` (now cd $REPO_DIR/nodejs). Require root; add a
  BRANCH override (default master).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-10 13:14:48 -04:00
wmantly cd0cc50a19 Fix HTTP/2 coalescing cross-routing in targetinfo.lua
Hosts that share one wildcard cert (e.g. hassio.718it.biz and
metrics.718it.biz under *.718it.biz) resolve to the same IP, so browsers
coalesce them onto a single HTTP/2 connection. The SSL request_domain
phase resolves the connection's first host and caches it in
ngx.ctx.targetInfo; the unguarded `if targetInfo then return targetInfo`
then handed that first host's target to every coalesced request on the
connection -- e.g. hassio.718it.biz served from metrics' 192.168.1.8:8088.

Confirmed via debug logging: for GET requests to hassio.718it.biz on a
coalesced connection, ngx.ctx already held metrics' IP and the function
short-circuited to it.

Guard the reuse by host: only return the cached target when
ngx.ctx.targetInfo_domain matches the requested domain, and record that
domain whenever a target is resolved. A coalesced request for a different
host now re-resolves against its actual Host header.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-10 13:05:43 -04:00
wmantly 2665e7d466 Fix cert deletion key and harden nginx SSL/redis handling
- host.remove() now deletes the cert under the host key instead of the
  Domain relation object, so certs are actually removed from redis
- targetinfo.lua returns the redis connection to the pool via
  set_keepalive instead of leaking one connection per request
- autossl.conf drops TLSv1/1.1 and 3DES, adds TLSv1.3

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-03 01:29:43 -04:00
wmantly c51b9c007b Update install.sh 2024-11-12 19:40:47 -05:00
wmantly de67510a4e Update install.sh 2024-11-12 19:13:27 -05:00
wmantly 92df05540b Updated nginx files 2024-08-09 14:45:05 -04:00
wmantly 0a0f7d8ce5 Updated nginx files 2024-08-09 14:16:41 -04:00
wmantly c49dcafc34 Fixed nginx conf issue 2024-08-08 14:30:22 -04:00
wmantly 07ff3a2e39 Fixed nginx conf issue 2024-08-08 14:00:00 -04:00
wmantly 4c7558c2d7 Fixed nginx conf issue 2024-08-08 09:17:51 -04:00
wmantly 8c53b120b8 Fixed nginx conf issue 2024-08-08 09:15:56 -04:00
wmantly ee582891fa Fixed nginx conf issue 2024-08-08 08:38:51 -04:00
wmantly cf557f8aea Fixed nginx conf issue 2024-08-07 22:48:53 -04:00
wmantly d16c632045 Fixed nginx conf issue 2024-08-07 22:39:43 -04:00
wmantly d64edd87d9 Fixed nginx conf issue 2024-08-07 22:38:54 -04:00
wmantly c42a44be2c Fixed nginx conf issue 2024-08-07 22:35:30 -04:00
wmantly e29fc6b2a3 Merge pull request #64 from theta42/certs
Fixed nginx conf issue
2024-08-07 21:34:58 -04:00
wmantly f44284685f Fixed nginx conf issue 2024-08-07 21:34:03 -04:00
wmantly e0601e9c90 Merge pull request #62 from theta42/certs
Wildcard Certs and Front End update
2024-08-07 15:12:34 -04:00
wmantly de96886b61 nginx conf files 2024-08-06 19:02:01 -04:00
wmantly 0862ae8f10 nginx conf files 2024-08-06 19:01:02 -04:00
wmantly 73df8a111b shell script to pull certs from redis 2024-07-30 20:36:41 -04:00
noot 575e4d5a53 Update install.sh
fixed for real just tested
2023-12-20 14:47:40 +08:00
noot 60117d780f Update install.sh 2023-12-20 01:27:34 +08:00
noot e3d10993f6 Update install.sh 2023-12-18 16:21:05 +08:00
wmantly 7659b77d67 Update install.sh 2021-03-15 14:23:53 -04:00
wmantly 18ace1cfd7 Update install.sh 2021-03-15 14:21:17 -04:00
wmantly 3094b58a47 Update install.sh 2021-03-15 14:19:05 -04:00
wmantly 6fb073e28e Create install.sh 2021-03-15 14:12:18 -04:00
wmantly d5b969a1b3 Create proxy.service 2021-03-15 14:09:54 -04:00
wmantly 22c4eddcd8 Create nginx.conf 2021-03-15 14:06:30 -04:00
wmantly fc70778c35 removed vendored cookbook 2020-04-11 22:46:32 -04:00
wmantly d39c423da0 removed chef vendor 2020-04-11 22:44:33 -04:00
wmantly 42700d8d0a vagrant up 2019-12-10 16:50:32 -05:00
wmantly 565eb9c2e7 vagrant works 2019-12-10 01:39:53 -05:00
wmantly f1809bef83 vagrant and chef install everything 2019-09-02 16:48:23 -04:00
wmantly 4fb554add5 vagrant conf, first pass 2019-09-02 11:38:59 -04:00
wmantly c614f0aa79 removed vendor 2019-06-30 21:41:37 -04:00
wmantly ec6f4134be Base ready 2019-06-30 21:40:37 -04:00