hi - can somebody tell me a step by step manual to run notification server paralel to a seafile binary installion? never used docker before.
thank you
mario
hi - can somebody tell me a step by step manual to run notification server paralel to a seafile binary installion? never used docker before.
thank you
mario
so i think it is not possible to use a docker notification server in combination with a real binary server - because the “real” database is not visible in the container.
i create an .env file:
COMPOSE_FILE=‘notification-server.yml’
COMPOSE_PATH_SEPARATOR=‘,’
TIME_ZONE=Europe/Berlin
JWT_PRIVATE_KEY=zXXXXXXXX
SEAFILE_SERVER_PROTOCOL=https
SEAFILE_SERVER_HOSTNAME=seafile.xxxx.org
SEAFILE_MYSQL_DB_HOST=127.0.0.1 # your MySQL host
SEAFILE_MYSQL_DB_PORT=3306
SEAFILE_MYSQL_DB_USER=seafile
SEAFILE_MYSQL_DB_PASSWORD=XXXXXXXX
SEAFILE_MYSQL_DB_CCNET_DB_NAME=ccnet-db
SEAFILE_MYSQL_DB_SEAFILE_DB_NAME=seafile-db
SEAFILE_MYSQL_DB_SEAHUB_DB_NAME=seahub-db
NOTIFICATION_SERVER_IMAGE=seafileltd/notification-server:12.0-latest
NOTIFICATION_SERVER_VOLUME=/opt/notification-data
after compose:
service “notification-server” depends on undefined service “db”: invalid compose project
so i think the “db” service came from the main seafile docker package - so it is not possible to run the notification server standalone with docker.
any idea?
service “notification-server” depends on undefined service “db”: invalid compose project
The notification server can access the regular database service on the host (not inside a container), and so can the seafile docker. A good place to start is the instructions for running seafile without the mysql container.
https://manual.seafile.com/12.0/setup/setup_with_an_existing_mysql_server/
You might need to modify the configuration of your mysql service to change it to allow connections from other computers over the network (the container will have a different IP and so it looks like it is a remote network connection). You might also need to modify the seafile user to allow login from remote machines:
GRANT ALL PRIVILEGES ON *.* TO 'seafile'@'%' IDENTIFIED BY 'your_password_here' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON `ccnet_db`.* to 'seafile'@'%';
GRANT ALL PRIVILEGES ON `seafile_db`.* to 'seafile'@'%';
GRANT ALL PRIVILEGES ON `seahub_db`.* to 'seafile'@'%';
Then you need to set the notification server to have the seafile user and password, and the address for the mysql server (the IP address of the host machine usually). Also, you will need to add a section to your reverse proxy config (if you haven’t already) for “location /notification” to forward that to the container.
thank you very much for your reply. alright - disable the container database service is the keyword. but how i disable in the container the seafile/seahub service? in my case they overwrite or crash my current database with a new one or use there twice.
thank you!
In the default seafile docker setup there are several containers. There is the seafile-server, the database, notification, and seadoc. If you only want the notification server, then only run that one. In the .env file, edit the COMPOSE_FILE to only list the notification server:
COMPOSE_FILE='notification-server.yml'
The seafile-server container has a script that will try to make new databases and tables and stuff if it thinks you are doing a new installation, but the notification-server does not. So just not running the seafile-server should mean your database won’t get messed with.
i’ve try it out. not working, first i must disable the “db” section in the notification-server.yml file. then the container is starting up. but port 8083 not reachable. if i look in the notification-server file the caddy service is required for “upgrade websocket.” - when i enable caddy service, port 80 and 443 is used from my real nginx - so caddy comes not up. try different ports, but the needed port 8083 not connectable. i think the way with a docker image for the notification server is not the best way. may be good work when the whole seafile is published with docker. but with the binary version the notification server should also in the the binary version like before.
Yeah, I missed a step. In the notification-server.yml file you need to add this section:
ports:
- "8083:8083"
The normal setup expects the connection to be coming from caddy in another docker container, so by default the port is made available outside of docker. This is one more reason that I have found that the more you know about docker, the more you hate docker.
My reverse proxy is nginx, and I added this section to make the notification server work:
location /notification {
proxy_pass http://192.168.69.6:8083/notification;
include /etc/nginx/snippets/proxy.conf;
access_log /var/log/nginx/seafile_notification.access.log;
error_log /var/log/nginx/seafile_notification.error.log;
}
the container creates a bridge network 172.17.0.1 to 172.18.0.1 . but the notification-server can’t connect the mysql server in the container. do you know a solution to add the notification-server to the real host network? this is much easier for me, because i’ve my iptables chain on that server.
As far as I know, Docker doesn’t let programs in the container connect to the real network. They can only connect to the docker virtual network. The closest you can get is that “port” section in the config which tells docker to run some program (can’t remember the name) to listen on the real network, and forward connections in to the container network.
When I was testing with it, I found that docker messed with my iptables rules. I think it made new tables or something, I don’t remember because that was the last straw that made me switch to using podman instead of docker.
Can you connect to the mysql server with telnet or some similar simple test? And then can you do the same from inside of the container?