Outline: Difference between revisions

From NixOS Wiki
imported>Onny
mNo edit summary
imported>Onny
Fix config
Line 6: Line 6:


{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
networking.extraHosts = ''
  127.0.0.1 dex.localhost
'';
services = {
services = {


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


    # Defined but not used in this minimal setup
     storage = {
     storage = {
       accessKey = "outline";
       accessKey = "outline";
Line 21: Line 26:


     oidcAuthentication = {
     oidcAuthentication = {
       authUrl = "";
      # Parts taken from
       clientId = (builtins.elemAt config.services.dex.settings.staticClients 0).id;
      # 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;
       clientSecretFile = (builtins.elemAt config.services.dex.settings.staticClients 0).secretFile;
       tokenUrl = "";
       scopes = [ "openid" "email" "profile" ];
       userinfoUrl = "";
       usernameClaim = "preferred_username";
       #usernameClaim = "";
       displayName = "Dex";
     };
     };
   };
   };


   minio = {
   dex = {
     enable = true;
     enable = true;
     listenAddress = "127.0.0.1:9000";
     settings = {
    consoleAddress = "127.0.0.1:9001";
      issuer = "http://dex.localhost";
    rootCredentialsFile = "/var/lib/minio/minio-credentials";
      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";
          };
        }
      ];
    };
  };
 
  systemd.services.dex = {
    serviceConfig.StateDirectory = "dex";
   };
   };


Line 42: Line 79:
       "localhost" = {
       "localhost" = {
         locations."/" = {
         locations."/" = {
           proxyPass = "http://${config.services.outline.publicUrl}";
           proxyPass = "${config.services.outline.publicUrl}";
        };
      };
      "storage.localhost" = {
        locations."/" = {
          proxyPass = "http://${config.services.minio.listenAddress}";
        };
      };
      "console.storage.localhost" = {
        locations."/" = {
          proxyPass = "http://${config.services.minio.consoleAddress}";
         };
         };
       };
       };
Line 63: Line 90:
   };
   };


  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";
};
};
</nowiki>}}
</nowiki>}}


Outline is available at http://localhost . Choose login provider "Dex" and authenticate with the example mock login <code>admin</code> and <code>password</code>.
== See also ==
== See also ==



Revision as of 11:42, 21 January 2023

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
networking.extraHosts = ''
  127.0.0.1 dex.localhost
'';

services = {

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

    # Defined but not used in this minimal setup
    storage = {
      accessKey = "outline";
      secretKeyFile = "/var/lib/outline/storage_secret";
      uploadBucketUrl = "http://storage.localhost";
      uploadBucketName = "outline";
    };

    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";
          };
        }
      ]; 
    };
  };

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

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

};

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.