Skip to content

Conversation

@amrit3701
Copy link
Member

This PR includes a complete step-by-step guide to installing LENS on TrueNAS Scale using a custom app installation via YAML.

For more details, check the documentation: docs/lens-truenas-app.md

Note

I have already created a PR Added LENS App to community train catalog #3739 to add the LENS app to the Community Train catalog of TrueNAS Scale.

Screenshots

image image image

@sliptonic
Copy link
Member

I followed instructions and got it to install and start. The main page shows up.
Trying to log in or register just hangs though. Nothing in frontend or backend logs.

Using 3000 for the default port is kind asking for trouble. That port, (and 5000) is widely used by a lot of development platforms and developers tend to use it (alot) so if the user has any more than one or two containers already running there's a very high likelihood of collision.
I'd pick a less likely default like 30097 or something. It won't entirely avoid the collision issue but will make it less likely.

@amrit3701
Copy link
Member Author

I followed instructions and got it to install and start. The main page shows up. Trying to log in or register just hangs though. Nothing in frontend or backend logs.

@sliptonic Could you send me your updated YAML file? I need to verify whether the IP and storage paths are populated correctly.

@sliptonic
Copy link
Member

I followed instructions and got it to install and start. The main page shows up. Trying to log in or register just hangs though. Nothing in frontend or backend logs.

@sliptonic Could you send me your updated YAML file? I need to verify whether the IP and storage paths are populated correctly.


services:
  backend:
    container_name: lens-backend
    depends_on:
      lens-init:
        condition: service_completed_successfully
      mongodb:
        condition: service_healthy
    environment:
      - HOSTNAME=192.168.1.30
      - PORT=3030
      - DB_URL=mongodb://mongodb:27017/backend-db
      - FRONTEND_URL=http://192.168.1.30:30097
      - >-
        FC_WORKER_URL=http://0.0.0.0:8080/2015-03-31/functions/function/invocations
      - SMTP_HOST=smtp.gmail.com
      - SMTP_PORT=465
      - [email protected]
      - SMTP_PASS=<REDACTED>
      - [email protected]
      - [email protected]
      - DEFAULT_ADMIN_USERNAME=admin
      - DEFAULT_ADMIN_PASSWORD=<REDACTED>
      - DEFAULT_ADMIN_NAME=Admin
      - LOCAL_SIGNED_URL_SECRET=
    healthcheck:
      interval: 30s
      retries: 5
      start_period: 15s
      test:
        - CMD
        - wget
        - '--quiet'
        - '--spider'
        - http://127.0.0.1:3030/
      timeout: 5s
    image: amrit3701/lens:backend-latest
    ports:
      - '3030:3030'
    restart: unless-stopped
    user: '0:0'
    volumes:
      - /mnt/Primus/configs/ondsel/media:/app/uploads
  fc-worker-api:
    container_name: lens-fc-worker-api
    depends_on:
      backend:
        condition: service_healthy
      fc-worker-redis:
        condition: service_healthy
    environment:
      - REDIS_HOST=fc-worker-redis
      - REDIS_PORT=6379
    healthcheck:
      interval: 30s
      retries: 5
      start_period: 15s
      test:
        - CMD-SHELL
        - echo OK
      timeout: 5s
    image: amrit3701/lens:fc-worker-api-latest
    network_mode: service:backend
    restart: unless-stopped
    user: '0:0'
  fc-worker-celery:
    container_name: lens-fc-worker-celery
    depends_on:
      backend:
        condition: service_healthy
      fc-worker-redis:
        condition: service_healthy
    environment:
      - REDIS_HOST=fc-worker-redis
      - REDIS_PORT=6379
      - BACKEND_URL=http://backend:3030
    healthcheck:
      interval: 30s
      retries: 5
      start_period: 15s
      test:
        - CMD-SHELL
        - echo OK
      timeout: 5s
    image: amrit3701/lens:fc-worker-celery-latest
    network_mode: service:backend
    restart: unless-stopped
    user: '0:0'
  fc-worker-redis:
    container_name: lens-fc-worker-redis
    healthcheck:
      interval: 30s
      retries: 5
      start_period: 15s
      test:
        - CMD
        - redis-cli
        - '-h'
        - 127.0.0.1
        - '-p'
        - '6379'
        - ping
      timeout: 5s
    image: redis:alpine
    restart: unless-stopped
    user: '0:0'
  frontend:
    cap_add:
      - CHOWN
      - SETUID
      - SETGID
    container_name: lens-frontend
    depends_on:
      backend:
        condition: service_healthy
    environment:
      - VITE_APP_API_URL=http://192.168.1.30:3030/
      - VITE_STRIPE_PURCHASE_PEER_URL=
      - PROXY_SCHEME_PREFIX=http://
    healthcheck:
      interval: 30s
      retries: 5
      start_period: 15s
      test:
        - CMD-SHELL
        - >-
          /bin/bash -c '{ printf "GET / HTTP/1.1\r\nHost:
          127.0.0.1\r\nConnection: close\r\n\r\n" >&0; grep "HTTP" | grep -q
          "200"; } 0<>/dev/tcp/127.0.0.1/80'
      timeout: 5s
    image: amrit3701/lens:frontend-latest
    ports:
      - '30097:80'
    restart: unless-stopped
    user: '0:0'
  lens-init:
    command:
      - >
        set -e

        echo "Initializing uploads directory..."

        if [ -z "$(ls -A /mnt/uploads 2>/dev/null)" ] && [ -d /app/uploads ];
        then
          echo "Copying sample files from image to volume..."
          cp -r /app/uploads/* /mnt/uploads/ 2>/dev/null || true
          echo "Sample files copied successfully"
        else
          echo "Uploads directory already contains files, skipping copy"
        fi

        echo "Uploads directory initialized"
    container_name: lens-init
    entrypoint:
      - /bin/sh
      - '-c'
    image: amrit3701/lens:backend-latest
    network_mode: none
    restart: on-failure
    user: '0:0'
    volumes:
      - /mnt/Primus/configs/ondsel/media:/app/uploads
  mongodb:
    container_name: lens-mongodb
    healthcheck:
      interval: 30s
      retries: 5
      start_period: 15s
      test:
        - CMD
        - mongosh
        - '--host'
        - 127.0.0.1
        - '--port'
        - '27017'
        - backend-db
        - '--eval'
        - db.adminCommand('ping')
        - '--quiet'
      timeout: 5s
    image: mongo:latest
    ports:
      - '27018:27017'
    restart: unless-stopped
    user: '568:568'
    volumes:
      - /mnt/Primus/configs/ondsel/data:/data/db

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants