thedevs-network / kutt

Free Modern URL Shortener.
https://kutt.it
MIT License
8.34k stars 1.07k forks source link

redirection issues #743

Open Go0ners opened 5 months ago

Go0ners commented 5 months ago

Hi,

I have a problem with Kutt/Docker. I can't figure out why when I launch the container, and put the kutt url in firefox, it instantly redirects to https://localhost.

Here is my configuration:

Docker compose :

version: "3.9"

services:
  kutt:
    image: 'kutt/kutt'
    container_name: 'kutt'
    labels:
      - 'traefik.enable=true'
      - 'traefik.http.routers.kutt.entryPoints=https'
      - 'traefik.http.routers.kutt.rule=Host('${KUTT_HOST}')'
      - 'traefik.http.routers.kutt.tls.certResolver=le'
      - 'traefik.http.services.kutt.loadBalancer.server.port=3000'
    depends_on:
      - 'kutt-postgres'
      - 'kutt-redis'
    env_file:
      - '.env'
    command: ["./wait-for-it.sh", "host:5432", "--", "npm", "start"]
    environment:
      - 'PUID=1000'
      - 'PGID=1000'
      - 'TZ=Europe/Paris'
      - 'DB_HOST=${KUTT_DB_HOST}'
      - 'DB_NAME=${KUTT_DB_NAME}'
      - 'DB_USER=${KUTT_DB_USER}'
      - 'DB_PASSWORD=${KUTT_DB_PASS}'
      - 'REDIS_HOST=${KUTT_REDIS_HOST}'
    volumes:
      - './logs:/root/.npm/_logs/'

  kutt-redis:
    container_name: 'kutt-redis'
    image: 'redis:6.0-alpine'
    volumes:
      - './redis_data:/data'

  kutt-postgres:
    container_name: 'kutt-postrgre'
    image: 'postgres:12-alpine'
    environment:
      - 'POSTGRES_DB=${KUTT_PGSQL_NAME}'
      - 'POSTGRES_USER=${KUTT_PGSQL_USER}'
      - 'POSTGRES_PASSWORD=${KUTT_PGSQL_PASS}'
    volumes:
      - './postgres_data:/var/lib/postgresql/data'

.env file :

`# App port to run on
PORT='3000'

# The name of the site where Kutt is hosted
SITE_NAME='name'

# The domain that this website is on
DEFAULT_DOMAIN='url.url.tld'

# Generated link length
LINK_LENGTH='6'

# Postgres database credential details
DB_HOST='host'
DB_PORT='5432'
DB_NAME='name'
DB_USER='user'
DB_PASSWORD='pwd'
DB_SSL='false'

# Redis host and port
REDIS_HOST='host'
REDIS_PORT='6379'
REDIS_PASSWORD=''
REDIS_DB='kutt'

# Disable registration
DISALLOW_REGISTRATION='false'

# Disable anonymous link creation
DISALLOW_ANONYMOUS_LINKS='false'

# The daily limit for each user
USER_LIMIT_PER_DAY='50'

# Create a cooldown for non-logged in users in minutes
# Set 0 to disable
NON_USER_COOLDOWN='0'

# Max number of visits for each link to have detailed stats
DEFAULT_MAX_STATS_PER_LINK='5000'

# Use HTTPS for links with custom domain
CUSTOM_DOMAIN_USE_HTTPS='false'

# A passphrase to encrypt JWT. Use a long and secure key.
JWT_SECRET='jwt'

# Admin emails so they can access admin actions on settings page
# Comma seperated
ADMIN_EMAILS='mail'

# Invisible reCaptcha secret key
# Create one in https://www.google.com/recaptcha/intro/
RECAPTCHA_SITE_KEY='key'
RECAPTCHA_SECRET_KEY='secret-'

# Your email host details to use to send verification emails.
# More info on http://nodemailer.com/
# Mail from example "Kutt <support@kutt.it>". Leave empty to use MAIL_USER
MAIL_HOST='smtp'
MAIL_PORT='port'
MAIL_SECURE='true'
MAIL_USER='mail'
MAIL_FROM='URL <name>'
MAIL_PASSWORD='pwd'

# The email address that will receive submitted reports.
REPORT_EMAIL='mail'

# Support email to show on the app
CONTACT_EMAIL='mail'`

logs :


kutt  | wait-for-it.sh: host:5432 is available after 0 seconds
kutt  |
kutt  | > kutt@2.7.4 start /usr/src/app
kutt  | > npm run migrate && cross-env NODE_ENV=production node production-server/server.js
kutt  |
kutt  |
kutt  | > kutt@2.7.4 migrate /usr/src/app
kutt  | > knex migrate:latest --env production
kutt  |
kutt  | Requiring external module ts-node/register
kutt  | Using environment: production
kutt  | Already up to date
kutt  | > Ready on http://localhost:3000```
kengher commented 5 months ago

have you by chance set up proxy pass on your server?

semaf commented 4 months ago

Seems that the guys do not care about the issues.