Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scodoc_issue_976
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Louis Dormael
scodoc_issue_976
Commits
d2947b23
Commit
d2947b23
authored
3 years ago
by
Emmanuel Viennet
Browse files
Options
Downloads
Patches
Plain Diff
améliore script postinst (FLASK_APP)
parent
72c63812
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+14
-3
14 additions, 3 deletions
README.md
tools/config.sh
+2
-0
2 additions, 0 deletions
tools/config.sh
tools/debian/postinst
+10
-2
10 additions, 2 deletions
tools/debian/postinst
tools/utils.sh
+7
-0
7 additions, 0 deletions
tools/utils.sh
with
33 additions
and
5 deletions
README.md
+
14
−
3
View file @
d2947b23
...
...
@@ -73,14 +73,25 @@ Installer ScoDoc 9 normalement ([voir la doc](https://scodoc.org/GuideInstallDeb
Puis remplacer
`/opt/scodoc`
par un clone du git.
sudo su
mv /opt/scodoc /opt/scodoc
-distrib
# ou ce que vous voulez
mv /opt/scodoc /opt/
off-
scodoc # ou ce que vous voulez
apt-get install git # si besoin
cd /opt
git clone https://scodoc.org/git/viennet/ScoDoc.git
# (ou bien utiliser votre clone gitea si vous l'avez déjà créé !)
mv ScoDoc scodoc # important !
cd /opt/scodoc
# et voilà.
Il faut ensuite installer l'environnement et le fichier de configuration:
# Le plus simple est de piquer le virtualenv configuré par l'installeur:
mv /opt/off-scodoc/venv /opt/scodoc
Et la config:
ln -s /opt/scodoc-data/.env /opt/scodoc
Cette dernière commande utilise le
`.env`
crée lors de l'install, ce qui
n'est pas toujours le plus judicieux: vous pouvez modifier son contenu, par
exemple pour travailler en mode "développement" avec
`FLASK_ENV=development`
.
### Tests unitaires
...
...
This diff is collapsed.
Click to expand it.
tools/config.sh
+
2
−
0
View file @
d2947b23
...
...
@@ -22,6 +22,8 @@ export SCODOC_VAR_DIR=/opt/scodoc-data
export
SCODOC_VERSION_DIR
=
"
${
SCODOC_VAR_DIR
}
/config/version"
export
SCODOC_LOGOS_DIR
=
"
${
SCODOC_VAR_DIR
}
/config/logos"
export
FLASK_APP
=
scodoc.py
# Unix user running ScoDoc server:
export
SCODOC_USER
=
scodoc
export
SCODOC_GROUP
=
root
...
...
This diff is collapsed.
Click to expand it.
tools/debian/postinst
+
10
−
2
View file @
d2947b23
...
...
@@ -80,15 +80,23 @@ fi
# --- NGINX
if
[
!
-L
/etc/nginx/sites-enabled/scodoc9.nginx
]
then
echo
"Enabling scodoc9 in nginx"
ln
-s
/etc/nginx/sites-available/scodoc9.nginx /etc/nginx/sites-enabled/
fi
/bin/rm
-f
/etc/nginx/sites-enabled/default
# --- POSTGRESQL
# ---
---------
POSTGRESQL
# --- Ensure postgres user "scodoc" ($POSTGRES_USER) exists
init_postgres_user
# --- MISES A JOUR
# ------------ CONFIG SERVICE SCODOC
echo
echo
"Installation du service systemd scodoc9..."
cp
"
$SCODOC_DIR
"
/tools/etc/scodoc9.service /etc/systemd/system/
systemctl daemon-reload
# ------------ MISES A JOUR
cp
"
$SCODOC_DIR
"
/tools/etc/scodoc-updater.service /etc/systemd/system
cp
"
$SCODOC_DIR
"
/tools/etc/scodoc-updater.timer /etc/systemd/system
systemctl
enable
scodoc-updater.timer
...
...
This diff is collapsed.
Click to expand it.
tools/utils.sh
+
7
−
0
View file @
d2947b23
...
...
@@ -68,6 +68,12 @@ check_create_scodoc_user() {
else
echo
"Unix user
${
SCODOC_USER
}
exists"
fi
# Check / set FLASK_APP
scodoc_home
=
$(
getent passwd
"
${
SCODOC_USER
}
"
|
cut
-d
:
-f
6
)
if
[
-e
"
$scodoc_home
/.profile"
]
&&
[
$(
grep
-c
FLASK_APP
"
$scodoc_home
/.profile"
)
==
0
]
then
echo
"export FLASK_APP=scodoc.py"
>>
"
$scodoc_home
/.profile"
fi
}
# --- Give all ScoDoc files (/opt/scodoc) to user "scodoc":
...
...
@@ -79,6 +85,7 @@ change_scodoc_file_ownership() {
# Création du répertoire local (scodoc-data) et vérification du propriétaire
set_scodoc_var_dir
()
{
echo
"Checking
$SCODOC_VAR_DIR
..."
[
-z
${
SCODOC_VAR_DIR
+x
}
]
&&
die
"Error: env var SCODOC_VAR_DIR not set"
[
-d
"
$SCODOC_VAR_DIR
"
]
||
mkdir
"
$SCODOC_VAR_DIR
"
||
die
"can't create
$SCODOC_VAR_DIR
directory"
for
d
in
archives photos tmp log config certs config/version config/depts config/logos
do
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment