First of all I want to say that atuin is a great project. My feedback is not meant to anger the devs, but rather describes my experience while setting up the atuin server.
I created a system user under which the atuin server is run.
The user does not have a home directory, since I created a systemd file with an EnvironmentFile
set.
Starting the server failed with an error, because atuin was not able to write to the user’s home directory.
I find it great that atuin tries to create a template server.toml
file with default settings explained. This has a nice touch and is something that is often missing in other projects. However, the fact that atuin abends was not expected. At least not from me. I gave atuin all the correct env vars to successfully start, yet it abends with an error.
If atuin has all the info to run, it should not error out. An info message is ok, or maybe even a warning message. Although I think ‘info’ is the right level.
I fixed that by also setting HOME to /etc/atuin
(where my env file resides) in the systemd service. Then it could create the ~/.config/atuin/server.toml
file.
I’m using Postgres 15 and since I spent almost 2 decades in the area of IBM DB2 (with 7 years in the DB2 Toronto Lab as an engine dev), I locked down the instance.
I created a database atuin
and a user atuin
. The user atuin
has full admin privileges on the database.
However, I revoked all privileges on the schema public
from the group public
in the atuin db, because the user atuin
has all privileges anyway. Additionally it is a security issue to allow anyone to do anything they want in the public schema.
\c atuin
REVOKE ALL PRIVILEGES ON SCHEMA public FROM PUBLIC;
Unfortunately atuin abends again with:
Error: failed to connect to db: PostgresSettings { db_uri: "postgres://atuin:passwordhere@127.0.0.1/atuin" }
Caused by:
Other(while executing migrations: error returned from database: no schema has been selected to create in
Caused by:
0: error returned from database: no schema has been selected to create in
1: no schema has been selected to create in
Location:
/rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/convert/mod.rs:757:9)
Location:
/home/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/atuin-server-18.0.1/src/lib.rs:141:10
The error message is a bit misleading, because connecting to the database works just fine.
I am actually quite puzzled by the “real” error message. The user atuin
has all privileges on the database, even for the schema PUBLIC
. But I had to grant the group public all privileges to the schema public. What?
I seriously don’t understand the world anymore.
I hope I was not too harsh with my feedback.