Compare commits

...
Sign in to create a new pull request.

6 commits
main ... 100

6 changed files with 118 additions and 12 deletions

View file

@ -42,18 +42,22 @@
}; };
# hardened openssh # hardened openssh
services.openssh = { services = {
allowSFTP = false; fail2ban.enable = true;
extraConfig = '' endlessh = {
AllowTcpForwarding yes enable = true;
X11Forwarding no port = 22;
AllowAgentForwarding no openFirewall = true;
AllowStreamLocalForwarding no };
AuthenticationMethods publickey openssh = {
''; enable = true;
ports = [ 5011 ];
settings = { settings = {
KbdInteractiveAuthentication = false;
PasswordAuthentication = false; PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
PermitRootLogin = "no";
AllowUsers = [ "srv" ];
};
}; };
}; };

View file

@ -12,6 +12,7 @@
"cryptpad" "cryptpad"
"fi33.buzz" "fi33.buzz"
"gatus" "gatus"
"forgejo"
"homepage-dashboard" "homepage-dashboard"
"immich" "immich"
"jellyfin" "jellyfin"

View file

@ -0,0 +1,87 @@
{
config,
lib,
...
}:
let
port = 5027;
certloc = "/var/lib/acme/fi33.buzz";
hostname = "git.fi33.buzz";
url = "https://git.fi33.buzz";
sshPort = lib.head config.services.openssh.ports;
in
{
services = {
forgejo = {
enable = true;
dump = {
enable = true;
interval = "00:00";
};
lfs.enable = true;
settings = {
server = {
# keep-sorted start
DOMAIN = hostname;
HTTP_PORT = port;
ROOT_URL = url;
SSH_PORT = sshPort;
# keep-sorted end
};
service.DISABLE_REGISTRATION = true;
};
user = "git";
group = "git";
};
openssh.settings.AllowUsers = [ "git" ];
gatus.settings.endpoints = [
{
name = "Forgejo";
group = "Private Services";
inherit url;
interval = "5m";
conditions = [
"[STATUS] == 200"
"[CONNECTED] == true"
"[RESPONSE_TIME] < 500"
];
alerts = [ { type = "ntfy"; } ];
}
{
name = "Forgejo SSH";
group = "Private Services";
url = "ssh://${hostname}:${toString sshPort}";
interval = "5m";
conditions = [
"[CONNECTED] == true"
"[RESPONSE_TIME] < 500"
];
alerts = [ { type = "ntfy"; } ];
}
];
borgbackup.jobs = {
onsite.paths = [ "/var/lib/forgejo" ];
offsite.paths = [ "/var/lib/forgejo" ];
};
caddy.virtualHosts.${hostname}.extraConfig = ''
reverse_proxy localhost:${toString port}
tls ${certloc}/cert.pem ${certloc}/key.pem {
protocols tls1.3
}
'';
};
users = {
users.git = {
home = "/var/lib/forgejo";
useDefaultShell = true;
group = "git";
isSystemUser = true;
};
groups.git = { };
};
}

View file

@ -23,6 +23,7 @@ let
secrets = [ secrets = [
# keep-sorted start # keep-sorted start
"forgejo-read-token"
"immich" "immich"
"jellyfin" "jellyfin"
"kavita-api" "kavita-api"
@ -79,6 +80,18 @@ in
} }
{ {
"Media Management" = [ "Media Management" = [
{
Forgejo = {
description = "Software forge";
icon = "forgejo.svg";
href = "https://git.fi33.buzz/";
widget = {
type = "gitea";
url = "https://git.fi33.buzz/";
key = "@forgejo-read-token@";
};
};
}
{ {
Radarr = { Radarr = {
description = "Movie organizer/manager"; description = "Movie organizer/manager";

Binary file not shown.

View file

@ -18,6 +18,7 @@ in
"borgbackup-offsite.age".publicKeys = users; "borgbackup-offsite.age".publicKeys = users;
"borgbackup-onsite.age".publicKeys = users; "borgbackup-onsite.age".publicKeys = users;
"copyparty.age".publicKeys = users; "copyparty.age".publicKeys = users;
"forgejo-read-token.age".publicKeys = users;
"gatus.age".publicKeys = users; "gatus.age".publicKeys = users;
"git_signing_key.age".publicKeys = users; "git_signing_key.age".publicKeys = users;
"git_signing_key.pub.age".publicKeys = users; "git_signing_key.pub.age".publicKeys = users;