Outline: Difference between revisions

From NixOS Wiki
imported>Onny
Fix configuration example
imported>Onny
Simplified storage configuration
Line 4: Line 4:


The most minimal local installation of Outline can be enabled with the following configuration
The most minimal local installation of Outline can be enabled with the following configuration
{{Note|The storage configuration is not yet stable and will be available with the upcoming NixOS 23.11 release.}}


{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
Line 18: Line 20:
     publicUrl = "http://localhost:3000";
     publicUrl = "http://localhost:3000";
     forceHttps = false;
     forceHttps = false;
 
     storage.storageType = "local";
    # Defined but not used in a minimal setup. Uploading files will
    # only work if you configure a sotrage backend (see below).
     storage = {
      accessKey = "outline";
      secretKeyFile = "${pkgs.writeText "minio-secret" "test123"}";
      region = config.services.minio.region;
      uploadBucketUrl = "http://127.0.0.1:9000";
      uploadBucketName = "outline";
    };
 
     oidcAuthentication = {
     oidcAuthentication = {
       # Parts taken from
       # Parts taken from
Line 98: Line 90:


Outline is available at http://localhost . Choose login provider "Dex" and authenticate with the example mock login <code>admin</code> and <code>password</code>.
Outline is available at http://localhost . Choose login provider "Dex" and authenticate with the example mock login <code>admin</code> and <code>password</code>.
== Configuration ==
=== Storage backend ===
It is possible to host a S3-compatible object storage using [[Minio]]. The following configuration enables a minimal, local Minio instance:
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
services.minio = {
  enable = true;
  listenAddress = "127.0.0.1:9000";
  consoleAddress = "127.0.0.1:9001";
  # Storing secrets world-readable in the Nix store is not recommended.
  # This is only for demonstration purpose.
  rootCredentialsFile = "${pkgs.writeText "minio-secret" "test123"}";
};
</nowiki>}}
Login into the Minio web console on http://127.0.0.1:9001 using the default credentials with user <code>minioadmin</code> and password <code>minioadmin</code>.
* Create a new bucket and name it, for example <code>outline</code>.
* Create a new user. For demonstration purpose call it <code>outline</code> with the password <code>outline123</code>
Bucket name (<code>outline</code>), user (or accessKey: <code>outline</code>) and password (or the content of secretKeyFile: <code>outline123</code>) have to match the storage configuration of the Outline module above.


== See also ==
== See also ==

Revision as of 08:24, 18 November 2023

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

Setup

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

Note: The storage configuration is not yet stable and will be available with the upcoming NixOS 23.11 release.
/etc/nixos/configuration.nix
{ config, pkgs, lib, ... }: {

networking.extraHosts = ''
  127.0.0.1 dex.localhost
'';

services = {

  outline = {
    enable = true;
    publicUrl = "http://localhost:3000";
    forceHttps = false;
    storage.storageType = "local";
    oidcAuthentication = {
      # Parts taken from
      # http://dex.localhost/.well-known/openid-configuration
      authUrl = "http://dex.localhost/auth";
      tokenUrl = "http://dex.localhost/token";
      userinfoUrl = "http://dex.localhost/userinfo";
      clientId = "outline";
      clientSecretFile = (builtins.elemAt config.services.dex.settings.staticClients 0).secretFile;
      scopes = [ "openid" "email" "profile" ];
      usernameClaim = "preferred_username";
      displayName = "Dex";
    };
  };

  dex = {
    enable = true;
    settings = {
      issuer = "http://dex.localhost";
      storage = {
        type = "sqlite3";
        config.file = "/var/lib/dex/db.sqlite3";
      };
      web.http = "127.0.0.1:5556";
      staticClients = [
        {
          id = "outline";
          name = "Outline Client";
          redirectURIs = [ "http://localhost:3000/auth/oidc.callback" ];
          secretFile = "${pkgs.writeText "outline-oidc-secret" "test123"}";
        }
      ];
      connectors = [
        {
          type = "mockPassword";
          id = "mock";
          name = "Example";
          config = {
            username = "admin";
            password = "password";
          };
        }
      ]; 
    };
  };

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

};

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

Outline is available at http://localhost . Choose login provider "Dex" and authenticate with the example mock login admin and password.

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.