Outils pour utilisateurs

Outils du site


installation_de_standardnotes

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
installation_de_standardnotes [2021/09/10 20:13] tomampliusinstallation_de_standardnotes [2021/11/04 22:06] (Version actuelle) tomamplius
Ligne 1: Ligne 1:
 +====== Installation de standardnotes ======
 +[[https://standardnotes.com/|standardnotes]] [[https://github.com/standardnotes|git]]
 +
 +Bonjour, 
 +Je suis ouvert à toutes améliorations. Contactez moi sur Matrix @thomas:lgy.fr
 +
 Pré-requis : Pré-requis :
   * Debian 11   * Debian 11
Ligne 5: Ligne 11:
 Préparation de la bdd Préparation de la bdd
 <code> <code>
-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://deb.lgy.fr | bash && amp-full-upgrade apt update && apt install wget -y && wget -O - https://deb.lgy.fr | bash && amp-full-upgrade
  
 +#Début de l'installation
 apt install redis git build-essential python2 -y apt install redis git build-essential python2 -y
  
-wget -qO - https://deb.nodesource.com/setup_15.x | bash -+wget -qO - https://deb.nodesource.com/setup_16.x | bash -
 apt-get install -y nodejs  apt-get install -y nodejs 
  
Ligne 40: Ligne 46:
  
 useradd standardnotes -r -s /bin/false -m -d /usr/lib/standardnotes useradd standardnotes -r -s /bin/false -m -d /usr/lib/standardnotes
- 
-cd /usr/lib/standardnotes 
  
 su - -s $(which bash) standardnotes << 'EOF' su - -s $(which bash) standardnotes << 'EOF'
Ligne 59: Ligne 63:
 npm run setup npm run setup
 npm run bundle npm run bundle
- 
  
 mkdir /usr/lib/standardnotes/extention/ mkdir /usr/lib/standardnotes/extention/
- 
 mkdir /usr/lib/standardnotes/extention-src/ mkdir /usr/lib/standardnotes/extention-src/
 cd /usr/lib/standardnotes/extention-src/ cd /usr/lib/standardnotes/extention-src/
Ligne 106: Ligne 108:
  
 cat << 'EOF' > /usr/lib/standardnotes/web/webpack.dev.js cat << 'EOF' > /usr/lib/standardnotes/web/webpack.dev.js
-const { merge } = require('webpack-merge');+onst { merge } = require('webpack-merge');
 const config = require('./webpack.config.js'); const config = require('./webpack.config.js');
 const HtmlWebpackPlugin = require('html-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin');
 +const mergeWithEnvDefaults = require('./webpack-defaults.js');
  
 module.exports = (env, argv) => { module.exports = (env, argv) => {
   const port = argv.port || 3004;   const port = argv.port || 3004;
 +  mergeWithEnvDefaults(env);
   return merge(config(env, argv), {   return merge(config(env, argv), {
     mode: 'development',     mode: 'development',
-    /** Only create an html file for the dev-server */ +    optimization:
-    plugins: argv.liveReload ? [+      minimize: false, 
 +    }, 
 +    plugins: [
       new HtmlWebpackPlugin({       new HtmlWebpackPlugin({
         template: './index.html',         template: './index.html',
 +        inject: true,
         templateParameters: {         templateParameters: {
-          env: process.env+          env: process.env,
         },         },
       }),       }),
-    ] : [],+    ],
     devServer: {     devServer: {
-       disableHostChecktrue+      allowedHosts['all']
-       host: '0.0.0.0',  +      host: '0.0.0.0', 
-      proxy+      hot: 'only', 
-        '/extensions': { +      static: './', 
-          target: `http://standardnotes.net.lgy.fr:${port}`+      port, 
-          pathRewrite'^/extensions': '/public/extensions'+      devMiddleware: { 
-        }+        writeToDisk: argv.writeToDisk,
-        '/assets':+
-          target: `http://standardnotes.net.lgy.fr:${port}`+
-          pathRewrite: { '^/assets': '/public/assets' } +
-        },+
       },       },
-      port, +    },
-      writeToDisk: argv.writeToDisk, +
-    }+
   });   });
 }; };
 EOF EOF
- 
  
 cat << 'EOF' > /etc/standardnotes/api-gateway.env cat << 'EOF' > /etc/standardnotes/api-gateway.env
Ligne 233: Ligne 233:
 EXTENSION_SERVER_URL= EXTENSION_SERVER_URL=
 EOF EOF
- 
  
 cat << 'EOF' > /etc/standardnotes/syncing-server-js.env cat << 'EOF' > /etc/standardnotes/syncing-server-js.env
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 << 'EOF' > /etc/standardnotes/web.env cat << 'EOF' > /etc/standardnotes/web.env
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 << 'EOF' > /etc/systemd/system/standardnotes-syncing-server-js-worker.service cat << 'EOF' > /etc/systemd/system/standardnotes-syncing-server-js-worker.service
 [Unit] [Unit]
-Description=standardnote syncing-server-js+Description=standardnote syncing-server-js worker
 Documentation=https://github.com/standardnotes/syncing-server-js Documentation=https://github.com/standardnotes/syncing-server-js
 After=network.target After=network.target
Ligne 411: Ligne 407:
 cat << 'EOF' > /etc/systemd/system/standardnotes-auth-worker.service cat << 'EOF' > /etc/systemd/system/standardnotes-auth-worker.service
 [Unit] [Unit]
