22
0
mirror of https://github.com/SuperSandro2000/nixos-modules.git synced 2024-06-14 03:46:57 +02:00

gitea: expand recommended settings

This commit is contained in:
Sandro - 2023-01-11 00:53:53 +01:00
parent aafa533bd1
commit e2683a4fcb
Signed by: sandro
GPG Key ID: 3AF5A43A3EECC2E5

View File

@ -9,11 +9,35 @@ in
};
config = lib.mkIf cfg.enable {
services.gitea.settings = lib.mkIf cfg.recommendedDefaults (libS.modules.mkRecursiveDefault {
"update_checker".ENABLED = false;
other.SHOW_FOOTER_VERSION = false;
session.COOKIE_SECURE = lib.mkForce true;
time.DEFAULT_UI_LOCATION = config.time.timeZone;
services.gitea = lib.mkIf cfg.recommendedDefaults (libS.modules.mkRecursiveDefault {
rootUrl = "https://${config.services.gitea.domain}/";
settings = {
cors = {
ALLOW_DOMAIN = config.services.gitea.domain;
ENABLED = true;
SCHEME = "https";
};
other.SHOW_FOOTER_VERSION = false;
repository.ACCESS_CONTROL_ALLOW_ORIGIN = config.services.gitea.domain;
server = {
ENABLE_GZIP = true;
SSH_SERVER_CIPHERS = "chacha20-poly1305@openssh.com, aes256-gcm@openssh.com, aes128-gcm@openssh.com";
SSH_SERVER_KEY_EXCHANGES = "curve25519-sha256@libssh.org, ecdh-sha2-nistp521, ecdh-sha2-nistp384, ecdh-sha2-nistp256, diffie-hellman-group14-sha1";
SSH_SERVER_MACS = "hmac-sha2-256-etm@openssh.com, hmac-sha2-256, hmac-sha1";
};
session = {
COOKIE_SECURE = true;
PROVIDER = "db";
SAME_SITE = "strict";
SESSION_LIFE_TIME = 604800; # 7 days
};
"ssh.minimum_key_sizes" = {
ECDSA = -1;
RSA = 4095;
};
time.DEFAULT_UI_LOCATION = config.time.timeZone;
update_checker.ENABLED = false;
};
});
};
}