mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 18:41:34 +01:00
Add robots.txt to forgejo
This commit is contained in:
parent
6dc9025762
commit
0c51cdd6df
1 changed files with 14 additions and 0 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
@ -7,6 +8,7 @@ let
|
||||||
cfg = config.custom.services.forgejo;
|
cfg = config.custom.services.forgejo;
|
||||||
|
|
||||||
user = config.users.users.forgejo.name;
|
user = config.users.users.forgejo.name;
|
||||||
|
inherit (config.users.users.forgejo) group;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.custom.services.forgejo = {
|
options.custom.services.forgejo = {
|
||||||
|
|
@ -53,5 +55,17 @@ in
|
||||||
passwordPath = config.sops.secrets."forgejo/admin-password".path;
|
passwordPath = config.sops.secrets."forgejo/admin-password".path;
|
||||||
in
|
in
|
||||||
''${createCmd} --username SebastianStork --password "$(cat ${passwordPath})" --email "sebastian.stork@pm.me" --admin || true'';
|
''${createCmd} --username SebastianStork --password "$(cat ${passwordPath})" --email "sebastian.stork@pm.me" --admin || true'';
|
||||||
|
|
||||||
|
systemd.tmpfiles.rules =
|
||||||
|
let
|
||||||
|
disallow-all-robots = lib.replaceStrings [ "\n" ] [ "\\n" ] ''
|
||||||
|
User-agent: *
|
||||||
|
Disallow: /
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
[
|
||||||
|
"d ${config.services.forgejo.customDir}/public 750 ${user} ${group} - -"
|
||||||
|
"f+ ${config.services.forgejo.customDir}/public/robots.txt 750 ${user} ${group} - ${disallow-all-robots}"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue