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

bin/otobo.SetPermission.pl doesn't work in docker container #480

Closed
StefanRother-OTOBO opened this issue Sep 27, 2020 · 9 comments
Closed
Assignees
Labels
question Further information is requested wontfix This will not be worked on
Milestone

Comments

@StefanRother-OTOBO
Copy link
Contributor

Hi,

if I execute /opt/otobo/bin/otobo.SetPermission.pl in a docker container, the permissions are wrong.

I change the behavior and check now before, if otobo runs on docker (Check Environment OTOBO_RUNS_UNDER_DOCKER).
If yes, I try to get the user and group info from environment too.

Please, can you check if this is the right procedure?

Thanks!

Stefan

@StefanRother-OTOBO
Copy link
Contributor Author

Hi,

I fix this issue in 3fcca9d

@Bernhard: Please can you check if the way is right for docker?
And I add hooks/build in otobo.SetPermission.pl to the executable files, I hope that's right? hooks/post_push is not executable at the moment.

@bschmalhofer
Copy link
Contributor

@StefanRother-OTOBO I think that this needs more thought.

The execute bit on hooks/post_push is apparently not required. At least it isn't mentioned in https://docs.docker.com/docker-hub/builds/advanced/ . And adding the label :latest did work for the OTOBO 10.0.3. release.

When the Docker image is built, bin/docker/set_permissions.pl is executed. set_permissions,pl is basically a simplified version of bin/otobo.SetPermissions.pl . The idea was that the script could be simplified further and eventually be integrated into otobo.web.dockerfile.

How to proceed depends on whether permissions need to be set after installation. If not, then I propose to revert the patch and to put both scripts into .dockignore. If a set permission script is needed after installation then I propose to merge set_permissions.pl into otobo.SetPermiissions.pl.

@StefanRother-OTOBO
Copy link
Contributor Author

Hi @bschmalhofer,

The execute bit on hooks/post_push is apparently not required. At least it isn't mentioned in
https://docs.docker.com/docker-hub/builds/advanced/ . And adding the label :latest did work for the OTOBO 10.0.3. release.

OK, I set the execute bit only for hooks/build, cause after execute otobo.SetPermissions.pl the rights where different.

How to proceed depends on whether permissions need to be set after installation. If not, then I propose to revert the patch and to put both scripts into .dockignore. If a set permission script is needed after installation then I propose to merge set_permissions.pl into otobo.SetPermiissions.pl.

We need the script otobo.SetPermission.pl. That's a extremely important tool (using docker or not).
For me it's not a good idea to add new scripts like bin/docker/set_permissions.pl with nearly the same code like otobo.SetPermission.pl. Please remove bin/docker/set_permissions.pl and use bin/otobo.SetPermission.pl if possible and when you have time. I think some problems based on the wrong permissions after using bin/otobo.SetPermission.pl.

The important think is, that OTOBO Admins and Consultants can use the known tools.

Thanks,

Stefan

@bschmalhofer bschmalhofer added this to the OTOBO 10.0.4 milestone Sep 28, 2020
@bschmalhofer bschmalhofer added the bug Something isn't working as intended label Sep 28, 2020
@bschmalhofer
Copy link
Contributor

Yes, I'll merge bin/otobe.SetPermission.pl and bin/docker/set_permission.pl. In order to be explicit I'll add a flag --runs-under-docker so that the call in otobo.web.dockerfile won't have to rely on the environment variable.

bschmalhofer added a commit that referenced this issue Sep 28, 2020
Also some refactoring and better code comments
@bschmalhofer
Copy link
Contributor

Scripts are merged, but not tested yet.

@svenoe svenoe modified the milestones: OTOBO 10.0.4, OTOBO 10.0.5 Oct 8, 2020
@StefanRother-OTOBO
Copy link
Contributor Author

Hi,

how das it work for docker environment without user root now?

Thanks,

Stefan

@bschmalhofer
Copy link
Contributor

Hi @StefanRother-OTOBO ,

the short answer is that it does not work under Docker.

It even does not work when one is root in the running otobo_web_1 container. Being root can be achieved by docker exec -it --user root otobo_web_1 bash. But otobo.SetPermissions.pl internally calls the Perl commands chmod and chown. The chown does not succeed because root has limited Linux capabilities in the container. There are workarounds for running that command with full capabilities. But I think that first we need to clarify what the use cases for 'otobo.SetPermissions.pl`are.

One use case is when building the Docker image. But calling it in otobo.web.dockerfile is really overkill, as the required funtionality could probably be done in a couple of shell commands.

So,I think that this needs to be discussen in a devel-meeting.

@svenoe svenoe added question Further information is requested and removed bug Something isn't working as intended labels Oct 14, 2020
@svenoe svenoe modified the milestones: OTOBO 10.0.5, OTOBO 10.0 Oct 14, 2020
@svenoe
Copy link
Contributor

svenoe commented Oct 14, 2020

This is not a bug, we will discuss somewhen, whether we need this functionality, but I guess not for 10.0.5.

@svenoe svenoe modified the milestones: OTOBO 10.0, OTOBO 10.0.5 Oct 14, 2020
@bschmalhofer bschmalhofer modified the milestones: OTOBO 10.0, OTOBO 10.0.6 Oct 28, 2020
@bschmalhofer bschmalhofer changed the title bin/otobo.SetPermission.pl don't work using docker container bin/otobo.SetPermission.pl doesn't work in docker container Oct 29, 2020
@bschmalhofer bschmalhofer added the wontfix This will not be worked on label Oct 29, 2020
@bschmalhofer
Copy link
Contributor

Let's close this issue as there is nothing to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants