fix(forgejo): use domain instead of full url
This commit is contained in:
parent
117c5d6ef9
commit
d1ef7bc3ea
@ -6,7 +6,8 @@
|
|||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.my.services.forgejo;
|
cfg = config.my.services.forgejo;
|
||||||
inherit (config.my.server) domain proxyIP firewallInterface;
|
inherit (config.my.server) domain proxyIP firewallInterface;
|
||||||
url = "https://git.${domain}";
|
forgejoDomain = "git.${domain}";
|
||||||
|
forgejoUrl = "https://${forgejoDomain}";
|
||||||
in {
|
in {
|
||||||
options.my.services.forgejo = {
|
options.my.services.forgejo = {
|
||||||
enable = mkEnableOption "Forgejo";
|
enable = mkEnableOption "Forgejo";
|
||||||
@ -30,8 +31,8 @@ in {
|
|||||||
services.forgejo = {
|
services.forgejo = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings.server = {
|
settings.server = {
|
||||||
DOMAIN = "git.${domain}";
|
DOMAIN = forgejoDomain;
|
||||||
ROOT_URL = url;
|
ROOT_URL = forgejoUrl;
|
||||||
DISABLE_SSH = true;
|
DISABLE_SSH = true;
|
||||||
HTTP_PORT = cfg.port;
|
HTTP_PORT = cfg.port;
|
||||||
};
|
};
|
||||||
@ -64,7 +65,7 @@ in {
|
|||||||
];
|
];
|
||||||
})
|
})
|
||||||
(mkIf cfg.proxy {
|
(mkIf cfg.proxy {
|
||||||
services.caddy.virtualHosts."${url}".extraConfig = ''
|
services.caddy.virtualHosts."${forgejoDomain}".extraConfig = ''
|
||||||
reverse_proxy http://${proxyIP}:${toString cfg.port}
|
reverse_proxy http://${proxyIP}:${toString cfg.port}
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user