-Description=standardnote auth+Description=standardnote auth worker
 Documentation=https://github.com/standardnotes/auth Documentation=https://github.com/standardnotes/auth
 After=network.target After=network.target
Ligne 448: Ligne 444:
 </code> </code>
  
-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 32 | basenc --base16 | cut -c 1-64 | head -n 1)+TMP=$(openssl rand -hex 32 | basenc --base16 | cut -c 1-64 | head -n 1)
 sed -i "s/#ENCRYPTION_SERVER_KEY#/$TMP/" /etc/standardnotes/* sed -i "s/#ENCRYPTION_SERVER_KEY#/$TMP/" /etc/standardnotes/*
  
Ligne 462: Ligne 458:
 sed -i "s/#DB_HOST#/$TMP/" /etc/standardnotes/* sed -i "s/#DB_HOST#/$TMP/" /etc/standardnotes/*
  
-TMP=stdnote+TMP=stdnotes
 sed -i "s/#DB_DATABASE#/$TMP/" /etc/standardnotes/* sed -i "s/#DB_DATABASE#/$TMP/" /etc/standardnotes/*
  
-TMP=stdnote+TMP=stdnotes
 sed -i "s/#DB_USERNAME#/$TMP/" /etc/standardnotes/* sed -i "s/#DB_USERNAME#/$TMP/" /etc/standardnotes/*
  
-TMP=OilOnotodfeOsyuItFijghorwodruefKojliNemVekekVogMamWiavOsfolyiej5+TMP=setpasswordinconfigfileandhere
 sed -i "s/#DB_PASSWORD#/$TMP/" /etc/standardnotes/* sed -i "s/#DB_PASSWORD#/$TMP/" /etc/standardnotes/*
  
Ligne 480: Ligne 476:
 sed -i "s/#AUTH_DB_USERNAME#/$TMP/" /etc/standardnotes/* sed -i "s/#AUTH_DB_USERNAME#/$TMP/" /etc/standardnotes/*
  
-TMP=OilOnotodfeOsyuItFijghorwodruefKojliNemVekekVogMamWiavOsfolyiej5+TMP=setpasswordinconfigfileandhere
 sed -i "s/#AUTH_DB_PASSWORD#/$TMP/" /etc/standardnotes/* sed -i "s/#AUTH_DB_PASSWORD#/$TMP/" /etc/standardnotes/*
 </code> </code>
Ligne 486: Ligne 482:
 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 
 +</code> 
 + 
 +Configuration du proxy sous apache2 
 + 
 +<code> 
 +<VirtualHost *:80> 
 + ServerName api.notes.lgy.fr 
 + 
 +        RewriteEngine On 
 +        RewriteCond %{HTTPS} off 
 +        RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} 
 +</VirtualHost> 
 + 
 +<VirtualHost *:443> 
 + ServerName api.notes.lgy.fr 
 + 
 + ProxyPreserveHost on 
 +        ProxyPass / http://standardnotes.net.lgy.fr:3000/ 
 +        ProxyPassReverse / http://standardnotes.net.lgy.fr:3000/ 
 + 
 + RequestHeader set X-Forwarded-Proto "https" 
 + 
 + SSLEngine On 
 + SSLCertificateFile /etc/letsencrypt/live/api.notes.lgy.fr/fullchain.pem 
 + SSLCertificateKeyFile /etc/letsencrypt/live/api.notes.lgy.fr/privkey.pem  
 +</VirtualHost> 
 +<VirtualHost *:80> 
 + ServerName ext.notes.lgy.fr 
 + 
 +        RewriteEngine On 
 +        RewriteCond %{HTTPS} off 
 +        RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} 
 +</VirtualHost> 
 + 
 +<VirtualHost *:443> 
 + ServerName ext.notes.lgy.fr 
 + 
 + ProxyPreserveHost on 
 +        ProxyPass / http://standardnotes.net.lgy.fr:8001/ 
 +        ProxyPassReverse / http://standardnotes.net.lgy.fr:8001/ 
 + RequestHeader set X-Forwarded-Proto "https" 
 + 
 + SSLEngine On 
 + SSLCertificateFile /etc/letsencrypt/live/ext.notes.lgy.fr/fullchain.pem 
 + SSLCertificateKeyFile /etc/letsencrypt/live/ext.notes.lgy.fr/privkey.pem 
 +  
 +</VirtualHost> 
 +<VirtualHost *:80> 
 + ServerName notes.lgy.fr 
 + 
 +        RewriteEngine On 
 +        RewriteCond %{HTTPS} off 
 +        RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} 
 +</VirtualHost> 
 + 
 +<VirtualHost *:443> 
 + ServerName notes.lgy.fr 
 + 
 + ProxyPreserveHost on 
 +        ProxyPass / http://standardnotes.net.lgy.fr:3004/ 
 +        ProxyPassReverse / http://standardnotes.net.lgy.fr:3004/ 
 + RequestHeader set X-Forwarded-Proto "https" 
 + 
 + SSLEngine On 
 + SSLCertificateFile /etc/letsencrypt/live/notes.lgy.fr/fullchain.pem 
 + SSLCertificateKeyFile /etc/letsencrypt/live/notes.lgy.fr/privkey.pem  
 +</VirtualHost> 
 </code> </code>
installation_de_standardnotes.1631297637.txt.gz · Dernière modification : 2021/09/10 20:13 de tomamplius

Sauf mention contraire, le contenu de ce wiki est placé sous les termes de la licence suivante : Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki