move discourse behind tide module
This commit is contained in:
parent
03f84d7b6a
commit
344d496a9b
11 changed files with 59 additions and 419 deletions
56
tide.nix
56
tide.nix
|
|
@ -1,37 +1,41 @@
|
|||
{
|
||||
domainName,
|
||||
...
|
||||
}:
|
||||
{ config, ... }:
|
||||
{
|
||||
services.tide = {
|
||||
enable = true;
|
||||
domain = "tide.${domainName}";
|
||||
apiDomain = "apitide.${domainName}";
|
||||
secretsFile = "/run/secrets/tide-env";
|
||||
# Reuse the wildcard cert already issued for *.${domainName}
|
||||
# in configuration.nix instead of requesting a new one per
|
||||
# subdomain.
|
||||
nginx.useACMEHost = null;
|
||||
secretFiles = {
|
||||
adminPassword = config.sops.secrets."tide-admin-password".path;
|
||||
mailPassword = config.sops.secrets."tide-mail-password".path;
|
||||
secretKeyBase = config.sops.secrets."tide-secret-key-base".path;
|
||||
borgPassphrase = config.sops.secrets."borg-passphrase".path;
|
||||
borgPrivateKey = config.sops.secrets."borg-private-key".path;
|
||||
};
|
||||
};
|
||||
|
||||
# Don't fail evaluation when secrets/tide.yaml is missing (e.g.
|
||||
# before the operator has encrypted it on a fresh checkout).
|
||||
# sops-install-secrets will still error at activation time if
|
||||
# the file is absent, which is the right place for that failure.
|
||||
sops.validateSopsFiles = false;
|
||||
|
||||
# Use the host's age key generated with age-keygen, not the
|
||||
# SSH-host-key-derived identity sops-nix falls back to by default.
|
||||
# The encrypted file's recipient is the public key paired with
|
||||
# this private key.
|
||||
sops.age.keyFile = "/var/lib/sops-nix/key.txt";
|
||||
sops.age.sshKeyPaths = [ ];
|
||||
sops.gnupg.sshKeyPaths = [ ];
|
||||
|
||||
sops.secrets."tide-env" = {
|
||||
sopsFile = ./secrets/tide.yaml;
|
||||
# phpfpm reads this via EnvironmentFile, which runs as root
|
||||
# before dropping to the tide user, so root readable is enough.
|
||||
mode = "0400";
|
||||
sops.secrets = {
|
||||
"tide-admin-password" = {
|
||||
sopsFile = ./secrets/tide.yaml;
|
||||
key = "admin-password";
|
||||
mode = "0400";
|
||||
owner = "discourse";
|
||||
group = "discourse";
|
||||
};
|
||||
"tide-mail-password" = {
|
||||
sopsFile = ./secrets/tide.yaml;
|
||||
key = "mail-key";
|
||||
mode = "0400";
|
||||
owner = "discourse";
|
||||
group = "discourse";
|
||||
};
|
||||
"tide-secret-key-base" = {
|
||||
sopsFile = ./secrets/tide.yaml;
|
||||
key = "secret-key";
|
||||
mode = "0400";
|
||||
owner = "discourse";
|
||||
group = "discourse";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue