Add stash, adjust gitea

This commit is contained in:
Felix Albrigtsen 2023-06-29 23:31:55 +02:00
parent 5c1a89ab9e
commit 8ce458e2d3
3 changed files with 59 additions and 0 deletions

View File

@ -24,6 +24,7 @@
./services/hedgedoc.nix ./services/hedgedoc.nix
./services/vaultwarden.nix ./services/vaultwarden.nix
./services/calibre.nix ./services/calibre.nix
./services/stash.nix
# ./services/code-server.nix # ./services/code-server.nix
]; ];

View File

@ -3,6 +3,7 @@ let
cfg = config.services.gitea; cfg = config.services.gitea;
domain = "git.feal.no"; domain = "git.feal.no";
httpPort = 3004; httpPort = 3004;
/* sshPort = 2222; */
in { in {
services.gitea = { services.gitea = {
enable = true; enable = true;
@ -16,6 +17,8 @@ in {
server = { server = {
LANDING_PAGE=''"/felixalb"''; LANDING_PAGE=''"/felixalb"'';
HTTP_PORT = httpPort; HTTP_PORT = httpPort;
/* SSH_PORT = sshPort; */
SSH_DOMAIN = "voyager.home.feal.no";
DOMAIN = domain; DOMAIN = domain;
ROOT_URL = "https://${domain}"; ROOT_URL = "https://${domain}";
}; };
@ -48,5 +51,6 @@ in {
# - configure mailer # - configure mailer
}; };
/* networking.firewall.allowedTCPPorts = [ httpPort sshPort ]; */
networking.firewall.allowedTCPPorts = [ httpPort ]; networking.firewall.allowedTCPPorts = [ httpPort ];
} }

View File

@ -0,0 +1,54 @@
{ config, pkgs, lib, ... }:
let
host = "127.0.1.2";
port = "5008";
# Some uid I will never use for anything else
uid = config.ids.uids.amule;
gid = config.ids.gids.amule;
in {
sops.secrets."transmission/vpncreds" = {
owner = "transmission";
group = "transmission";
};
users.users.stash = {
inherit uid;
group = "stash";
isSystemUser = true;
useDefaultShell = true;
description = "Stash media hosting platform";
};
users.groups.stash = {
inherit gid;
};
# Stash media hosting platform
virtualisation.oci-containers.containers.stash = {
image = "stashapp/stash";
ports = [ "${host}:${port}:9999" ];
volumes = [
"/var/lib/stash/config:/root/.stash"
"/var/lib/stash/cache:/cache"
"/tank/media/stash/data:/data"
"/tank/media/stash/other/metadata:/metadata"
"/tank/media/stash/other/blobs:/blobs"
"/tank/media/stash/other/generated:/generated"
];
environment = {
STASH_STASH = "/data/";
STASH_GENERATED = "/generated/";
STASH_METADATA = "/metadata";
STASH_CACHE = "/cache";
STASH_PORT = "9999";
};
environmentFiles = [
];
};
services.nginx.virtualHosts."stash.home.feal.no" = {
locations."/" = {
proxyPass = "http://${host}:${port}";
};
};
}