Traefik with noncustom app

hey,
so i ahve treafik runing as a custom app trefik config below !!!

networks:
frontend:
external: True
services:
traefik:
container_name: traefik-rp
environment:
- CF_DNS_API_TOKEN=‘CF_DNS_API_TOKEN’
image: traefik:latest
networks:
- frontend
ports:
- ‘80:80’
- ‘443:443’
- ‘8080:8080’
restart: unless-stopped
volumes:
- /run/docker.sock:/run/docker.sock:ro
- ./config/traefik.yaml:/etc/traefik/traefik.yaml:ro
- ./config/conf.d/:/etc/traefik/conf.d/:ro
- ./data/certs/:/var/traefik/certs/:rw
i have my truenas dashbored running on difrent ports so i can use 443 and 80 i ahve the dashbored enabled just for testing im uisng nxing as a terst applaction and using a custome app with this config works

networks:
frontend:
external: True
services:
nginx:
container_name: nginx-ass
image: nginx:latest
labels:
- traefik.enable=true
- traefik.http.routers.nginx.rule=Host(nginx.example.com)
- traefik.http.routers.nginx.tls.certresolver=cloudflare
- traefik.http.routers.nginx.entrypoints=websecure
- traefik.http.routers.nginx.tls=true
networks:
- frontend
restart: unless-stopped

now this config works great the issues is when i want to pass lables though truenas apps i get the apps to show up in treafik but it wont rout to them

anyone know how i can pass though

networks:
frontend:
external: True
to truenas apps
down below is my treafik config


global:
checkNewVersion: false
sendAnonymousUsage: false
api:
dashboard: true
disableDashboardAd: true
insecure: true
entryPoints:
web:
address: :80
http:
redirections:
entryPoint:
to: websecure
scheme: https
websecure:
address: :443
certificatesResolvers:
cloudflare:
acme:
email: ‘example@example.com’
storage: /var/traefik/certs/cloudflare-acme.json
caServer: ‘https://acme-v02.api.letsencrypt.org/directory
keyType: EC256
dnsChallenge:
resolvers:
- “1.1.1.1:53”
- “8.8.8.8:53”
providers:
docker:
endpoint: “unix:///var/run/docker.sock”
exposedByDefault: false
file:
directory: /etc/traefik
watch: true

You can’t pass arbitrary docker-compose parameters to TrueNAS (non-custom) apps. To do this, you just need to make custom apps with your own YaML file and skip the built-in TrueNAS ones. You can also use Dockge or Portainer, as many users do, to manage your apps, so you build them all from custom docker-compose YaML files, but personally it seems easy enough to just do it with TN’s custom YaML feature.

1 Like

I just thought it would be nice to have one ui to rule em all I changed the truenas app config and got it working but when I updated the app it broke my config I’ma look into making own charts if that’s even possible or and not a nightmare I’ve got the free time

Yes, it is possible to modify the app config in TN (I’m guessing you edited the metadata.yml file? I did this to add icons to my custom apps), but as you found out, it’s not persistent and will be lost when you update the app. You could just write a shell script to do the edit automatically, and run that manually any time you do an update. You could also edit the TN code directly (the code that controls the app config), and submit a patch; hopefully it’ll be accepted. The code is at GitHub - truenas/apps

Please use code blocks when sharing code blocks… YAML is fairly useless without proper formatting…

Example Below

networks:
  frontend:
    external: True

services:
  nginx:
    container_name: nginx-ass
    image: nginx:latest
    labels:
      - traefik.enable=true
      - traefik.http.routers.nginx.rule=Host(nginx.example.com)
      - traefik.http.routers.nginx.tls.certresolver=cloudflare
      - traefik.http.routers.nginx.entrypoints=websecure
      - traefik.http.routers.nginx.tls=true
    networks:
      - frontend
    restart: unless-stopped

iX official apps have docker label support since a couple of months. You should be able to add traefik labels to an iX app and it should work.

i haven’t visted this in a while last i remember i did a bunch of network diagnose and found that default truenas apps were unreachable to treafik even if deployed via yml maybe ill give it another go