I am wondering if someone can tell me how to access Vikunja in the web browser from a PC on my home network? At the moment I can only access it from the local host where the container has been deployed.
I followed these instructions exactly : Docker Walkthrough | Vikunja
and it works perfectly on the local host. I am not extremely experienced with Linux, and totally new to docker-compose, so if someone could explain in simple terms how to set up networking to be able to access Vikunja from other PCs on my network, that would be hugely appreciated.
Did you try to point the other device in your home network to the ip of the host you have VIkunja running on? If youâre running the config from the example you linked that should work.
On linux, you can get the ip of your host pc by running ip a in a terminal, then look for an ip address starting with 192.168.xx.
Thanks for the reply, Iâm not sure if this helps but, from my home network devices I can ping/ssh the device on which Vikunja is running. But I cannot ping the docker container. I can only ping the docker container locally from the device on which Vikunja is running. Does this mean I need a route on my home network devices to point to the Vikunja container? (I use mac for my home network devices, and Vikunja is running on an Ubuntu device)
should frontend be edited to be the IP address of frontend, or should be left as is? For what it is worth, I did try to edit it, but it made no difference.
That should be frontend. Since both the proxy container and the frontend container are in the same docker network, they can talk to each other via their hostname.
Ahhh, my fundamental understanding of docker has been flawed. Thank you in pointing me in the right direction. All I needed to do was to use the ubuntu address and NOT the container address! Everything works beautifully on my home network now. Regarding the docker-compose file, I am using exact copy taken from ï»żhttps://vikunja.io/docs/docker-walkthrough/
To access Vikunja from the internet
I now set up port forwarding on my router on port 80 to point to my Ubuntu server, and I can access it form the web perfectly well. I am however worried about security implications of this. Would you advise against this kind of set up?
Container addresses are only valid on the host network stack, as youâve already figured out.
It should be fine to use it like this. You might want to make it reachable from the outside (in your router) under a different port than 80, something really high to avoid automated scanners to detect your Vikunja installation. While Vikunja itself isnât vulnerable to security issues (as far as I can tell right now) this might increase the load on your server for no good reason.
Vikunja-wise, you probably want to disable the registration if you donât intend to use it with other people.
Ok that makes sense. Thanks! Can you please explain how to disable user registration?
I read Config options | Vikunja and following the instruction I used the provided default config.yml. I created a directory /etc/vikunja and this is where I placed the config.yml . inside the config I changed the variable enableregistration: so that it states false
at this point i restarted the container with the following commands so that the changes in the config take effect (is this required?)
sudo docker-compose down
sudo docker-compose up
but still when I go to Vikunja login screen there is a Registration box which successfully allows me to register.
What am I doing wrong?
I read your response to a similar question here, but it isnât very clear to me Disable Registration and User management is what you are saying is that I have to mount the /etc/vikunja/config.yml ? How can I do that?
I also tried adding VIKUNJA_SERVICE_ENABLEREGISTRATION: false
to the docker-compose.yml but then when i tried running sudo docker-compose down
I received the error:
ERROR: The Compose file â./docker-compose.ymlâ is invalid because:
services.api.environment.VIKUNJA_SERVICE_ENABLEREGISTRATION contains false, which is an invalid type, it should be a string, number, or a null
Thank you for all your help, and also for wiring such an incredible piece of software!
EDIT: could you also advise on creating a self signed certificate so that the connection is https instead of http ? I looked through all the docs but canât see anything pointing to this. Thanks!
You should use environment variables, just as you tried in your second attempt. Try putting in a '0' instead of false and it should work.
Vikunja running in the container does not have access to your host file system so if you add a config.yml file on your host, the container has no way of knowing this until you tell it to. Thatâs what mounts are for. The docker docs on volumes (thatâs the docker term for mounts) provides a bit more information if youâre curious about it.
For configuration, environment variables is generally preferred over config files mounted in the container because that keeps everything in one place.
For that youâll need a proxy that sits between Vikunjaâs proxy container and the outside world. Thereâs a few options available, you can do it with a self signed certificate and Vikunjaâs proxy container you already have, or use something like traefik to handle all of this. Thereâs examples for traefik in the docs, for self signed just search for something like ânginx with self signed TLSâ. If you go down that road, Iâd advise you to read up a bit on how reverse proxies work.
Thanks for the comments above. I got the registration disabled now. One final outstanding issue is that of https. I really need to get this to work before allowing Vakunja it to be accessible from the web.
The traefik instructions are sadly over my head by some distance⊠but i am trying to set up self signed certificate inside the vikunja proxy (nginx) docker container. I created the certificate using this line
Iâve been reading about mounting different files and so now I tried to create certificate on my host system and mount them. This is successful, but when I do docker-compose up I get the following error
proxy_1
I nginx: [emerg] cannot load certiftcate â/etc/ngtnx/my-stte.con.crtâ: PEM_read_bto_X509_AUX() fatled (SSL: error: 0909006C:PEN routtnes:get_name:no start ltne:Expecting: TRUSTED CERTIFICATE)
I do understand this is perhaps a bit much to help on a forum board, but if you could point me in the right direction, that would be awesome, i feel like Iâm so damn close!
Thanks for all that, it looked very promising the first time I run docker-compose up. The Dockerfile has been executed. Unfortunately https still did not work, I tried again and now I keep getting this error and the proxy container keeps restarting
Each time I run docker-compose up I do not see the certificates being generated (only saw it the first time), does this mean that the first time it run, they got saved (committed) inside the docker container?
Thank you for the correction, but it looks like something is still not right, now I keep getting the following
proxy_1 | 2021/11/10 19:22:37 [emerg] 1#1: unknown directive âserâ in /etc/nginx/nginx.conf:1
proxy_1 | nginx: [emerg] unknown directive âserâ in /etc/nginx/nginx.conf:1
ops⊠looks like when I revert the nginx.conf and docker-compose.xml to the original version, I still get the error next time I will be taking a Timeshift snapshot before anything
I wanted to test out
docker-compose pull
docker-compose down
docker-compose up -d
and it appears to of broken something. I have done the commands above, but now I get Network Error on the Vikunja login page when trying to log in?
I also tried
docker-compose pull
docker-compose down
docker-compose build
docker-compose up -d
but that did not help either
edit:
I figured it would be good opportunity to test the Timeshift restore. It restored successfully, and I can see that the files were reverted to previous versions, but sadly the issue persists
edit2:
It is all working, I am not sure what was wrong, but I have re-run the commands a couple of times ( down / build / up) and everything is working again. I also cleared cache in Firefox in case that was causing an issue, I thought to do this as initially it worked in Safari while I was still receiving Network Error in Firefox.