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

Replaced unixid with uid-/gidnumber (glauth v2.0) #17

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zeo101
Copy link

@zeo101 zeo101 commented Dec 11, 2021

Hey Nils,

since glauth v2.0.0 complains about unixid being deprecated I replaced it with uidnumber and gidnumber accordingly.

To be consistent, I also changed the db column names in the group and user table.
So if you have an existing setup, you need to rename the sqlite columns using dbeaver for example.

@sonicnkt
Copy link
Owner

hey thanks for the info and the code.
Haven't follwed glauth development in the last months because i was pretty busy in my day job and the system just worked but 2.0 introduced a lot of other useful features (users.capabilities and behaviors) which should be configureable in the ui.

It might be possible to create a migration script which does this automatically.
Another solution would be a warning on startup that detects the old db scheme and prompt fo manual upgrade (maybe with a small python script which will do this automatically.

Well lots of stuff do do here :)
I will soon merge this in a dev branch and start working on glauth 2.0 compatibility. I have some free time before christmas and this is a chance to dust of my dev environment!

@sonicnkt
Copy link
Owner

sonicnkt commented Dec 22, 2021

Ok i merge your pr into a new branch (glauth-2.X), here i also updated the python environment (3.9) and all libraries.
I am still working on a migration script.

We should be able to alter the table names with the following in the flask migrate file See Commit:

def upgrade():
    op.alter_column('user', 'unixid', nullable=False, new_column_name='uidnumber')
    op.alter_column('group', 'unixid', nullable=False, new_column_name='gidnumber')
    # TODO foreign keys

But we also have to update the foreign keys in the user, included_groups and othergroups_users table. This is definatly possible but i haven't figured it out yet to do this without losing any existing data/connections.

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.

2 participants