installation_de_standardnotes
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
installation_de_standardnotes [2021/09/10 19:54] – tomamplius | installation_de_standardnotes [2021/11/04 22:06] (Version actuelle) – tomamplius | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
+ | ====== Installation de standardnotes ====== | ||
+ | [[https:// | ||
+ | |||
+ | Bonjour, | ||
+ | Je suis ouvert à toutes améliorations. Contactez moi sur Matrix @thomas: | ||
+ | |||
Pré-requis : | Pré-requis : | ||
* Debian 11 | * Debian 11 | ||
Ligne 5: | Ligne 11: | ||
Préparation de la bdd | Préparation de la bdd | ||
< | < | ||
- | create user stdnotesauth@standardnotes.net.lgy.fr identified by 'OilOnotodfeOsyuItFijghorwodruefKojliNemVekekVogMamWiavOsfolyiej5'; | + | create user stdnotesauth@standardnotes.net.lgy.fr identified by 'setpasswordinconfigfileandhere'; |
create database IF NOT EXISTS stdnotesauth ; | create database IF NOT EXISTS stdnotesauth ; | ||
grant all privileges on stdnotesauth.* to stdnotesauth@standardnotes.net.lgy.fr; | grant all privileges on stdnotesauth.* to stdnotesauth@standardnotes.net.lgy.fr; | ||
- | create user stdnotes@standardnotes.net.lgy.fr identified by 'OilOnotodfeOsyuItFijghorwodruefKojliNemVekekVogMamWiavOsfolyiej5'; | + | create user stdnotes@standardnotes.net.lgy.fr identified by 'setpasswordinconfigfileandhere'; |
create database IF NOT EXISTS stdnotes ; | create database IF NOT EXISTS stdnotes ; | ||
grant all privileges on stdnotes.* to stdnotes@standardnotes.net.lgy.fr; | grant all privileges on stdnotes.* to stdnotes@standardnotes.net.lgy.fr; | ||
Ligne 26: | Ligne 32: | ||
<code bash install.sh> | <code bash install.sh> | ||
+ | #Commande Perso facultative | ||
apt update && apt install wget -y && wget -O - https:// | apt update && apt install wget -y && wget -O - https:// | ||
+ | #Début de l' | ||
apt install redis git build-essential python2 -y | apt install redis git build-essential python2 -y | ||
- | wget -qO - https:// | + | wget -qO - https:// |
apt-get install -y nodejs | apt-get install -y nodejs | ||
Ligne 40: | Ligne 46: | ||
useradd standardnotes -r -s /bin/false -m -d / | useradd standardnotes -r -s /bin/false -m -d / | ||
- | |||
- | cd / | ||
su - -s $(which bash) standardnotes << ' | su - -s $(which bash) standardnotes << ' | ||
Ligne 59: | Ligne 63: | ||
npm run setup | npm run setup | ||
npm run bundle | npm run bundle | ||
- | |||
mkdir / | mkdir / | ||
- | |||
mkdir / | mkdir / | ||
cd / | cd / | ||
Ligne 106: | Ligne 108: | ||
cat << ' | cat << ' | ||
- | const { merge } = require(' | + | onst { merge } = require(' |
const config = require(' | const config = require(' | ||
const HtmlWebpackPlugin = require(' | const HtmlWebpackPlugin = require(' | ||
+ | const mergeWithEnvDefaults = require(' | ||
module.exports = (env, argv) => { | module.exports = (env, argv) => { | ||
const port = argv.port || 3004; | const port = argv.port || 3004; | ||
+ | mergeWithEnvDefaults(env); | ||
return merge(config(env, | return merge(config(env, | ||
mode: ' | mode: ' | ||
- | | + | |
- | plugins: | + | minimize: false, |
+ | }, | ||
+ | plugins: [ | ||
new HtmlWebpackPlugin({ | new HtmlWebpackPlugin({ | ||
template: ' | template: ' | ||
+ | inject: true, | ||
templateParameters: | templateParameters: | ||
- | env: process.env | + | env: process.env, |
}, | }, | ||
}), | }), | ||
- | | + | ], |
devServer: { | devServer: { | ||
- | | + | allowedHosts: [' |
- | | + | host: ' |
- | | + | |
- | | + | |
- | target: `http:// | + | port, |
- | | + | |
- | }, | + | |
- | '/ | + | |
- | target: `http:// | + | |
- | | + | |
- | | + | |
}, | }, | ||
- | port, | + | }, |
- | writeToDisk: | + | |
- | } | + | |
}); | }); | ||
}; | }; | ||
EOF | EOF | ||
- | |||
cat << ' | cat << ' | ||
Ligne 157: | Ligne 157: | ||
HTTP_CALL_TIMEOUT=10000 | HTTP_CALL_TIMEOUT=10000 | ||
- | AUTH_JWT_SECRET=BubohadtatyuhevGotsitvaijDikonoalyeldEerrEeHinyabEgyodridOudcecs | + | AUTH_JWT_SECRET=# |
# (Optional) New Relic Setup | # (Optional) New Relic Setup | ||
Ligne 233: | Ligne 233: | ||
EXTENSION_SERVER_URL= | EXTENSION_SERVER_URL= | ||
EOF | EOF | ||
- | |||
cat << ' | cat << ' | ||
Ligne 282: | Ligne 281: | ||
NEW_RELIC_LOG_ENABLED=false | NEW_RELIC_LOG_ENABLED=false | ||
NEW_RELIC_LOG_LEVEL=debug | NEW_RELIC_LOG_LEVEL=debug | ||
- | |||
EOF | EOF | ||
- | |||
cat << ' | cat << ' | ||
Ligne 312: | Ligne 309: | ||
NEW_RELIC_APP_NAME=Web | NEW_RELIC_APP_NAME=Web | ||
NEW_RELIC_BROWSER_MONITORING_AUTO_INSTRUMENT=false | NEW_RELIC_BROWSER_MONITORING_AUTO_INSTRUMENT=false | ||
- | |||
EOF | EOF | ||
Ligne 355: | Ligne 351: | ||
cat << ' | cat << ' | ||
[Unit] | [Unit] | ||
- | Description=standardnote syncing-server-js | + | Description=standardnote syncing-server-js |
Documentation=https:// | Documentation=https:// | ||
After=network.target | After=network.target | ||
Ligne 411: | Ligne 407: | ||
cat << ' | cat << ' | ||
[Unit] | [Unit] | ||
- | Description=standardnote auth | + | Description=standardnote auth worker |
Documentation=https:// | Documentation=https:// | ||
After=network.target | After=network.target | ||
Ligne 448: | Ligne 444: | ||
</ | </ | ||
- | Définition des clef de sécurité | + | Définition des parametres de bdd et de sécurité |
<code bash> | <code bash> | ||
- | TMP=$(openssl rand -base64 | + | TMP=$(openssl rand -hex 32 | basenc --base16 | cut -c 1-64 | head -n 1) |
- | sed -i " | + | sed -i " |
- | TMP=$(openssl rand -base64 | + | TMP=$(openssl rand -hex 64 | cut -c 1-64 | head -n 1) |
- | sed -i " | + | sed -i " |
- | TMP=$(openssl rand -base64 | + | TMP=$(openssl rand -hex 64 | cut -c 1-64 | head -n 1) |
- | sed -i " | + | sed -i " |
TMP=mysql.net.lgy.fr | TMP=mysql.net.lgy.fr | ||
- | sed -i " | + | sed -i " |
- | TMP=stdnote | + | TMP=stdnotes |
- | sed -i " | + | sed -i " |
- | TMP=stdnote | + | TMP=stdnotes |
- | sed -i " | + | sed -i " |
- | TMP=OilOnotodfeOsyuItFijghorwodruefKojliNemVekekVogMamWiavOsfolyiej5 | + | TMP=setpasswordinconfigfileandhere |
- | sed -i " | + | sed -i " |
TMP=mysql.net.lgy.fr | TMP=mysql.net.lgy.fr | ||
- | sed -i " | + | sed -i " |
TMP=stdnotesauth | TMP=stdnotesauth | ||
- | sed -i " | + | sed -i " |
TMP=stdnotesauth | TMP=stdnotesauth | ||
- | sed -i " | + | sed -i " |
- | TMP=OilOnotodfeOsyuItFijghorwodruefKojliNemVekekVogMamWiavOsfolyiej5 | + | TMP=setpasswordinconfigfileandhere |
- | sed -i " | + | sed -i " |
</ | </ | ||
Inscription et lancement des services | Inscription et lancement des services | ||
<code bash> | <code bash> | ||
- | systemctl enable standardnotes-api-gateway standardnotes-extention standardnotes-web standardnotes-auth standardnotes-syncing-server-js standardnotes-auth-worker standardnotes-syncing-server-js-worker --now | + | systemctl enable |
+ | standardnotes-api-gateway | ||
+ | standardnotes-extention | ||
+ | standardnotes-web | ||
+ | standardnotes-auth | ||
+ | standardnotes-syncing-server-js | ||
+ | standardnotes-auth-worker | ||
+ | standardnotes-syncing-server-js-worker | ||
+ | --now | ||
+ | </ | ||
+ | |||
+ | Configuration du proxy sous apache2 | ||
+ | |||
+ | < | ||
+ | < | ||
+ | ServerName api.notes.lgy.fr | ||
+ | |||
+ | RewriteEngine On | ||
+ | RewriteCond %{HTTPS} off | ||
+ | RewriteRule (.*) https:// | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | ServerName api.notes.lgy.fr | ||
+ | |||
+ | ProxyPreserveHost on | ||
+ | ProxyPass / http:// | ||
+ | ProxyPassReverse / http:// | ||
+ | |||
+ | RequestHeader set X-Forwarded-Proto " | ||
+ | |||
+ | SSLEngine On | ||
+ | SSLCertificateFile / | ||
+ | SSLCertificateKeyFile / | ||
+ | </ | ||
+ | < | ||
+ | ServerName ext.notes.lgy.fr | ||
+ | |||
+ | RewriteEngine On | ||
+ | RewriteCond %{HTTPS} off | ||
+ | RewriteRule (.*) https:// | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | ServerName ext.notes.lgy.fr | ||
+ | |||
+ | ProxyPreserveHost on | ||
+ | ProxyPass / http:// | ||
+ | ProxyPassReverse / http:// | ||
+ | RequestHeader set X-Forwarded-Proto " | ||
+ | |||
+ | SSLEngine On | ||
+ | SSLCertificateFile / | ||
+ | SSLCertificateKeyFile / | ||
+ | |||
+ | </ | ||
+ | < | ||
+ | ServerName notes.lgy.fr | ||
+ | |||
+ | RewriteEngine On | ||
+ | RewriteCond %{HTTPS} off | ||
+ | RewriteRule (.*) https:// | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | ServerName notes.lgy.fr | ||
+ | |||
+ | ProxyPreserveHost on | ||
+ | ProxyPass / http:// | ||
+ | ProxyPassReverse / http:// | ||
+ | RequestHeader set X-Forwarded-Proto " | ||
+ | |||
+ | SSLEngine On | ||
+ | SSLCertificateFile / | ||
+ | SSLCertificateKeyFile / | ||
+ | </ | ||
</ | </ |
installation_de_standardnotes.1631296497.txt.gz · Dernière modification : 2021/09/10 19:54 de tomamplius