Compare commits
6 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6bac995f02 | |||
| 996f826781 | |||
| af06b6d5ef | |||
| 383989516c | |||
|
|
c6135ee301 | ||
|
|
79dba1beb4 |
6 changed files with 118 additions and 12 deletions
|
|
@ -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;
|
||||||
settings = {
|
ports = [ 5011 ];
|
||||||
KbdInteractiveAuthentication = false;
|
settings = {
|
||||||
PasswordAuthentication = false;
|
PasswordAuthentication = false;
|
||||||
|
KbdInteractiveAuthentication = false;
|
||||||
|
PermitRootLogin = "no";
|
||||||
|
AllowUsers = [ "srv" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
"cryptpad"
|
"cryptpad"
|
||||||
"fi33.buzz"
|
"fi33.buzz"
|
||||||
"gatus"
|
"gatus"
|
||||||
|
"forgejo"
|
||||||
"homepage-dashboard"
|
"homepage-dashboard"
|
||||||
"immich"
|
"immich"
|
||||||
"jellyfin"
|
"jellyfin"
|
||||||
|
|
|
||||||
87
modules/nixos/features/forgejo.nix
Normal file
87
modules/nixos/features/forgejo.nix
Normal 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 = { };
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -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";
|
||||||
|
|
|
||||||
BIN
secrets/forgejo-read-token.age
Normal file
BIN
secrets/forgejo-read-token.age
Normal file
Binary file not shown.
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue