feat: glauth: sqlite backend for runtime users

main
LeRoyce Pearson 2024-01-10 00:25:03 -07:00
parent 40a83335f8
commit 922165b439
3 changed files with 181 additions and 16 deletions

View File

@ -195,18 +195,12 @@
nameFormat = "cn";
groupFormat = "ou";
}
# # TODO: package glauth sqlite plugin
# {
# datastore = "plugin";
# plugin = "sqlite.so";
# pluginhandler = "NewSqliteHandler";
# database = "/run/glauth/glauth.db";
# }
# For now, simply act as a proxy for lldap
# Local database
{
datastore = "ldap";
servers = [ "ldap://127.0.0.1:3890" ];
datastore = "plugin";
plugin = "${pkgs.glauth-sqlite}/bin/sqlite.so";
pluginhandler = "NewSqliteHandler";
database = "/run/glauth/glauth.db";
}
];
api = {

View File

@ -63,6 +63,136 @@
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_3"
},
"locked": {
"lastModified": 1701680307,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_3": {
"inputs": {
"systems": "systems_4"
},
"locked": {
"lastModified": 1701680307,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"glauth": {
"inputs": {
"flake-utils": "flake-utils",
"gomod2nix": "gomod2nix",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1704867971,
"narHash": "sha256-ltNKZ5XP7x+23YudLeQvPrXWj3qDuqb71jH0c1f9aN0=",
"owner": "leroycep",
"repo": "glauth",
"rev": "5c0be9f05fbb8ee0e12c34fd35acea6189461061",
"type": "github"
},
"original": {
"owner": "leroycep",
"repo": "glauth",
"type": "github"
}
},
"glauth-sqlite": {
"inputs": {
"flake-utils": "flake-utils_2",
"gomod2nix": "gomod2nix_2",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1704871050,
"narHash": "sha256-V5GPi5SmCHpNAaUFEyvWkxV7W3tiLZyF1t7XpJ+NH4s=",
"owner": "leroycep",
"repo": "glauth-sqlite",
"rev": "43fc8b29722916a418e96527d7afbdfcf708a705",
"type": "github"
},
"original": {
"owner": "leroycep",
"repo": "glauth-sqlite",
"type": "github"
}
},
"gomod2nix": {
"inputs": {
"flake-utils": [
"glauth",
"flake-utils"
],
"nixpkgs": [
"glauth",
"nixpkgs"
]
},
"locked": {
"lastModified": 1701687253,
"narHash": "sha256-qJCMxIKWXonJODPF2oV7mCd0xu7VYVenTucrY0bizto=",
"owner": "nix-community",
"repo": "gomod2nix",
"rev": "001bbfa22e2adeb87c34c6015e5694e88721cabe",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "gomod2nix",
"type": "github"
}
},
"gomod2nix_2": {
"inputs": {
"flake-utils": [
"glauth-sqlite",
"flake-utils"
],
"nixpkgs": [
"glauth-sqlite",
"nixpkgs"
]
},
"locked": {
"lastModified": 1701687253,
"narHash": "sha256-qJCMxIKWXonJODPF2oV7mCd0xu7VYVenTucrY0bizto=",
"owner": "nix-community",
"repo": "gomod2nix",
"rev": "001bbfa22e2adeb87c34c6015e5694e88721cabe",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "gomod2nix",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@ -86,7 +216,7 @@
},
"juanfont-headscale": {
"inputs": {
"flake-utils": "flake-utils",
"flake-utils": "flake-utils_3",
"nixpkgs": [
"nixpkgs"
]
@ -125,6 +255,8 @@
"root": {
"inputs": {
"agenix": "agenix",
"glauth": "glauth",
"glauth-sqlite": "glauth-sqlite",
"juanfont-headscale": "juanfont-headscale",
"nixpkgs": "nixpkgs"
}
@ -158,6 +290,36 @@
"repo": "default",
"type": "github"
}
},
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_4": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",

View File

@ -9,11 +9,19 @@
url = "github:juanfont/headscale/v0.23.0-alpha2";
inputs.nixpkgs.follows = "nixpkgs";
};
glauth = {
url = "github:leroycep/glauth";
inputs.nixpkgs.follows = "nixpkgs";
};
glauth-sqlite = {
url = "github:leroycep/glauth-sqlite";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, agenix, juanfont-headscale }: {
packages.x86_64-linux = let pkgs = import nixpkgs { system = "x86_64-linux"; }; in {
glauth = pkgs.callPackage ./pkgs/glauth.nix {};
outputs = { self, nixpkgs, agenix, juanfont-headscale, glauth, glauth-sqlite }: {
packages.x86_64-linux = let pkgs = import nixpkgs { system = "x86_64-linux"; }; in rec {
cockpit-tailscale = pkgs.callPackage ./pkgs/cockpit-tailscale.nix {};
cockpit-zfs-manager = pkgs.callPackage ./pkgs/cockpit-zfs-manager.nix {};
};
@ -24,7 +32,8 @@
({config, pkgs, ...}: {
nixpkgs.overlays = [ (final: prev: {
juanfont-headscale = juanfont-headscale.packages.${prev.system};
glauth = self.packages.${prev.system}.glauth;
glauth = glauth.packages.${prev.system}.glauth.v2;
glauth-sqlite = glauth-sqlite.packages.${prev.system}.glauth-sqlite;
cockpit-tailscale = self.packages.${prev.system}.cockpit-tailscale;
cockpit-zfs-manager = self.packages.${prev.system}.cockpit-zfs-manager;
})];