replace keycloak with dex
This commit is contained in:
parent
a150103a0b
commit
d1a61a0f28
|
@ -123,10 +123,7 @@
|
||||||
ip = "10.42.42.28";
|
ip = "10.42.42.28";
|
||||||
mac = "9E:86:D3:46:EE:AE";
|
mac = "9E:86:D3:46:EE:AE";
|
||||||
};
|
};
|
||||||
"keycloak" = {
|
# 10.42.42.29
|
||||||
ip = "10.42.42.29";
|
|
||||||
mac = "A6:09:1D:A8:81:28";
|
|
||||||
};
|
|
||||||
"vault-1" = {
|
"vault-1" = {
|
||||||
ip = "10.42.42.30";
|
ip = "10.42.42.30";
|
||||||
mac = "26:69:0E:7C:B3:79";
|
mac = "26:69:0E:7C:B3:79";
|
||||||
|
|
|
@ -49,19 +49,24 @@ in {
|
||||||
};
|
};
|
||||||
web.http = "0.0.0.0:5556";
|
web.http = "0.0.0.0:5556";
|
||||||
|
|
||||||
connectors = [
|
connectors = [{
|
||||||
{
|
type = "gitea";
|
||||||
type = "gitea";
|
id = "gitea";
|
||||||
id = "gitea";
|
name = "Gitea";
|
||||||
name = "Gitea";
|
config = {
|
||||||
config = {
|
clientID = "$GITEA_CLIENT_ID";
|
||||||
clientID = "$GITEA_CLIENT_ID";
|
clientSecret = "$GITEA_CLIENT_SECRET";
|
||||||
clientSecret = "$GITEA_CLIENT_SECRET";
|
redirectURI = "https://dex.0x76.dev/callback";
|
||||||
redirectURI = "https://dex.0x76.dev/callback";
|
baseURL = "https://git.0x76.dev";
|
||||||
baseURL = "https://git.0x76.dev";
|
};
|
||||||
};
|
}];
|
||||||
}
|
|
||||||
];
|
staticClients = [{
|
||||||
|
id = "outline";
|
||||||
|
name = "Outline";
|
||||||
|
redirectURIs = [ "https://outline.0x76.dev/auth/oidc.callback" ];
|
||||||
|
secretEnv = "OUTLINE_CLIENT_SECRET";
|
||||||
|
}];
|
||||||
};
|
};
|
||||||
|
|
||||||
environmentFile = "${vs.dex}/environment";
|
environmentFile = "${vs.dex}/environment";
|
||||||
|
|
|
@ -1,47 +0,0 @@
|
||||||
# Edit this configuration file to define what should be installed on
|
|
||||||
# your system. Help is available in the configuration.nix(5) man page
|
|
||||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
|
||||||
|
|
||||||
{ config, pkgs, lib, ... }:
|
|
||||||
let vs = config.vault-secrets.secrets; in
|
|
||||||
{
|
|
||||||
imports = [ ];
|
|
||||||
|
|
||||||
# This value determines the NixOS release from which the default
|
|
||||||
# settings for stateful data, like file locations and database versions
|
|
||||||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
|
||||||
# this value at the release version of the first install of this system.
|
|
||||||
# Before changing this value read the documentation for this option
|
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
|
||||||
system.stateVersion = "22.11"; # Did you read the comment?
|
|
||||||
|
|
||||||
# Additional packages
|
|
||||||
environment.systemPackages = with pkgs; [ ];
|
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [
|
|
||||||
config.services.keycloak.settings.http-port
|
|
||||||
];
|
|
||||||
|
|
||||||
environment.noXlibs = lib.mkForce false;
|
|
||||||
|
|
||||||
vault-secrets.secrets.keycloak = { };
|
|
||||||
|
|
||||||
# If loadCredential doesn't work:
|
|
||||||
# https://github.com/NixOS/nixpkgs/issues/157449#issuecomment-1208501368
|
|
||||||
# also check: systemd 252 got more strict about how exactly the filesystems need to be set up for credentials to work properly
|
|
||||||
services.keycloak = {
|
|
||||||
enable = true;
|
|
||||||
database = {
|
|
||||||
type = "postgresql";
|
|
||||||
host = "localhost";
|
|
||||||
createLocally = true;
|
|
||||||
passwordFile = "${vs.keycloak}/databasePassword";
|
|
||||||
};
|
|
||||||
settings = {
|
|
||||||
hostname = "id.0x76.dev";
|
|
||||||
proxy = "edge";
|
|
||||||
hostname-strict-backchannel = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
|
@ -43,10 +43,6 @@ let vs = config.vault-secrets.secrets; in
|
||||||
aliases = [ "lau@meowy.tech" ];
|
aliases = [ "lau@meowy.tech" ];
|
||||||
};
|
};
|
||||||
# Services
|
# Services
|
||||||
"keycloak@0x76.dev" = {
|
|
||||||
hashedPasswordFile = "${vs.mailserver}/keycloak@0x76.dev";
|
|
||||||
sendOnly = true;
|
|
||||||
};
|
|
||||||
"gitea@0x76.dev" = {
|
"gitea@0x76.dev" = {
|
||||||
hashedPasswordFile = "${vs.mailserver}/gitea@0x76.dev";
|
hashedPasswordFile = "${vs.mailserver}/gitea@0x76.dev";
|
||||||
sendOnly = true;
|
sendOnly = true;
|
||||||
|
|
|
@ -52,7 +52,6 @@ in {
|
||||||
virtualHosts."o.0x76.dev" = proxy "http://minio.olympus:9000";
|
virtualHosts."o.0x76.dev" = proxy "http://minio.olympus:9000";
|
||||||
virtualHosts."grafana.0x76.dev" = proxy "http://victoriametrics.olympus:2342";
|
virtualHosts."grafana.0x76.dev" = proxy "http://victoriametrics.olympus:2342";
|
||||||
virtualHosts."outline.0x76.dev" = proxy "http://outline.olympus:3000";
|
virtualHosts."outline.0x76.dev" = proxy "http://outline.olympus:3000";
|
||||||
virtualHosts."id.0x76.dev" = proxy "http://keycloak.olympus:80";
|
|
||||||
virtualHosts."ntfy.0x76.dev" = proxy "http://ntfy.olympus:80";
|
virtualHosts."ntfy.0x76.dev" = proxy "http://ntfy.olympus:80";
|
||||||
virtualHosts."ci.0x76.dev" = proxy "http://woodpecker.olympus:8000";
|
virtualHosts."ci.0x76.dev" = proxy "http://woodpecker.olympus:8000";
|
||||||
virtualHosts."dex.0x76.dev" = proxy "http://dex.olympus:5556";
|
virtualHosts."dex.0x76.dev" = proxy "http://dex.olympus:5556";
|
||||||
|
|
|
@ -16,8 +16,6 @@ let vs = config.vault-secrets.secrets; in
|
||||||
system.stateVersion = "22.11"; # Did you read the comment?
|
system.stateVersion = "22.11"; # Did you read the comment?
|
||||||
|
|
||||||
# Additional packages
|
# Additional packages
|
||||||
environment.systemPackages = with pkgs; [ ];
|
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [
|
networking.firewall.allowedTCPPorts = [
|
||||||
config.services.outline.port
|
config.services.outline.port
|
||||||
];
|
];
|
||||||
|
@ -42,13 +40,13 @@ let vs = config.vault-secrets.secrets; in
|
||||||
uploadBucketName = "outline";
|
uploadBucketName = "outline";
|
||||||
region = "us-east-1"; # fake
|
region = "us-east-1"; # fake
|
||||||
};
|
};
|
||||||
oidcAuthentication = {
|
oidcAuthentication = {
|
||||||
displayName = "Keycloak";
|
displayName = "Dex";
|
||||||
userinfoUrl = "https://id.0x76.dev/realms/master/protocol/openid-connect/userinfo";
|
userinfoUrl = "https://dex.0x76.dev/userinfo";
|
||||||
tokenUrl = "https://id.0x76.dev/realms/master/protocol/openid-connect/token";
|
tokenUrl = "https://dex.0x76.dev/token";
|
||||||
clientId = "outline";
|
clientId = "outline";
|
||||||
authUrl = "https://id.0x76.dev/realms/master/protocol/openid-connect/auth";
|
authUrl = "https://dex.0x76.dev/auth";
|
||||||
clientSecretFile = "${vs.outline}/keycloakClientSecret";
|
clientSecretFile = "${vs.outline}/dexClientSecret";
|
||||||
};
|
};
|
||||||
smtp = rec {
|
smtp = rec {
|
||||||
username = "outline@0x76.dev";
|
username = "outline@0x76.dev";
|
||||||
|
|
Loading…
Reference in a new issue