drasl: init - minecraft auth server (unmojang)
This commit is contained in:
parent
9a87a9e132
commit
4436f3918b
10 changed files with 191 additions and 0 deletions
24
shared/patches/drasl-flakes-nix-add-option-package.patch
Normal file
24
shared/patches/drasl-flakes-nix-add-option-package.patch
Normal file
|
@ -0,0 +1,24 @@
|
|||
diff --git a/flake.nix b/flake.nix
|
||||
index f6cfa25..68358a8 100644
|
||||
--- a/flake.nix
|
||||
+++ b/flake.nix
|
||||
@@ -101,6 +101,7 @@
|
||||
in {
|
||||
options.services.drasl = {
|
||||
enable = mkEnableOption (lib.mdDoc ''drasl'');
|
||||
+ package = mkPackageOption { drasl = self.defaultPackage.${pkgs.system}; } "drasl" {};
|
||||
settings = mkOption {
|
||||
type = format.type;
|
||||
default = {};
|
||||
@@ -115,10 +116,9 @@
|
||||
wantedBy = ["multi-user.target"];
|
||||
|
||||
serviceConfig = let
|
||||
- pkg = self.defaultPackage.${pkgs.system};
|
||||
config = format.generate "config.toml" cfg.settings;
|
||||
in {
|
||||
- ExecStart = "${pkg}/bin/drasl -config ${config}";
|
||||
+ ExecStart = "${cfg.package}/bin/drasl -config ${config}";
|
||||
DynamicUser = true;
|
||||
StateDirectory = "drasl";
|
||||
Restart = "always";
|
14
shared/patches/drasl-registration-oidc-env.patch
Normal file
14
shared/patches/drasl-registration-oidc-env.patch
Normal file
|
@ -0,0 +1,14 @@
|
|||
diff --git a/config.go b/config.go
|
||||
index 24e17b5..11194e6 100644
|
||||
--- a/config.go
|
||||
+++ b/config.go
|
||||
@@ -393,6 +393,9 @@ func CleanConfig(config *Config) error {
|
||||
return fmt.Errorf("Duplicate RegistrationOIDC Name: %s", oidcConfig.Name)
|
||||
}
|
||||
oidcNames.Add(oidcConfig.Name)
|
||||
+ envkey := fmt.Sprintf("DRASL_REGISTRATION_OIDC_%s_CLIENT_SECRET", strings.ToUpper(oidcConfig.Name))
|
||||
+ envvalue := strings.TrimSpace(Getenv(envkey, oidcConfig.ClientSecret))
|
||||
+ oidcConfig.ClientSecret = envvalue
|
||||
oidcConfig.Issuer, err = cleanURL(
|
||||
fmt.Sprintf("RegistrationOIDC %s Issuer", oidcConfig.Name),
|
||||
mo.Some("https://idm.example.com/oauth2/openid/drasl"),
|
Loading…
Add table
Add a link
Reference in a new issue