2024-01-14 23:19:41 +01:00
|
|
|
# Sources for this configuration:
|
|
|
|
# - https://forgejo.org/
|
|
|
|
# - https://forgejo.org/docs/latest/
|
|
|
|
# - https://forgejo.org/docs/latest/admin/database-preparation/
|
|
|
|
# - https://forgejo.org/docs/latest/admin/config-cheat-sheet/
|
|
|
|
# - https://forgejo.org/docs/latest/admin/recommendations/
|
|
|
|
# - https://codeberg.org/forgejo/forgejo/src/branch/forgejo/docs/content/administration/reverse-proxies.en-us.md
|
|
|
|
# - https://forgejo.org/docs/latest/admin/email-setup/
|
|
|
|
|
2024-01-20 21:34:09 +01:00
|
|
|
{ pkgs-unstable, ... }:
|
2024-01-14 23:19:41 +01:00
|
|
|
|
|
|
|
{
|
|
|
|
services.forgejo = {
|
|
|
|
enable = true;
|
|
|
|
database.type = "postgres";
|
2024-05-25 16:47:34 +02:00
|
|
|
mailerPasswordFile = "/run/secrets/forgejo_git_smtp_password";
|
2024-01-14 23:19:41 +01:00
|
|
|
|
|
|
|
settings = {
|
|
|
|
DEFAULT = {
|
|
|
|
APP_NAME = "CCCHH Git";
|
|
|
|
};
|
|
|
|
server = {
|
|
|
|
DOMAIN = "git.hamburg.ccc.de";
|
|
|
|
PROTOCOL = "http";
|
|
|
|
HTTP_ADDR = "127.0.0.1";
|
|
|
|
HTTP_PORT = 3000;
|
|
|
|
ROOT_URL = "https://git.hamburg.ccc.de/";
|
|
|
|
# LOCAL_ROOT_URL is apparently what Forgejo uses to access itself.
|
|
|
|
# Doesn't need to be set.
|
2024-01-24 20:17:59 +01:00
|
|
|
OFFLINE_MODE = true;
|
2024-01-14 23:19:41 +01:00
|
|
|
};
|
|
|
|
admin = {
|
|
|
|
DISABLE_REGULAR_ORG_CREATION = false;
|
|
|
|
};
|
|
|
|
session = {
|
|
|
|
COOKIE_SECURE = true;
|
|
|
|
};
|
|
|
|
"ui.meta" = {
|
|
|
|
AUTHOR = "CCCHH Git";
|
|
|
|
DESCRIPTION = "Git instance of the CCCHH.";
|
|
|
|
KEYWORDS = "git,forge,forgejo,ccchh";
|
|
|
|
};
|
|
|
|
service = {
|
|
|
|
ALLOW_ONLY_EXTERNAL_REGISTRATION = true;
|
|
|
|
DEFAULT_USER_VISIBILITY = "limited";
|
|
|
|
DEFAULT_KEEP_EMAIL_PRIVATE = true;
|
2024-01-16 20:35:56 +01:00
|
|
|
ENABLE_BASIC_AUTHENTICATION = false;
|
2024-11-10 19:26:26 +01:00
|
|
|
ENABLE_NOTIFY_MAIL = true;
|
2024-01-16 20:35:56 +01:00
|
|
|
};
|
|
|
|
repo = {
|
|
|
|
DEFAULT_REPO_UNITS = "repo.code,repo.issues,repo.pulls";
|
2024-01-14 23:19:41 +01:00
|
|
|
};
|
2024-01-18 05:02:47 +01:00
|
|
|
actions = {
|
|
|
|
ENABLED = true;
|
2024-01-20 21:39:22 +01:00
|
|
|
ARTIFACT_RETENTION_DAYS = 30;
|
2024-01-18 05:02:47 +01:00
|
|
|
};
|
2024-01-14 23:19:41 +01:00
|
|
|
mailer = {
|
|
|
|
ENABLED = true;
|
|
|
|
FROM = "no-reply@git.hamburg.ccc.de";
|
|
|
|
PROTOCOL = "smtps";
|
|
|
|
SMTP_ADDR = "cow.hamburg.ccc.de";
|
|
|
|
SMTP_PORT = 465;
|
|
|
|
USER = "no-reply@git.hamburg.ccc.de";
|
|
|
|
};
|
|
|
|
cache = {
|
|
|
|
ENABLED = true;
|
|
|
|
ADAPTER = "redis";
|
|
|
|
HOST = "redis+socket:///run/redis-forgejo/redis.sock";
|
|
|
|
};
|
2024-01-22 17:59:01 +01:00
|
|
|
indexer = {
|
|
|
|
ISSUE_INDEXER_TYPE = "elasticsearch";
|
|
|
|
ISSUE_INDEXER_CONN_STR = "http://127.0.0.1:9200";
|
|
|
|
REPO_INDEXER_ENABLED = true;
|
|
|
|
REPO_INDEXER_TYPE = "elasticsearch";
|
|
|
|
REPO_INDEXER_CONN_STR = "http://127.0.0.1:9200";
|
|
|
|
};
|
2024-01-14 23:19:41 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-05-25 16:47:34 +02:00
|
|
|
sops.secrets."forgejo_git_smtp_password" = {
|
|
|
|
mode = "0440";
|
|
|
|
owner = "forgejo";
|
|
|
|
group = "forgejo";
|
|
|
|
restartUnits = [ "forgejo.service" ];
|
2024-01-14 23:19:41 +01:00
|
|
|
};
|
|
|
|
}
|