Repository navigation
Fix certificates on nginx and Apache, and let a deploy turn HTTPS off - #23
Merged
Merged
Conversation
…ut of the root-only state folder, sites written before are rewritten at start-up, and a deploy can turn HTTPS off for a site
liamdevss
added a commit
to serveroshq/panel
that referenced
this pull request
Nov 16, 2026
For #97, with serveroshq/daemon#23 (which fixes the actual bug: nginx and Apache couldn't read certbot's challenge folder, so they never got a certificate). The deploy dialog gets a **Serve over HTTPS** tickbox under the domain, on by default. With it on, the hint says the chosen proxy gets a certificate and sends HTTP to HTTPS. With it off, it says the site is plain HTTP with no certificate, for a CDN or proxy in front that does HTTPS. - A deploy with a domain sends `https` when the dialog (or the API or MCP) says. Leaving it out lets the daemon keep what the app had, which is HTTPS for a new one. - Gated on `daemon.https_choice_since` (0.1.1-pre.41). The dialog only shows the tickbox from that version. Turning HTTPS off on an older daemon is refused with "too old to serve a domain without HTTPS", and asking for HTTPS is always fine. - The deploy result's address is `http://` when HTTPS is off, so the done step doesn't promise a certificate. - `deploy_from_git` and `deploy_template` (MCP) take `https` too. - The wildcard hint only promises per-subdomain certificates for Caddy with HTTPS on. - Strings in es, de and hi. **Checked** - New `HttpsChoiceTest` (5 tests), and `ServiceTemplateTest` updated for the new field. - Full `tests/` suite: three failures that also fail without this change in my local setup (AuditCoverage, SyncDaemonReleases, and a trial-celebration test that passes on its own). - Pint, PHPStan on the changed files, `vp check`, `vue-tsc`. Co-authored-by: liamdevss <213730082+liamdevss@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes serveroshq/panel#97.
The bug. certbot's HTTP challenge files went in
/var/lib/serveros/acme, inside the daemon's state folder, which is0700root. nginx and Apache workers run aswww-data, so Let's Encrypt's request for the challenge file got a 403 and every certificate request failed. Sites stayed on plain HTTP, retrying every 15 minutes forever. (My container test in #20 never got this far: Let's Encrypt refuses.testnames before it asks for the file.)The fix
/var/lib/serveros-acme, created0755.HTTPS on or off, per site
DeploySpec.https(optional): false serves the domains over plain HTTP on every proxy, with no certificate and no redirect. That's for a CDN or proxy in front that does HTTPS, or a site that shouldn't have it.https=offon the# ServerOS site:line), so rollbacks, clones and switching proxies keep it. A deploy that doesn't say keeps what the site had, and HTTPS for a new one.Checked on Ubuntu 24.04 with systemd
/var/lib/serverosat700, the old layout gives a 403 for the challenge file (workers run as www-data). The new one serves it.refresh_sites, and the challenge is served afterwards.https=offin its file, and certbot isn't run for it.cargo fmt,cargo clippy --workspace --all-targets -D warningsand the tests. New tests cover the folder location, HTTPS off on all four proxies (nothing on 443, no redirect, no resolver, no on-demand TLS), reading it back, and a certificate on disk not turning an HTTPS-off site back on.