Skip to content

Commit

Permalink
caddy: Move caddy environment file
Browse files Browse the repository at this point in the history
Move caddy environment file from `/run/caddy.env` to
`/var/lib/caddy/caddy.env` to make it persist reboots. Before this
change, caddy service would fail to start after the first boot due to
missing caddy environment file.

Signed-off-by: Henri Rosten <henri.rosten@unikie.com>
  • Loading branch information
henrirosten committed Feb 29, 2024
1 parent 1303739 commit 0f81c5f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion hosts/azure/binary-cache/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
""
"${pkgs.caddy}/bin/caddy run --environ --config ${config.services.caddy.configFile}/Caddyfile"
];
systemd.services.caddy.serviceConfig.EnvironmentFile = "/run/caddy.env";
systemd.services.caddy.serviceConfig.EnvironmentFile = "/var/lib/caddy/caddy.env";

# Wait for cloud-init mounting before we start caddy.
systemd.services.caddy.after = ["cloud-init.service"];
Expand Down
2 changes: 1 addition & 1 deletion hosts/azure/jenkins-controller/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ in {
""
"${pkgs.caddy}/bin/caddy run --environ --config ${config.services.caddy.configFile}/Caddyfile"
];
systemd.services.caddy.serviceConfig.EnvironmentFile = "/run/caddy.env";
systemd.services.caddy.serviceConfig.EnvironmentFile = "/var/lib/caddy/caddy.env";

# Wait for cloud-init mounting before we start caddy.
systemd.services.caddy.after = ["cloud-init.service"];
Expand Down
2 changes: 1 addition & 1 deletion terraform/binary-cache.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module "binary_cache_vm" {
},
{
content = "SITE_ADDRESS=ghaf-binary-cache-${local.env}.northeurope.cloudapp.azure.com",
"path" = "/run/caddy.env"
"path" = "/var/lib/caddy/caddy.env"
},
],
})])
Expand Down
2 changes: 1 addition & 1 deletion terraform/jenkins-controller.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ module "jenkins_controller_vm" {
},
{
content = "SITE_ADDRESS=ghaf-jenkins-controller-${local.env}.northeurope.cloudapp.azure.com",
"path" = "/run/caddy.env"
"path" = "/var/lib/caddy/caddy.env"
}
]
})])
Expand Down

0 comments on commit 0f81c5f

Please sign in to comment.