0

I have deployed n8n and Baserow in a Digital ocean droplet. I have used baserow.mydomain.com and n8n.mydomain.com subdomains for Baserow and n8n serverices respectively. Traefik has used as a proxy in front of containers. Both services can be accessible using their subdomains. However, when I tried to connect Baserow node from n8n workflow,did not work. My N8n, Baserow and Traefik configuration are given bellow

Traefik/docker-compose.yml :-

---
version: "3"
services:
  traefik:
    container_name: ${DOMAIN_NAME}
    environment:
      DO_AUTH_TOKEN: ${DO_AUTH_TOKEN}
    restart: always
    image: traefik
    networks:
      - mydomain
    ports:
      - 80:80
      - 443:443
      - 8080:8080
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - "./traefik:/etc/traefik:ro"
networks:
  mydomain:
    name: ${DOMAIN_NAME}

Traefik/traefik.toml:-

[entryPoints]
  [entryPoints.http]
    address = ":80"
  [entryPoints.https]
    address = ":443"
[providers]
  [providers.docker]
    exposedByDefault = false
    network = "mydomain.com"
[api]
  dashboard = true
  insecure = true
[certificatesResolvers.default.acme]
  email = "info@mydomain.com" #change this line
  storage = "acme.json"
  [certificatesResolvers.default.acme.dnsChallenge]
    provider = "digitalocean"
    delayBeforeCheck = 0

N8n/docker-compose.yml:-

version: "3"
services:
n8n:
    image: n8nio/n8n
    container_name: n8n
    restart: always
    labels:
      - traefik.enable=true
      - traefik.http.routers.n8n.rule=Host(`${SUBDOMAIN}.${DOMAIN_NAME}`)
      - traefik.http.routers.n8n.tls=true
      - traefik.http.routers.n8n.entrypoints=http,https
      - traefik.http.routers.n8n.tls.certresolver=default
      - traefik.http.middlewares.n8n.headers.SSLRedirect=true
      - traefik.http.middlewares.n8n.headers.STSSeconds=315360000
      - traefik.http.middlewares.n8n.headers.browserXSSFilter=true
      - traefik.http.middlewares.n8n.headers.contentTypeNosniff=true
      - traefik.http.middlewares.n8n.headers.forceSTSHeader=true
      - traefik.http.middlewares.n8n.headers.SSLHost=${DOMAIN_NAME}
      - traefik.http.middlewares.n8n.headers.STSIncludeSubdomains=true
      - traefik.http.middlewares.n8n.headers.STSPreload=true
      - traefik.http.routers.n8n.middlewares=n8n@docker
      - traefik.http.services.n8n.loadbalancer.server.port=5678
    environment:
      - DB_TYPE=postgresdb
      - DB_POSTGRESDB_HOST=postgres
      - DB_POSTGRESDB_PORT=5432
      - DB_POSTGRESDB_DATABASE=${POSTGRES_DB}
      - DB_POSTGRESDB_USER=${POSTGRES_NON_ROOT_USER}
      - DB_POSTGRESDB_PASSWORD=${POSTGRES_NON_ROOT_PASSWORD}
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_BASIC_AUTH_USER
      - N8N_BASIC_AUTH_PASSWORD
      - N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - NODE_ENV=production
      - N8N_EMAIL_MODE
      - N8N_SMTP_HOST
      - N8N_SMTP_PORT
      - N8N_SMTP_USER
      - N8N_SMTP_PASS
      - N8N_SMTP_SENDER
      - WEBHOOK_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/
      - GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
    links:
      - postgres
    networks:
      - mydomain.com
      - default
    volumes:
      - ${DATA_FOLDER}/.n8n:/home/node/.n8n
      - ./n8n-local-files:/files
    depends_on:
      postgres:
        condition: service_healthy

volumes:
  n8n_db_storage:

networks:
  mydomain.com:
    external: true

Baserow/docker-compose.yml:-

version: "3"
services:
  baserow:
    image: baserow/baserow:1.14.0
    container_name: baserow
    labels:
        # Explicitly tell Traefik to expose this container
        - "traefik.enable=true"
        # The domain the service will respond to
        - traefik.http.middlewares.baserow-websecure-redirect.redirectscheme.scheme=https 
        - traefik.http.routers.baserow-secure.entrypoints=https 
        - traefik.http.routers.baserow-secure.rule=Host(`baserow.mydomain.com`) 
        - traefik.http.routers.baserow-secure.service=baserow
        - traefik.http.routers.baserow-secure.tls=true 
        - traefik.http.routers.baserow-secure.tls.certresolver=default 
        - traefik.http.routers.baserow.entrypoints=http 
        - traefik.http.routers.baserow.middlewares=baserow-websecure-redirect@docker
        - traefik.http.routers.baserow.rule=Host(`baserow.mydomain.com`) 
        - traefik.http.services.baserow.loadbalancer.server.port=80
    environment:
      - BASEROW_PUBLIC_URL=https://baserow.t99ltd.foundation
    volumes:
      - baserow_data:/baserow/data
    networks:
      - mydomain.com
      - default
volumes:
  baserow_data:
networks:
  mydomain.com:
    external: true

I can access to n8n application using https://n8n.mydomain.com and to Baserow using https://baserow.mydomain.com. However when tried to connect from n8n workflow to a Baserow node using following URL and Credentials the Baserow rows were not loaded API URL : https://baserow.mydomain.com UserName: baserow Password: password. On the other hand I can fetch the API successfully using Postman or any RESTclient. TIA

kissu
  • 40,416
  • 14
  • 65
  • 133
Mrsk
  • 129
  • 5
  • 13

0 Answers0