@peter
Hope you haven’t given up on me. Figured out how to get into the logs and found this
corteza-db-1 |
corteza-db-1 | PostgreSQL Database directory appears to contain a database; Skipping initialization
corteza-db-1 |
corteza-db-1 | 2023-10-22 12:49:38.771 UTC [1] LOG: starting PostgreSQL 15.4 (Debian 15.4-2.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
corteza-db-1 | 2023-10-22 12:49:38.771 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
corteza-db-1 | 2023-10-22 12:49:38.771 UTC [1] LOG: listening on IPv6 address "::", port 5432
corteza-db-1 | 2023-10-22 12:49:38.774 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
corteza-db-1 | 2023-10-22 12:49:38.780 UTC [29] LOG: database system was shut down at 2023-10-22 12:31:41 UTC
corteza-db-1 | 2023-10-22 12:49:38.790 UTC [1] LOG: database system is ready to accept connections
corteza-server-1 | {"level":"warn","ts":1697978980.2520418,"msg":"no SMTP servers found, email sending will be disabled"}
corteza-server-1 | {"level":"warn","ts":1697978980.270505,"logger":"http.apigw","msg":"profiler enabled only for routes with a profiler prefilter, use global setting to enable for all (APIGW_PROFILER_GLOBAL)"}
corteza-server-1 | {"level":"warn","ts":1697978980.2706485,"logger":"http.apigw","msg":"profiler enabled only for routes with a profiler prefilter, use global setting to enable for all (APIGW_PROFILER_GLOBAL)"}
corteza-server-1 | {"level":"warn","ts":1697978980.271572,"logger":"http.apigw","msg":"profiler enabled only for routes with a profiler prefilter, use global setting to enable for all (APIGW_PROFILER_GLOBAL)"}
corteza-db-1 | 2023-10-22 12:54:38.881 UTC [27] LOG: checkpoint starting: time
corteza-db-1 | 2023-10-22 12:54:51.032 UTC [27] LOG: checkpoint complete: wrote 124 buffers (0.8%); 0 WAL file(s) added, 0 removed, 0 recycled; write=12.141 s, sync=0.004 s, total=12.152 s; sync files=34, longest=0.001 s, average=0.001 s; distance=795 kB, estimate=795 kB
So my logs aren’t showing any errors (I don’t have the SMTP stuff set up yet - want to get a solid base config before I fiddle with details).
Here’s my .env file:
########################################################################################################################
# docker-compose supports environment variable interpolation/substitution in compose configuration file
# (more info: https://docs.docker.com/compose/environment-variables)
########################################################################################################################
# General settings
DOMAIN=corteza.techthrasher.com
VERSION=2023.3
########################################################################################################################
# Database connection
DB_DSN=postgres://corteza:corteza@db:5432/corteza?sslmode=disable
########################################################################################################################
# Server settings
# Serve Corteza webapps alongside API
HTTP_WEBAPP_ENABLED=true
# Send action log to container logs as well
# ACTIONLOG_DEBUG=true
# Uncomment for extra debug info if something goes wrong
# LOG_LEVEL=debug
# Use nicer and colorful log instead of JSON
# LOG_DEBUG=true
########################################################################################################################
# Authentication
# Secret to use for JWT token
# Make sure you change it (>30 random characters) if
# you expose your deployment to outside traffic
# AUTH_JWT_SECRET=this-is-only-for-demo-purpose--make-sure-you-change-it-for-production
########################################################################################################################
# SMTP (mail sending) settings
# Point this to your local or external SMTP server if you want to send emails.
# In most cases, Corteza can detect that SMTP is disabled and skips over sending emails without an error
#SMTP_HOST=smtp-server.example.tld:587
#SMTP_USER=postmaster@smtp-server.example.tld
#SMTP_PASS=this-is-your-smtp-password
#SMTP_FROM='"Demo" <info@your-demo.example.tld>'
And here’s my docker-compose.yaml. I set up a defined IP address so my redirect could always find it:
GNU nano 5.4 docker-compose.yaml
version: '3.5'
services:
server:
image: cortezaproject/corteza:${VERSION}
networks:
proxy:
ipv4_address: 172.18.0.2
internal:
restart: always
env_file: [ .env ]
depends_on: [ db ]
volumes: [ "./data/server:/data" ]
environment:
# VIRTUAL_HOST helps NginX proxy route traffic for specific virtual host to
# this container
# This value is also picked up by initial boot auto-configuration procedure
# If this is changed, make sure you change settings accordingly
VIRTUAL_HOST: ${DOMAIN}
# This is needed only if you are using NginX Lets-Encrypt companion
# (see docs.cortezaproject.org for details)
LETSENCRYPT_HOST: ${DOMAIN}
db:
# PostgreSQL Database
# See https://hub.docker.com/_/postgres for details
# Support for postgres 13, 14 and 15 is available in the latest version of Corteza
image: postgres:15
networks:
internal:
restart: always
healthcheck: { test: ["CMD-SHELL", "pg_isready -U corteza"], interval: 10s, timeout: 5s, retries: 5 }
environment:
# Warning: these are values that are only used on 1st start
# if you want to change it later, you need to do that
# manually inside db container
POSTGRES_USER: corteza
POSTGRES_PASSWORD: my-db-password
networks:
internal:
name: corteza-net
proxy:
name: proxy
ipam:
driver: default
config:
- subnet: 172.18.0.0/24
gateway: 172.18.0.1
Finally - here’s what my web browser shows:
In the URL of the web browser, it has this:
https://corteza.techthrasher.com/auth/oauth2/authorize?client_id=360288286020730883&redirect_uri=https%3A%2F%2Fcorteza.techthrasher.com%2Fauth%2Fcallback&response_mode=query&response_type=code&scope=profile+api&state=iz1ff011tv
My guess is there’s something going on with redirect URLs, etc., and the auth can’t get what it needs. I’m running Yunohost, which has NGINX. Could this be an issue with the NGINX?
Here’s my NGINX config:
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
listen [::]:80;
server_name corteza.techthrasher.com;
access_by_lua_file /usr/share/ssowat/access.lua;
include /etc/nginx/conf.d/acme-challenge.conf.inc;
location ^~ '/.well-known/ynh-diagnosis/' {
alias /var/www/.well-known/ynh-diagnosis/;
}
location / {
return 301 https://$host$request_uri;
}
include /etc/nginx/conf.d/yunohost_http_errors.conf.inc;
access_log /var/log/nginx/corteza.techthrasher.com-access.log;
error_log /var/log/nginx/corteza.techthrasher.com-error.log;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name corteza.techthrasher.com;
include /etc/nginx/conf.d/security.conf.inc;
ssl_certificate /etc/yunohost/certs/corteza.techthrasher.com/crt.pem;
ssl_certificate_key /etc/yunohost/certs/corteza.techthrasher.com/key.pem;
more_set_headers "Strict-Transport-Security : max-age=63072000; includeSubDomains; preload";
# OCSP settings
ssl_stapling on;
ssl_stapling_verify on;
ssl_trusted_certificate /etc/yunohost/certs/corteza.techthrasher.com/crt.pem;
resolver 1.1.1.1 9.9.9.9 valid=300s;
resolver_timeout 5s;
access_by_lua_file /usr/share/ssowat/access.lua;
include /etc/nginx/conf.d/corteza.techthrasher.com.d/*.conf;
include /etc/nginx/conf.d/yunohost_sso.conf.inc;
include /etc/nginx/conf.d/yunohost_admin.conf.inc;
include /etc/nginx/conf.d/yunohost_api.conf.inc;
include /etc/nginx/conf.d/yunohost_http_errors.conf.inc;
access_log /var/log/nginx/corteza.techthrasher.com-access.log;
error_log /var/log/nginx/corteza.techthrasher.com-error.log;
}
Here’s the error from the NGINX log
2023/10/22 12:24:07 [error] 160088#160088: *3340 connect() failed (111: Connection refused) while connecting to upstream, client: 76.21.207.80, server: corteza.techthrasher.com, request: "GET / HTTP/2.0", upstream: "http://127.0.0.1:12000/", host: "corteza.techthrasher.com"
I would really appreciate any help you can give.
Thanks,
Phil