< 072024-05-08⋎09 >

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
01:14symbioquine[m]<mstenta[m]> "Do you mind if I change it to..." <- Any of those sound fine
01:15symbioquine[m]The inner brackets were used in the classic editorial style - which I recognize can be confusing in a markdown context.
03:37*paul121[m] has joined
03:37paul121[m]<mstenta[m]> "wonder if there's a way to do..." <- If you make a PR on Drupal Gitlab it should spin up a Tugboat. Haven't used that in a while but it should be wired up
05:35*farmBOT has joined
09:32farmBOT@farmOS@fosstodon.org => The #farmOS monthly community call is today at 2pm Eastern. All are welcome! farmos.org/community/monthly-call/ => fosstodon.org/@farmOS/112404693162214589
13:46*samno[m] has joined
13:58samno[m]Hello, I'm new to farmos and I'm having difficulties getting it set up. I thought I was good at computers compared to my farming friends but this is a bit above me. I have got ubuntu installed on an old tablet. I struggle to make a lot of sense of the install instructions. I asked chatGPT and did get a fair way through the install, but ended up with a minimal farmos with every link linking to a 404 page. I think I was using the packaged
13:58samno[m]install rather than docker. Are there some install instructions for noobs that are written with less technical language and don't assume background knowledge in databases? Thanks, Sam
13:59mstenta[m]Hi samno! Welcome!
14:00mstenta[m]Can you share a little more details about what you did?
14:01mstenta[m]> Are there some install instructions for noobs that are written with less technical language and don't assume background knowledge in databases?
14:01mstenta[m]The tricky thing about this is... you will be managing a database. farmOS doesn't do that for you. So if you aren't comfortable with that, then you're taking on some risks. For example, farmOS does not handle backups for you. You need to know how to do that yourself.
14:01samno[m]Ill try my best!
14:01samno[m]I'm keen to learn
14:01mstenta[m]Self-hosting provides a lot of freedom and flexibility, but it does assume some expertise.
14:01mstenta[m]The alternative is to use a hosted solution like farmier.com
14:02mstenta[m](shameless plug 😄)
14:02samno[m]To install farmOS on Ubuntu, you can follow these steps:... (full message at <matrix.org/_matrix/media/v3/download/mat>)
14:02mstenta[m]We try to make self-hosting as accessible as possible, but it definitely isn't a "push button process".
14:03symbioquine[m]First step: Don't use ChatGPT
14:03symbioquine[m]Start here: farmos.org/hosting/
14:04mstenta[m]Yea I'd second what symbioquine - ChatGPT makes me super nervous... about providing misleading/wrong instructions.
14:04mstenta[m]We've seen that a bunch in this community already
14:05symbioquine[m]The instructions are some vague amalgamation of generic "install this PHP software on a LAMP stack"
14:05symbioquine[m]* The instructions (from ChatGPT above) are some
14:05mstenta[m]samno: It helps to understand that farmOS is built on top of Drupal. So you are essentially hosting a Drupal website. There are tons of resources out there for hosting Drupal generally. And we can help you understand what's specifically needed for farmOS.
14:06symbioquine[m]symbioquine[m]: It might get you close, but that's the least supported way of installing farmOS
14:06symbioquine[m](and hardest)
14:08samno[m]I'm aware of farmier, but it somewhat avoids the point of running your own management system if you arent in control of your data and have to pay. There are several apps where I can pay for farm management software. I think there is an opportunity for something like this now that record keeping is becoming a massive part of farming, but I was just hoping I'd missed something simple with the install and it was a bit simpler
14:09samno[m]I diodnt want to use chatGPT, i was just looking for some "step 1... step 2..." instreuctions
14:10symbioquine[m]The problem is that just providing "step 1, step 2, etc" is risky since getting farmOS (or any self-hosted record keeping software) running is only a small piece of the work...
14:11symbioquine[m]You need to understand where your data is going, how it is getting backed up, and how to troubleshoot (at least a little bit)
14:11samno[m]I started by following farmer eds instrucions, but having spoke to farmer ed via FB, it turns out they were suitable for ubuntu
14:11samno[m]farmer-eds-shed.com/farmos-version-2-ras
14:11samno[m]werent*
14:12mstenta[m]If you're using Ubuntu, I would recommend installing Docker and running farmOS and PostgreSQL in Docker containers.
14:12mstenta[m]We will most likely be dropping support for the "packaged releases" in the future.
14:13mstenta[m](Which are just tarballs you unpack)
14:13mstenta[m]Docker containers are the easiest things for us to support (as a volunteer community)
14:13mstenta[m]Across lots of different platforms
14:13symbioquine[m]farmos.org/hosting/install/#farmos-in-do
14:14mstenta[m]symbioquine: Maybe we should update that to recommend using Docker Compose, and include PosgreSQL in our example production docker-compose.yml file
14:15mstenta[m]Then we could just provide three simple commands like we do for the dev env: farmos.org/development/environment/
14:15symbioquine[m]Yeah, probably worthwhile...
14:15symbioquine[m]We could provide a "self-hosting quick start guide"
14:15mstenta[m]samno: Can I suggest some steps to you right here and we'll see if they work? :-)
14:15symbioquine[m]but IMHO it should be opinionated about some sort of backup strategy
14:16samno[m]yep sure, is a local install still fully functional? that may be sufficient for what I need
14:17mstenta[m]Yep! Although if you want to be able to access this from multiple devices it will need to be exposed to the internet...
14:17mstenta[m]Have you ever done something like that?
14:17mstenta[m](That's a whole separate set of considerations!)
14:18mstenta[m]farmOS is a web server application, so it has all the same considerations
14:18mstenta[m]Same as if you were hosting something like NextCloud yourself
14:19samno[m]no, Ive installed home assistant which I was hoping was something similar
14:19mstenta[m]OK - yea I think that's similar...
14:19mstenta[m]But that leads to another question: are you installing these on the same machine?
14:20mstenta[m]If so, you'll need to put them both behind a proxy so that requests can be routed to each
14:20samno[m]no, i installed HA on another windows tablet through a VM
14:20samno[m]its not running at the moment
14:20mstenta[m](layers of complexity haha)
14:21mstenta[m]ok cool
14:21mstenta[m]and you don't have any other web servers running on your Ubuntu system?
14:22samno[m]no, fresh install
14:22mstenta[m]great
14:22mstenta[m]ok. first thing to do is install Docker: docs.docker.com/engine/install/ubuntu/
14:22mstenta[m]just follow the instructions on that page and let me know when you have the hello-world working
14:23mstenta[m]installing docker may seem complicated, but it's actually fairly straightforward... and once that's done it will make running farmOS (and any other containers) a lot easier
14:32samno[m]ok, think im there, ran the hello world command and its come back saying the installation appears to be working correctly
14:33mstenta[m]OK. So next step is to make a farmOS directory somewhere... this is where all your data will be stored.
14:33mstenta[m]Then, from the command line, change to that directory and run: curl raw.githubusercontent.com/farmOS/farmOS/ -o docker-compose.yml
14:33samno[m]ok, done
14:34mstenta[m]That will basically just download this file and rename it to docker-compose.yml: github.com/farmOS/farmOS/blob/3.x/docker
14:35mstenta[m]Once you have that docker-compose.yml file, open it in a text editor... we're going to add/change a few things...
14:37mstenta[m]First, you're going to add this in the `services` section, before the `www:` line:... (full message at <matrix.org/_matrix/media/v3/download/mat>)
14:37mstenta[m]That will tell it to run a PostgreSQL 13 server in its own container alongside the farmOS container
14:37mstenta[m]So you'll have Apache+PHP+Drupal+farmOS in one container and PostgreSQL in another
14:38mstenta[m]You can add this to the `www` section, to ensure that the `db` starts first:... (full message at <matrix.org/_matrix/media/v3/download/mat>)
14:38mstenta[m]And lastly, change x.y.z to 3.2.1
14:40mstenta[m]Oh and maybe remove the restart: always
14:40mstenta[m]Should all look roughly like this when you're done:... (full message at <matrix.org/_matrix/media/v3/download/mat>)
14:42mstenta[m](fwiw I was just saying to symbioquine that we might update our docs to include all this... so you're our guinea pig) :-)
14:42samno[m]ok, think im done there
14:42samno[m]fine by me!
14:43mstenta[m]ok - so from the command line, in your farmOS directory, run sudo docker compose up
14:43mstenta[m]you should see the terminal fill with log messages, it will basically stream the logs from PostgreSQL and Apache
14:43mstenta[m]Then go to localhost in your browser
14:44mstenta[m](note: if you Ctrl + C in your terminal, it will shut down the containers. if you want this to run in the background you can add -d to the end like sudo docker compose up -d - then you'll be able to close the terminal window and it will still be running. but it's helpful to start it in the foreground this first time to make sure everything's working)
14:45mstenta[m](you can view running containers in the future with sudo docker ps)
14:45mstenta[m](or just docker without sudo if you set it up that way via Docker's instructions...)
14:51samno[m]ok, ive got the Apache 2 deafult page
14:52mstenta[m]hmm. you may have apache installed already in ubuntu... in which case there may be an error in your docker logs indicating that port 80 is already taken... do you see anything like that?
14:53mstenta[m]if so, Ctrl+C in your terminal to shut down the containers, edit docker-compose.yml and change 80:80 to 8080:80 and `docker compose up again... then open localhost:8080 in your browser
14:53samno[m]yes there is something like that
14:53mstenta[m]> `sudo apt install lamp-server^`
14:53mstenta[m]oh right... you did this earlier... so that's probably what's happening
14:57samno[m]ok yep, at the install page
14:57mstenta[m]great!
14:57mstenta[m]ok... so you can fix the 8080 / 80 issue later if you want (by uninstalling Apache from Ubuntu)
14:57mstenta[m]brb
15:01mstenta[m]ok so in the install form, plug in the following database options:... (full message at <matrix.org/_matrix/media/v3/download/mat>)
15:02samno[m]port number 5432 ok?
15:03mstenta[m]yep
15:04samno[m]Failed to connect to your database server. The server reports the following message: SQLSTATE[08006] [7] could not translate host name "db" to address: Temporary failure in name resolution.
15:05mstenta[m]Are you sure your docker-compose.yml is correct? the db: should be at the same indentation line as www:. The db name comes from there, and that's what allows other Docker containers to access it using that name.
15:06mstenta[m]You should also see PostgreSQL logs in the terminal.
15:10*uploaded an image: (54KiB) < matrix.org/_matrix/media/v3/download/mat >
15:11mstenta[m]can you share your terminal logs? maybe stick them in a private/temporary pastebin.com/
15:15samno[m]pastebin.com/dDJk2pTM
15:15mstenta[m]OK yea the datasbase container is failing...
15:16mstenta[m]Are you running as sudo?
15:16samno[m]i think so
15:17mstenta[m]Do you see a db directory next to docker-compose.yml?
15:17mstenta[m](Along with a sites directory)
15:17samno[m]yes
15:17mstenta[m]Can you run ls -al db and share the results?
15:19samno[m]as in tyoe it in the terminal? do i need to stop the current process?
15:19mstenta[m]yes
15:20samno[m]permission denied]
15:20mstenta[m]sudo ls -al db
15:21samno[m]total 80... (full message at <matrix.org/_matrix/media/v3/download/mat>)
15:22mstenta[m]hmm. not sure what's wrong. but this is showing in your terminal log...... (full message at <matrix.org/_matrix/media/v3/download/mat>)
15:22mstenta[m]So what I would suggest is sudo rm -rf db
15:22mstenta[m]And then try sudo docker compose up again
15:23mstenta[m]A little explanation: Docker containers are "ephemeral" which means they don't persist any data you put in them by default. So eg if you created a PostgreSQL container, added data to it, then shut it down and restarted the container all that data is lost. The way to persist it is to mount a "volume" from outside of the container. In this case, that's the db folder.
15:23samno[m]ok yep, were on to configuring site now
15:23mstenta[m]So the db folder will container your database.
15:24mstenta[m]And the sites folder will contain things necessary to persist farmOS data like settings.php and any files/photos you upload.
15:24mstenta[m]So those two directories are where all your data is. Don't lose them!
15:24mstenta[m]:-)
15:24mstenta[m]Great!
15:24samno[m]cool
15:25mstenta[m]You could just backup both of those directories to make backups. But ALWAYS shut down your containers first.
15:25mstenta[m]Because PostgreSQL needs to write pending data to the directory during it's shutdown process.
15:26mstenta[m]The other way to make backups is to export a database snapshot as a *.sql file.
15:26mstenta[m]That's done using a tool like pg_dump, and is run while the container is running
15:27samno[m]ok i think that makes sense!
15:27mstenta[m]But a very simple backup procedure might be a simple script like this:... (full message at <matrix.org/_matrix/media/v3/download/mat>)
15:27samno[m]Ill make a note of that!
15:27mstenta[m]that shuts down the containers, makes a backup.tar.gz file with db and sites in it, and then starts the containers again
15:28mstenta[m]be sure to test that... it's just off the top of my head :-)
15:28mstenta[m]also a good idea to include the data and/or farmOS version number in the tarball filename, like backup-3.2.1-20240508.tar.gz
15:28mstenta[m]that way, when you are updating to a new version of farmOS, if you run into any issues, you can roll back easily
15:29mstenta[m]that's the basic! you're on track now!
15:29mstenta[m]s/basic/basics/
15:30mstenta[m]symbioquine am I overlooking anything?
15:30mstenta[m]here is how to update farmOS: farmos.org/hosting/update/
15:30samno[m]great! many thanks for your perseverance and help
15:30mstenta[m]it's important to take a backup before updating... and to run update.php and rebuild caches after updating (all described in detail on that page)
15:31mstenta[m]lastly, join the forum! farmOS.discourse.group :-)
15:32samno[m]thanks, im on the forum but i figured I needed one to one help more so than starting a topic there!
15:32mstenta[m]yea this chat is better for that kind of stuff - forum is better for longer discussions
16:00symbioquine[m]<mstenta[m]> "symbioquine am I overlooking..." <- No, I think as long as you bring the database down first, that's a good strategy...
16:00symbioquine[m]It might even work okay with the DB up - since the DB needs to be able to recover from power loss, but there could be situations where a larger write/import/etc was captured in a partially completed state.
16:01mstenta[m]Yea true
20:48mstenta[m]symbioquine paul121 TIL `version` is no longer recommended in `docker-compose.yml` files
20:48mstenta[m]github.com/farmOS/farmOS/pull/845
20:48mstenta[m]github.com/docker/compose/issues/11628
22:04farmBOT@farmOS@fosstodon.org => #farmOS is approaching 1000 stars on GitHub! Help us get there! github.com/farmOS/farmOS/ => fosstodon.org/@farmOS/112407352555091160

< 072024-05-08⋏09 >