forked from ScoDoc/DocScoDoc
Script install et doc pour Debian 11
This commit is contained in:
parent
027237c1c6
commit
a576dd2f39
@ -75,7 +75,7 @@ Sur un système Linux Debian 11, en tant que `root`:
|
||||
cd /opt/scodoc/tools
|
||||
./install_debian11.sh
|
||||
|
||||
ce script crée un compte utilisateur "scodoc".
|
||||
ce script crée un compte utilisateur "scodoc" s'il n'existe pas déjà.
|
||||
|
||||
Note: si vous installez sur une machine déjà configurée pour ScoDoc 7, il
|
||||
est inutile de reconfigurer la messagerie et le firewall.
|
||||
@ -90,10 +90,11 @@ Pour créer la base de données, lancer le script:
|
||||
|
||||
su scodoc # au besoin (pas root !)
|
||||
cd /opt/scodoc
|
||||
./tools/create_database.sh SCODOC
|
||||
./tools/create_database.sh SCODOC_DEV # pour la base "developement"
|
||||
./tools/create_database.sh SCODOC_TEST # pour les tests unitaires
|
||||
|
||||
Les bases créées appartiennent à l'utilisateur (role) postgres `scodoc`
|
||||
Les bases créées appartiennent à l'utilisateur (rôle) postgres `scodoc`
|
||||
(qui a été créé par le script d'installation précédent).
|
||||
|
||||
### Variables d'environnement
|
||||
@ -121,9 +122,6 @@ En tant qu'utilisateur `scodoc`:
|
||||
su scodoc # si besoin
|
||||
cd /opt/scodoc
|
||||
source venv/bin/activate
|
||||
#flask db init
|
||||
#flask db migrate -m "initial database"
|
||||
#flask db upgrade
|
||||
|
||||
Puis initialisation de l'appli:
|
||||
|
||||
|
@ -38,7 +38,7 @@ $$ LANGUAGE plpgsql;
|
||||
|
||||
-- Fonction pour anonymisation:
|
||||
-- inspirée par https://www.simononsoftware.com/random-string-in-postgresql/
|
||||
CREATE FUNCTION random_text_md5( integer ) returns text
|
||||
CREATE OR REPLACE FUNCTION random_text_md5( integer ) returns text
|
||||
LANGUAGE SQL
|
||||
AS $$
|
||||
select upper( substring( (SELECT string_agg(md5(random()::TEXT), '')
|
||||
|
@ -407,7 +407,7 @@ def _check_values(context, ue_list, values):
|
||||
if code not in _UE_VALID_CODES:
|
||||
return False, "code invalide" + pu
|
||||
if code != None:
|
||||
if note is False or note is "":
|
||||
if note is False or note == "":
|
||||
return False, "note manquante" + pu
|
||||
if note != False and note != "":
|
||||
if code == None:
|
||||
|
@ -17,6 +17,10 @@
|
||||
href="{{url_for('scolar.index_html', scodoc_dept=dept.acronym)}}">Département
|
||||
{{dept.acronym}}</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li>
|
||||
<b>Aucun département défini !</b>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
|
67
requirements-3.9.txt
Executable file
67
requirements-3.9.txt
Executable file
@ -0,0 +1,67 @@
|
||||
alembic==1.6.5
|
||||
astroid==2.6.6
|
||||
attrs==21.2.0
|
||||
Babel==2.9.1
|
||||
blinker==1.4
|
||||
certifi==2021.5.30
|
||||
cffi==1.14.6
|
||||
chardet==4.0.0
|
||||
charset-normalizer==2.0.4
|
||||
click==8.0.1
|
||||
cracklib==2.9.3
|
||||
cryptography==3.4.7
|
||||
dnspython==2.1.0
|
||||
dominate==2.6.0
|
||||
email-validator==1.1.3
|
||||
et-xmlfile==1.1.0
|
||||
Flask==2.0.1
|
||||
Flask-Babel==2.0.0
|
||||
Flask-Bootstrap==3.3.7.1
|
||||
Flask-Caching==1.10.1
|
||||
Flask-Login==0.5.0
|
||||
Flask-Mail==0.9.1
|
||||
Flask-Migrate==3.1.0
|
||||
Flask-Moment==1.0.2
|
||||
Flask-SQLAlchemy==2.5.1
|
||||
Flask-WTF==0.15.1
|
||||
greenlet==1.1.1
|
||||
gunicorn==20.1.0
|
||||
icalendar==4.0.7
|
||||
idna==3.2
|
||||
iniconfig==1.1.1
|
||||
isort==5.9.3
|
||||
itsdangerous==2.0.1
|
||||
Jinja2==3.0.1
|
||||
jwt==1.2.0
|
||||
lazy-object-proxy==1.6.0
|
||||
Mako==1.1.4
|
||||
MarkupSafe==2.0.1
|
||||
mccabe==0.6.1
|
||||
openpyxl==3.0.7
|
||||
packaging==21.0
|
||||
Pillow==8.3.1
|
||||
pluggy==0.13.1
|
||||
psycopg2==2.9.1
|
||||
py==1.10.0
|
||||
pycparser==2.20
|
||||
pydot==1.4.2
|
||||
pylint==2.9.6
|
||||
pyOpenSSL==20.0.1
|
||||
pyparsing==2.4.7
|
||||
pytest==6.2.4
|
||||
python-dateutil==2.8.2
|
||||
python-dotenv==0.19.0
|
||||
python-editor==1.0.4
|
||||
pytz==2021.1
|
||||
redis==3.5.3
|
||||
reportlab==3.6.1
|
||||
requests==2.26.0
|
||||
rq==1.9.0
|
||||
six==1.16.0
|
||||
SQLAlchemy==1.4.22
|
||||
toml==0.10.2
|
||||
urllib3==1.26.6
|
||||
visitor==0.1.3
|
||||
Werkzeug==2.0.1
|
||||
wrapt==1.12.1
|
||||
WTForms==2.3.3
|
@ -40,7 +40,7 @@ export SCODOC_DB_TEST="SCODOC_TEST"
|
||||
# psql command: if various versions installed, force the one we want:
|
||||
if [ "${debian_version}" = "11" ]
|
||||
then
|
||||
PSQL=/usr/lib/postgresql/11/bin/psql
|
||||
PSQL=/usr/lib/postgresql/13/bin/psql
|
||||
export POSTGRES_SERVICE="postgresql@11-main.service"
|
||||
else
|
||||
die "unsupported Debian version"
|
||||
|
@ -72,11 +72,11 @@ python3 -m venv venv || die "can't create Python 3 virtualenv"
|
||||
source venv/bin/activate
|
||||
# pip install --upgrade pip => bug [Errno 39] Directory not empty: '_internal'
|
||||
pip install wheel
|
||||
pip install -r requirements-3.7.txt
|
||||
pip install -r requirements-3.9.txt
|
||||
|
||||
# ------------
|
||||
GITCOMMIT=$(git rev-parse HEAD)
|
||||
SVERSION=$(curl --silent http://scodoc.iutv.univ-paris13.fr/scodoc-installmgr/version?mode=install\&commit="$GITCOMMIT")
|
||||
SCODOC_RELEASE=$(cat VERSION)
|
||||
SVERSION=$(curl --silent http://scodoc.iutv.univ-paris13.fr/scodoc-installmgr/version?mode=install\&release="$SCODOC_RELEASE")
|
||||
echo "$SVERSION" > "${SCODOC_VERSION_DIR}/scodoc.sn"
|
||||
|
||||
|
||||
|
@ -51,11 +51,11 @@ scodocctl() {
|
||||
|
||||
# --- Ensure postgres user scodoc exists
|
||||
init_postgres_user() { # run as root
|
||||
if [ -z $(echo "select usename from pg_user;" | su -c "$PSQL -d template1 -p $POSTGRES_PORT" $POSTGRES_SUPERUSER | grep $POSTGRES_USER) ]
|
||||
if [ -z $(echo "select usename from pg_user;" | su -c "(cd; $PSQL -d template1 -p $POSTGRES_PORT)" "$POSTGRES_SUPERUSER" | grep "$POSTGRES_USER") ]
|
||||
then
|
||||
# add database user
|
||||
echo "Creating postgresql user $POSTGRES_USER"
|
||||
su -c "createuser -p $POSTGRES_PORT --createdb --no-superuser --no-adduser --no-createrole ${POSTGRES_USER}" "$POSTGRES_SUPERUSER"
|
||||
su -c "(cd; createuser -p $POSTGRES_PORT --createdb --no-superuser --no-createrole ${POSTGRES_USER})" "$POSTGRES_SUPERUSER"
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user