diff --git a/hosts/mirror.lewd.wtf/configuration.nix b/hosts/mirror.lewd.wtf/configuration.nix index 5774e41..c5206cb 100644 --- a/hosts/mirror.lewd.wtf/configuration.nix +++ b/hosts/mirror.lewd.wtf/configuration.nix @@ -3,6 +3,7 @@ imports = [ ./hardware-configuration.nix ./networking.nix + ./mirror/default.nix" ]; variables.hostName = "new"; diff --git a/hosts/mirror.lewd.wtf/mirror/default.nix b/hosts/mirror.lewd.wtf/mirror/default.nix new file mode 100644 index 0000000..6d8cd1b --- /dev/null +++ b/hosts/mirror.lewd.wtf/mirror/default.nix @@ -0,0 +1,45 @@ +{ config, ... }: +{ + imports = [ + ./xslt_template.nix + ]; + + networking.firewall.allowedTCPPorts = [ 80 443 ]; + + services.nginx = { + enable = true; + virtualHosts."mirror.lewd.wtf" = { + serverName = "${config.variables.hostName}.${config.variables.domain}"; + enableACME = true; + forceSSL = true; + root = "/var/www/mirror/mirror/"; + locations = { + "/" = { + extraConfig = '' + if ($arg_format = "json") { + rewrite ^ /json$request_uri last; + } + autoindex on; + autoindex_format xml; + xslt_stylesheet /etc/nginx/mirror.xslt dirname='$1'; + ''; + }; + "/json/" = { + alias = "/var/www/mirror/mirror/"; + extraConfig = '' + autoindex on; + autoindex_format json; + ''; + }; + "/private/" = { + alias = "/var/www/mirror/private/"; + extraConfig = '' + autoindex off; + ''; + }; + "~ \.xml$" = { + }; + }; + }; + }; +} diff --git a/hosts/mirror.lewd.wtf/mirror/xslt_template.nix b/hosts/mirror.lewd.wtf/mirror/xslt_template.nix new file mode 100644 index 0000000..7aac3cd --- /dev/null +++ b/hosts/mirror.lewd.wtf/mirror/xslt_template.nix @@ -0,0 +1,8 @@ +{ + environment.etc = { + "nginx/mirror.xslt" = { + source = ./xslt_template.xslt; + mode = "0444"; + }; + }; +} diff --git a/hosts/mirror.lewd.wtf/mirror/xslt_template.xslt b/hosts/mirror.lewd.wtf/mirror/xslt_template.xslt new file mode 100644 index 0000000..ca65b77 --- /dev/null +++ b/hosts/mirror.lewd.wtf/mirror/xslt_template.xslt @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Lewd.wtf Mirror Service

+

Welcome to the mirror service of lewd.wtf! I provide this service free of charge to projects that could benefit from it.

+

Want to get your files hosted here? Please contact me at mirror_request@lewd.wtf and provide details regarding your projects.

+

Proud Sineater and Sin's Cove Hater!

+

If you come here from Sin's Cove, please close this page. This site is hosted by Ecchibitionist, the person you constantly harass.

+

You claim I bullied the original developer of EmuSAK, even though that's a blatant lie (and you know it).

+
+
+

+ +

+ + + + + + + + + + + + + + + + + + + + + + + B + KiB + MiB + + + + + + + + + +
NameSize
drive_file_move_rtl../
+ + + folder + folder_zip + folder_zip + insert_drive_file + + + +
+
+ + + +
+