I read from other posts with this same error that perhaps the host-name should match the name of the container (though they used docker not an lxc container), so I tried changing the following:
in config.exs url: [host: "penguin"]
in dev.exs hostname: "penguin" http: [ip: {127, 0, 0, 1}, port: 4000]
in etc/hosts 127.0.1.1 arch // artifact from linux installation? 127.0.0.1 penguin // i added this
(penguin is the name of the default container with linux on chromeos)
but then again, since i’m just starting, so I have no idea what i’m doing. I’m just trying to finish the “up and running” part of the tutorial!
okay. my bad. I guess while following the up 'n running section of the tutorial I didn’t expect to set up database stuff myself. I thought ecto.create did that!
my notes:
# for archlinux
# follow https://wiki.archlinux.org/title/PostgreSQL
sudo -i -u postgres
initdb -D /var/lib/postgres/data
pg_ctl -D /var/lib/postgres/data -l logfile start
#pg_ctl -D /var/lib/postgres/data start
exit
# if lockfile error on /var/run/postgresql...
# https://stackoverflow.com/questions/22851352/postgresql-server-failed-to-start-could-not-create-lock-file-permission-denied
mkdir /var/run/postgresql
sudo -i -u postgres
chown -R postgres:postgres /var/run/postgresql
exit
# can use env vars PGHOST 'n PGPORT
# see defaults here: /var/lib/postgres/data/postgresql.conf
sudo systemctl start postgresql.service
#sudo systemctl enable postgresql.service
mix ecto.create
yeah, I dunno anything about databases nowadays, but i’m cool with the defaults; besides, it gives the option of using supabase if I don’t want to deal with it.
what’s really fantastic is that i’m able to reach the example web-site on the server, which is run in a container, from the chromeos’s browser… For flutter, the tutorial told me to install another browser in the container . Or maybe it does work for flutter, and it was recommended for debugging via chrome debugger…? Who knows… but I’m so happy to dig into this!