First, I'd like to congratulate you on your fantastic work. I've only been using it for a few days; I tried the Ubuntu Linux version and had no problems. Perhaps the documentation could be improved (I know documentation is always a pain to write). However, the pre-built applications are a great help in understanding how it works; just find something similar and analyze it.
But, yes, there's always a but.... 🙂
For some reason, I've been trying to get the Docker version to work. I've encountered two issues here, which I've solved by working around them, at least until the next update.
I'm posting my solution to help anyone who might be interested.
FIRST PROBLEM
I can't change:
- DB Name
- Username
- Password
I set the indicated environment variables, but when I run "docker compose up",
the variables are CORRECTLY USED ONLY for the Postgres part. Consequently, the database is initialized with the correct values, but the config.json file is not modified and uses "app" for all three parameters, and obviously, it doesn't log in.
Honestly, I haven't read how to build a docker yet, but I looked at the file on github and created a batch file that simulates the tar.gz download and the "sed" sequence.
By setting the variables before sed, I verified that the config.json file was created correctly. If I had to bet, I'd say the problem lies elsewhere. I'd point to some issue with passing parameters (which I don't know how to simulate).
This problem can be circumvented after creating the docker by manually editing the variables within the docker volume.
It's easy to access it externally:
sudo nano /var/lib/docker/volumes/rei3de_data_app/_data/config.json (on an Ubuntu server).
SECOND PROBLEM (less trivial to solve)
The version provided on Docker works in HTTP, not HTTPS (required to use the Password Safe application).
I saw a reply from Gabriel, who suggested removing the "-http" flag in the launch command "/opt/r3/r3", "-run", "-http", "-config", "/opt/r3/data/config.json"
but this command is internal to the Docker file, and I don't know how to handle the change. The thread didn't end with a explicit solution and a "yes, it works now."
My solution, for now, consists of editing the file: docker-compose.yml
In the "r3" section of the file, I added:
command: ["/opt/r3/r3", "-run", "-config","/opt/r3/data/config.json"]
This command overrides the internal command that adds the -html flag and disables https.
I also modified the listening port accordingly:
ports:
- "0.0.0.0:14000:443"
Of course, I adapted the config.json file to the situation. Here are the key lines:
"db" section with my specific parameters:
"name": "my_db_name",
"user": "my_db_user",
"pass": "my_secret_password",
"web" section
"port": 443,
WARNING! For those who don't know...
In YML files, indentation is part of the syntax. Just like in Python, getting it wrong
can cause disaster.
BE CAREFUL AGAIN.
Changes require a container restart (at least the rei3 one) to take effect.
Eventually, following errors and incorrect attempts, it may also be useful to delete dirty volumes (I had new, empty volumes, but BE CAREFUL NOT TO SCREW YOUR DATA).
Useful commands
Essential, used for managing docker.
sudo apt-get install docker.io docker-buildx docker-compose
Install psql, useful for testing:
sudo apt install postgresql-client-common postgresql-client
The following commands don't contain "sudo" because I've allowed my user to work with docker.
Install/uninstall:
docker compose up (install)
docker compose down (uninstall, but correctly, doesn't remove the volumes)
To see the status
docker ps (Shows active ones and ports used)
docker ps -a (Shows all active or deactivated dockers)
Start the application
docker start r3.11.8_db (First the database...
docker start r3.11.8_app (... and then the app)
To clarify, here are the logs
docker logs r3.11.8_db
docker logs r3.11.8_app
STOP the application
docker stop r3.11.8_app (First the app...)
docker stop r3.11.8_db (... Then the database)
Volumes with persistent data:
docker volume list
For volume management (with docker turned off):
#docker volume rm rei3de_data_db (!!! DELETE THE DATABASE. Think about it first if you have data, and possibly back up the database)
#docker volume rm rei3de_data_app (!!! DELETE what you did on REI3. Think about it first if you have data, and possibly back up the database)
For developers (Congratulations on this great product):
In my opinion, at least the -html flag should be removed from docker and port 443 should be set by default. I don't see the need to keep HTTP compatibility.
This seems like a useful improvement, and also easy to implement.