2020-12-19 19:22:22 +01:00
|
|
|
#!/bin/bash
|
2020-09-26 16:19:37 +02:00
|
|
|
# Version majeure de Debian (..., 9, 10)
|
|
|
|
debian_version=$(cat /etc/debian_version)
|
|
|
|
debian_version=${debian_version%%.*}
|
|
|
|
|
2021-01-23 17:42:14 +01:00
|
|
|
die() {
|
2024-08-24 14:39:02 +02:00
|
|
|
echo
|
2021-01-23 17:42:14 +01:00
|
|
|
echo "Erreur: $1"
|
|
|
|
echo
|
|
|
|
exit 1
|
|
|
|
}
|
2020-09-26 16:19:37 +02:00
|
|
|
|
|
|
|
# Fix path
|
|
|
|
export PATH="${PATH}":/usr/sbin:/sbin
|
|
|
|
|
|
|
|
# ScoDoc: environment variables
|
|
|
|
umask 0022
|
|
|
|
|
2021-07-25 09:51:09 +02:00
|
|
|
export SCODOC_DIR=/opt/scodoc
|
2024-08-24 14:39:02 +02:00
|
|
|
export SCODOC_VAR_DIR=/opt/scodoc-data
|
|
|
|
export SCODOC_INSTALL_STATUS_FILE="${SCODOC_VAR_DIR}/.install_status"
|
2020-09-26 16:19:37 +02:00
|
|
|
export SCODOC_VERSION_DIR="${SCODOC_VAR_DIR}/config/version"
|
|
|
|
export SCODOC_LOGOS_DIR="${SCODOC_VAR_DIR}/config/logos"
|
|
|
|
|
2021-08-27 10:41:22 +02:00
|
|
|
export FLASK_APP=scodoc.py
|
|
|
|
|
2021-08-14 18:54:32 +02:00
|
|
|
# Unix user running ScoDoc server:
|
2021-07-21 22:32:30 +02:00
|
|
|
export SCODOC_USER=scodoc
|
|
|
|
export SCODOC_GROUP=root
|
|
|
|
|
|
|
|
# Postgresql normal user: (same as unix user)
|
2020-09-26 16:19:37 +02:00
|
|
|
# IMPORTANT: must match SCO_DEFAULT_SQL_USER defined in sco_utils.py
|
2021-07-21 22:32:30 +02:00
|
|
|
export POSTGRES_USER="$SCODOC_USER"
|
|
|
|
# Postgresql superuser:
|
|
|
|
export POSTGRES_SUPERUSER=postgres
|
2020-09-26 16:19:37 +02:00
|
|
|
|
2021-08-15 16:43:53 +02:00
|
|
|
export SCODOC_DB_PROD="SCODOC"
|
|
|
|
export SCODOC_DB_DEV="SCODOC_DEV"
|
|
|
|
export SCODOC_DB_TEST="SCODOC_TEST"
|
|
|
|
|
2021-07-23 13:45:56 +02:00
|
|
|
|
2020-09-26 16:19:37 +02:00
|
|
|
# psql command: if various versions installed, force the one we want:
|
2023-07-11 09:56:25 +02:00
|
|
|
if [ "${debian_version}" = "12" ]
|
2020-09-26 16:19:37 +02:00
|
|
|
then
|
2023-07-11 09:56:25 +02:00
|
|
|
PSQL=/usr/lib/postgresql/15/bin/psql
|
|
|
|
#export POSTGRES_SERVICE="postgresql@11-main.service"
|
2021-07-21 22:32:30 +02:00
|
|
|
else
|
2023-08-22 23:42:32 +02:00
|
|
|
die "unsupported Debian version (${debian_version}, expected 12)"
|
2020-09-26 16:19:37 +02:00
|
|
|
fi
|
2020-12-19 19:22:22 +01:00
|
|
|
export PSQL
|
2020-09-26 16:19:37 +02:00
|
|
|
|
2024-08-24 14:39:02 +02:00
|
|
|
# tcp port for SQL server
|
2020-09-26 16:19:37 +02:00
|
|
|
# Important note: if changed, you should probably also change it in
|
|
|
|
# sco_utils.py (SCO_DEFAULT_SQL_PORT).
|
|
|
|
export POSTGRES_PORT=5432
|
2021-07-23 09:32:20 +02:00
|
|
|
|
|
|
|
# ---
|
2021-07-25 11:19:01 +02:00
|
|
|
#echo "SCODOC_USER=$SCODOC_USER"
|
|
|
|
#echo "SCODOC_DIR=$SCODOC_DIR"
|
|
|
|
#echo "SCODOC_VAR_DIR=$SCODOC_VAR_DIR"
|