linuxserver / Heimdall

An Application dashboard and launcher
MIT License
7.71k stars 535 forks source link

Ingress and heimdall https error #315

Closed sylflo closed 5 years ago

sylflo commented 5 years ago

I'm struggling to set Ingress and Heimdall together, I have differents software which are currently running with no problem in HTTPS (Seafile, plex, Sonarr, deluge ...)

But I can't make it happen with Heimdall, I think the problen is related to the fact the URL are hardcoded. I have this error

Mixed Content: The page at 'https://heimdall.daydreamnation.fr/' was loaded over HTTPS, but requested an insecure stylesheet 'http://heimdall.daydreamnation.fr/css/app.css'. This request has been blocked; the content must be served over HTTPS.

I saw this issue https://github.com/linuxserver/Heimdall/issues/268.

So I suppose because of the error I have in the console it means the redirect does not happen correctly but when I go to http://heimdall.daydreamnation.fr/css/app.css it redirects me correctly to the HTTPS.

My ingress config file is like this

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/tls-acme: "true"
    certmanager.k8s.io/cluster-issuer: {{ .Values.clusterissuer }}
  creationTimestamp: null
  labels:
    io.kompose.service: heimdall
  name: heimdall
spec:
  rules:
  - host: heimdall.{{ .Values.domain_name }}
    http:
      paths:
      - backend:
          serviceName: heimdall
          servicePort: 80
  tls:
  - hosts:
    - heimdall.{{ .Values.domain_name }}
    secretName: heimdall-crt
status:
  loadBalancer: {}
onelesd commented 5 years ago

I just ran into this, and adding FORCE_HTTPS=true to the www/.env file caused the http:// asset links to switch to https://.

KodeStar commented 5 years ago

I mean.. the answers all seem to be in the issue you referenced.. have you tried any of them?

sylflo commented 5 years ago

I tried to set the variable when creating the pod I also tried to set it in the /var/www/.env file with no success so far

cat /var/www/.env
FORCE_HTTPS=true
aptalca commented 5 years ago

@sylflo I believe you need to edit the existing .env, not create a new one

sylflo commented 5 years ago

I had to modify this file

cat /var/www/localhost/heimdall/.env
APP_NAME=Heimdall
APP_ENV=local
APP_KEY=base64:OWLS1X37mtCijOPjlNRTo2IUkIunCumTQmCFM8MbJpI=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost

DB_CONNECTION=sqlite
DB_DATABASE=app.sqlite

BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
SESSION_LIFETIME=120
QUEUE_DRIVER=database

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

FORCE_HTTPS=true

I read the documentation too fast I thought I was suppose to modify the .env file related to the reverse proxy. Sorry to have bother you thanks for you help

KodeStar commented 5 years ago

@sylflo not a problem, glad you got it sorted, I'll try and make the readme a bit more clear, or feel free to suggest a PR if you can think of a better way of wording it. Also /var/www/localhost/heimdall/.env is a symlink in the docker, it should also be available on your local file system in the /config/ dir without having to exec into the docker.