Announcement

#1 2021-01-25 17:24:21

alb
Member
2021-01-25
18

[resolved] A few very basic questions from a novice user

Hello! And a big thank you to the developers for this great software!

I am a new user and not a web developer so please forgive me if the answers to my naïve questions are implicitly assumed by profies in the field. I have read guides on the site, looked through other materials, set up an instance of piwigo and used it already some time in hope to figure out the answers myself before asking for help here. Unfortunately, some frustration regarding very basic things persists. I would be thankful if you could point me to document(s) where my questions are answered. I also read the forum rule which says to open a new topic for each question but my questions seem so basic, related to getting started with piwigo, and small that I dare to combine them in a single post. If you find this too much, please remove this post and I will create a series which comply to the rule.

1. Questions related to software installation

1.1. I set up mariadb, created a database and a user. I also have given that user a standard set of access rights to the database (CREATE, SELECT, INSERT, DELETE, UPDATE) and immediately found that this set is not enough. So I have granted the full access to the user but this is obviously not the greatest practice. What is the actual minimally needed set of access rights for the piwigo database user now and in the future?

1.2. I found that installation creates a world-readable file

Code:

local/config/database.inc.php

which contains some secrets (database user and password). Obviously this is not the best security practice to have such files world-readable. Is there a list of files (including any files that belong to plugins and themes) that need a system administrator to review their security manually? Is it enough to do so once upon installation or one need to return to this list from time to time (after upgrades, for example)?

1.3. I currently have set up a piwigo instance on a single server (actually, my home PC) and it mostly works. But what I would like to achieve is to have a cluster of two servers in two geographic locations for redundancy (say, the main server and a backup with continuous or scheduled replication for the case when the main server fails). Is there some ready to use features which help me in such a setup? Could you point me to any guides I should read before attempting to do this?

2. Questions related to software upgrade

2.1. I have read that some plugins may become incompatible after a major upgrade like from 2.10 to 11. Is there a way to know in advance (that is, prior to upgrade) which installed plugins become incompatible? I believe I have seen once such a list in the administration interface of piwigo but I have not been able to find it again.

2.2. I have read the manual update guide. I am running Gentoo linux with its two-stage installation of web applications. Would you please confirm that my adaptation to the manual update guide is correct? (I am going the manual route because I prefer that the package manager databases (portage and webapp-config, in Gentoo) are in accordance with the actual state of things and that I can use automatized checks for known vulnerabilities in software provided by the OS (glsa-check, in Gentoo). So my adaptation is as follows:
2.2.1. I should update piwigo with normal system update. I also should ignore the step of deleting local/config directory because webapp-config will take care of not installing config or modified files anyway.
2.2.2..2.2.4. I should complete steps 2-4 without modification (backup the database, skip the step 3, lock the gallery).
2.2.5. I should skip the cleaning because webapp-config will care about only updating files that have not been modified (and I will revert files which are to be updated and which I modified manually) and have changed in the new version.
2.2.6. Do actual update with OS-supplied mechanism (with the webapp-config -U).
2.2.7. Launch upgrade.php
2.2.8. Check everything, unlock the gallery

Sorry if this is too much Gentoo-specific. I do not ask to dig into details if you are not already there but would you confirm that my general understanding is correct provided that the tool webapp-config does install (actually, hard-link to the application’s web root) only files that changed in the new version and not changed on the disk compared to their state at the time of previous installation.

Thanks in advance for help.
Regards,
Alexander.


Following the rule 6,
    Piwigo 2.10.2 Check for upgrade
    Operating system: Linux
    PHP: 7.4.14 (Show info) [2021-01-25 16:15:34]
    MySQL: 5.5.5-10.4.17-MariaDB-log [2021-01-25 19:15:34]
    Graphics Library: External ImageMagick 7.0.10-52
Piwigo URL: unseen.photo (I am going to switch it off though soon for replacing RAID battery).

Last edited by alb (2021-01-25 17:37:30)

Offline

 

#2 2021-01-25 20:15:59

erAck
Only trying to help
2015-09-06
2026

Re: [resolved] A few very basic questions from a novice user

Re: 1.1 database access rights

You'll probably also need CONTROL on table and ALTER on schema, or the database user be member of the according database role(s) (forgot which is which).


Re: 1.2 world-readable file local/config/database.inc.php

The installation does not know about the actual user configuration on the server but the file has to be readable (and for upgrades possibly writable) by the effective user the web server runs as. You as web admin may restrict file permissions (or even by ACLs) such that no one else can read or write it (and it's recommendable to do so of course).

Maybe an improvement in the installation process could be to create the file with 0600 permissions, assuming the creating web server user would be the same as the later reading web server user, but users would be lost if that was not the case (for whatever reason).


Re: 1.3 cluster of servers

That's out of scope of Piwigo. You'd need something like a load balancing "front door" and a replication strategy.


Re: 2.1 incompatible plugins

Version 11.0.0 in the upgrade page (from where you can still cancel the process) listed the non-compatible plugins (actually those where it's not explicitly known and flagged that they work), version 11.1.0 omitted that list but that's supposed to be fixed now.


Running Piwigo at https://erack.net/gallery/

Offline

 

#3 2021-01-26 18:33:46

alb
Member
2021-01-25
18

Re: [resolved] A few very basic questions from a novice user

erAck, thank you for your fast response!

Re: 1.2. This is all clear. My question was is that the only file a system administrator should pay attention to?

Re: 2.1.

erAck wrote:

version 11.1.0 omitted that list but that's supposed to be fixed now.

Ah, indeed! This is where I have seen that. Thank you!

Thanks and regards.
Alexander.

Last edited by alb (2021-01-26 18:35:45)

Offline

 

#4 2021-01-26 19:42:13

erAck
Only trying to help
2015-09-06
2026

Re: [resolved] A few very basic questions from a novice user

AFAIK there's no other file than database.inc.php that contains a secret.

However, if you are concerned that some server user account could spy on that file due to file system permissions then you should also be concerned about them writing to files and establish permissions and access control that forbids them to do so (i.e. write permission only for owner or group but not for other on any file or directory; if the web server runs as someone other (not owner or group) then you'd have to give it permissions at least before upgrades and remove them after).

It may also be a good idea to generally have

# Deny *.inc.php
<FilesMatch "\.inc\.php$">
Order deny,allow
Deny from all
</FilesMatch>

in Piwigo's .htaccess or at least in the local/config directory so that any request for to-only-be-included files is denied by the server already. Without, requests of database.inc.php are allowed but don't do any harm because it's interpreted by PHP and a blank page delivered. *Unless* the file is edited and left broken somehow, e.g. leading <?php intro missing.


Running Piwigo at https://erack.net/gallery/

Offline

 

#5 2021-01-29 14:51:55

alb
Member
2021-01-25
18

Re: [resolved] A few very basic questions from a novice user

erAck,

thank you for your reply! The idea to strengthen the installation by restricting the processing of include files by web server is great!

Regards,
Alexander.

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact