Die Ziel-URL ist https://discourse.example.com:9443.
Wir verwenden einen Reverse-Proxy (nginx) auf einem anderen Server mit dieser Konfiguration:
Спойлер
server {
listen 9443 ssl;
listen [::]:9443 ssl;
client_max_body_size 500m;
server_name discourse.example.com;
ssl_certificate /etc/ssl/certs/example.com.pem;
ssl_certificate_key /etc/ssl/private/example.com.key;
location / {
proxy_pass http://10.250.26.133:3080/;
proxy_set_header Host $host;
proxy_set_header X-Real_IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Und diese containers/app.yml:
Спойлер
templates:
- "templates/postgres.template.yml"
- "templates/redis.template.yml"
- "templates/web.template.yml"
- "templates/web.ratelimited.template.yml"
# - "templates/web.ssl.template.yml"
# - "templates/web.letsencrypt.ssl.template.yml"
expose:
- "3080:80" # http
- "443:443" # https
params:
db_default_text_search_config: "pg_catalog.english"
db_shared_buffers: "2048MB"
env:
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
LANGUAGE: en_US.UTF-8
# DISCOURSE_DEFAULT_LOCALE: en
UNICORN_WORKERS: 8
DISCOURSE_HOSTNAME: discourse.example.com
DISCOURSE_PORT: 9443 # <- das funktioniert nicht
#DOCKER_USE_HOSTNAME: true
DISCOURSE_DEVELOPER_EMAILS: 'admin@example.com'
DISCOURSE_SMTP_ADDRESS: smtp.example.com
DISCOURSE_SMTP_PORT: 587
DISCOURSE_SMTP_USER_NAME: example-username
DISCOURSE_SMTP_PASSWORD: "p@ssw0rd"
DISCOURSE_SMTP_AUTHENTICATION: login
DISCOURSE_SMTP_OPENSSL_VERIFY_MODE: none
DISCOURSE_SMTP_ENABLE_START_TLS: true # (optional, Standard: true)
DISCOURSE_SMTP_DOMAIN: example.com
DISCOURSE_NOTIFICATION_EMAIL: discourse@example.com
LETSENCRYPT_ACCOUNT_EMAIL: me@example.com
volumes:
- volume:
host: /var/discourse/shared/standalone
guest: /shared
- volume:
host: /var/discourse/shared/standalone/log/var-log
guest: /var/log
hooks:
after_code:
- exec:
cd: $home/plugins
cmd:
- git clone https://github.com/discourse/docker_manager.git
- git clone https://github.com/discourse/discourse-oauth2-basic.git
run:
- exec: echo "Beginning of custom commands"
- exec: echo "End of custom commands"
Ich führe ./launcher rebuild app aus.
Danach funktioniert die URL https://discourse.example.com:9443.
Aber
-
Ich konnte keinen Admin-Benutzer erstellen, da Discourse mich auf eine URL ohne Port 9443 umleitet.
Ich musste den Admin über die Konsole erstellen (./launcher enter appund dannrake admin:create). -
Ich konnte keinen anderen Benutzer registrieren, aus demselben Grund.
-
Ich konnte mich nicht mit Gitea OAuth verbinden, da Discourse eine Autorisierungs-URL mit einer falschen redirect_uri generiert (Port 9443 fehlt in der URL).
Gibt es eine Möglichkeit, DISCOURSE_PORT neben DISCOURSE_HOSTNAME anzugeben?