Update Postgres version and SimpleLogin mail env
Bump PostgreSQL target from 16 to 17 in discourse-install.sh and make pg_hba.conf lookup dynamic (uses find) instead of a hardcoded path, ensuring compatibility with systems where the data directory path differs. Also add EMAIL_SERVERS_WITH_PRIORITY and POSTFIX_SERVER entries to the SimpleLogin .env to configure local mail delivery (set to localhost).
This commit is contained in:
@@ -29,13 +29,13 @@ $STD apt install -y \
|
|||||||
redis-server
|
redis-server
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
PG_VERSION="16" PG_MODULES="pgvector" setup_postgresql
|
PG_VERSION="17" PG_MODULES="pgvector" setup_postgresql
|
||||||
NODE_VERSION="22" setup_nodejs
|
NODE_VERSION="22" setup_nodejs
|
||||||
RUBY_VERSION="3.4.4" setup_ruby
|
RUBY_VERSION="3.4.4" setup_ruby
|
||||||
|
|
||||||
msg_info "Configuring PostgreSQL for Discourse"
|
msg_info "Configuring PostgreSQL for Discourse"
|
||||||
DISCOURSE_DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
|
DISCOURSE_DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
|
||||||
PG_HBA="/etc/postgresql/16/main/pg_hba.conf"
|
PG_HBA=$(find /etc/postgresql -name pg_hba.conf 2>/dev/null | head -n1)
|
||||||
sed -i 's/^local\s\+all\s\+all\s\+peer$/local all all md5/' "$PG_HBA"
|
sed -i 's/^local\s\+all\s\+all\s\+peer$/local all all md5/' "$PG_HBA"
|
||||||
$STD systemctl restart postgresql
|
$STD systemctl restart postgresql
|
||||||
PG_DB_NAME="discourse" PG_DB_USER="discourse" PG_DB_PASS="$DISCOURSE_DB_PASS" setup_postgresql_db
|
PG_DB_NAME="discourse" PG_DB_USER="discourse" PG_DB_PASS="$DISCOURSE_DB_PASS" setup_postgresql_db
|
||||||
|
|||||||
@@ -76,6 +76,8 @@ cat <<EOF >/opt/simplelogin/.env
|
|||||||
URL=http://${LOCAL_IP}
|
URL=http://${LOCAL_IP}
|
||||||
EMAIL_DOMAIN=example.com
|
EMAIL_DOMAIN=example.com
|
||||||
SUPPORT_EMAIL=support@example.com
|
SUPPORT_EMAIL=support@example.com
|
||||||
|
EMAIL_SERVERS_WITH_PRIORITY=[(10, "localhost.")]
|
||||||
|
POSTFIX_SERVER=localhost
|
||||||
DB_URI=postgresql://${PG_DB_USER}:${PG_DB_PASS}@localhost/${PG_DB_NAME}
|
DB_URI=postgresql://${PG_DB_USER}:${PG_DB_PASS}@localhost/${PG_DB_NAME}
|
||||||
FLASK_SECRET=${FLASK_SECRET}
|
FLASK_SECRET=${FLASK_SECRET}
|
||||||
DKIM_PRIVATE_KEY_PATH=/opt/simplelogin/dkim/dkim.private
|
DKIM_PRIVATE_KEY_PATH=/opt/simplelogin/dkim/dkim.private
|
||||||
|
|||||||
Reference in New Issue
Block a user