HedgeDoc » Historique » Version 2
Matthieu Herrb, 07/02/2021 21:15
lancement service
1 | 1 | Matthieu Herrb | h1. HedgeDoc |
---|---|---|---|
2 | 1 | Matthieu Herrb | |
3 | 1 | Matthieu Herrb | Cette page décrit l'installation de HedeDoc (éditeur collaboratif Markdown) : https://hedgedoc.org/ sur https://md.tetaneutral.net |
4 | 1 | Matthieu Herrb | |
5 | 1 | Matthieu Herrb | la VM a Debian 10 / 2 Go RAM / 20 Go disque |
6 | 1 | Matthieu Herrb | |
7 | 1 | Matthieu Herrb | h2. Paquets prérequis |
8 | 1 | Matthieu Herrb | |
9 | 1 | Matthieu Herrb | <pre> |
10 | 1 | Matthieu Herrb | apt install git |
11 | 1 | Matthieu Herrb | apt install nodejs |
12 | 1 | Matthieu Herrb | apt install postgresql |
13 | 1 | Matthieu Herrb | apt install nginx |
14 | 1 | Matthieu Herrb | apt install certbot |
15 | 1 | Matthieu Herrb | apt install python3-certbot-nginx |
16 | 1 | Matthieu Herrb | apt install npm |
17 | 1 | Matthieu Herrb | npm install --global yarn |
18 | 1 | Matthieu Herrb | </pre> |
19 | 1 | Matthieu Herrb | |
20 | 1 | Matthieu Herrb | h2. Création utilisateur + base de données PostgreSQL |
21 | 1 | Matthieu Herrb | |
22 | 1 | Matthieu Herrb | <pre> |
23 | 1 | Matthieu Herrb | adduser hedgedoc (long random password) |
24 | 1 | Matthieu Herrb | </pre> |
25 | 1 | Matthieu Herrb | |
26 | 1 | Matthieu Herrb | <pre> |
27 | 1 | Matthieu Herrb | su - postgres |
28 | 1 | Matthieu Herrb | createuser --pwprompt hedgedoc (meme mot de passe) |
29 | 1 | Matthieu Herrb | createdb -O hedgedoc hedgedoc |
30 | 1 | Matthieu Herrb | exit |
31 | 1 | Matthieu Herrb | </pre> |
32 | 1 | Matthieu Herrb | |
33 | 1 | Matthieu Herrb | h2. Installation du logiiciel lui-même: |
34 | 1 | Matthieu Herrb | |
35 | 1 | Matthieu Herrb | <pre> |
36 | 1 | Matthieu Herrb | sudo -u hedgedoc bash |
37 | 1 | Matthieu Herrb | git clone -b 1.7.2 https://github.com/hedgedoc/hedgedoc.git |
38 | 1 | Matthieu Herrb | cd hedgedoc |
39 | 1 | Matthieu Herrb | ./bin/setup |
40 | 1 | Matthieu Herrb | yarn run build |
41 | 1 | Matthieu Herrb | </pre> |
42 | 1 | Matthieu Herrb | |
43 | 1 | Matthieu Herrb | Créer @env.sh@ |
44 | 1 | Matthieu Herrb | <pre> |
45 | 1 | Matthieu Herrb | # Environment pour HedgeDoc |
46 | 1 | Matthieu Herrb | # https://docs.hedgedoc.org/configuration/ |
47 | 1 | Matthieu Herrb | |
48 | 1 | Matthieu Herrb | CMD_DOMAIN=md.tetaneutral.net |
49 | 1 | Matthieu Herrb | CMD_HOST=127.0.0.1 |
50 | 1 | Matthieu Herrb | CMD_PORT=3000 |
51 | 1 | Matthieu Herrb | CMD_PROTOCOL_USESSL=true |
52 | 1 | Matthieu Herrb | |
53 | 1 | Matthieu Herrb | CMD_DB_URL=postgres://hedgedoc:<mot de passe>@localhost:5432/hedgedoc |
54 | 1 | Matthieu Herrb | |
55 | 1 | Matthieu Herrb | CMD_ALLOW_ANONYMOUS=false |
56 | 1 | Matthieu Herrb | CMD_ALLOW_ANONYMOUS_EDIT=true |
57 | 1 | Matthieu Herrb | CMD_ALLOW_ANONYMOUS_VIEWS=true |
58 | 1 | Matthieu Herrb | CMD_DEFAULT_PERMISSION=limited |
59 | 1 | Matthieu Herrb | CMD_DEFAULT_USE_HARD_BREAK=false |
60 | 1 | Matthieu Herrb | |
61 | 1 | Matthieu Herrb | CMD_SESSION_SECRET=<secret generé par pwgen 32 1> |
62 | 1 | Matthieu Herrb | |
63 | 1 | Matthieu Herrb | CMD_IMAGE_UPLOAD_TYPE=filesystem |
64 | 1 | Matthieu Herrb | |
65 | 1 | Matthieu Herrb | CMD_EMAIL=false |
66 | 1 | Matthieu Herrb | CMD_ALLOW_EMAIL_REGISTER=false |
67 | 1 | Matthieu Herrb | |
68 | 1 | Matthieu Herrb | CMD_ALLOW_FREEURL=true |
69 | 1 | Matthieu Herrb | CMD_REQUIRE_FREEURL_AUTHENTICATION=true |
70 | 1 | Matthieu Herrb | |
71 | 1 | Matthieu Herrb | CMD_LDAP_URL=ldaps://ldap.tetaneutral.net/ |
72 | 1 | Matthieu Herrb | CMD_LDAP_BINDDN='cn=directory manager' |
73 | 1 | Matthieu Herrb | CMD_LDAP_BINDCREDENTIALS=<mdp root ldap> |
74 | 1 | Matthieu Herrb | CMD_LDAP_SEARCHBASE=ou=people,dc=tetaneutral,dc=net |
75 | 1 | Matthieu Herrb | CMD_LDAP_SEARCHFILTER='(cn={{username}})' |
76 | 1 | Matthieu Herrb | CMD_LDAP_SEARCHATTRIBUTES='cn,nsUniqueId' |
77 | 1 | Matthieu Herrb | CMD_LDAP_USERIDFIELD=nsUniqueId |
78 | 1 | Matthieu Herrb | CMD_LDAP_USERNAMEFIELD=cn |
79 | 1 | Matthieu Herrb | CMD_LDAP_PROVIDERNAME=Tetaneutral.net |
80 | 1 | Matthieu Herrb | |
81 | 1 | Matthieu Herrb | CMD_USECDN=false |
82 | 1 | Matthieu Herrb | CMD_ALLOW_GRAVATAR=true |
83 | 1 | Matthieu Herrb | CMD_ALLOW_ORIGIN=md.tetaneutral.net |
84 | 1 | Matthieu Herrb | |
85 | 1 | Matthieu Herrb | DEBUG=false |
86 | 1 | Matthieu Herrb | NODE_ENV=production |
87 | 1 | Matthieu Herrb | </pre> |
88 | 1 | Matthieu Herrb | |
89 | 1 | Matthieu Herrb | et @.sequelizerc@ : |
90 | 1 | Matthieu Herrb | <pre> |
91 | 1 | Matthieu Herrb | var path = require('path'); |
92 | 1 | Matthieu Herrb | |
93 | 1 | Matthieu Herrb | module.exports = { |
94 | 1 | Matthieu Herrb | 'config': path.resolve('config.json'), |
95 | 1 | Matthieu Herrb | 'migrations-path': path.resolve('lib', 'migrations'), |
96 | 1 | Matthieu Herrb | 'models-path': path.resolve('lib', 'models'), |
97 | 1 | Matthieu Herrb | 'url': 'postgres://hedgedoc:<mot de passe>@localhost:5432/hedgedoc' |
98 | 1 | Matthieu Herrb | } |
99 | 1 | Matthieu Herrb | </pre> |
100 | 1 | Matthieu Herrb | |
101 | 1 | Matthieu Herrb | h2. Service systemd |
102 | 1 | Matthieu Herrb | |
103 | 1 | Matthieu Herrb | Créer @/etc/systemd/system/hedgedoc.service@ : |
104 | 1 | Matthieu Herrb | |
105 | 1 | Matthieu Herrb | <pre> |
106 | 1 | Matthieu Herrb | [Unit] |
107 | 1 | Matthieu Herrb | Description=HedgeDoc |
108 | 1 | Matthieu Herrb | After=network.target |
109 | 1 | Matthieu Herrb | |
110 | 1 | Matthieu Herrb | [Service] |
111 | 1 | Matthieu Herrb | Type=simple |
112 | 1 | Matthieu Herrb | User=hedgedoc |
113 | 1 | Matthieu Herrb | EnvironmentFile=/home/hedgedoc/hedgedoc/env.sh |
114 | 1 | Matthieu Herrb | WorkingDirectory=/home/hedgedoc/hedgedoc |
115 | 1 | Matthieu Herrb | ExecStart=/usr/local/bin/yarn start |
116 | 1 | Matthieu Herrb | TimeoutSec=15 |
117 | 1 | Matthieu Herrb | Restart=always |
118 | 1 | Matthieu Herrb | |
119 | 1 | Matthieu Herrb | [Install] |
120 | 1 | Matthieu Herrb | WantedBy=multi-user.target |
121 | 1 | Matthieu Herrb | </pre> |
122 | 2 | Matthieu Herrb | |
123 | 2 | Matthieu Herrb | Ensuite exécuter @systemctl daemon-reload@ pour lire le nouveau service et |
124 | 2 | Matthieu Herrb | |
125 | 2 | Matthieu Herrb | <pre> |
126 | 2 | Matthieu Herrb | systemctl enable hedgedoc |
127 | 2 | Matthieu Herrb | systemctl start hedgedoc |
128 | 2 | Matthieu Herrb | </pre> |
129 | 2 | Matthieu Herrb | |
130 | 2 | Matthieu Herrb | pour lancer le service et le rendre permanent. |