Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente Prochaine révisionLes deux révisions suivantes | ||
playground:playground [2020/07/29 09:38] – modification externe 127.0.0.1 | playground:playground [2022/03/04 13:39] – zorro | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | ====== | + | < |
+ | ====== | ||
+ | [[https:// | ||
+ | |||
+ | Cet article va vous décrire l' | ||
+ | </ | ||
+ | |||
+ | Vous devez vous préparer à fournir les [[https:// | ||
+ | |||
+ | - un serveur web, ici [[ports: | ||
+ | - un mécanisme pour fournir des clefs pour https, ici [[https:// | ||
+ | - Ainsi qu'un serveur de base de données [[https:// | ||
+ | |||
+ | ===== La jail ===== | ||
+ | |||
+ | Préparez une [[jails: | ||
+ | |||
+ | <file javascript / | ||
+ | matrix { | ||
+ | ip4.addr = " | ||
+ | mount.devfs; | ||
+ | path ="/ | ||
+ | exec.start = "/ | ||
+ | exec.stop = "/ | ||
+ | depend=pg; # depend on postgresql jail | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Adaptez la configuration de la //jail// '' | ||
+ | |||
+ | <file ini matrix/ | ||
+ | hostname=" | ||
+ | </ | ||
+ | |||
+ | <callout type=" | ||
+ | Un serveur diaspora va vouloir [[https:// | ||
+ | </ | ||
+ | |||
+ | On assure le démarrage au reboot: | ||
+ | <code bash> | ||
+ | root@popeye:# | ||
+ | root@popeye:# | ||
+ | </ | ||
+ | |||
+ | ===== La base de données ===== | ||
+ | |||
+ | Préparez votre base de donnée pour Diaspora. | ||
+ | Dans cet exemple, le serveur est confiné dans une //jail// nommée '' | ||
+ | |||
+ | Créer un utilisateur, | ||
+ | <code bash> | ||
+ | root@pg:/ # su - postgres | ||
+ | $ createuser -P -d diaspora | ||
+ | Enter password for new role: | ||
+ | Enter it again: | ||
+ | </ | ||
+ | |||
+ | Restreindre l' | ||
+ | <file bash / | ||
+ | host all diaspora | ||
+ | </ | ||
+ | |||
+ | ===== Le serveur web ===== | ||
+ | |||
+ | Créez une entrée DNS, ici '' | ||
+ | |||
+ | Obtenez un certificat **SSL**. | ||
+ | <code bash> | ||
+ | root@popeye:/ | ||
+ | </ | ||
+ | |||
+ | Rediriger les requêtes vers votre //jail//, pour cela, on va définir un fichier dédié pour //nginx//. | ||
+ | |||
+ | <file javascript / | ||
+ | server { | ||
+ | root / | ||
+ | # Configure maximum picture size | ||
+ | # Note that Diaspora has a client side check set at 4M | ||
+ | client_max_body_size 5M; | ||
+ | client_body_buffer_size 256K; | ||
+ | ssl_certificate / | ||
+ | ssl_certificate_key / | ||
+ | |||
+ | # Proxy if requested file not found | ||
+ | try_files $uri @diaspora; | ||
+ | |||
+ | location /assets/ { | ||
+ | expires max; | ||
+ | add_header Cache-Control public; | ||
+ | } | ||
+ | |||
+ | # Camo support | ||
+ | #location /camo/ { | ||
+ | # proxy_redirect off; | ||
+ | # proxy_pass http:// | ||
+ | # break; | ||
+ | #} | ||
+ | |||
+ | location @diaspora { | ||
+ | proxy_set_header X-Real-IP $remote_addr; | ||
+ | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
+ | proxy_set_header X-Forwarded-Proto https; | ||
+ | proxy_set_header Host $http_host; | ||
+ | proxy_redirect off; | ||
+ | proxy_pass http:// | ||
+ | } | ||
+ | } | ||
+ | upstream diaspora_server { | ||
+ | server unix:/ | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Et l' | ||
+ | |||
+ | <file javascript / | ||
+ | | ||
+ | listen 443 ssl http2 ; | ||
+ | listen [::]:443 ssl http2 ; | ||
+ | server_name diaspora.lapinbilly.eu; | ||
+ | include diaspora.conf; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ===== Installer ===== | ||
+ | |||
+ | Installez les ports suivants dans la //jail// '' | ||
+ | <code bash> | ||
+ | root@popeye:# | ||
+ | root@popeye:# | ||
+ | </ | ||
+ | |||
+ | Construisez le serveur: | ||
+ | <code bash> | ||
+ | root@popeye:# | ||
+ | root@popeye:# | ||
+ | root@popeye:# | ||
+ | </ | ||
+ | |||
+ | Préparer l' | ||
+ | <code bash> | ||
+ | root@diaspora:# | ||
+ | root@diaspora:# | ||
+ | root@diaspora:# | ||
+ | root@diaspora:# | ||
+ | </ | ||
+ | |||
+ | Ajoutez un utilisateur '' | ||
+ | <code bash> | ||
+ | root@diaspora:# | ||
+ | root@diaspora:# | ||
+ | root@diaspora:# | ||
+ | root@diaspora:# | ||
+ | </ | ||
+ | |||
+ | Les deux dernières vont vous éviter bien des ennuis, elles précisent deux paramètres de base utilisé par tous les scripts: | ||
+ | * l' | ||
+ | * la base de donnée utilisée. | ||
+ | |||
+ | <callout type=" | ||
+ | Attention, ceux sont des instructions pour un //shell// '' | ||
+ | </ | ||
+ | |||
+ | Et allons-y pour l' | ||
+ | <code bash> | ||
+ | diaspora@diaspora: | ||
+ | diaspora@diaspora: | ||
+ | diaspora@diaspora: | ||
+ | diaspora@diaspora: | ||
+ | diaspora@diaspora: | ||
+ | diaspora@diaspora: | ||
+ | diaspora@diaspora: | ||
+ | diaspora@diaspora: | ||
+ | diaspora@diaspora: | ||
+ | |||
+ | </ | ||
+ | |||
+ | ==== Configurer ==== | ||
+ | |||
+ | Adaptez le serveur à la //jail// et au serveur de base de données, | ||
+ | c'est à dire permettre au serveur **diaspora** d' | ||
+ | |||
+ | Deux fichiers de configuration sont importants à copier depuis les exemples du répertoire '' | ||
+ | |||
+ | - '' | ||
+ | - '' | ||
+ | |||
+ | Dirigez la connexion vers votre base de données: | ||
+ | <file diff config/ | ||
+ | --- config/ | ||
+ | +++ config/ | ||
+ | @@ -1,9 +1,9 @@ | ||
+ | | ||
+ | | ||
+ | - host: " | ||
+ | + host: " | ||
+ | port: 5432 | ||
+ | - username: " | ||
+ | - password: "" | ||
+ | + username: " | ||
+ | + password: " | ||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | </ | ||
+ | |||
+ | Dans le fichier '' | ||
+ | |||
+ | - Adresser les certificats | ||
+ | - Réglez le serveur d' | ||
+ | - Donnez un nom de serveur . | ||
+ | |||
+ | <file diff config/ | ||
+ | --- config/ | ||
+ | +++ config/ | ||
+ | @@ -36,7 +36,7 @@ | ||
+ | ## However changing http to https is okay and has no consequences. | ||
+ | ## If you do change the URL, you will have to start again as the URL | ||
+ | ## will be hardcoded into the database. | ||
+ | - #url: " | ||
+ | + url: " | ||
+ | |||
+ | ## Set the bundle of certificate authorities (CA) certificates. | ||
+ | ## This is specific to your operating system. | ||
+ | @@ -44,7 +44,7 @@ | ||
+ | ## For Debian, Ubuntu, Archlinux, Gentoo (package ca-certificates): | ||
+ | # | ||
+ | ## For CentOS, Fedora: | ||
+ | - # | ||
+ | + certificate_authorities: | ||
+ | |||
+ | ## URL for a remote Redis (default=localhost). | ||
+ | ## Don't forget to restrict IP access if you uncomment these! | ||
+ | @@ -175,7 +175,7 @@ | ||
+ | ## Where the appserver should listen to (default=unix: | ||
+ | # | ||
+ | # | ||
+ | - #listen: ' | ||
+ | + #listen: ' | ||
+ | |||
+ | ## Set the path for the PID file of the unicorn master process (default=tmp/ | ||
+ | #pid: ' | ||
+ | @@ -609,14 +609,14 @@ | ||
+ | mail: ## Section | ||
+ | |||
+ | ## First you need to enable it. | ||
+ | - #enable: true | ||
+ | + enable: true | ||
+ | |||
+ | ## Sender address used in mail sent by Diaspora. | ||
+ | - # | ||
+ | + sender_address: | ||
+ | |||
+ | ## This selects which mailer should be used. Use ' | ||
+ | ## connection or ' | ||
+ | - #method: ' | ||
+ | + method: ' | ||
+ | |||
+ | ## Ignore if method isn't ' | ||
+ | smtp: ## Section | ||
+ | @@ -653,7 +653,7 @@ | ||
+ | | ||
+ | |||
+ | ## The path to the sendmail binary (default='/ | ||
+ | - #location: '/ | ||
+ | + location: '/ | ||
+ | |||
+ | ## Use exim and sendmail (default=false) | ||
+ | # | ||
+ | @@ -665,10 +665,10 @@ | ||
+ | ## This doesn' | ||
+ | ## admin contact is needed, much like the postmaster role in mail | ||
+ | ## systems. Set only the username, NOT the full ID. | ||
+ | - #account: " | ||
+ | + account: " | ||
+ | |||
+ | ## E-mail address to contact the administrator. | ||
+ | - # | ||
+ | + podmin_email: | ||
+ | |||
+ | ## Settings related to relays | ||
+ | | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ===== Démarrer ==== | ||
+ | |||
+ | Lancez simplement: | ||
+ | |||
+ | <code bash> | ||
+ | diaspora@diaspora: | ||
+ | </ | ||
+ | |||
+ | Redémarrez votre serveur web avec la nouvelle configuration: | ||
+ | <code bash> | ||
+ | root@popeye:# | ||
+ | </ | ||
+ | |||
+ | Connectez vous sur le site et ajoutez un utilisateur. Déclarez le ensuite comme un administrateur à l'aide de son //adresse mail//. | ||
+ | |||
+ | <code bash> | ||
+ | root@popeye:# | ||
+ | root@diaspora:# | ||
+ | diaspora@diaspora: | ||
+ | diaspora@diaspora: | ||
+ | Role.add_admin User.where(email: | ||
+ | </ | ||
+ | |||
+ | === Mettre à jour === |