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

DietPi-Software | Single File PHP Gallery: Wrong permissions on install #4251

Closed
Alexgolshtein opened this issue Apr 7, 2021 · 7 comments · Fixed by #4252
Closed

DietPi-Software | Single File PHP Gallery: Wrong permissions on install #4251

Alexgolshtein opened this issue Apr 7, 2021 · 7 comments · Fixed by #4252
Labels
External bug 🐞 For bugs which are not caused by DietPi. Workaround available 🆗 Workaround is available/has been implemented, but a definite solution should be found when possible.
Milestone

Comments

@Alexgolshtein
Copy link

Alexgolshtein commented Apr 7, 2021

Single File PHP Gallery doesn't work after install.

HTTP://[host]/gallery/index.php returns 403

Required Information

  • DietPi version |
    G_DIETPI_VERSION_CORE=7
    G_DIETPI_VERSION_SUB=0
    G_DIETPI_VERSION_RC=2
    G_GITBRANCH='master'
    G_GITOWNER='MichaIng'
  • Distro version | buster 10.9
  • Kernel version | Linux DietPi 5.10.21-sunxi64 #21.02.3 SMP Mon Mar 8 00:45:13 UTC 2021 aarch64 GNU/Linux
  • SBC model | Orange Pi Prime
  • Power supply used | 5V 2A
  • Sony uhs3

Additional Information (if applicable)

  • Software title | Single File PHP Gallery
  • Fresh install
  • Can this issue be replicated on a fresh installation of DietPi?
  • Bug report ID | dfc8ca53-b4fe-4784-abfc-bea6b945e2dc

Steps to reproduce

Install WebMin,
Install Nextcloud
Install Syncthing
Uninstall Nextcloud
Install Single File PHP Gallery
/var/www/gallery exists and contains data

Expected behaviour

HTTP://[host]/gallery Should work

Actual behaviour

HTTP://[host]/gallery returns 403
HTTP://[host]/gallery/index.php returns 403

@Joulinar
Copy link
Collaborator

Joulinar commented Apr 7, 2021

Hi,

many thanks for your message. Looks like file system permission are incorrect. Pls try following as workaround

chown -R www-data:www-data /var/www/gallery/

@Alexgolshtein
Copy link
Author

Alexgolshtein commented Apr 7, 2021

Hi,

many thanks for your message. Looks like file system permission are incorrect. Pls try following as workaround

chown -R www-data:www-data /var/www/gallery/

This fixed the issue. Thank you!

@MichaIng MichaIng added this to the v7.1 milestone Apr 7, 2021
@MichaIng MichaIng changed the title Single File PHP Gallery, DietPi-Software | Single File PHP Gallery: Wrong permissions on install Apr 7, 2021
@MichaIng
Copy link
Owner

MichaIng commented Apr 7, 2021

Reopening it until we merged the fix. I want to find out why it worked fine in the past with the permissions we had, but now not anymore. AFAIK the version was not updated since then.

@MichaIng MichaIng reopened this Apr 7, 2021
@Joulinar
Copy link
Collaborator

Joulinar commented Apr 7, 2021

Gallery folder has r/w permission for root user only. No other permission for groups or other. Means, web server is not able to access the folder at all 😉

@MichaIng MichaIng linked a pull request Apr 7, 2021 that will close this issue
1 task
@MichaIng
Copy link
Owner

MichaIng commented Apr 7, 2021

All dirs are created via mkdir -p which should lead to default 755 modes, i.e. read access for the webserver. Only the _sfpg_data sub dir is chowned to permit write access, which should be sufficient.

... lol found the issue: 7zr creates the target parent directory with 700 mode, ignoring the default umask... needs to be reported to the Debian bug tracker. As a quick workaround, i'll pre-create the target dir for 7zr extraction, if it does not exist yet.

To verify, chmod 755 /var/www/gallery is sufficient to get the intended access and permissions.

@MichaIng MichaIng added Solution available 🥂 Definite solution has been done External bug 🐞 For bugs which are not caused by DietPi. Workaround available 🆗 Workaround is available/has been implemented, but a definite solution should be found when possible. and removed Bug 🐞 Investigating 🤔 Solution available 🥂 Definite solution has been done labels Apr 7, 2021
@Joulinar
Copy link
Collaborator

Joulinar commented Apr 7, 2021

To verify, chmod 755 /var/www/gallery is sufficient to get the intended access and permissions.

yep is working as 👍

@MichaIng
Copy link
Owner

MichaIng commented Apr 8, 2021

Reported to Debian bug tracker: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=986634

I tested the new official 7-Zip Linux binaries, which work fine and do not suffer from the issue: #4195

As I do not expect it to be fixed anymore, since p7zip is basically abandoned, creating own 7-Zip DEB packages seems to be a nice alternative. But not sure if this is a good idea as long as they're marked as alpha state.

@Joulinar Joulinar added Solution available 🥂 Definite solution has been done and removed Workaround available 🆗 Workaround is available/has been implemented, but a definite solution should be found when possible. labels Apr 11, 2021
@MichaIng MichaIng mentioned this issue Apr 27, 2021
@MichaIng MichaIng added Waiting for external fix ⏳ Workaround available 🆗 Workaround is available/has been implemented, but a definite solution should be found when possible. labels Sep 26, 2021
@MichaIng MichaIng removed the Solution available 🥂 Definite solution has been done label Sep 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
External bug 🐞 For bugs which are not caused by DietPi. Workaround available 🆗 Workaround is available/has been implemented, but a definite solution should be found when possible.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants