IRC logs for #farmOS, 2023-01-18 (GMT)

2023-01-17
2023-01-19
TimeNickMessage
[08:18:16]<mstenta[m]>symbioquine: heads up... I think we'll have some new folks on the dev call today who are interested in the learning more about the WFS module + GIS integration
[08:18:36]<symbioquine[m]>Very cool!
[08:18:46]<mstenta[m]>Aislinn from Rothamsted and Jonathan from PearGIS
[08:18:48]<symbioquine[m]>Dev call might be tomorrow though...
[08:18:52]<mstenta[m]>ah right hahaha
[08:19:23]<lordeddi[m]>hi, i went through that private folders and settings.php story
[08:19:40]<lordeddi[m]>not sure if there will be time on the dev-call.
[08:20:23]<mstenta[m]>oh lordeddi fyi we had another one: https://farmos.discourse.group/t/the-file-could-not-be-uploaded-because-...
[08:20:46]<mstenta[m]>confirmed that clearing the cache made the differene
[08:20:48]<lordeddi[m]>basically:
[08:20:49]<lordeddi[m]>- if one unpacks or spins up docker and loads the page > settings.php is created and editable
[08:20:49]<lordeddi[m]>if the private path is set and after that the web-install is done, all works, the private folder is created right after setting the DB configuration in web-installer
[08:20:49]<mstenta[m]>s/differene/difference/
[08:21:21]<lordeddi[m]>- if the web-installer is done and after that the settings.php is changes > the caches are already created and the error occurs
[08:21:39]<lordeddi[m]>the save button in admin/config/media/file-system does not work
[08:21:58]<lordeddi[m]>the clear caches button in admin/config/development/performance does work
[08:22:14]<mstenta[m]>great!
[08:22:19]<mstenta[m]>thanks for testing that all out!
[08:22:33]<mstenta[m]>so it sounds like we just need to add "clear the cache" to the instructions
[08:22:34]<lordeddi[m]>but only after the admin creates the web/sites/default/private folder (the "files" subfolder is created automatically)
[08:22:58]<lordeddi[m]>mstenta[m]: 🙀 no! the folder needs to be created too
[08:23:24]<lordeddi[m]>i think it would be best to advise users to FIRST change the settings.php and THEN running through the web-installer
[08:23:33]<lordeddi[m]>if that makes sense, and is explicable to users
[08:23:50]<mstenta[m]>well... the problem is that the web-installer CREATES settings.php
[08:23:51]<lordeddi[m]>(since drupal will create the folder with correct user and permissions)
[08:23:54]<lordeddi[m]>:)
[08:23:58]<mstenta[m]>that's the reason why we don't say to do that first
[08:24:36]<lordeddi[m]>ah okay, i wasnt clear
[08:24:36]<lordeddi[m]>1. unpack or docker-compose up
[08:24:36]<lordeddi[m]>2. (settings is created) update settings
[08:24:36]<lordeddi[m]>3. perform web-installer
[08:24:38]<symbioquine[m]>It would be nice if Drush just had the option to specify a folder location as part of the site-install command...
[08:24:43]<mstenta[m]>see this comment: https://farmos.discourse.group/t/the-file-could-not-be-uploaded-because-...
[08:25:10]<lordeddi[m]> * ah okay, i wasnt clear
[08:25:10]<lordeddi[m]>1. unpack or docker-compose up
[08:25:10]<lordeddi[m]>2. load page (settings is created) update settings
[08:25:10]<lordeddi[m]>3. perform web-installer
[08:25:11]<symbioquine[m]>https://www.drupal.org/project/drush/issues/1195120
[08:25:20]<lordeddi[m]> * ah okay, i wasnt clear... (full message at <https://libera.ems.host/_matrix/media/v3/download/libera.chat/6246e650ef...)
[08:25:29]<mstenta[m]>so... maybe we just need to add steps to the install guide:
[08:25:29]<mstenta[m]>- create private files dir w/ proper perms
[08:25:29]<mstenta[m]>- add line to settings.php
[08:25:29]<mstenta[m]>- clear cache
[08:26:10]<lordeddi[m]>yeah, that would work
[08:26:46]<lordeddi[m]>also, the path in the docs is .....default/private/files
[08:26:46]<lordeddi[m]>but the files sub-folder is not really needed, maybe this is for clarity?
[08:26:53]<lordeddi[m]>could be default/private
[08:27:01]<lordeddi[m]>and then all files would be stored under private
[08:27:17]<mstenta[m]>> ah okay, i wasnt clear... (full message at <https://libera.ems.host/_matrix/media/v3/download/libera.chat/506aa1a631...)
[08:27:27]<lordeddi[m]>agreed
[08:28:10]<lordeddi[m]>also, when visiting the media/file-system page after adding that settings line, the button won't work since :
[08:28:13]<mstenta[m]>> also, the path in the docs is .....default/private/files
[08:28:13]<mstenta[m]>> but the files sub-folder is not really needed, maybe this is for clarity?
[08:28:13]<mstenta[m]>hmm i think it needs to be `private/files`... but i don't have a good reason to back that up... it's been drupal convention for as long as i can remember, so there might be a good reason
[08:29:17]<lordeddi[m]>ACTION uploaded an image: (69KiB) < https://libera.ems.host/_matrix/media/v3/download/oblak.be/pourXKaqzRSQb... >
[08:29:21]<mstenta[m]>hmm or maybe that's outdated info on my part!
[08:29:21]<mstenta[m]>https://www.drupal.org/docs/8/core/modules/file/overview#content-accessi...
[08:29:47]<lordeddi[m]>that list does not show the private option, and clicking the public option makes so that all files would be stored under .../default/files (not okay)
[08:29:53]<lordeddi[m]>* (not okay/adviseable)
[08:30:08]<mstenta[m]>hmm yea something's wrong there... it should show the private option
[08:30:17]<lordeddi[m]>> <@mstenta:matrix.org> > also, the path in the docs is .....default/private/files... (full message at <https://libera.ems.host/_matrix/media/v3/download/libera.chat/91c0409f0c...)
[08:30:32]<mstenta[m]>no i think you're right lordeddi - it can just be `private`
[08:30:37]<mstenta[m]>that's what these docs have: https://www.drupal.org/docs/8/core/modules/file/overview#content-accessi...
[08:30:45]<mstenta[m]>so maybe i'm just outdated :-)
[08:30:54]<lordeddi[m]>mstenta[m]: it does not since it is at that moment not yet aware of that folder or something, or because the folder is not yet created (i did not dare digging deeper 🪱)
[08:31:38]<mstenta[m]>ok... but if you create it and add the line to settings.php and clear cache, does the form work properly?
[08:31:48]<mstenta[m]>i think ideally we wouldn't need to tell users to go to that form
[08:32:01]<lordeddi[m]>yes
[08:32:03]<mstenta[m]>* create it (the folder) and add
[08:32:18]<lordeddi[m]>mstenta[m]: yes to this
[08:32:31]<lordeddi[m]>mstenta[m]: the file-systems one?
[08:32:46]<lordeddi[m]>i would agree to that
[08:32:58]<mstenta[m]>yea, it shouldn't be necessary to use that form
[08:33:17]<lordeddi[m]>exact/agree
[08:33:19]<mstenta[m]>we were playing around with saving that form during debugging, just to see if it helped
[08:33:51]<lordeddi[m]>i never needed that file-systems form when debugging/testing this private stuffs
[08:33:57]<mstenta[m]>> so... maybe we just need to add steps to the install guide:... (full message at <https://libera.ems.host/_matrix/media/v3/download/libera.chat/a710438043...)
[08:34:14]<lordeddi[m]>it only confused me (with that list and all) 😆
[08:35:04]<lordeddi[m]>i'll test it one more time, now i have it all ready to go, so we don't mess it up :D
[08:35:54]<mstenta[m]>great thanks again lordeddi!
[08:36:36]<lordeddi[m]>i guess enabling many modules during web-install won't affect the resul;t
[08:36:39]<lordeddi[m]>s/resul;t/result?/
[08:37:00]<mstenta[m]>shouldn't
[08:37:25]<mstenta[m]>also worth noting: using drush site-install would have the same end-result
[08:37:40]<mstenta[m]>(as the web-installer)
[08:37:52]<mstenta[m]>(and the steps to enable private files afterwards would be the same I think)
[08:38:12]<lordeddi[m]>i think so too
[08:38:27]<lordeddi[m]>that drush command creates the settings.php
[08:38:50]<mstenta[m]>(i only mention that because it might make testing easier/faster... it's possible to use drush site-install and tell it to only install base modules - the same as unchecking all of them during web-install)
[08:38:53]<lordeddi[m]>when loading an installed/configured farmos instance webpage those caches are created and stuffs goes wrong
[08:39:25]<lordeddi[m]>if you change the private afterwards, like we all seem to be doing :D
[08:42:31]<lordeddi[m]>> <@mstenta:matrix.org> so... maybe we just need to add steps to the install guide:... (full message at <https://libera.ems.host/_matrix/media/v3/download/libera.chat/6731a1483a...)
[08:42:41]<lordeddi[m]>after that upload works
[08:44:31]<lordeddi[m]>also: make sure to add it to both
[08:44:31]<lordeddi[m]>- https://farmos.org/development/environment/
[08:44:31]<lordeddi[m]>- https://farmos.org/hosting/install
[08:49:47]<lordeddi[m]>glad to have helped 😊
[08:50:29]<mstenta[m]>lordeddi: do you have time/interest in making a PR?
[08:50:49]<mstenta[m]>no pressure - I'm happy to as well, but wanted to give you the opportunity for commit credit :-)
[08:50:54]<mstenta[m]>thanks for all the help investigating!!
[08:52:31]<lordeddi[m]>yeah, sure i can try, never done a pr before (on my jobs, i usually set up new gits, and never get to PR's before another team takes over or the startup goes bust :D)
[08:52:44]<lordeddi[m]>i would need to read some docs and that might take time 🙄
[08:53:14]<mstenta[m]>No worries! I'm happy to do it :-)
[08:54:42]<lordeddi[m]>maybe you can give me some pointers, which repo and what branch ?
[08:54:52]<lordeddi[m]>#readingTheDocs
[08:54:54]<lordeddi[m]>:D
[08:55:50]<mstenta[m]>Sure!
[08:56:37]<lordeddi[m]>and i guess i need to fork the project too into my github account?
[08:56:37]<mstenta[m]>In your local dev env, the farmOS repo is in web/profiles/farm
[08:56:38]<lordeddi[m]>mstenta[m]: if you have time, ay, mstenta
[08:57:03]<mstenta[m]>> and i guess i need to fork the project too into my github account?
[08:57:03]<mstenta[m]>Yep! The farmOS repo
[08:57:27]<mstenta[m]>cd to the farm dir and run these commands:
[08:57:51]<mstenta[m]>git checkout -b 2.x-private-file-docs
[08:58:02]<mstenta[m]>That will create a new branch for your changes
[08:58:52]<mstenta[m]>git remote add lordeddi [repo]
[08:58:56]<mstenta[m]>Replace [repo] with your fork URL, which you can get from Github
[08:59:20]<mstenta[m]>I think it will be git@github.com:lordeddi/farmOS.git
[08:59:52]<mstenta[m]>Then you can make commits, and push the branch to your fork
[09:00:10]<mstenta[m]>git push lordeddi 2.x-private-file-docs
[09:04:49]<mstenta[m]>after that, when you go to your fork in github, you'll see a little prompt for opening a PR
[09:09:32]<lordeddi[m]>thanks! working through it
[09:09:32]<lordeddi[m]>got a fork of farmos (only forked 2.x branch though, hope that's okay)
[09:11:18]<mstenta[m]>yup that's correct!
[09:12:22]<mstenta[m]>> In your local dev env, the farmOS repo is in web/profiles/farm
[09:12:22]<mstenta[m]>you have a choice... you can either do it in the directory in your local dev environment... or if you would prefer you can just `git clone` the farmOS repo to a new directory somewhere...
[09:12:33]<mstenta[m]>since this is just doc changes, you don't really need it to be in your dev environment for testing code
[09:12:55]<mstenta[m]>(but if you ever want to do that in the future, you can)
[09:28:29]<lordeddi[m]>the user should be www-data
[09:28:38]<lordeddi[m]>and the folder permissions should be 755 ?
[09:28:53]<lordeddi[m]>(of that private folder)
[09:29:21]<symbioquine[m]>lordeddi[m]: Probably not...
[09:29:39]<symbioquine[m]>Seems too open
[09:29:54]<lordeddi[m]>oops true
[09:31:10]<symbioquine[m]>https://www.drupal.org/node/244924
[09:32:41]<mstenta[m]>> the user should be `www-data`
[09:32:42]<mstenta[m]>this is true for Apache... maybe not for others (Nginx?)
[09:32:42]<symbioquine[m]>> Hosted sites "files" directory: rwxrwx---
[09:32:48]<symbioquine[m]>> <@mstenta:matrix.org> > the user should be `www-data`
[09:32:49]<symbioquine[m]>>
[09:32:49]<symbioquine[m]>> this is true for Apache... maybe not for others (Nginx?)
[09:32:49]<symbioquine[m]>And different OS'/distros may use different names/ids
[09:33:24]<mstenta[m]>so maybe something like: "If you are using Apache (or the farmOS Docker image), then the web server user/group is probably `www-data`"
[09:33:33]<mstenta[m]> * so maybe something like: "If you are using Apache (like in the farmOS Docker image), then the web server user/group is probably `www-data`"
[09:42:40]<lordeddi[m]>so if i understand this, for the docker image
[09:42:40]<lordeddi[m]>`drwxr-x--- 3 www-data www-data 4096 Jan 18 13:41 private`
[09:42:55]<lordeddi[m]>which is permission 740
[09:43:16]<lordeddi[m]>and IIRC nginx,by default, runs as www-data
[09:43:21]<lordeddi[m]>(last time i checked)
[10:00:54]<lordeddi[m]> * <del>(last time i checked)</del>
[10:01:47]<lordeddi[m]>the user which nginx runs under is configured under /etc/nginx/nginx.conf and on a fairly new and default setup it states user www-data;
[10:12:46]<lordeddi[m]><lordeddi[m]> "which is permission 740" <- hm.... so if the folder belongs to the webserver user `www-data` permissions `700` would suffice, since the webserver user is the only user which needs rwx to that folder (group can be omitted)
[10:12:46]<lordeddi[m]>`770` would also work as symbioquine posted (which i missed)
[10:16:17]* farmBOT has joined #farmos
[10:28:04]<lordeddi[m]>sorry for the many messages... (full message at <https://libera.ems.host/_matrix/media/v3/download/libera.chat/195e1ac8c9...)
[11:46:52]<mstenta[m]>sorry lordeddi I have a bunch of appointments and meetings today so i haven't been able to keep up
[12:22:03]<lordeddi[m]>Hey dont worry. Whenever there's time. Hope i did not come over as a pushy person. I only had a small window and was trying to cram everything in there 😄
[12:33:25]<mstenta[m]>all good!
[12:46:56]<mstenta[m]>lordeddi: yea I think that looks pretty good! the only part that might be a bit ambiguous is the last two lines... it should probably explicitly say to set the user/group of the directory to `www-data`, because that's what `770` assumes.
[12:47:01]<mstenta[m]>(very minor nitpick) :-)
[12:49:06]<mstenta[m]>Maybe like:... (full message at <https://libera.ems.host/_matrix/media/v3/download/libera.chat/3617b61782...)
[12:49:26]<mstenta[m]>not much different from what you had I suppose :-)
[12:49:55]<mstenta[m]>* Docker image (running Apache), this
[15:04:22]<lordeddi[m]>Thanks!
[15:56:32]<evered[m]>Thank you!
[15:56:49]<evered[m]>ACTION gets in on the thanking part :)