summaryrefslogtreecommitdiff
path: root/modules/server/virtualisation/containers/september.nix
blob: 16a43b47256ab844559fd5f14b972e5ecba09a30 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{ config, ... }:
let
  port = builtins.toString 8084;
in
{
  services.caddy.virtualHosts."fuwn.me".extraConfig = ''
    reverse_proxy localhost:${port}

    header Onion-Location http://fuwnme4wbs5x36jjf2usedw2zscozwhazykhyfkjsmudtb7egs3mb7yd.onion{path}

    @blocked {
      path /proxy/illegaldrugs.net/cgi-bin/news.php*
      path /proxy/scholasticdiversity.us.to/scriptures/*
      path /proxy/jsreed5.org/oeis/*
    }
    respond @blocked 403

    @no_forwarded_for not header X-Forwarded-For *
    request_header @no_forwarded_for X-Forwarded-For {remote_host}
    respond /whoami {header.X-Forwarded-For} 200
  '';

  virtualisation.oci-containers.containers.september = {
    inherit (config.modules.containers) extraOptions;

    image = "fuwn/september";
    autoStart = true;
    ports = [ "127.0.0.1:${port}:80" ];

    environment = {
      CONDENSE_LINKS_AT_HEADINGS = "## Quick Links,# Fuwn[.me],## Footer";
      EMBED_IMAGES = "2";
      MATHJAX = "true";
      PLAIN_TEXT_ROUTE = "*.xml,*.txt";
      PRIMARY_COLOUR = "#DCC6BD";

      HEAD = ''
        <script
          defer src="https://analytics.fuwn.me/script.js"
          data-website-id="e7eae941-140b-48af-b36b-d7c5fea3a493"
        ></script>

        <link
          rel="icon"
          type="image/x-icon"
          href="https://avatars.githubusercontent.com/u/99055925?s=200&v=4"
        >
      '';
    };
  };
}