feat: we now have a sso/oauth server ther we can use to connect services to
Some checks failed
Build_Deploy / linter (push) Successful in 11s
Build_Deploy / build (push) Successful in 47s
Build_Deploy / deploy_dns (push) Successful in 1m29s
Build_Deploy / deploy_active (active) (push) Successful in 1m36s
Build_Deploy / deploy_active (active-ext) (push) Failing after 44s
Build_Deploy / deploy_active (active-core) (push) Successful in 6m43s
Some checks failed
Build_Deploy / linter (push) Successful in 11s
Build_Deploy / build (push) Successful in 47s
Build_Deploy / deploy_dns (push) Successful in 1m29s
Build_Deploy / deploy_active (active) (push) Successful in 1m36s
Build_Deploy / deploy_active (active-ext) (push) Failing after 44s
Build_Deploy / deploy_active (active-core) (push) Successful in 6m43s
Currently works with Proxmox (VE and MG) and Forgejo
This commit is contained in:
parent
70263f4b1f
commit
69ec3abb3b
4 changed files with 107 additions and 0 deletions
77
applications/sso.nix
Normal file
77
applications/sso.nix
Normal file
|
@ -0,0 +1,77 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
name = "sso";
|
||||
cfg = config.services.skynet."${name}";
|
||||
in {
|
||||
imports = [
|
||||
];
|
||||
|
||||
options.services.skynet."${name}" = {
|
||||
enable = mkEnableOption "Keycloak server";
|
||||
|
||||
datasource = {
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
url = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.skynet.dns.records = [
|
||||
{
|
||||
record = "${name}";
|
||||
r_type = "CNAME";
|
||||
value = config.services.skynet.host.name;
|
||||
}
|
||||
];
|
||||
|
||||
services.skynet.acme.domains = [
|
||||
"${name}.skynet.ie"
|
||||
];
|
||||
|
||||
age.secrets.keycloak_pw.file = ../secrets/keycloak/pw.age;
|
||||
|
||||
services.nginx.virtualHosts = {
|
||||
"${name}.skynet.ie" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "skynet";
|
||||
locations = {
|
||||
"/" = {
|
||||
proxyPass = "http://localhost:${toString config.services.keycloak.settings.http-port}/";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.postgresql.enable = true;
|
||||
|
||||
services.keycloak = {
|
||||
enable = true;
|
||||
|
||||
initialAdminPassword = "sharky_loves_sso";
|
||||
|
||||
database = {
|
||||
type = "postgresql";
|
||||
createLocally = true;
|
||||
|
||||
username = "keycloak";
|
||||
passwordFile = config.age.secrets.keycloak_pw.path;
|
||||
};
|
||||
|
||||
settings = {
|
||||
hostname = "${name}.skynet.ie";
|
||||
http-port = 38080;
|
||||
proxy-headers = "xforwarded";
|
||||
http-enabled = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue