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

Add raw user config #28

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

Zen3515
Copy link
Contributor

@Zen3515 Zen3515 commented Aug 27, 2023

I decided to implement raw user config to quickly bring new features of GLAuth to the UI, without much dev time.

For instance, we can add all the new complex feature of GLAuth by just typing in the raw config like this

Raw config filed:

  loginShell = "/bin/sh"
  homeDir = "/root"
  sshkeys = ["ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEA3UKCEllO2IZXgqNygiVb+dDLJJwVw3AJwV34t2jzR+/tUNVeJ9XddKpYQektNHsFmY93lJw5QDSbeH/mAC4KPoUM47EriINKEelRbyG4hC/ko/e2JWqEclPS9LP7GtqGmscXXo4JFkqnKw4TIRD52XI9n1syYM9Y8rJ88fjC/Lpn+01AB0paLVIfppJU35t0Ho9doHAEfEvcQA6tcm7FLJUvklAxc8WUbdziczbRV40KzDroIkXAZRjX7vXXhh/p7XBYnA0GO8oTa2VY4dTQSeDAUJSUxbzevbL0ll9Gi1uYaTDQyE5gbn2NfJSqq0OYA+3eyGtIVjFYZgi+txSuhw== rsa-key-20160209"]
  passappsha256 = [
    "c32255dbf6fd6b64883ec8801f793bccfa2a860f2b1ae1315cd95cdac1338efa", # TestAppPw1
    "c9853d5f2599e90497e9f8cc671bd2022b0fb5d1bd7cfff92f079e8f8f02b8d3", # TestAppPw2
    "4939efa7c87095dacb5e7e8b8cfb3a660fa1f5edcc9108f6d7ec20ea4d6b3a88", # TestAppPw3
  ]

    [[users.capabilities]]
    action = "search"
    object = "*"

Which will resulted in this generated config

[[users]]
  name = "j_doe"
  givenname = "Jane"
  sn = "Doe"
  mail = "[email protected]"
  uidnumber = 5001
  primarygroup = 5501
  passsha256 = "6478579e37aff45f013e14eeb30b3cc56c72ccdc310123bcdf53e0333e3f416a"
  otherGroups = [ 5551 ]
  loginShell = "/bin/sh"
  homeDir = "/root"
  sshkeys = ["ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEA3UKCEllO2IZXgqNygiVb+dDLJJwVw3AJwV34t2jzR+/tUNVeJ9XddKpYQektNHsFmY93lJw5QDSbeH/mAC4KPoUM47EriINKEelRbyG4hC/ko/e2JWqEclPS9LP7GtqGmscXXo4JFkqnKw4TIRD52XI9n1syYM9Y8rJ88fjC/Lpn+01AB0paLVIfppJU35t0Ho9doHAEfEvcQA6tcm7FLJUvklAxc8WUbdziczbRV40KzDroIkXAZRjX7vXXhh/p7XBYnA0GO8oTa2VY4dTQSeDAUJSUxbzevbL0ll9Gi1uYaTDQyE5gbn2NfJSqq0OYA+3eyGtIVjFYZgi+txSuhw== rsa-key-20160209"]
  passappsha256 = [
    "c32255dbf6fd6b64883ec8801f793bccfa2a860f2b1ae1315cd95cdac1338efa", # TestAppPw1
    "c9853d5f2599e90497e9f8cc671bd2022b0fb5d1bd7cfff92f079e8f8f02b8d3", # TestAppPw2
    "4939efa7c87095dacb5e7e8b8cfb3a660fa1f5edcc9108f6d7ec20ea4d6b3a88", # TestAppPw3
  ]
    [[users.capabilities]]
    action = "search"
    object = "*"

I don't think that this is the best idea ever, but I've been patiently waiting to use the new feature of newer version of GLauth for so long, but this repo seems to not be under active development.

So, my choices are

  • Live with it (no way)
  • Manage your config without UI (not convenient)
  • Render from ansible (but I could not email reset password, and what not) (UI is more convenient anyway)
  • Make some low code application (I'm too lazy for that)
  • Fork and properly implement everything (I'm too lazy for that)

Which leaves me with a last option, the easiest way to get all the new features, is just to manually add the new feature into the config ourselves. It has some downside, but probably be fine.

I don't expect this to get merged, since I don't think it was a good idea, there is no form validation whatsoever.

PS. You can try out my new feature at my dev branch

https://github.com/Zen3515/glauth-ui
https://hub.docker.com/r/zen3515/glauth-ui

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant