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

Files and directories locations #2

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

vamgnu
Copy link

@vamgnu vamgnu commented Jan 8, 2025

Hi!

First of all, thanks for deploy and maintain this project. I'm proposing to add this recommendation about files and directories locations:
https://glpi-install.readthedocs.io/en/latest/install/index.html#files-and-directories-locations

I introduced this vars to perform this:

glpi_config_dir: /etc/glpi/
glpi_var_dir: /var/lib/glpi/
glpi_log_dir: /var/log/glpi/

There was other tasks to perform backups to deploy updates. These are not necessary any more because files and config directories are not in the default place and, for security reasons, is not the idea.

Thanks in advance,
Regards

@olherasymchuk
Copy link

Hi @vamgnu ,

I am not the contributor of this repository, just using it sometimes - so excuse me if my proposals will be wrong.

Could you please check if we need and glpi_auto_install in row 41 - it seems that removing this condition makes process run smoothly for those who prefer continue installation with browser.

And maybe would be nice to have defined owner:group in task Download and extract

Thank you!

@vamgnu
Copy link
Author

vamgnu commented Jan 9, 2025

Hi @olherasymchuk, thanks for answer! Others views on code makes it better!

I feel the same with and glpi_auto_install. But i don't want to impact in the usual workflow with this role. Is very interesting what you say about to prefer continue installation with browser. I made some changes to consider this scenario and follow documentation about files and directories locations.

About ownership of downloaded files: configure web server user is not a good practice. According the same documentation.

Regards!

@olherasymchuk
Copy link

Thank you @vamgnu

Now it works better but unfortunately additional issue was found.
Opening the Setup / Plugins (in fresh installation), I getting next message:

We can't write on the markeplace directory (/var/www/glpi/marketplace).
If you want to ease the plugins download, please check permissions and ownership of this directory.
Otherwise, you will need to download and unzip the plugins archives manually.

Similar warning also received during the web-installation.

/var/www/glpi/marketplace created with 755 permissions and owned by account used by Ansible for SSH connection.
PHP code running by www-data account without write permissions to this folder.

Could you please check it?

@olherasymchuk
Copy link

Not sure if this good idea, but what do you think about:

  1. Maybe we can define the new var glpi_market_dir, similarly to other 3 new vars.

  2. Define also the GLPI_MARKETPLACE_DIR in local_define.php.j2

  3. Update defaults to something like this (I also propose to remove trailing slashes from current defaults, but this may need to review the part of related tasks)

glpi_config_dir: /etc/glpi
glpi_var_dir: /var/lib/glpi/files
glpi_log_dir: /var/log/glpi
glpi_market_dir: /var/lib/glpi/marketplace
  1. Update the task Download and extract with owner:nobody and group:nogroup

Sorry in advance if some suggestions were wrong or doesn't needed at all.
Thank you.

@olherasymchuk
Copy link

But moving the marketplace to different directory triggering bug described in glpi-project/glpi#17241

Marketplace seems to be working - but URL contains the part of an address from Filesystem.

Reproduced on 10.0.16 and still exists after update to 10.0.17

@vamgnu
Copy link
Author

vamgnu commented Jan 10, 2025

Wow! Thanks for all this review job @olherasymchuk!!!! I really appreciate that. Finally, i add on this commit support to parametrize owner and group for download. By default, nobody:nogroup.

In related to marketplace and plugins, i'm working to give back plugin support to this role. I think this is the correct place to work now. if you want to comment on this PR on fork, i'll apreciate! Also i added marketplace directory on custom locations on this commit.

Regards!

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