lightsail-tokyo: add forgejo

This commit is contained in:
Guanran Wang 2024-06-10 16:48:35 +08:00
parent 132bc369a0
commit 7a51cbb042
Signed by: nyancat
GPG key ID: 91F97D9ED12639CF
2 changed files with 39 additions and 8 deletions

View file

@ -138,3 +138,8 @@ mastodon.ny4.dev {
file_server file_server
} }
} }
git.ny4.dev {
import default
reverse_proxy unix//run/forgejo/forgejo.sock
}

View file

@ -204,30 +204,32 @@
}; };
}; };
services = [ services = let
getDesc = pkg: pkg.meta.description;
in [
{ {
"Services" = [ "Services" = [
{ {
"SearXNG" = { "SearXNG" = {
description = "A privacy-respecting, open metasearch engine."; description = getDesc pkgs.searxng;
href = "https://searx.ny4.dev"; href = "https://searx.ny4.dev";
}; };
} }
{ {
"Wastebin" = { "Wastebin" = {
description = "A minimal pastebin with a design shamelessly copied from bin."; description = getDesc pkgs.wastebin;
href = "https://pb.ny4.dev"; href = "https://pb.ny4.dev";
}; };
} }
{ {
"Ntfy" = { "Ntfy" = {
description = "Send push notifications to your phone or desktop using PUT/POST."; description = getDesc pkgs.ntfy;
href = "https://ntfy.ny4.dev/"; href = "https://ntfy.ny4.dev/";
}; };
} }
{ {
"Mumble" = { "Mumble" = {
description = "Open Source, Low Latency, High Quality Voice Chat. (Connect with ny4.dev:64738)"; description = "${getDesc pkgs.mumble} (Connect with ny4.dev:64738)";
}; };
} }
]; ];
@ -236,7 +238,7 @@
"Private stuff" = [ "Private stuff" = [
{ {
"Mastodon" = rec { "Mastodon" = rec {
description = "Free, open-source decentralized social media platform."; description = getDesc pkgs.mastodon;
href = "https://mastodon.ny4.dev/"; href = "https://mastodon.ny4.dev/";
widget.type = "mastodon"; widget.type = "mastodon";
widget.url = href; widget.url = href;
@ -244,7 +246,7 @@
} }
{ {
"Matrix" = { "Matrix" = {
description = "An open network for secure, decentralised communication."; description = getDesc pkgs.element-web;
href = "https://element.ny4.dev/"; href = "https://element.ny4.dev/";
}; };
} }
@ -256,10 +258,16 @@
} }
{ {
"Uptime Kuma" = { "Uptime Kuma" = {
description = "A fancy self-hosted monitoring tool."; description = getDesc pkgs.uptime-kuma;
href = "https://uptime.ny4.dev/"; href = "https://uptime.ny4.dev/";
}; };
} }
{
"Forgejo" = {
description = getDesc pkgs.forgejo;
href = "https://git.ny4.dev/";
};
}
]; ];
} }
{ {
@ -268,11 +276,29 @@
{"GitHub".href = "https://github.com/Guanran928";} {"GitHub".href = "https://github.com/Guanran928";}
{"Mastodon".herf = "https://mastodon.ny4.dev/@nyancat";} {"Mastodon".herf = "https://mastodon.ny4.dev/@nyancat";}
{"Matrix".href = "https://matrix.to/#/@root:ny4.dev";} {"Matrix".href = "https://matrix.to/#/@root:ny4.dev";}
{"Forgejo".href = "https://git.ny4.dev/nyancat";}
]; ];
} }
]; ];
}; };
services.forgejo = {
enable = true;
database.type = "postgres";
settings = {
server = {
# TODO: whats the difference between this and fcgi+unix
DOMAIN = "git.ny4.dev";
PROTOCOL = "http+unix";
ROOT_URL = "https://git.ny4.dev/";
};
service = {
ALLOW_ONLY_EXTERNAL_REGISTRATION = true;
};
};
};
### Prevents me from bankrupt ### Prevents me from bankrupt
# https://fmk.im/p/shutdown-aws/ # https://fmk.im/p/shutdown-aws/
services.vnstat.enable = true; services.vnstat.enable = true;