Hi,
I've tried to explain my installation.
I want to try Joplin and Joplin Server to replace my Evernote usage since more than 10y... (when Ever was a startup !).
My physical installation is :
- a "server" with lot of VM ; one on Debian10 + Docker + Portainer including yml for db/joplin server
- a NAS where a /Notes is share with a "joplin" user. The aim of this storage is to have a reliable directory where DB & notes are stored (synchronized with an another NAS outside and an encrypted harddrive in parallel).
So, i've installed my VM based on Debian10 ; in proxmox.
Please note that i have a separated VM apache where all my vhost are configured (see after).
Just for the directory mount on the VM, my fstab is:
//NASIP/Notes /mnt/QNAP cifs user=joplin,pass=password,dir_mode=0755,file_mode=0755,uid=1000,gid=1000 0 0
After docker installation, portainer is launched.
I added a stack:
version: '2'
services:
db:
image: postgres:13
volumes:
- /mnt/QNAP:/var/lib/postgresql/data
ports:
- "5432:5432"
restart: unless-stopped
environment:
- POSTGRES_PASSWORD=db_password_stupid
- POSTGRES_USER=db_admin
- POSTGRES_DB=db_joplin
app:
image: joplin/server:latest
depends_on:
- db
ports:
- "22300:22300"
restart: unless-stopped
environment:
- APP_PORT=22300
- APP_BASE_URL=http://192.168.2.81:22300
- DB_CLIENT=pg
- POSTGRES_PASSWORD=db_password_stupid
- POSTGRES_DATABASE=db_joplin
- POSTGRES_USER=db_admin
- POSTGRES_PORT=5432
- POSTGRES_HOST=db
After, i've access in my local network to
http://192.168.2.81:22300/login
Seems to be good ... No.
In the log for postgre db:
The files belonging to this database system will be owned by user "postgres".,
This user must also own the server process.,
,
The database cluster will be initialized with locale "en_US.utf8".,
The default database encoding has accordingly been set to "UTF8".,
The default text search configuration will be set to "english".,
,
Data page checksums are disabled.,
,
fixing permissions on existing directory /var/lib/postgresql/data ... ok,
creating subdirectories ... ok,
selecting dynamic shared memory implementation ... posix,
selecting default max_connections ... 100,
selecting default shared_buffers ... 128MB,
selecting default time zone ... Etc/UTC,
creating configuration files ... ok,
running bootstrap script ... ok,
performing post-bootstrap initialization ... ok,
syncing data to disk ... ok,
,
initdb: warning: enabling "trust" authentication for local connections,
You can change this by editing pg_hba.conf or using the option -A, or,
--auth-local and --auth-host, the next time you run initdb.,
,
Success. You can now start the database server using:,
,
pg_ctl -D /var/lib/postgresql/data -l logfile start,
,
waiting for server to start....2022-05-08 16:44:13.175 UTC [48] LOG: starting PostgreSQL 13.6 (Debian 13.6-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit,
2022-05-08 16:44:13.179 UTC [48] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432",
2022-05-08 16:44:13.191 UTC [49] LOG: database system was shut down at 2022-05-08 16:44:12 UTC,
2022-05-08 16:44:13.197 UTC [48] LOG: database system is ready to accept connections,
done,
server started,
CREATE DATABASE,
,
,
/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*,
,
2022-05-08 16:44:13.621 UTC [48] LOG: received fast shutdown request,
waiting for server to shut down....2022-05-08 16:44:13.625 UTC [48] LOG: aborting any active transactions,
2022-05-08 16:44:13.627 UTC [48] LOG: background worker "logical replication launcher" (PID 55) exited with exit code 1,
2022-05-08 16:44:13.629 UTC [50] LOG: shutting down,
2022-05-08 16:44:13.651 UTC [48] LOG: database system is shut down,
done,
server stopped,
,
PostgreSQL init process complete; ready for start up.,
,
2022-05-08 16:44:13.746 UTC [1] LOG: starting PostgreSQL 13.6 (Debian 13.6-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit,
2022-05-08 16:44:13.746 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432,
2022-05-08 16:44:13.746 UTC [1] LOG: listening on IPv6 address "::", port 5432,
2022-05-08 16:44:13.752 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432",
2022-05-08 16:44:13.764 UTC [62] LOG: database system was shut down at 2022-05-08 16:44:13 UTC,
2022-05-08 16:44:13.772 UTC [1] LOG: database system is ready to accept connections,
2022-05-08 16:44:18.070 UTC [69] ERROR: relation "knex_migrations" does not exist at character 20,
2022-05-08 16:44:18.070 UTC [69] STATEMENT: select "name" from "knex_migrations" order by "id" desc limit $1,
Is it normal to see ????
2022-05-08 16:44:13.772 UTC [1] LOG: database system is ready to accept connections,
2022-05-08 16:44:18.070 UTC [69] ERROR: relation "knex_migrations" does not exist at character 20,
2022-05-08 16:44:18.070 UTC [69] STATEMENT: select "name" from "knex_migrations" order by "id" desc limit $1,
Maybe, i'm not sure, but i can't access with my sudo user on the VM to /mnt/QNAP where are stored the DB. Docker user is 998 (guid) ; my user is 1000 (gid). Is it okay ?
On my NAS, i don't see the files in the mounted directory (mount is okay without error)...
Another problem, maybe due to i'm not an expert on vhost.
My router maps the 22300 to 22300 / IP - VM (where joplin server & db).
I'm not sure if i do correctly.
I want to expose only SSL/HTTPS on the web to access & sync outside my notes.
My conf is not working. I have an error message (i've tried https, http etc)
2022-05-08 17:06:22: [error] App: 404: GET /login: ::ffff:IPIP: Invalid origin: https://subdomain.domain.ovh:22300
joplin-ssl.conf (with a2ensite ; reload):
<IfModule mod_ssl.c>
<VirtualHost *:443>
ProxyPreserveHost On
ServerName subdom.dom.ovh
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://192.168.2.81:22300/ keepalive=On retry=5
ProxyPassReverse / http://192.168.2.81:22300/
ErrorLog /var/log/apache2/joplin_error.log
CustomLog /var/log/apache2/joplin_access.log combined
Include /etc/letsencrypt/options-ssl-apache.conf
RewriteEngine on
SSLEngine on
<IfModule mod_headers.c>
<FilesMatch "\.(css|js|png|jpeg|jpg|ttf|woff)$">
Header set Cache-Control "max-age=7200"
</FilesMatch>
<FilesMatch ".*(getResources.php)">
Header set Cache-Control "max-age=7200"
</FilesMatch>
<FilesMatch ".*(getJS.php)">
Header set Cache-Control "max-age=7200"
</FilesMatch>
</IfModule>
SSLCertificateFile /etc/letsencrypt/live/subdom.dom.ovh-0001/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/subdom.dom.ovh-0001/privkey.pem
</VirtualHost>
</IfModule>
Last questions, how i can add:
- a 2nd authentification factor like authenticator ?
- an email server configuration (to send email) ?
- is it possible to send email directly to joplin (like evernote) ?
Thanks for your help !!!!!