Cloudflare Tunnel ubable to connect on new release

Hello,

Prior to the new version, I was able to access my Vikunja install just fine via cloudflare tunnel.

Essentially what I did was had tasks.domain.com and vkapi.domain.com. I told it to use the api URL and all was well.

With the new release, I had issues upgrading and couldn’t get anything to work, so I started over. It was fine, I’m the only user and I only had a few tasks, so I backed those up.

I am fairly new to self hosting, so I’m a novice with docker and command line stuff. I typically put my docker-compose files in portainer.

I just got everything up and running locally via IP address with the following docker-compose file:

version: '3'

services:
  vikunja:
    image: vikunja/vikunja
    environment:
      VIKUNJA_SERVICE_PUBLICURL: http://192.168.4.245:3456
      VIKUNJA_DATABASE_HOST: db
      VIKUNJA_DATABASE_PASSWORD: [[redacted]]
      VIKUNJA_DATABASE_TYPE: mysql
      VIKUNJA_DATABASE_USER: vikunja
      VIKUNJA_DATABASE_DATABASE: vikunja
      VIKUNJA_SERVICE_JWTSECRET: [[redacted]]
    ports:
      - 3456:3456
    volumes:
      - /docker_configs/vikunja/files:/app/vikunja/files
    depends_on:
      db:
        condition: service_healthy
    restart: unless-stopped
  db:
    image: mariadb:10
    command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
    environment:
      MYSQL_ROOT_PASSWORD: [[redacted]]
      MYSQL_USER: vikunja
      MYSQL_PASSWORD: [[redacted]]
      MYSQL_DATABASE: vikunja
    volumes:
      - /docker_configs/vikunja/db:/var/lib/mysql
    restart: unless-stopped
    healthcheck:
      test: ["CMD-SHELL", "mysqladmin ping -h localhost -u $$MYSQL_USER --password=$$MYSQL_PASSWORD"]
      interval: 2s
      start_period: 30s

I have removed all previous volumes. I have changed cloudflare tunnel to direct to port 3456. No matter what I try, I cannot seem to connect to the database via cloudflare. I visit the URL and Vikunja spends a few minutes loading, and then I get the following window:


I’m not sure where it’s getting the URL from. Maybe it’s my browser, maybe it’s something else, but it’s got the old API URL in there. No matter what I try, whether it’s public URL or the local IP address, I can’t get anything to take away the red warning box.

The database password is new, the location is new, the volumes are new.

Here’s my old docker-compose file

version: '3'

services:
  db:
    image: mariadb:10
    command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
    environment:
      MYSQL_ROOT_PASSWORD: [[redacted]]
      MYSQL_USER: vikunja
      MYSQL_PASSWORD: [[redacted]]
      MYSQL_DATABASE: vikunja
    volumes:
      - /docker_configs/vk/config/db:/var/lib/mysql
    restart: unless-stopped
  api:
    image: vikunja/api
    environment:
      VIKUNJA_DATABASE_HOST: db
      VIKUNJA_DATABASE_PASSWORD: [[redacted]]
      VIKUNJA_DATABASE_TYPE: mysql
      VIKUNJA_DATABASE_USER: vikunja
      VIKUNJA_DATABASE_DATABASE: vikunja
      VIKUNJA_SERVICE_JWTSECRET: [[redacted]]
      VIKUNJA_SERVICE_FRONTENDURL: http://tasks.domain.cloud/
      VIKUNJA_MAILER_ENABLED: "true"
      VIKUNJA_MAILER_HOST: smtp.gmail.com
      VIKUNJA_MAILER_PORT: 465
      VIKUNJA_MAILER_USERNAME: [[redacted]]
      VIKUNJA_MAILER_PASSWORD: [[redacted]]
      VIKUNJA_MAILER_FROM: [[redacted]]
      VIKUNJA_MAILER_FORCESSL: "true"
    # Optionally, if your email server does not require authentication:
    # VIKUNJA_MAILER_ENABLESTARTTLS: "true"     # Enable StartTLS, set to "false" if not required
    ports:
      - 3456:3456
    volumes:
      - /docker_configs/vk/config/files:/app/vikunja/files
    depends_on:
      - db
    restart: unless-stopped
  frontend:
    image: vikunja/frontend
    ports:
      - 86:80
    environment:
      VIKUNJA_API_URL: https://vkapi.domain.cloud/api/v1
    restart: unless-stopped

I’ve tried http and https
I’ve tried URL and local IP address

Not sure what else to try. Any help would be massively appreciated.

The publicurl should be the one where it is publicly reachable, so the cloudflare tunnel address in your case. Can you access https://<public cloudflare tunnel url>/api/v1/info in a browser? Does it work in a private tab?

Amazing, I just needed to change the url to /api/v1/in that window. It now works!