Skip to content

Commit

Permalink
feat: use caddy to reverse proxy homepage using tailscale certs
Browse files Browse the repository at this point in the history
Also update browser policies to use the local homepage over https.
  • Loading branch information
flexiondotorg committed Jun 5, 2024
1 parent 7e5f761 commit b8d98e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 deletions.
6 changes: 3 additions & 3 deletions nixos/_mixins/desktop/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ in
"SafeBrowsingSurveysEnabled" = false;
# Startup, Home and New Tab Page
"HomePageIsNewTabPage" = true;
"HomePageLocation" = "https://${hostname}.wimpress.io";
"NewTabPageLocation" = "https://${hostname}.wimpress.io";
"HomePageLocation" = "https://${hostname}.drongo-gamma.ts.net";
"NewTabPageLocation" = "https://${hostname}.drongo-gamma.ts.net";
"RestoreOnStartup" = 1;
"ShowHomeButton" = false;
};
Expand Down Expand Up @@ -367,7 +367,7 @@ in
"Homepage" = {
"Locked" = false;
"StartPage" = "previous-session";
"URL" = "https://${hostname}.wimpress.io";
"URL" = "https://${hostname}.drongo-gamma.ts.net";
};
"NetworkPrediction" = false;
"NewTabPage" = true;
Expand Down
19 changes: 4 additions & 15 deletions nixos/_mixins/services/homepage.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,6 @@ let
isWorkstation = if (desktop != null) then true else false;
in
{
networking = {
extraHosts = ''
127.0.0.2 ${hostname}.wimpress.io
'';
firewall.allowedTCPPorts = [
80
443
];
};
security.acme = {
email = "REDACTED";
acceptTerms = true;
};
services = {
homepage-dashboard = {
enable = isInstall;
Expand Down Expand Up @@ -279,10 +266,12 @@ in
virtualHosts."localhost" = {
extraConfig = ''
reverse_proxy http://127.0.0.1:8082
tls internal
'';
serverAliases = [ "${hostname}.wimpress.io" ];
serverAliases = [ "${hostname}.drongo-gamma.ts.net" ];
};
};
# Enable caddy to acquire certificates from the tailscale daemon
# - https://tailscale.com/blog/caddy
tailscale.permitCertUid = "caddy";
};
}

0 comments on commit b8d98e0

Please sign in to comment.