< 212022-02-22⋎23 >

Topic for #farmOS is: farmOS (farmos.org) is a free and open source, web-based farm management system. User guide: farmos.org/guide/ - Forum: farmOS.discourse.groupSet by mstenta on 2021-06-15 at 12:52
09:00*kunigunde[m] has quit (Quit: You have been kicked for being idle)
09:00*farmtech[m] has quit (Quit: You have been kicked for being idle)
09:00*postmanpat[m] has quit (Quit: You have been kicked for being idle)
09:00*IyarkaiTechLab[m has quit (Quit: You have been kicked for being idle)
09:00*SpencerOnazi[m] has quit (Quit: You have been kicked for being idle)
09:00*OmkarEkbote[m] has quit (Quit: You have been kicked for being idle)
09:00*Anonymous[m]1234 has quit (Quit: You have been kicked for being idle)
09:00*davd[m] has quit (Quit: You have been kicked for being idle)
09:00*and712[m] has quit (Quit: You have been kicked for being idle)
09:00*frederike[m] has quit (Quit: You have been kicked for being idle)
09:00*gretel[m] has quit (Quit: You have been kicked for being idle)
09:00*goldi[m] has quit (Quit: You have been kicked for being idle)
09:00*gunter[m] has quit (Quit: You have been kicked for being idle)
09:00*hra38192639[m] has quit (Quit: You have been kicked for being idle)
09:00*mindcls[m] has quit (Quit: You have been kicked for being idle)
09:00*iuresearcherpw[m has quit (Quit: You have been kicked for being idle)
09:00*harry[m]12 has quit (Quit: You have been kicked for being idle)
09:00*olaf[m] has quit (Quit: You have been kicked for being idle)
09:00*phantomse[m] has quit (Quit: You have been kicked for being idle)
09:00*steinfarm[m] has quit (Quit: You have been kicked for being idle)
09:00*JanSonntag[m] has quit (Quit: You have been kicked for being idle)
09:00*ChristophWolfes[ has quit (Quit: You have been kicked for being idle)
09:00*AllanMacGregor[m has quit (Quit: You have been kicked for being idle)
09:00*lordeddi[m] has quit (Quit: You have been kicked for being idle)
09:00*Noaht[m] has quit (Quit: You have been kicked for being idle)
09:00*aislinnpearson[m has quit (Quit: You have been kicked for being idle)
09:00*oliverp44[m] has quit (Quit: You have been kicked for being idle)
09:00*matrixtrix[m] has quit (Quit: You have been kicked for being idle)
10:12skipper_is[m]I've got a few days of being stuck in side doing admin, so I'm going to try again to migrate across to FarmOS2. I've got it working on my server (just running Apache2, php, MySQL etc nativly). But, I'm wondering is it better to use docker? Keep it all containerised? Can docker run alongside Apache2 without fighting too much?
10:30skipper_is[m]:Edit: Oh wow, no they do not place nice together.
10:46mstenta[m]skipper_is: i think port 80 conflict would be the only consideration
10:47mstenta[m]But there are ways around that... You can run the docker container on a different port... Or, you could put both behind an Nginx reverse proxy perhaps
21:39skipper_is[m]Spent the day trying to get Apache reverse proxy to work... Finally succeeded...
21:43skipper_is[m]Now I've just got to create the custom land types, and the migration form....
21:44skipper_is[m]How stable is it now? Do you recommend going for the main site on FarmOS2?
21:44skipper_is[m]Or keep it on FarmOS1.x for now?
21:44mstenta[m]Definitely! Good to go!
21:45skipper_is[m]Nice, I'll try and port some modules then!
21:46skipper_is[m]For updates, is it easy enough to update the docker instance?
21:49mstenta[m]farmos.org/hosting/update/
21:50mstenta[m]Tl;dr: yes - if you only bind-mount the `sites` directory as a volume
21:50mstenta[m]Also be sure to use a specific version for the docker image (eg: `farmos/farmos:2.0.0-beta2` - NOT `farmos/farmos:latest`) to ensure your updates are intentional
21:51mstenta[m]And of course, be sure to backup your db first! ;-)
21:51mstenta[m]And run `update.php` afterwards... and clear cache for good measure
21:52mstenta[m](all in that doc link)
21:52skipper_is[m]Always CC, fixes everything
21:52skipper_is[m]What will "docker pull farmos/farmos" pull down?
21:53skipper_is[m]Latest latest, or latest release?
21:53mstenta[m]`farmos/farmos` will be automatically interpretted (by Docker) as `farmos/farmos:latest`
21:53mstenta[m]i don't recommend that, just because you may end up updating accidentally
21:53skipper_is[m]and :latest will be the most recent commit?
21:53mstenta[m]better to declare the specific version so it's intentional
21:54mstenta[m]ah good question... no... `latest` will be the latest tagged release
21:54skipper_is[m]ah ok
21:54mstenta[m](that's how we do it anyway... not necessarily how other docker images work fyi)
21:54skipper_is[m]But it'll only update when you re-do pull? I've not used docker before..
21:54mstenta[m]yes
21:54skipper_is[m]Oki
21:55mstenta[m]so its *pretty* safe... but there are cases where it can "getcha"
21:56mstenta[m]eg: say you realized your server disk was full of old docker images, so you shut down your containers and run `docker system prune -a` - this deletes all unused images. if you then bring your farmOS container back up, it will pull a fresh `latest` automatically
21:56mstenta[m]GOTCHA
21:56skipper_is[m]Ah
21:56mstenta[m]:-P
21:56skipper_is[m]....And the quick forms format looks really different...
21:56mstenta[m]i speak from experience - i was gotten
21:57mstenta[m]there are some differences with quick forms... but in general the Drupal Form API hasn't changed too much
21:57mstenta[m]they are in classes now - that's the biggest thing
21:57mstenta[m]and `$form_state` is an object, not an array
21:57*sent a code block: libera.ems.host/_matrix/media/r0/downloa
21:57skipper_is[m]What's all that stuff?
21:58mstenta[m]Drupal 8+ uses PSR-4 namespaces, which is a newer PHP standard... it allows you to have classes with the same name without conflicts basically
21:58mstenta[m]`namespace` at the top of the file declares the namespace for that class (one class per file)
21:59mstenta[m]all the `use` lines declare classes that are used by code in that file
21:59skipper_is[m]like import in Python?
21:59mstenta[m]PHPStorm makes this stuff WAAAAY easy... it will automatically fill a lot of that stuff in for you as you're coding
21:59mstenta[m]yes pretty much!
21:59skipper_is[m]Yea, but PHPStorm is expensive...
22:00mstenta[m]Drupal uses Symfony which "autoloads" classes as you use them
22:01mstenta[m]yea... I think symbioquine uses Eclipse (?) but I can't speak to that...
22:01mstenta[m]i do enough Drupal/PHP dev that it's worth it :-)
22:01mstenta[m](definitely curious about Eclipse tho! just never made the jump)
22:01skipper_is[m]I'll stick with Atom
22:01mstenta[m]anywho- you can get away without that stuff too...
22:02mstenta[m]oh yea I bet Atom has some good PHP plugins
22:02mstenta[m]one other thing to notice... in the planting quick form there are a few `use` statements IN the class itself (at the top)
22:02skipper_is[m]I've no idea to be honest.... I just use it as notepad with a file explorer on the side...
22:02mstenta[m]those are traits... which are a new PHP feature that essentially let's you "mixin" additional methods into your class
22:03mstenta[m]so farmOS core provides a few `Quick*Trait` traits, that have some helper methods for doing common things
22:03skipper_is[m]So `use Drupal\Component\Datetime\TimeInterface;` for a date/time box?
22:03mstenta[m]search for `TimeInterface` and you'll see where that gets referenced
22:05mstenta[m]this is a somewhat complex quickform (the planting one) so it has a lot of stuff you may not need
22:06mstenta[m]here's a simpler one: github.com/mstenta/farmOS/blob/2.x-quick
22:06mstenta[m](work in progress - but maybe helpful for comparison)
22:06mstenta[m](also hasn't been tested in a while - hopefully still works 😬)
22:09mstenta[m]the planting quick form makes use of another new(er) PHP concept you might need to learn: dependency injection (that's what the `__construct()` and `create()` methods are responsible for)
22:10mstenta[m]basically: allows you to declare the "services" you need, and Drupal will automagically pass them into the class for you to use
22:10skipper_is[m]Ah yes, the egg forms looks a bit simpler!
22:11skipper_is[m]Right, I'd better go shut some chickens in for the night. I'll have a play tomorrow and see what happens!
22:11mstenta[m]for example, the planting form makes use of the Drupal time service - that's where `TimeInterface` is used

< 212022-02-22⋏23 >