Hostwiki / wikijs-sitemap

Sitemap for Wiki.js
MIT License
11 stars 2 forks source link

db password #12

Closed DarkDau closed 3 months ago

DarkDau commented 4 months ago

I have successfully started wikijs-sitemap. Thank you for this! Only I am too stupid to put the wikijs password in a file, which I try to do, I only get a successful postgres database connect if the password is unencrypted in the docker_run file. So like this: -e 'DB_PASS=my!password' Other Methods are all wrong... What am I doing wrong? I use Debian Bookworm.

Philipinho commented 4 months ago

To use a database password file, first ensure the password file /etc/wiki/.db-secret exists by creating it with vi /etc/wiki/.db-secret and adding your Wiki.js db password.

Then, include -e DB_PASS_FILE=/etc/wiki/.db-secret -v /etc/wiki/.db-secret:/etc/wiki/.db-secret:ro in your container setup to securely link the password.

Let me know if you are still having issues.

DarkDau commented 4 months ago

ok, your setup works. Thank you. But it do not work with a different directory. even aanother dir in /etc doesnt work. Unable read DB_PASS_FILE secret env variable: Error: ENOENT: no such file or directory, open '/etc/wikijs-sitemap/.db-secret' This File /etc/wikijs-sitemap/.db-secret is readable for all. -e DB_PASS_FILE=/etc/wikijs-sitemap/.db-secret \ -v /etc/wikijs-sitemap/.db-secret:/etc/wiki/.db-secret:ro \ it seems that DB_PASS_FILE does not allow other dirs than yours?

Philipinho commented 3 months ago

Are you sure you created the password file in the directory of your choice? AFAIK, DB_PASS_FILE is not limited to any file path.

Philipinho commented 3 months ago

-e DB_PASS_FILE=/etc/wikijs-sitemap/.db-secret \ -v /etc/wikijs-sitemap/.db-secret:/etc/wiki/.db-secret:ro \ it seems that DB_PASS_FILE does not allow other dirs than yours?

From the line above, there is an error here -v /etc/wikijs-sitemap/.db-secret:/etc/wiki/.db-secret:ro. Notice the wrong path given/etc/wiki/.db-secret:ro? which should be -v /etc/wikijs-sitemap/.db-secret:/etc/wikijs-sitemap/.db-secret:ro.

DarkDau commented 3 months ago

I will try. thank you. It seems I still misunderstand the volume concept. I come back with result shortly.

DarkDau commented 3 months ago

Yes it really works. Thank you a lot for your time!

Philipinho commented 3 months ago

Glad to hear.