Add rimgo
This commit is contained in:
parent
499c10f99b
commit
ea0338519d
5 changed files with 91 additions and 0 deletions
|
@ -89,6 +89,12 @@
|
||||||
group = "nginx";
|
group = "nginx";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
rimgo-auth = {
|
||||||
|
file = ./rimgo/auth.age;
|
||||||
|
owner = "nginx";
|
||||||
|
group = "nginx";
|
||||||
|
};
|
||||||
|
|
||||||
anonymous-overflow-config = {
|
anonymous-overflow-config = {
|
||||||
file = ./anonymous-overflow/config.age;
|
file = ./anonymous-overflow/config.age;
|
||||||
mode = "444";
|
mode = "444";
|
||||||
|
|
14
agenix/hosts/sail/rimgo/auth.age
Normal file
14
agenix/hosts/sail/rimgo/auth.age
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
-----BEGIN AGE ENCRYPTED FILE-----
|
||||||
|
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IE10R3A2ZyAySTBM
|
||||||
|
aFBCMXFLc0JJeHlSMjBEM0pqeElpZ3FOYmd6WFI4bndMcGluMWxVCmJ6aHBYNFlW
|
||||||
|
RFlyTjhGYkluMWJ3bmRjaU55QWthYUZaWVpnZ081NUxYdDQKLT4gc3NoLWVkMjU1
|
||||||
|
MTkgTmJWNGh3IFN2SWJ6ZFloZkk4YVI3NXFFUkJsQnMwemV0czQ0L3Q3d0ZxQkZP
|
||||||
|
aXRFQUEKWWRSV2hQOC8zMFZ4aUFack9DcjM0SEg5VmVDdnZoUUdKb1FoTzMvclhI
|
||||||
|
YwotPiBtc017cmNSNy1ncmVhc2UgO191L2tOfSAuX2sKYjlmMEpJSTJKbFpNb1h0
|
||||||
|
U2s2K1U0NnAyejBjbHhyTDJaUG85dCtORDdMME1iTmFNTWlTZGdpRi90emVVT0ZL
|
||||||
|
RgpLemUyVXJHR1ZyNEJCbExuN3cxQWw4Q1ZvKzAzZ1l5bTJ6ekh1N2VtbWhsUAot
|
||||||
|
LS0gZDZuVXliZXRqeHpEa24vbTdLRjY2RkdReUgrVk4yRXJVam82ZklCUER5dwoi
|
||||||
|
onrE2i7Culh6zYX79xMkJOuhSXlTpX2q4LQin5RA8O0b6lVui5lGR+K+wTkfYvKw
|
||||||
|
D92KqHxvQbCpYECM5QrEued9+3ujmRjd5Zh9YBCdmoM1P7BlyTYaMIduUenN7VjP
|
||||||
|
LjqdajKkDcu8Jf7p27Qob0A=
|
||||||
|
-----END AGE ENCRYPTED FILE-----
|
|
@ -29,6 +29,8 @@ in
|
||||||
|
|
||||||
"agenix/hosts/sail/libreddit/auth.age".publicKeys = sail;
|
"agenix/hosts/sail/libreddit/auth.age".publicKeys = sail;
|
||||||
|
|
||||||
|
"agenix/hosts/sail/rimgo/auth.age".publicKeys = sail;
|
||||||
|
|
||||||
"agenix/hosts/sail/anonymous-overflow/config.age".publicKeys = sail;
|
"agenix/hosts/sail/anonymous-overflow/config.age".publicKeys = sail;
|
||||||
"agenix/hosts/sail/anonymous-overflow/auth.age".publicKeys = sail;
|
"agenix/hosts/sail/anonymous-overflow/auth.age".publicKeys = sail;
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,8 @@ in
|
||||||
|
|
||||||
(import ../nixos/ntfy-sh.nix (args // { inherit secret; }))
|
(import ../nixos/ntfy-sh.nix (args // { inherit secret; }))
|
||||||
|
|
||||||
|
../nixos/rimgo.nix
|
||||||
|
|
||||||
../nixos/synapse.nix
|
../nixos/synapse.nix
|
||||||
|
|
||||||
../nixos/websites.nix
|
../nixos/websites.nix
|
||||||
|
|
67
system/nixos/rimgo.nix
Normal file
67
system/nixos/rimgo.nix
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
{ pkgs, config, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
rimgo-pkg = pkgs.rimgo;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
systemd.services.rimgo = {
|
||||||
|
description = "An alternative frontend for Imgur";
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
after = [ "network.target" ];
|
||||||
|
serviceConfig = {
|
||||||
|
DynamicUser = true;
|
||||||
|
StateDirectory = "rimgo";
|
||||||
|
Environment = [
|
||||||
|
"ADDRESS=127.0.0.1"
|
||||||
|
"PORT=8006"
|
||||||
|
];
|
||||||
|
ExecStart = "${rimgo-pkg}/bin/rimgo";
|
||||||
|
Restart = "on-failure";
|
||||||
|
RestartSec = "5s";
|
||||||
|
# Hardening
|
||||||
|
CapabilityBoundingSet = [ "" ];
|
||||||
|
DeviceAllow = [ "" ];
|
||||||
|
LockPersonality = true;
|
||||||
|
MemoryDenyWriteExecute = true;
|
||||||
|
PrivateDevices = true;
|
||||||
|
PrivateUsers = true;
|
||||||
|
ProcSubset = "pid";
|
||||||
|
ProtectClock = true;
|
||||||
|
ProtectControlGroups = true;
|
||||||
|
ProtectHome = true;
|
||||||
|
ProtectHostname = true;
|
||||||
|
ProtectKernelLogs = true;
|
||||||
|
ProtectKernelModules = true;
|
||||||
|
ProtectKernelTunables = true;
|
||||||
|
RestrictAddressFamilies = [ "AF_INET" "AF_INET6" ];
|
||||||
|
RestrictNamespaces = true;
|
||||||
|
RestrictRealtime = true;
|
||||||
|
RestrictSUIDSGID = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx = {
|
||||||
|
enable = true;
|
||||||
|
recommendedOptimisation = true;
|
||||||
|
recommendedGzipSettings = true;
|
||||||
|
recommendedBrotliSettings = true;
|
||||||
|
|
||||||
|
virtualHosts."rimgo.only.internal" = {
|
||||||
|
listen = [
|
||||||
|
{
|
||||||
|
addr = "127.0.0.1";
|
||||||
|
port = 80;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
forceSSL = false;
|
||||||
|
enableACME = false;
|
||||||
|
basicAuthFile = config.age.secrets.rimgo-auth.path;
|
||||||
|
|
||||||
|
locations."/" = {
|
||||||
|
recommendedProxySettings = true;
|
||||||
|
proxyPass = "http://127.0.0.1:8006";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue