Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
4e5ebcf
Setup test host
stackptr Oct 14, 2025
0515d91
Enable pocket-id service
stackptr Oct 14, 2025
b59bb32
Use pocketid postgres database
stackptr Oct 14, 2025
54c10e9
Ensure start-ordering
stackptr Oct 14, 2025
4ca055f
Supply stable encryption key
stackptr Oct 14, 2025
9021871
Use oauth2-proxy for single shared SSO
stackptr Oct 14, 2025
ad6a33f
Move test vhost
stackptr Oct 14, 2025
390a556
Use oauth2-proxy in test page
stackptr Oct 14, 2025
c78f861
Update `authHost`
stackptr Oct 14, 2025
d31ebfe
Set content type
stackptr Oct 14, 2025
de9d60f
Set headers in oauth2
stackptr Oct 14, 2025
a9c33ee
Update error_page directive
stackptr Oct 14, 2025
4d13fac
Use named location for redirect
stackptr Oct 14, 2025
6c91865
Update `email.domains`
stackptr Oct 14, 2025
1861fe1
Update test page HTML
stackptr Oct 14, 2025
9208aff
Do not rewrite 403
stackptr Oct 14, 2025
9d395f1
Set `nginx.domain`
stackptr Oct 15, 2025
da576dc
Use `whitelist-domain`
stackptr Oct 15, 2025
5621b56
Auth any email domain
stackptr Oct 15, 2025
fda872c
Try allowing unverified emails
stackptr Oct 15, 2025
cc10c19
Remove exact-match
stackptr Oct 15, 2025
51a75d2
Fix typo
stackptr Oct 15, 2025
51e0c18
Use `X-Forwarded-Proto`
stackptr Oct 15, 2025
5e29191
Set subrequest with no body
stackptr Oct 15, 2025
589fe9f
Try removing `return 200 ...`
stackptr Oct 15, 2025
7123432
Try internal named location
stackptr Oct 15, 2025
ba30907
Use `rewrite` directive
stackptr Oct 15, 2025
ba531da
Use `root` with static site from store
stackptr Oct 15, 2025
e93b803
Extract config into `rc.web.auth` module
stackptr Oct 15, 2025
d75579d
Wrap module logic in `mkMerge`
stackptr Oct 15, 2025
8e4ca35
Warn when `requireAuth` set with auth not enabled
stackptr Oct 15, 2025
c020855
Move auth_request into vhost option
stackptr Oct 15, 2025
b7b7ea5
Switch to `rc.web.auth` for hosts
stackptr Oct 15, 2025
80efe57
Remove test vhost
stackptr Oct 15, 2025
6e1f168
Move module to `services/web/auth.nix`
stackptr Oct 15, 2025
4c9a18a
Update paths
stackptr Oct 15, 2025
335ab98
Remove Authelia
stackptr Oct 15, 2025
f24e256
Remove TODO
stackptr Oct 15, 2025
418172c
Depend on `network-online.target`
stackptr Oct 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed hosts/spore/secrets/jwt-secret.age
Binary file not shown.
Binary file added hosts/spore/secrets/oauth2-proxy-env.age
Binary file not shown.
7 changes: 7 additions & 0 deletions hosts/spore/secrets/pocket-id-encryption-key.age
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
age-encryption.org/v1
-> ssh-ed25519 stFZUQ aFqQX0Rpg18dsE3tTTcg3mxbyaskZwmeHmwRXTTAizc
/Gwz5TQ7ladAcB3ED82VVIWndbImy2g3tTjF6HeWPnU
-> ssh-ed25519 3EWhnQ vskXoOXSQeBFLf7AV7ojly2EVcElbuclX0fTvLk6Og8
eyaqaKa7Bq5n/+0xVqsBwyx5Y5OeWOHDJEY7MIasHCU
--- EFeE0j6r+vRDo3hf7AcB7ZtmXmwRK7wigxu5ucLPyhA
��L%_,Rr�K_�#=���'f��I�<��H�7�U����fN��a\�M�@�!��3Įwث�rp[O� ��'���
13 changes: 0 additions & 13 deletions hosts/spore/secrets/session-secret.age

