Commit Graph
2529 Commits
Author SHA1 Message Date
Juan Denis 0c18aa421f Trace apps through an OpenTelemetry Collector
A new collector template receives OTLP; Attach → Tracing gives an
app the standard OTEL_EXPORTER_OTLP_* variables, and a Jaeger
attached to the collector as its trace store receives the spans.
ServerKit does not instrument apps; it only wires the path. A docker
leg sends a span from an app and finds it in Jaeger.
2026-09-27 22:13:55 -04:00
Juan Denis 4730afa031 Fix Jaeger exiting at start on a fresh volume
The image runs unprivileged and a new named volume at /badger is
root-owned, so badger could not create its directories and every
Jaeger install exited with mkdir /badger/key: permission denied.
It now runs as root inside its own container.
2026-09-27 22:13:54 -04:00
Juan Denis 722072a14b Wire Grafana to Prometheus and Loki by attaching
The Prometheus, Grafana and Loki templates installed but connected
to nothing. A Grafana install now takes Metrics and Logs
attachments: the panel creates the data source through Grafana's
API with the recorded admin login, and a metrics attach also imports
a dashboard of the panel's fleet metrics. An attached app joins the
shared network, so Grafana reaches the source by name.
2026-09-27 21:53:52 -04:00
Juan Denis 776bf7793a Let an installed Prometheus scrape the panel
The metrics endpoint only accepted a PROMETHEUS_TOKEN env var that
almost no install sets, and the Prometheus template's config never
reached its container. The panel now keeps its own scrape token in
an internal vault, hands it to templates as SERVERKIT_METRICS_TOKEN,
and the template ships a prometheus.yml with a serverkit job.
2026-09-27 21:42:18 -04:00
Juan Denis dc08f6975c Show top queries and hit ratios per database
The explorer showed live sessions but nothing about which queries
cost the most or whether the cache was working. A container's new
Insights tab lists top queries by total time (pg_stat_statements,
performance_schema digests) with connections in use and the buffer
cache hit ratio, and says why a list is empty. PostgreSQL's
pg_stat_statements is switched on through the config tuner, keeping
existing preloads, so its rollback undoes it.
2026-09-27 21:30:07 -04:00
Juan Denis 6986f497f3 Attach a cache, storage or queue from the app page
Installed Redis and a running app were unrelated until someone wrote
the env by hand. The Overview's Attached services card reuses an
installed service or installs one, writes the fromService references
(REDIS_URL, AMQP_URL/BROKER_URL, the S3_* set), shows that kind's
failure mode, and offers a redeploy. Detach removes exactly what the
attach wrote.
2026-09-27 21:16:58 -04:00
Juan Denis 5e4ebbaf30 Add a queue broker and provision manifest Redis
RabbitMQ joins the catalog with an amqp:// fromService URL. A
manifest service of type redis now installs the Redis engine under
its own name instead of logging declared but not provisioned, so
its consumers' fromService refs bind to it. The bundled index also
gains the Garage entry the storage commit left out.
2026-09-27 21:04:02 -04:00
Juan Denis 4fdd7e31d6 Run Procfile workers beside a build-pack app
Only the Procfile web: line was read, so worker: and scheduler:
never ran. Each now runs as serverkit-app-<id>-<process> from the
same image with the app's env and volumes, no port, and a restart
policy; start, stop and restart follow the web container, and a line
removed from the Procfile goes on the next deploy. Single-container
apps also join the shared service network, which only compose apps
did, and the app's container list now shows the web and its workers.
2026-09-27 21:03:59 -04:00
Juan Denis f23c7a5009 Give each app its own bucket and a scoped key
MinIO's images no longer pull, so object storage is now the Garage
template. Attach storage creates a bucket named for the app and a key
that can read and write only that bucket, keeps the secret in an
internal vault, and wires S3_* and AWS_* env through fromService and
fromSecret. Detach revokes the key and removes the env but keeps the
bucket and its objects. A docker leg proves the scope against a
real Garage.
2026-09-27 20:36:38 -04:00
Juan Denis 3040db46ad Cascade request rollups in the ORM, not the DB
passive_deletes left removal to ON DELETE CASCADE, which SQLite
does not enforce here (foreign_keys is never switched on), so a
hard-deleted app left its rollup rows behind.
2026-09-27 20:36:37 -04:00
Juan Denis 197be719f6 Prove an app reaches a real Redis via fromService
A docker-builds leg runs the bundled Redis template with its managed
override and a separate project that only has the resolved URL; it
answers PING, and without the override it cannot resolve the host.
The probe is redis-py: redis-cli does not percent-decode URL
passwords, while app client libraries do.
2026-09-27 20:13:50 -04:00
Juan Denis 954f0dd388 Let apps reference an installed Redis or MinIO
fromService gave full connection details only for managed databases;
a Redis or MinIO sibling resolved to a bare http:// URL on a network
the app could not reach. Engine templates now offer protocol URLs and
their parts, any template can declare properties in a connection:
block, and apps on either side join a shared serverkit-services
network through the managed compose override. Secrets come from the
recorded install variables, never the running container.
2026-09-27 20:08:31 -04:00
Juan Denis 87408b0705 Merge branch 'dev' of https://github.com/jhd3197/ServerKit into dev 2026-09-27 19:56:02 -04:00
Juan Denis d148ccc247 Make the micro-cache a real page cache
Each site now sets its own TTL (10s default, 300s cap), and serves
the last good page while the app errors or the entry refreshes, with
one upstream request per missing entry. The cache key carries the
host, so purge clears only this site's files instead of every site's
cache. The settings panel shows the 24h hit ratio.
2026-09-27 18:51:05 -04:00
Juan Denis 11af8a588d Gate request metrics the way the sweeps expect
The route's access check moved into the service, where the per-app
authz sweeps can't see it; it is back in the route. The rollup table
now has a parent-side cascade so a purged app takes its rows, and
reads its histogram through the JSON column mixin.
2026-09-27 18:51:04 -04:00
Juan Denis b02dd53eaa Compress responses for every site
Nothing configured gzip beyond Debian's stock text/html-only line,
and the .htaccess converter claimed compression was global. A conf.d
snippet now adds gzip (and brotli when the module is loaded), holding
only the directives the running config lacks: a repeated http-level
gzip directive fails nginx -t. A snippet nginx rejects is removed, so
compression can't block a vhost write.
2026-09-27 18:18:39 -04:00
Juan Denis d2fd3b38b0 Show per-app request rate, errors and latency
A one-minute builtin tick tails each app's timed access log from a
stored byte offset and rolls it into minute and hour rows: status
classes, cache HIT/MISS/BYPASS/STALE and a latency histogram, so
p50/p95/p99 merge exactly across ticks and into hours. Minute rows
go after 48 h and hour rows after 30 days on the same tick. The
Overview tab gets a Traffic card.
2026-09-27 18:18:30 -04:00
Juan Denis 7a8f436dbb Log request timing in every generated vhost
Per-app latency, error rate and cache status were invisible: the
vhosts logged plain combined lines. The serverkit_timed format keeps
the combined fields first so bandwidth accounting and the fail2ban
filters still match, and appends request/upstream time, cache status
and host. Legacy access_log lines read as equivalent for drift so an
upgrade doesn't flag every site.
2026-09-27 17:50:32 -04:00
github-actions[bot] b5dca709d5 chore: bump version to 1.11.12 [skip ci] 2026-09-27 21:19:37 +00:00
Juan Denis 7a5cdda9a6 Skip the release-unpack test when tar is missing
The openSUSE Leap image ships without tar, so deploy_release could not
unpack the fixture and T20b failed its deploy assertions there. The
test now skips without tar, like its neighbours skip without
sha256sum.
2026-09-27 17:12:14 -04:00
Juan Denis f81a9c2060 Ignore the installed auto-updates extension
serverkit-auto-updates lives in its own repo; the panel writes these
copies when it is installed from the registry, and like the other
extracted extensions they must not be vendored back here.
2026-09-27 17:07:00 -04:00
Juan Denis 0748158026 Note the disk guardrails in the changelog 2026-09-27 17:05:31 -04:00
Juan Denis d3baa27b72 Regenerate inventories for the Storage work
Adds GET /system/storage to the API surface, records the Storage
tab's form block in the migration inventory, and seeds the history
retention test through make_application.
2026-09-27 17:04:36 -04:00
Juan Denis 631128e76e Link the disk warning to the Storage page 2026-09-27 16:41:22 -04:00
Juan Denis 7c303f856c Add a Storage tab to admin settings
Shows where the panel host's disk goes, when the rollback install is
removed, and the retention windows that bound ServerKit's own share,
with cleanup handed to the existing reclaim modal.
2026-09-27 16:40:48 -04:00
Juan Denis 03b4d3b751 Check free disk before a deploy stops anything
Deploys had no disk check, so a pull or build on a full disk failed
mid-way. The compose preflight now refuses under 512 MB free, before
any container stops, and warns under max(2 GB, 5% of the disk), both
pointing at Storage.
2026-09-27 16:37:54 -04:00
Juan Denis 2189a87986 Warn admins before the disk fills
Host disk alerts were off by default and Doctor's headroom failure
notified nobody, so a box reached 100% silently. A 15-minute builtin
now notifies admins once when the panel host disk crosses 85%, again
at 95%, and resets below 80% (storage.disk_alert_percent, 0 = off).
2026-09-27 16:36:17 -04:00
Juan Denis d669b7cac5 Add a storage overview endpoint
GET /system/storage measures where the panel host's disk goes (app
images and volumes, build cache, panel database, backups, logs, the
previous install) and returns the retention settings that bound
ServerKit's own share, for the Storage page.
2026-09-27 16:33:53 -04:00
Juan Denis 3cc90ecd30 Keep one upgrade snapshot and no tree copy
On blue/green installs the previous slot is the code rollback, so the
serverkit-tree-* copy of it duplicated ~1 GB per update. With
SERVERKIT_BACKUP_RETENTION unset, disks under 50 GiB now keep one
database snapshot instead of three.
2026-09-27 16:32:29 -04:00
Juan Denis 9500ae5d28 Bound panel logs, old installs and small-disk data
- Panel start writes a logrotate file for the panel's logs and a
  default json-file size cap into Docker's daemon.json (merged, never
  restarting Docker); the retention tick keeps the newest 10 update
  logs and 10 build logs per app.
