diff --git a/hosts/plover/default.nix b/hosts/plover/default.nix index 78671af5..b46b8874 100644 --- a/hosts/plover/default.nix +++ b/hosts/plover/default.nix @@ -200,8 +200,17 @@ in }; domain = codeForgeDomain; rootUrl = "https://${codeForgeDomain}"; + + # Allow Gitea to take a dump. + dump = { + enable = true; + interval = "Sunday"; + }; + + # There are a lot of services in port 3000 so we'll change it. httpPort = 8432; lfs.enable = true; + mailerPasswordFile = config.sops.secrets."plover/gitea/smtp/password".path; settings = { @@ -211,6 +220,7 @@ in }; ui = { + DEFAULT_THEME = "auto"; EXPLORE_PAGING_SUM = 15; GRAPH_MAX_COMMIT_NUM = 200; }; @@ -241,13 +251,13 @@ in # Mailer service. mailer = { ENABLED = true; - PROTOCOL = "smtp"; + PROTOCOL = "smtp+starttls"; SMTP_ADDRESS = "smtp.sendgrid.net"; SMTP_PORT = 587; USER = "apikey"; - FROM = "Gitea"; - ENVELOPE_FROM = "bot+gitea@foodogsquared.one"; + FROM = "bot+gitea@foodogsquared.one"; SEND_AS_PLAIN_TEXT = true; + SENDMAIL_PATH = "${pkgs.system-sendmail}/bin/sendmail"; }; # Well, collaboration between forges is nice... @@ -262,6 +272,9 @@ in # Some more database configuration. database.SCHEMA = config.services.gitea.user; + # Run various periodic services. + "cron.update_mirrors".SCHEDULE = "@every 12h"; + other = { SHOW_FOOTER_VERSION = true; ENABLE_SITEMAP = true; @@ -293,7 +306,10 @@ in # nonexistent because this is just intended for me (at least right now). SIGNUPS_ALLOWED = false; SIGNUPS_VERIFY = true; + + # Invitations... INVITATIONS_ALLOWED = true; + INVITATION_ORG_NAME = "foodogsquared's Vaultwarden"; # Notifications... WEBSOCKET_ENABLED = true; @@ -356,5 +372,14 @@ in IdentityFile ${config.sops.secrets."plover/ssh-key".path} ''; + systemd.tmpfiles.rules = let + # To be used similarly to $GITEA_CUSTOM variable. + giteaCustomDir = "${config.services.gitea.stateDir}/custom"; + in [ + "L+ ${giteaCustomDir}/templates/home.tmpl - - - - ${./files/gitea/home.tmpl}" + "L+ ${giteaCustomDir}/public/img/logo.svg - - - - ${./files/gitea/logo.svg}" + "L+ ${giteaCustomDir}/public/img/logo.png - - - - ${./files/gitea/logo.png}" + ]; + system.stateVersion = "22.11"; } diff --git a/hosts/plover/files/gitea/home.tmpl b/hosts/plover/files/gitea/home.tmpl new file mode 100644 index 00000000..c1b4c335 --- /dev/null +++ b/hosts/plover/files/gitea/home.tmpl @@ -0,0 +1,30 @@ +{{template "base/head" .}} +
+
+
+
+
+

+ foodogsquared's personal forge +

+
+
+ +
+
+
+

+ A single-user instance for the purpose of showing my personal projects without a bunch of scattered projects I forgot to remove in my other code repositories (e.g., GitHub, GitLab). + Includes my personal projects (of course) and a bunch of mirrored repositories I'm mainly interested in archiving. +

+

+ Though this is a single-user instance, I'm also interested in collaboration in this instance. + Feel free to send some patches in email at $FOODOGSQUARED_GITEA_USER@$FOODOGSQUARED_DOMAIN and I'll consider it to be merged. + If the time comes, the need for email patches is reduced once ForgeFed protocol has been implemented. + Once that happens, that would be the preferred way of collaborating. +

+
+
+
+
+{{template "base/footer" .}} diff --git a/hosts/plover/files/gitea/logo.png b/hosts/plover/files/gitea/logo.png new file mode 100644 index 00000000..cc30ed96 Binary files /dev/null and b/hosts/plover/files/gitea/logo.png differ diff --git a/hosts/plover/files/gitea/logo.svg b/hosts/plover/files/gitea/logo.svg new file mode 100644 index 00000000..8dcdca50 --- /dev/null +++ b/hosts/plover/files/gitea/logo.svg @@ -0,0 +1,254 @@ + +