Outline: Difference between revisions
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 | ||
# 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; | ||
scopes = [ "openid" "email" "profile" ]; | |||
usernameClaim = "preferred_username"; | |||
displayName = "Dex"; | |||
}; | }; | ||
}; | }; | ||
dex = { | |||
enable = true; | 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"; | |||
}; | }; | ||
| Line 42: | Line 79: | ||
"localhost" = { | "localhost" = { | ||
locations."/" = { | locations."/" = { | ||
proxyPass = " | proxyPass = "${config.services.outline.publicUrl}"; | ||
}; | }; | ||
}; | }; | ||
| Line 63: | Line 90: | ||
}; | }; | ||
}; | }; | ||
</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 == | ||