Repository navigation
odoo: per-instance LAN and internet exposure - #39
Merged
Merged
Conversation
Each instance can now be reached beyond the machine itself, chosen per instance: expose.lan serves https://<name>.odoo.<host>.home.arpa on the LAN addresses (firewall on lan.interfaces, nginx allow-list lan.allowedClients) with the local CA, whose name constraints and certificate now also cover the LAN domain; clients get hosts-file lines from odoo-hosts and the CA from http://<lan domain>/ca.crt. *.localhost cannot work from other machines (browsers keep it local). expose.public serves a real domain with a Let's Encrypt certificate (HTTP-01), database manager 404, login rate limit, HSTS and a frozen web.base.url. Catch-all servers refuse every other name. Also fixes nginx reloads: the TLS key came in as a systemd credential, which `nginx -t` on reload (run as nginx) cannot read, so every reload (deploy, ACME renewal) failed and kept old certificates. The key is now a root:nginx 0440 clan var. ip_nonlocal_bind lets nginx start before DHCP assigns the LAN address. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
andrewthomaslee
enabled auto-merge (squash)
November 12, 2026 18:19
This was referenced Nov 12, 2026
Merged
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.
Summary
Each Odoo instance stays local (
https://<name>.odoo.localhost) and can add LAN and/or internet exposure, independently of the others:hostSpec.services.odoo = { enable = true; + lan = { # shared by LAN-exposed instances + domain = "odoo.<host>.home.arpa"; # default; RFC 8375 + addresses = [ ... ]; # nginx listens here (values flake) + interfaces = [ ... ]; # firewall 80/443 only here + allowedClients = [ ... ]; # nginx allow-list, else 403 + }; + acme.email = ...; # only with expose.public instances = { - demo = {}; + demo.expose.lan = true; # + https://demo.odoo.<host>.home.arpa + shop.expose.public = { # + https://erp.example.com, Let's Encrypt + enable = true; + domain = "erp.example.com"; + }; scratch = {}; # local only }; };odoo-hosts: the hosts-file lines a LAN client (Windows laptop) needs./web/database/*404,/web/loginrate limit (429), HSTS,web.base.urlfrozen at the public URL.LoadCredential;systemctl reload nginxrunsnginx -tas the nginx user, which cannot read credentials, so every reload (deploys, ACME renewals) failed and kept old certificates. The key is now aroot:nginx 0440clan var.ip_nonlocal_bindwhile LAN-exposed: nginx starts before DHCP assigns the LAN address (beelink is on NetworkManager).odoo-access.md(Windows hosts file + CA import, macOS/Linux, removal, internet checklist), cross-links fromodoo.md, README.Evidence
systemctl reload nginxfailed (cannot load certificate key "/run/credentials/nginx.service/odoo-tls.key": Permission denied), first seen when pebble issued a cert and nginx kept serving the placeholder.After: all on euc-hel-0, sandboxed, exit 0:
Merge Danger
Door: two-way
Additive options; nothing is exposed unless an instance asks. On machines that enable the module,
odoo-local-caandodoo-tlsregenerate once (validationchanged: CA constraints and SANs now includelan.domain), soclan vars generate <machine>before deploy; Firefox on the machine picks up the new CA via policy, LAN clients import it.Blast Radius: beelink
Only beelink enables Odoo. Merge order: this PR, then home #44 (bumps
modules, beelink exposesdemoandblankto the home LAN, not the internet).🤖 Generated with Claude Code