Synology: vikunja working locally but not via proxy

Hello,

I managed to install vikunja via docker-compose on my synology nas (i used portainer’s stacks and it was surprisingly easy for a newbie like me to follow your “Example without any proxy”) :slight_smile:
locally, everything works fine :+1:

Now i would like to access vikunja from outside: synology has a pre-installed proxy so i connected my local vikunja 192.168.1.10:8088 to my domain vikunja_mydomain_com (like i already did with other containers) but it does not work: there is a “network error” message on the login page :confused:

Any idea how i can correct this “network error” (+ remove the register button) ?

i tried adding these env. variables but it doesn’t work :
VIKUNJA_SERVICE_FRONTENDURL: https://vikunja.mydomain.com
VIKUNJA_SERVICE_ENABLEREGISTRATION: 0

What part of Vikunja did you connect to your proxy? Frontend or API?

Because your browser actually makes the requests to the api directly, it needs to have access to it. That means you have to expose both containers, on different ports.

Once you’ve done that you need to configure the API Url in your frontend, check out this part of the docs for that.

Thanks for your swift reply but i’m not sure i understood correctly :

  • i created a proxy to redirect the api “192.168.1.10:3344” to a domain “api_mydomain_com”
  • so now both containers are exposed
  • i also modified the frontend container and changed VIKUNJA_API_URL to “https_api_mydomain_com/api/v1”
    but i still get a network error when i try to login via the frontend “vikunja_mydomain_com”

Can you access the api from your browser at https_api_mydomain_com/api/v1/info?

yes : i get a json page that starts with version “v0.18.1”

edit:
it works ! :smile: i had to change the url on the login page too (on top of the login field)

Thank you - if you want i can send you the exact steps to make it work on a synology nas so you can maybe add it to your docs ?

1 Like

Glad you figured it out!

If you could provide the steps for the docs that would be awesome, if you feel up to it you could also send a PR directly.

Hey @kolaente,

I’m having also troubles with this error.

Description of the problem

  • Frontend works, but doesn’t get to the api
  • The /api/v1/info request always delivers the correct response
  • Forwarding 443 from Router to Synology
  • Reverse proxy on synology for vi / api on 443 (HTTPS)
    • vi goes to frontend docker 8882 (HTTP)
    • api goes to api docker 3456 (HTTP)
  • On my computer in the browser (same network) it works fine.
  • With local IPs it works fine
  • DesktopApp won’t work (with domain)
  • Mobile phones work “sporadically?!”
  • Mobile phone in my network gives error immediately (AxiosError: Network Error)
  • Mobile phone from 5G loads 30sec before returning timeout (AxiosError: timeout exceeded)

On my mobile I got it to work, after chaning also the api at the top of the page to NOT having /api/v1. It somehow was not enough to update the api via the “error input field” that you have anyways… Trying the exact same thing on another mobile, didn’t work again. I always receive the AxiosError: timeout exceeded… Also the DesktopApp is not working. I’m totally clueless…

What is the correct input for the api in 0.20.2? The url with or without /api/v1?

Thanks a lot in advance!
Best regards,
Marcel

Docker files:

PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PGID xx
PUID xx
VIKUNJA_CORS_ENABLE true
VIKUNJA_DATABASE_DATABASE vikunja
VIKUNJA_DATABASE_HOST db
VIKUNJA_DATABASE_PASSWORD secret
VIKUNJA_DATABASE_TYPE mysql
VIKUNJA_DATABASE_USER vikunja
VIKUNJA_FILES_BASEPATH /app/vikunja/files
VIKUNJA_MAILER_ENABLED 1
VIKUNJA_MAILER_FROMEMAIL xx
VIKUNJA_MAILER_HOST xx
VIKUNJA_MAILER_PASSWORD xx
VIKUNJA_MAILER_PORT xx
VIKUNJA_MAILER_SKIPTLSVERIFY false
VIKUNJA_MAILER_USERNAME xx
VIKUNJA_MIGRATION_TODOIST_ENABLE 1
VIKUNJA_MIGRATION_WUNDERLIST_ENABLE 0
VIKUNJA_SERVICE_ENABLEREGISTRATION 0
VIKUNJA_SERVICE_FRONTENDURL https://vi.xx.net/
VIKUNJA_SERVICE_JWTSECRET xx
VIKUNJA_SERVICE_ROOTPATH /app/vikunja/
NGINX_VERSION 1.23.3
NJS_VERSION 0.7.9
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PKG_RELEASE 1
VIKUNJA_API_URL https://api.xx.net/api/v1

Can you reach the api directly at /api/v1/info on all of these devices?

Yes! That works fine from all devices. That’s why I don’t really know where the problem’s supposed to be…

My SSL certificate from LetsEncrypt doesn’t seem to cover the subdomains, since in the browser I get warnings. Could that be an issue?

And if you set that api url that only works sometimes? That’s really wired.
Does it work without the /api/v1 suffix?

It’s not the api that works sometimes, I only got it to work on my mobile somehow not reproducible. The /api/v1/Info works always.

Okay but you configured the VIKUNJA_API_URL on the frontend container to https://api.xx.net/api/v1? Is that where the api is reachable or is that https://api.xx.net:3456/api/v1?

Exactly, the api is reachable under:
https://api.xx.net/api/v1

HTTPS api.xx.net:443 has a reverse proxy entry on my synology DS to the docker container 3456.

And I just had the same issue on my other notebook from a totally different network.

  • AxiosError: Network Error
  • I changed the api URL on top and clicked all the apply buttons on the page
    • didnt help!
  • I refreshed the page → It works

I now added matching LetsEncrypt certificates for both subdomains. I’ll give a feedback as soon as I know if it helped… (seems to be better know!)

@kolaente so the issue seem to have been the not valid certificate. I don’t know at which point the problem occurs, but obviously when the frontend tries to connect to the api and it doesn’t provide a valid certificate. As far as I can see there also isn’t a setting to disable cert checking at this specific point. Thanks for your support!

1 Like