- The previous blue/green slot is removed once the current one has
  been live storage.previous_slot_hours (24), never mid-update.
- Disks under 50 GB get shorter retention defaults once per install;
  values the operator changed are left alone.
2026-09-27 16:32:29 -04:00
Juan Denis 80eb84f14a Age out history tables that nothing pruned
Audit logs, error logs, notifications, deployment jobs, cron runs,
webhook and event deliveries, image update checks, workflow and
onboarding logs, and sandbox runs all grew forever. They now go after
audit_log_retention_days / history.retention_days (90) on the existing
retention tick. Only finished rows are removed, and each app keeps
its newest deployment job and image check.
2026-09-27 16:24:47 -04:00
Juan Denis a25aa0e4ef Keep successful builtin ticks for a day
The panel's scheduled checks run ~12k times a day on one box, and
each success kept a job, its queue message, log lines and a system
event for 14-30 days: ~500 MB recording "checked, nothing to do".
Successful ticks now go after 24 h with their queue message and emit
no event. Failures keep full retention.
2026-09-27 16:18:48 -04:00
Juan Denis f122acce01 Remove the updater's release download dirs
download_release runs in a command substitution, so its mktemp dir
was never removed: every update stranded the ~70 MB tarball in /tmp
(11 dirs, 644 MB on a 25 GB box). The download and unpack dirs are
now removed on success and on abort, and old leftovers are swept.
2026-09-27 16:04:29 -04:00
Juan Denis a5836bc264 Delete a pruned job's run log lines with it
Job retention deleted jobs but left their run_log_entries rows, and
nothing else prunes that table. A 25 GB box carried 540k orphaned rows
(~160 MB with the index). Old orphans are swept on the same tick so
upgraded boxes recover without a manual step.
2026-09-27 16:02:08 -04:00
github-actions[bot] ed5ab63aa2 chore: bump version to 1.11.11 [skip ci] 2026-09-27 18:11:30 +00:00
Juan Denis 6000d5c849 Merge pull request #151 from PeterDaveHelloKitchen/zh-Hant
Update and improve Traditional Chinese locale
2026-09-27 14:08:38 -04:00
Peter Dave Hello ad97c9f658 Update and improve Traditional Chinese locale 2026-09-27 22:49:18 +08:00
Juan Denis d15f79746f Merge pull request #149 from jhd3197/dev
Ubuntu 26.04 installs, a setup code for the first admin, and working Git deploys
v1.11.10
2026-09-24 01:45:46 -04:00
github-actions[bot] 1e9a96deb6 chore: bump version to 1.11.10 [skip ci] 2026-09-24 05:28:49 +00:00
Juan Denis d692e998b5 Fix CI: test seeds and leaked SQLite FK mode
The new Git deploy tests built Application rows by hand, which the
seed ratchet forbids; they use make_application now. A test that
enables foreign keys could leave a pooled connection enforcing them,
failing unrelated tests depending on shard order; every checkout now
starts with enforcement off.
2026-09-24 01:20:45 -04:00
Juan Denis 45bc3c70bd Guard first admin with a setup code, fix Git deploys
A fresh panel no longer lets whoever reaches it first become admin:
registering the first account needs a one-time code the installer
prints (`serverkit setup-code` repeats it). SERVERKIT_ADMIN_EMAIL and
SERVERKIT_ADMIN_PASSWORD create the admin unattended instead.

