8000 Can self-hosting Kan works without S3 bucket? · Issue #77 · kanbn/kan · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Can self-hosting Kan works without S3 bucket? #77
Open
@Albirew

Description

@Albirew

What happened
When trying to setup a self-hosted, internal, Kan container, I stumble on this error:
Invalid environment variables: { NEXT_PUBLIC_STORAGE_URL: [ 'Invalid url' ] }

  • let it unset (since it should NOT be mandatory according to this table pops the error
  • setting it with the same address as NEXT_PUBLIC_BASE_URL makes container works, but i cannot send files

Additional context

  • content of .env
POSTGRES_URL=postgres://kan_user:kan_pass@kan_db:5432/kan_database

EMAIL_FROM="Kan <genghis@kan.tld>"
SMTP_HOST=smtp.kan.tld
SMTP_PORT=587
SMTP_USER=**removed**
SMTP_PASSWORD=**removed**

NEXT_PUBLIC_KAN_ENV=production
NEXT_PUBLIC_BASE_URL=http://192.168.10.252:3002/
NEXT_PUBLIC_ALLOW_CREDENTIALS=true
NEXT_PUBLIC_DISABLE_SIGN_UP=false

NEXT_PUBLIC_STORAGE_URL=http://192.168.10.252:3002/
NEXT_PUBLIC_AVATAR_BUCKET_NAME=
NEXT_PUBLIC_STORAGE_DOMAIN=

BETTER_AUTH_SECRET=**removed**
BETTER_AUTH_TRUSTED_ORIGINS=http://192.168.10.252:3002/,http://localhost:3000,http://localhost:3002

TRELLO_APP_API_KEY=
TRELLO_APP_SECRET=
  • content of docker-compose.yml
services:
  kan_db:
    image: postgres:15
    container_name: kan_db
    volumes:
      - ./db:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=kan_database
      - POSTGRES_USER=kan_user
      - POSTGRES_PASSWORD=kan_pass

  kan_app:
    image: ghcr.io/kanbn/kan
    container_name: kan_app
    ports:
      - "3002:3000"
    restart: unless-stopped
    depends_on:
      - kan_db
    env_file:
      - .env
    environment:
      - POSTGRES_URL=${POSTGRES_URL}
      - EMAIL_FROM=${EMAIL_FROM}
      - SMTP_HOST=${SMTP_HOST}
      - SMTP_PORT=${SMTP_PORT}
      - SMTP_USER=${SMTP_USER}
      - SMTP_PASSWORD=${SMTP_PASSWORD}
      - NEXT_PUBLIC_KAN_ENV=${NEXT_PUBLIC_KAN_ENV}
      - NEXT_PUBLIC_BASE_URL=${NEXT_PUBLIC_BASE_URL}
      - NEXT_PUBLIC_ALLOW_CREDENTIALS=${NEXT_PUBLIC_ALLOW_CREDENTIALS}
      - NEXT_PUBLIC_DISABLE_SIGN_UP=${NEXT_PUBLIC_DISABLE_SIGN_UP}
      - NEXT_PUBLIC_STORAGE_URL=${NEXT_PUBLIC_STORAGE_URL}
      - NEXT_PUBLIC_AVATAR_BUCKET_NAME=${NEXT_PUBLIC_AVATAR_BUCKET_NAME}
      - NEXT_PUBLIC_STORAGE_DOMAIN=${NEXT_PUBLIC_STORAGE_DOMAIN}
      - BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET}
      - BETTER_AUTH_TRUSTED_ORIGINS=${BETTER_AUTH_TRUSTED_ORIGINS}
      - TRELLO_APP_API_KEY=${TRELLO_APP_API_KEY}
      - TRELLO_APP_SECRET=${TRELLO_APP_SECRET}
  • Looping log when no NEXT_PUBLIC_STORAGE_URL specified:
> kan@ db:migrate /app
> cd packages/db && pnpm migrate
> @kan/db@0.1.0 migrate /app/packages/db
> pnpm with-env drizzle-kit migrate
> @kan/db@0.1.0 with-env /app/packages/db
> dotenv -e ../../.env -- "drizzle-kit" "migrate"
No config path provided, using default 'drizzle.config.ts'
Reading config file '/app/packages/db/drizzle.config.ts'
Using 'pg' driver for database querying
[⣷] applying migrations...[✓] migrations applied successfully!
> @kan/web@0.1.0 start /app/apps/web
> pnpm with-env next start
> @kan/web@0.1.0 with-env /app/apps/web
> dotenv -e ../../.env -- "next" "start"
  ▲ Next.js 14.2.20
  - Local:        http://localhost:3000
 ✓ Starting...
❌ Invalid environment variables: { NEXT_PUBLIC_STORAGE_URL: [ 'Invalid url' ] }
 ⨯ Failed to load next.config.js, see more info here https://nextjs.org/docs/messages/next-config-error
Error: Invalid environment variables
    at onValidationError (/app/node_modules/@t3-oss/env-core/dist/index.js:29:11)
    at createEnv (/app/node_modules/@t3-oss/env-core/dist/index.js:35:12)
    at createEnv (/app/node_modules/@t3-oss/env-nextjs/dist/index.js:12:33)
    at /app/apps/web/src/env.ts:5:52
    at evalModule (/app/node_modules/jiti/dist/jiti.js:1:247313)
    at jiti (/app/node_modules/jiti/dist/jiti.js:1:245241)
    at file:///app/apps/web/next.config.js:7:43
    at ModuleJob.run (node:internal/modules/esm/module_job:263:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:540:24)
    at async loadConfig (/app/node_modules/next/dist/server/config.js:711:36)
 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed with exit code 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0