Question: how to use a Mongo instance with authentication?
Open Source kanban with MIT license
Brought to you by:
wekan
I would like to setup a Wekan Docker container on my synology. Problem is my Mongo DB has authentication enabled because I use it for other products (Leanote for example).
All examples of Wekan Dockerfile I found use the deprecated "--link" instructions, and even while looking inside the Dockerfile it self, I can't figure out how to specify Mongo IP, port, database name, user and password.
I probably miss something, but didn't find anything really useful for this.
Thanks.
Mirrored from https://github.com/wekan/wekan/issues/1375.
Source: http://localhost:2000/wekan/wekan/issues/1375.
Original author: romu70; created: 2017-12-02T19:29:02+02:00.
@romu70
You probably use some MongoDB authentication URL for all your other products, so you need to setup environment variable to your existing MongoDB container before starting Wekan Docker container. Wekan can use any existing MongoDB inside or outside of Docker, just provide correct MongoDB URL to database name to use. So you only need to start Wekan Docker container.
Examples:
https://github.com/wekan/wekan-maintainer/blob/master/virtualbox/start-wekan.sh#L5
https://github.com/wekan/wekan-mongodb/blob/master/docker-compose.yml#L80
Starting only Wekan container, example modified from without link to MongoDB container like at
https://github.com/wekan/wekan/wiki/Docker
so in this case you would use command line like this to run Wekan on port 8080, mapping to only localhost so port is not exposed to local network. If you would like to expose it to local network, add server IP address there. Then you would need to use some webserver like at Docker production setup to provide proxy to Wekan, look at Wekan GitHub wiki for configuration examples of various webservers.
If you use directly Wekan IP address and port at http://192.168.1.200:8080 at local network:
If you have some webserver at front of Wekan proxying to Wekan at localhost 8080, and have Nginx configured for example to http://192.168.1.200/wekan, you could use this:
If you have some name in your LAN computers /etc/hosts files pointing to your local server IP address, like this line:
Then you could use url http://wekan to access local Wekan, having server_name wekan; in your nginx config, and start Wekan this way:
Mirrored from http://localhost:2000/wekan/wekan/issues/1375#issuecomment-18179.
Original author: xet7; created: 2017-12-02T20:10:09+02:00.
@romu70
It seems that MongoDB connection string example is here:
https://docs.mongodb.com/manual/reference/connection-string/
Mirrored from http://localhost:2000/wekan/wekan/issues/1375#issuecomment-18180.
Original author: xet7; created: 2017-12-02T20:18:01+02:00.
@romu70
Please reopen issue if you still have problems with this.
Mirrored from http://localhost:2000/wekan/wekan/issues/1375#issuecomment-18181.
Original author: xet7; created: 2017-12-02T21:03:52+02:00.
Thanks a lot @xet7 . I tweaked a bit your first command to run this:
The container output is this:
So I guess some things are pretty normal, right? But when I connect http://myserver_IP:4300, I get:
CPU is below 1% and memory around 130 MB. How can I debug? Thanks.
Mirrored from http://localhost:2000/wekan/wekan/issues/1375#issuecomment-18182.
Original author: romu70; created: 2017-12-03T19:57:50+02:00.
@romu70
Container output means that connection to database was succesful and Wekan is able to save data to database.
Do you have port 4300 open on your Synology NAS ?
Mirrored from http://localhost:2000/wekan/wekan/issues/1375#issuecomment-18183.
Original author: xet7; created: 2017-12-03T20:05:06+02:00.
You can see Docker logs by using container name or ID:
Mirrored from http://localhost:2000/wekan/wekan/issues/1375#issuecomment-18184.
Original author: xet7; created: 2017-12-03T20:06:16+02:00.
I don't run a firewall on my Syno. I run some other containers on port 4000, 4100 4200, ...without any problem.
Is there something I can try to diagnose by connecting the container itself?
Mirrored from http://localhost:2000/wekan/wekan/issues/1375#issuecomment-18185.
Original author: romu70; created: 2017-12-03T20:06:41+02:00.
Yes, going inside container:
Mirrored from http://localhost:2000/wekan/wekan/issues/1375#issuecomment-18186.
Original author: xet7; created: 2017-12-03T20:07:48+02:00.
Docker logs are the one I provided above.
I know this command, but I need some specific Wekan commands to analyse the problem.
Mirrored from http://localhost:2000/wekan/wekan/issues/1375#issuecomment-18187.
Original author: romu70; created: 2017-12-03T20:08:48+02:00.
To see running processes inside container:
To see what is on open port outside container, or some processes
Mirrored from http://localhost:2000/wekan/wekan/issues/1375#issuecomment-18188.
Original author: xet7; created: 2017-12-03T20:12:21+02:00.
I'm was the docker command syntax correct to open port correctly to outside container, you could compare it to how other docker contaieners are setup in your system, outside docker:
Mirrored from http://localhost:2000/wekan/wekan/issues/1375#issuecomment-18189.
Original author: xet7; created: 2017-12-03T20:13:48+02:00.
On the host:
So obviously, there is something which runs.
From within the container:
So Node runs.
docker psoutput on the host:Mirrored from http://localhost:2000/wekan/wekan/issues/1375#issuecomment-18190.
Original author: romu70; created: 2017-12-03T20:35:28+02:00.
Hmm, there is problem that inside container it goes to 4300 and not 80.
To fix it, remove inside port option this way:
Mirrored from http://localhost:2000/wekan/wekan/issues/1375#issuecomment-18191.
Original author: xet7; created: 2017-12-03T20:42:35+02:00.
Good catch!! Thanks a lot, it works.
Mirrored from http://localhost:2000/wekan/wekan/issues/1375#issuecomment-18192.
Original author: romu70; created: 2017-12-03T20:47:28+02:00.
After spend a lot time trying discover why wekan docker image didn't work, I discovered that Wekan don't work if you configure PORT value less then 3000 (I think this is a Node.js limitation). So, I solved configuring PORT igual 3000 and mapping inside of my server:
For the Dockerfile:
For captain-definition file, if you are using Captain Duck Duck (https://captainduckduck.com/):
Mirrored from http://localhost:2000/wekan/wekan/issues/1375#issuecomment-18193.
Original author: polotto; created: 2018-08-16T20:37:31+03:00.
I would recommend that for docker image you use quay:
https://github.com/wekan/wekan-mongodb
Mirrored from http://localhost:2000/wekan/wekan/issues/1375#issuecomment-18194.
Original author: xet7; created: 2018-08-17T12:12:55+03:00.
Examples of MongoDB with authentication
Mirrored from http://localhost:2000/wekan/wekan/issues/1375#issuecomment-18195.
Original author: xet7; created: 2025-02-07T15:53:16+02:00.