Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/keycloak: init module #91734

Closed
wants to merge 1 commit into from
Closed

Conversation

ngerstle
Copy link
Contributor

Motivation for this change

Request to add a module for keycloak: #87673

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@ngerstle
Copy link
Contributor Author

The service will fail to run if the necessary configuration is missing- several property files and standalone.xml in the configuration directory:

├── configuration
│   ├── application-roles.properties
│   ├── application-users.properties
│   ├── logging.properties
│   ├── mgmt-groups.properties
│   ├── mgmt-users.properties
│   └──  standalone.xml
├──  data
....

Copy link
Member

@aanderse aanderse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing this module! I have left some initial comments I hope are useful. Note that I don't know much about keycloak so if I'm way off base on any comment just mention as such.

'';
};

user = mkOption {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DynamicUser might be a good thing to consider here.

description = "Package that should be used for keycloak";
};

jbossBaseDir = mkOption {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm under the impression configuration can be immutable and keycloak will operate fine that way. Is there a way we can separate configuration into an immutable directory (like /nix/store/...)? It might be nice to specify a separate logs directory as well (like /var/log/keycloak).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you say configuration can be immutable, what level of configuration are you thinking of?
Most usage supposes management of realms/clients/users/etc dynamically- are you thinking of the files listed above?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there no concept of root owned configuration under /etc that isn't modified at runtime? While some java apps follow this pattern many do not... but I thought there was at least some concept of configuration (not state) with keycloak like this. I defer to your knowledge as I don't know much about the application.

nixos/modules/services/web-apps/keycloak.nix Show resolved Hide resolved
};

serviceConfig = {
User = "${cfg.user}";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quotation marks not required, but see above comment about DynamicUser.

nixos/modules/services/web-apps/keycloak.nix Show resolved Hide resolved
nixos/modules/services/web-apps/keycloak.nix Show resolved Hide resolved
nixos/modules/services/web-apps/keycloak.nix Outdated Show resolved Hide resolved
cfg = config.services.keycloak;
in {
options = {
services.keycloak = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no documentation provided about the user needing to setup a reverse proxy with a web server like nginx, httpd, etc...

nixos/modules/services/web-apps/keycloak.nix Show resolved Hide resolved
@greizgh
Copy link
Contributor

greizgh commented Aug 1, 2020

Note that the current package does not provide database support, the jdbc driver needs to be provided "in-tree" to keycloack: relevant documentation.
But maybe this should be handled by the derivation through a withPostgresql flag?

@aanderse
Copy link
Member

Yeah that might work well. postgresqlSupport seems to be the most common naming used in nixpkgs. It would be nice if we could be consistent...

@talyz
Copy link
Contributor

talyz commented Nov 3, 2020

Superseded by #99906.

@talyz talyz closed this Nov 3, 2020
@ngerstle ngerstle deleted the keybase-module branch July 4, 2021 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants