Outline

From NixOS Wiki
Revision as of 17:12, 19 January 2023 by imported>Onny

Outline is a modern web based wiki and knowledge base for teams.

Installation

The most minimal local installation of Outline can be enabled with the following configuration

/etc/nixos/configuration.nix
services = {

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

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

    oidcAuthentication = {
      authUrl = "";
      clientId = (builtins.elemAt config.services.dex.settings.staticClients 0).id;
      clientSecretFile = (builtins.elemAt config.services.dex.settings.staticClients 0).secretFile;
      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 = {
    enable = true;
    virtualHosts = {
      "localhost" = {
        locations."/" = {
          proxyPass = "http://${config.services.outline.publicUrl}";
        };
      };
      "storage.localhost" = {
        locations."/" = {
          proxyPass = "http://${config.services.minio.listenAddress}";
        };
      };
      "console.storage.localhost" = {
        locations."/" = {
          proxyPass = "http://${config.services.minio.consoleAddress}";
        };
      };
      "dex.localhost" = {
        locations."/" = {
          proxyPass = "http://${config.services.dex.settings.web.http}";
        };
      };
    };
  };

  dex = {
    environmentFile = "/secrets/dex-env";
    enable = true;
    settings = {
      issuer = "http://dex.localhost";
      storage = {
        type = "sqlite3";
        config.file = "/var/lib/dex/db.sqlite3";
      };
      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 = []; 
    };
  };

};

systemd.services.dex = {
  serviceConfig.StateDirectory = "dex";
};

See also

  • Mediawiki, PHP- and web-based wiki software.
  • Dokuwiki, simple PHP- and web-based wiki software which uses file based storage for its content.