2024-09-05 21:11:15 +02:00
|
|
|
{pkgs, lib, config, ...}:
|
|
|
|
with lib; with builtins; {
|
2024-09-01 00:06:13 +02:00
|
|
|
services.forgejo = {
|
|
|
|
enable = true;
|
2024-09-06 05:01:21 +02:00
|
|
|
package = config.pkgsInstances.unstable.forgejo;
|
2024-09-01 00:06:13 +02:00
|
|
|
settings.server = {
|
|
|
|
ROOT_URL = "https://git.shibe.pro";
|
|
|
|
DOMAIN = "git.shibe.pro";
|
|
|
|
HTTP_PORT = 48540;
|
|
|
|
OFFLINE_MODE = true; # disable gravatar, CDN
|
|
|
|
};
|
|
|
|
settings.actions = {
|
|
|
|
ENABLED = true;
|
|
|
|
};
|
|
|
|
settings."repository.upload" = {
|
|
|
|
FILE_MAX_SIZE = 4095;
|
|
|
|
MAX_FILES = 20;
|
|
|
|
};
|
|
|
|
settings."attachment" = {
|
|
|
|
MAX_SIZE = 4095;
|
|
|
|
MAX_FILES = 20;
|
|
|
|
};
|
|
|
|
|
|
|
|
settings.service = {
|
|
|
|
DISABLE_REGISTRATION = true;
|
|
|
|
DEFAULT_KEEP_EMAIL_PRIVATE = true;
|
|
|
|
};
|
|
|
|
database = {
|
|
|
|
user = "forgejo";
|
2024-09-06 02:01:59 +02:00
|
|
|
passwordFile = config.sops.secrets."hosts/forgenite/forgejo_db_password".path;
|
2024-09-01 00:06:13 +02:00
|
|
|
name = "forgejodb";
|
|
|
|
type = "mysql";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# Allow forgejo user to adjust authorized_keys dynamically
|
|
|
|
services.openssh.extraConfig = ''
|
|
|
|
Match User forgejo
|
|
|
|
AuthorizedKeysFile ${config.users.users.forgejo.home}/.ssh/authorized_keys
|
|
|
|
'';
|
|
|
|
networking.firewall.allowedTCPPorts = [48540];
|
2024-09-05 21:11:15 +02:00
|
|
|
}
|