This file was deleted.

Binary file removed hosts/spore/secrets/storage-encryption-key.age
Binary file not shown.
145 changes: 0 additions & 145 deletions hosts/spore/services/authelia.nix

This file was deleted.

1 change: 0 additions & 1 deletion hosts/spore/services/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
...
}: {
imports = [
./authelia.nix
./db.nix
./homepage-dashboard.nix
./mastodon.nix
Expand Down
34 changes: 34 additions & 0 deletions hosts/spore/services/web/auth.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
config,
pkgs,
...
}: {
age.secrets.oauth2-proxy-env = {
file = ./../../secrets/oauth2-proxy-env.age;
mode = "440";
owner = "oauth2-proxy";
group = "oauth2-proxy";
};
age.secrets.pocket-id-encryption-key = {
file = ./../../secrets/pocket-id-encryption-key.age;
mode = "440";
owner = config.services.pocket-id.user;
group = config.services.pocket-id.group;
};

rc.web.auth = {
enable = true;
issuer = {
host = "id.zx.dev";
useACMEHost = "zx.dev";
encryptionKeyFile = config.age.secrets.pocket-id-encryption-key.path;
};
authProxy = {
host = "oauth.zx.dev";
domain = ".zx.dev";
clientID = "shared-sso";
useACMEHost = "zx.dev";
keyFile = config.age.secrets.oauth2-proxy-env.path;
};
};
}
2 changes: 1 addition & 1 deletion hosts/spore/services/web/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Web services and nginx configuration
{
imports = [
./nginx-options.nix
./auth.nix
./ssl-acme.nix
./nginx-config.nix
./srv.nix
Expand Down
124 changes: 0 additions & 124 deletions hosts/spore/services/web/nginx-options.nix

This file was deleted.

13 changes: 3 additions & 10 deletions hosts/spore/services/web/virtual-hosts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,10 @@
"/pgp".return = "302 https://keyoxide.org/hkp/413d1a0152bcb08d2e3ddacaf88c08579051ab48";
};
};
"auth.zx.dev" = {
forceSSL = true;
useACMEHost = "zx.dev";
useAutheliaProxyConf = true;
locations."/".proxyPass = "http://127.0.0.1:9091";
locations."/api/verify".proxyPass = "http://127.0.0.1:9091";
};
"torrents.zx.dev" = {
forceSSL = true;
useACMEHost = "zx.dev";
enableAutheliaAuth = true;
requireAuth = true;
locations."/".proxyPass = "http://glyph.rove-duck.ts.net:9091";
locations."~ (/transmission)?/rpc".proxyPass = "http://glyph.rove-duck.ts.net:9091";
};
Expand All @@ -60,13 +53,13 @@
"files.zx.dev" = {
forceSSL = true;
useACMEHost = "zx.dev";
enableAutheliaAuth = true;
requireAuth = true;
locations."/".proxyPass = "http://glyph.rove-duck.ts.net:8080";
};
"home.zx.dev" = {
forceSSL = true;
useACMEHost = "zx.dev";
enableAutheliaAuth = true;
requireAuth = true;
locations."/".proxyPass = "http://127.0.0.1:8082";
};
};
Expand Down
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ build-host host:
# Check specific service configurations
check-services:
@echo "🔍 Checking individual service configurations..."
nix flake check --print-build-logs | grep -E "(spore|glyph)-(nginx|authelia|postgresql|samba|transmission)" || echo "Service checks completed"
nix flake check --print-build-logs | grep -E "(spore|glyph)-(nginx|postgresql|samba|transmission)" || echo "Service checks completed"

# List all available hosts
list-hosts:
Expand Down
Loading