diff --git a/configs/Cubchoo-caddy/Caddyfile b/configs/Cubchoo-caddy/Caddyfile new file mode 100644 index 0000000..0bc227c --- /dev/null +++ b/configs/Cubchoo-caddy/Caddyfile @@ -0,0 +1,122 @@ +{ + email webmaster@strawmelonjuice.com +} + +(icon_redirect) { + redir /assets/site_icon.png https://strawmelonjuice.com/strawmelonjuice.svg permanent + redir /favicon.ico https://strawmelonjuice.com/strawmelonjuice.svg permanent + redir /favicon.png https://strawmelonjuice.com/strawmelonjuice.svg permanent + redir /assets/img/favicon.svg https://strawmelonjuice.com/strawmelonjuice.svg permanent + redir /assets/img/favicon.png https://strawmelonjuice.com/strawmelonjuice.svg permanent + redir /assets/img/site_icon.svg https://strawmelonjuice.com/strawmelonjuice.svg permanent + redir /assets/img/logo.svg https://strawmelonjuice.com/strawmelonjuice.svg permanent +} + +git.strawmelonjuice.com { + redir https://forge.strawmelonjuice.com{uri} +} + +forge.strawmelonjuice.com { + redir /assets/site_icon.png https://strawmelonjuice.com/svg/forgejo_strawmelonjuice.svg permanent + redir /favicon.ico https://strawmelonjuice.com/svg/forgejo_strawmelonjuice.svg permanent + redir /favicon.png https://strawmelonjuice.com/svg/forgejo_strawmelonjuice.svg permanent + redir /assets/img/favicon.svg https://strawmelonjuice.com/svg/forgejo_strawmelonjuice.svg permanent + redir /assets/img/favicon.png https://strawmelonjuice.com/svg/forgejo_strawmelonjuice.svg permanent + redir /assets/img/site_icon.svg https://strawmelonjuice.com/svg/forgejo_strawmelonjuice.svg permanent + redir /assets/img/logo.svg https://strawmelonjuice.com/svg/forgejo_strawmelonjuice.svg permanent + + # proxy to forgejo's anubis + reverse_proxy host.containers.internal:50001 { + header_up X-Real-Ip {remote_host} + } +} + +files-shared.strawmelonjuice.com { + redir https://media.strawmelonjuice.com{uri} +} + +fonts.strawmelonjuice.com { + reverse_proxy 100.65.127.22:39936 +} + +pds.strawmelonjuice.com { + reverse_proxy host.containers.internal:7060 +} + +media.strawmelonjuice.com { + # request_body { + # max_size 3GB + # } + reverse_proxy strawmedia:3022 +} + +cloud.strawmelonjuice.com { + reverse_proxy owncloud_server:8080 +} +matrix.strawmelonjuice.com { + reverse_proxy /_matrix/* matrix:8008 + reverse_proxy /_synapse/client/* matrix:8008 + reverse_proxy matrix:8008 { + transport http { + read_timeout 300s + write_timeout 300s + } + } + redir https://app.cinny.in/login/strawmelonjuice.com +} + +www.strawmelonjuice.com, +strawmelonjuice.com { + # Old strawmelonjuice.php and Cynthia Full pages that google is still trying and its annoying me. + @old_php_pages { + query p=* + query c=* + } + + handle @old_php_pages { + respond "This content is no longer available." 410 + } + # ===================------ ATPROTO ------=================== + handle_path /.well-known/atproto-did { + header Access-Control-Allow-Origin * + respond "did:plc:jgtfsmv25thfs4zmydtbccnn" + } + + # ================---- Matrix Homeserver ----================ + handle /.well-known/matrix/* { + header Access-Control-Allow-Origin * + header Content-Type application/json + + # Using a Matcher inside the handle to respond differently + @server path /.well-known/matrix/server + respond @server `{"m.server": "matrix.strawmelonjuice.com:443"}` + + @client path /.well-known/matrix/client + respond @client `{"m.homeserver": {"base_url": "https://strawmelonjuice.com"}, "m.identity_server": {"base_url": "https://vector.im"}}` + } + + handle /_matrix/* { + reverse_proxy matrix:8008 { + transport http { + read_timeout 300s + write_timeout 300s + dial_timeout 30s + } + } + } + + handle /_synapse/client/* { + reverse_proxy matrix:8008 + } + + # My site's anubis + reverse_proxy host.containers.internal:50002 { + header_up X-Real-Ip {remote_host} + } +} +http://localhost:7008 { + # My Site + root * /srv/strawmelonjuice-site/ + try_files {path} {path}/index.html /unpopulated.html unpopulated.html + file_server +} diff --git a/home/host-specific/Cubchoo.nix b/home/host-specific/Cubchoo.nix index b43df47..0e9164c 100644 --- a/home/host-specific/Cubchoo.nix +++ b/home/host-specific/Cubchoo.nix @@ -117,124 +117,47 @@ programs.zsh.shellAliases.caddy-reload = "podman exec -it caddy caddy reload --config /etc/caddy/Caddyfile"; - xdg.configFile."services/Caddy/Caddyfile".text = '' - { - email webmaster@strawmelonjuice.com - } - - (icon_redirect) { - redir /assets/site_icon.png https://strawmelonjuice.com/strawmelonjuice.svg permanent - redir /favicon.ico https://strawmelonjuice.com/strawmelonjuice.svg permanent - redir /favicon.png https://strawmelonjuice.com/strawmelonjuice.svg permanent - redir /assets/img/favicon.svg https://strawmelonjuice.com/strawmelonjuice.svg permanent - redir /assets/img/favicon.png https://strawmelonjuice.com/strawmelonjuice.svg permanent - redir /assets/img/site_icon.svg https://strawmelonjuice.com/strawmelonjuice.svg permanent - redir /assets/img/logo.svg https://strawmelonjuice.com/strawmelonjuice.svg permanent - } - - git.strawmelonjuice.com { - redir https://forge.strawmelonjuice.com{uri} - } - - forge.strawmelonjuice.com { - redir /assets/site_icon.png https://strawmelonjuice.com/svg/forgejo_strawmelonjuice.svg permanent - redir /favicon.ico https://strawmelonjuice.com/svg/forgejo_strawmelonjuice.svg permanent - redir /favicon.png https://strawmelonjuice.com/svg/forgejo_strawmelonjuice.svg permanent - redir /assets/img/favicon.svg https://strawmelonjuice.com/svg/forgejo_strawmelonjuice.svg permanent - redir /assets/img/favicon.png https://strawmelonjuice.com/svg/forgejo_strawmelonjuice.svg permanent - redir /assets/img/site_icon.svg https://strawmelonjuice.com/svg/forgejo_strawmelonjuice.svg permanent - redir /assets/img/logo.svg https://strawmelonjuice.com/svg/forgejo_strawmelonjuice.svg permanent - - - # proxy to forgejo - # reverse_proxy anubis-forge:3000 { - reverse_proxy forgejo:3000 { - header_up X-Real-Ip {remote_host} - } - } - - files-shared.strawmelonjuice.com { - redir https://media.strawmelonjuice.com{uri} - } - - fonts.strawmelonjuice.com { - reverse_proxy 100.65.127.22:39936 - } - - media.strawmelonjuice.com { - # request_body { - # max_size 3GB - # } - reverse_proxy strawmedia:3022 - } - - cloud.strawmelonjuice.com { - reverse_proxy owncloud_server:8080 - } - matrix.strawmelonjuice.com { - reverse_proxy /_matrix/* matrix:8008 - reverse_proxy /_synapse/client/* matrix:8008 - reverse_proxy matrix:8008 { - transport http { - read_timeout 300s - write_timeout 300s - } - } - reverse_proxy https://app.cinny.in - } - - www.strawmelonjuice.com, - strawmelonjuice.com { - # Old strawmelonjuice.php and Cynthia Full pages that google is still trying and its annoying me. - @old_php_pages { - query p=* - query c=* - } - - handle @old_php_pages { - respond "This content is no longer available." 410 - } - # ===================------ ATPROTO ------=================== - handle_path /.well-known/atproto-did { - header Access-Control-Allow-Origin * - respond "did:plc:jgtfsmv25thfs4zmydtbccnn" - } - - # ================---- Matrix Homeserver ----================ - handle /.well-known/matrix/* { - header Access-Control-Allow-Origin * - header Content-Type application/json - - # Using a Matcher inside the handle to respond differently - @server path /.well-known/matrix/server - respond @server `{"m.server": "matrix.strawmelonjuice.com:443"}` - - @client path /.well-known/matrix/client - respond @client `{"m.homeserver": {"base_url": "https://strawmelonjuice.com"}, "m.identity_server": {"base_url": "https://vector.im"}}` - } - - handle /_matrix/* { - reverse_proxy matrix:8008 { - transport http { - read_timeout 300s - write_timeout 300s - dial_timeout 30s - } - } - } - - handle /_synapse/client/* { - reverse_proxy matrix:8008 - } - - # ===================------ My Site ------=================== - handle { - root * /srv/strawmelonjuice-site/ - try_files {path} {path}/index.html /unpopulated.html unpopulated.html - file_server - } - } - ''; + xdg.configFile."services/Caddy/Caddyfile".source = ../../configs/Cubchoo-caddy/Caddyfile; + + # Anubis + services.anubis = { + # Forgejo + instances.forgejo = { + enable = true; + user = "anubis-forgejo"; + settings.BIND = ":50001"; + settings.TARGET = "http://localhost:7300"; + }; + instances.site = { + enable = true; + user = "anubis-site"; + settings.BIND = ":50001"; + settings.TARGET = "http://localhost:7008"; + }; + }; + + # Tranquil (trying this out) + + services.tranquil-pds = { + enable = true; + settings = { + server = { + hostname = "pds.strawmelonjuice.com"; + host = "localhost"; + port = "7060"; + }; + database = { + url = "postgresql://tranquil:postgres@main-database:5432"; + }; + storage = { + path = "/home/mar/services/data/tranquil/blobs"; + }; + tranquil_store = { + data_dir = "/home/mar/services/data/tranquil/data"; + }; + }; + environmentFiles = [ "/etc/secrets/tranquil.env.production" ]; + }; # Owncloud ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Add symlink between Owncloud files <-> Home folders @@ -324,6 +247,7 @@ network = "server-net"; ports = [ "222:22" + "7300:3000" ]; environment = { "FORGEJO__database__DB_TYPE" = "postgres"; diff --git a/home/host-specific/Samurott.nix b/home/host-specific/Samurott.nix index b1a28ba..b11f250 100644 --- a/home/host-specific/Samurott.nix +++ b/home/host-specific/Samurott.nix @@ -4,7 +4,7 @@ }: { imports = [ - ../modules/entertainment/steam.nix + ../modules/entertainment/light-games.nix ../modules/entertainment/music-streaming.nix ../modules/conversation.nix ../modules/school.nix