Outline: Difference between revisions

imported>Onny
mNo edit summary
imported>Onny
mNo edit summary
Line 6: Line 6:


{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
  services = {
services = {


    outline = {
  outline = {
      enable = true;
    enable = true;
      publicUrl = "localhost:3000";
    publicUrl = "localhost:3000";
      forceHttps = false;
    forceHttps = false;


      storage = {
    storage = {
        accessKey = "outline";
      accessKey = "outline";
        secretKeyFile = "/var/lib/outline/storage_secret";
      secretKeyFile = "/var/lib/outline/storage_secret";
        uploadBucketUrl = "http://storage.localhost";
      uploadBucketUrl = "http://storage.localhost";
        uploadBucketName = "outline";
      uploadBucketName = "outline";
      };
     };
     };


     minio = {
     oidcAuthentication = {
       enable = true;
       authUrl = "";
       listenAddress = "127.0.0.1:9000";
       clientId = (builtins.elemAt config.services.dex.settings.staticClients 0).id;
       consoleAddress = "127.0.0.1:9001";
       clientSecretFile = (builtins.elemAt config.services.dex.settings.staticClients 0).secretFile;
       rootCredentialsFile = "/path/to/secrets/minio-credentials";
      tokenUrl = "";
      userinfoUrl = "";
       #usernameClaim = "";
     };
     };
  };


  minio = {
    enable = true;
    listenAddress = "127.0.0.1:9000";
    consoleAddress = "127.0.0.1:9001";
    rootCredentialsFile = "/var/lib/minio/minio-credentials";
  };


    nginx = {
  nginx = {
      enable = true;
    enable = true;
      virtualHosts = {
    virtualHosts = {
        "localhost" = {
      "localhost" = {
          locations."/" = {
        locations."/" = {
            proxyPass = "http://${config.services.outline.publicUrl}";
          proxyPass = "http://${config.services.outline.publicUrl}";
          };
         };
         };
        "storage.localhost" = {
      };
          locations."/" = {
      "storage.localhost" = {
            proxyPass = "http://${config.services.minio.listenAddress}";
        locations."/" = {
          };
          proxyPass = "http://${config.services.minio.listenAddress}";
         };
         };
        "console.storage.localhost" = {
      };
          locations."/" = {
      "console.storage.localhost" = {
            proxyPass = "http://${config.services.minio.consoleAddress}";
        locations."/" = {
          };
          proxyPass = "http://${config.services.minio.consoleAddress}";
         };
         };
        "dex.localhost" = {
      };
          locations."/" = {
      "dex.localhost" = {
            proxyPass = "http://${config.services.dex.settings.web.http}";
        locations."/" = {
          };
          proxyPass = "http://${config.services.dex.settings.web.http}";
         };
         };
       };
       };
     };
     };
  };


    dex = {
  dex = {
      environmentFile = "/secrets/dex-env";
    environmentFile = "/secrets/dex-env";
      enable = true;
    enable = true;
      settings = {
    settings = {
        # External url
      issuer = "http://dex.localhost";
        issuer = "http://dex.localhost";
      storage = {
 
        type = "sqlite3";
        storage = {
        config.file = "/var/lib/dex/db.sqlite3";
          type = "sqlite3";
      };
          config.file = "/var/lib/dex/db.sqlite3";
      web = {
        };
        http = "127.0.0.1:5556";
        web = {
          http = "127.0.0.1:5556";
        };
        # enablePasswordDB = true;
        staticClients = [
          {
            id = "outline";
            name = "Outline Client";
            redirectURIs = [ "http://localhost/auth/oidc.callback" ];
            secretFile = "/var/lib/dex/outline-oidc-secret";
          }
        ];
        connectors = [];  
       };
       };
      # enablePasswordDB = true;
      staticClients = [
        {
          id = "outline";
          name = "Outline Client";
          redirectURIs = [ "http://localhost/auth/oidc.callback" ];
          secretFile = "/var/lib/dex/outline-oidc-secret";
        }
      ];
      connectors = [];
     };
     };
  };


  };
};


  systemd.services.dex = {
systemd.services.dex = {
    serviceConfig.StateDirectory = "dex";
  serviceConfig.StateDirectory = "dex";
  };
};
</nowiki>}}
</nowiki>}}