Git apps now deploy what users expect: a repository with a compose
file deploys every service it declares, "Deploy latest" builds the
branch's newest commit, and push webhooks rebuild the containers.
Also fixes branch switching on single-branch clones, uploads of a
lone file, compose v1 port preflight, and CLI commands that ignored
their flags.
2026-09-24 00:50:02 -04:00
github-actions[bot] 230d0d8b1a chore: bump version to 1.11.9 [skip ci] 2026-09-24 00:33:42 +00:00
Juan Denis 8affffef63 Let dev.sh use another database
SERVERKIT_DEV_DATABASE_URL points the dev panel at, e.g., a throwaway
sqlite file, so it starts in first-run setup like a fresh install
without touching the usual dev database. The release lab's local
browser journey relies on it.
2026-09-23 20:23:33 -04:00
Juan Denis 606aa41081 Point postgres templates at the published icon
postgresql.svg was never in the registry's icons/, so serverkit.ai
answered 404 and the catalog fell back to a built-in icon. The logo
the registry publishes is postgres.svg.
2026-09-23 20:23:33 -04:00
Juan Denis a22eaa8f14 Merge branch 'main' into dev 2026-09-20 23:51:08 -04:00
github-actions[bot] 156e0beee5 chore: bump version to 1.11.8 [skip ci] 2026-09-21 03:42:42 +00:00
Juan Denis 5ffc7257a3 fix(installer): require build tools only for local venv builds 2026-09-20 23:02:09 -04:00
Juan Denis b63427e2a2 fix(installer): provision native Python build dependencies (#148) 2026-09-20 22:29:53 -04:00
Juan Denis 824e2d79df Merge pull request #146 from jhd3197/dev
Passive runtime baselines for full installs
v1.11.7
2026-09-19 05:27:49 -04:00
Juan Denis e4275feed4 Merge remote-tracking branch 'origin/dev' into dev 2026-09-19 05:17:56 -04:00