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

Customise UID/GID #63

Merged
merged 2 commits into from
Jun 18, 2023
Merged

Customise UID/GID #63

merged 2 commits into from
Jun 18, 2023

Conversation

thomiceli
Copy link
Owner

@thomiceli thomiceli commented Jun 16, 2023

Closes #57

Customise UID and GID by changing them via env vars

Also changed mount volume from /root/.opengist to /opengist

@thomiceli
Copy link
Owner Author

thomiceli commented Jun 16, 2023

@Lyxon1337, @mariushosting Would you mind building the Docker image and try if it could work out for you ?

@thomiceli thomiceli changed the title Customise PUID/PGID Customise UID/GID Jun 16, 2023
@thomiceli thomiceli merged commit da19e48 into master Jun 18, 2023
@Lyxon1337
Copy link

oh sry forget it...
now i see u allready have this in the image! nice!
tested tag "1.3" and "latest = 1.4.0-dev"

On both i use your example compose from readme.
Both use the old mount path /root/.opengist? dunno (if i try the "new" one -> /opengist always failed.
Both start with given UID GID. But all data in the mapped Fodler are from host-root.
And also the created gist under "/repos" all created from host-root... So it's seems the UID/GID ENVs are not used here.

By the writting i have found a bug... But it's not the solution
it's a typo by the docker/entrypoint

u write:

export USER=opengist
PID=${PID:-1000}
GID=${GID:-1000}
groupmod -o -g "$GID" $USER
usermod -o -u "$PID" $USER

the PID is not the called readme UID :D
But even if i change the ENV from the compose the behavor not change at all (on both versions).

I'm pretty sure I'm forgetting something important

@mariushosting
Copy link

@thomiceli

@thomiceli
Copy link
Owner Author

thomiceli commented Jun 21, 2023

oh sry forget it... now i see u allready have this in the image! nice! tested tag "1.3" and "latest = 1.4.0-dev"

On both i use your example compose from readme. Both use the old mount path /root/.opengist? dunno (if i try the "new" one -> /opengist always failed. Both start with given UID GID. But all data in the mapped Fodler are from host-root. And also the created gist under "/repos" all created from host-root... So it's seems the UID/GID ENVs are not used here.

By the writting i have found a bug... But it's not the solution it's a typo by the docker/entrypoint

u write:

export USER=opengist
PID=${PID:-1000}
GID=${GID:-1000}
groupmod -o -g "$GID" $USER
usermod -o -u "$PID" $USER

the PID is not the called readme UID :D But even if i change the ENV from the compose the behavor not change at all (on both versions).

I'm pretty sure I'm forgetting something important

I missed the typo.. thanks i will fix it.
However I'm not sure why it fails for you, can you try by building the image yourself (make build_docker) and/or use the last opengist:dev image ? I was messing with the hosted images tags
I will try again to launch an instance from v1.3 and then migrate into v1.4 to see if I encounter sort of bugs.

@thomiceli
Copy link
Owner Author

thomiceli commented Jun 21, 2023

Actually I can't clearly see why your data is own by root in the host. The env vars UID GID and the new mount path /opengist are used in my instance and everything is working well. Maybe you weren't using the last docker image.
Also what is (/repos) ? It's the opengist folder in your docker host machine ?

@Lyxon1337
Copy link

Lyxon1337 commented Jun 21, 2023

new test series :D
install via Portainer v2.18.3
I deleted all old images from opengist :)

Download again the tag latest after looking into the image details the Image layers 7 says VOLUME [/root/.opengist]
Download after this the tag dev and there the Volume is the right -> VOLUME [/opengist]
nice one :)

install test 1 with latest -> UID GID no function all is owned an create from host-root
i create u user and a test gist... User folder spawn into the /repos folder and all are from root (the mapped volume from compose /volume1/docker/00-opengist:/root/.opengist:rw )

install test 2 with dev
after delete all content and container :D
changed the volume to the new one -> /volume1/docker/00-opengist:/opengist:rw
create user and a test gist...
And.. ALL WORKED ! :D noice
dev

The data and the created files are from the choosen user from compose :)
thanks for your fast work! :D

@thomiceli
Copy link
Owner Author

new test series :D install via Portainer v2.18.3 I deleted all old images from opengist :)

Download again the tag latest after looking into the image details the Image layers 7 says VOLUME [/root/.opengist] Download after this the tag dev and there the Volume is the right -> VOLUME [/opengist] nice one :)

install test 1 with latest -> UID GID no function all is owned an create from host-root i create u user and a test gist... User folder spawn into the /repos folder and all are from root (the mapped volume from compose /volume1/docker/00-opengist:/root/.opengist:rw )

install test 2 with dev after delete all content and container :D changed the volume to the new one -> /volume1/docker/00-opengist:/opengist:rw create user and a test gist... And.. ALL WORKED ! :D noice dev

The data and the created files are from the choosen user from compose :) thanks for your fast work! :D

No problem :) Glad it worked !

@thomiceli thomiceli deleted the feature/docker-custom-pguids branch July 2, 2023 21:55
jiriks74 pushed a commit to jiriks74/opengist that referenced this pull request Apr 28, 2024
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.

customize UID/GID
3 participants