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 | |||
| si:logiciels:lstu [2025/04/24 21:21] – supprimée - modification externe (Unknown date) 127.0.0.1 | si:logiciels:lstu [2025/04/24 21:21] (Version actuelle) – ↷ Page déplacée de si:lstu à si:logiciels:lstu vcalame | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | Installation du raccourcisseur d'url | ||
| + | |||
| + | Installation des paquets : | ||
| + | < | ||
| + | apt-get install build-essential libssl-dev zlib1g-dev sudo git | ||
| + | sudo apt-get install libpng-dev | ||
| + | sudo cpan Carton | ||
| + | sudo apt-get install memcached | ||
| + | sudo apt-get install libmariadbd-dev | ||
| + | </ | ||
| + | |||
| + | |||
| + | Ajout d'un utilisateur dédié | ||
| + | < | ||
| + | useradd lstu | ||
| + | groupadd lstu | ||
| + | mkdir -p / | ||
| + | chown -R lstu:lstu / | ||
| + | usermod -d / | ||
| + | </ | ||
| + | |||
| + | Récupération du dépôt via git | ||
| + | |||
| + | < | ||
| + | git clone https:// | ||
| + | </ | ||
| + | |||
| + | mise à jour | ||
| + | < | ||
| + | cd / | ||
| + | git pull | ||
| + | </ | ||
| + | |||
| + | Installation des dépendance | ||
| + | < | ||
| + | su lstu -s /bin/bash | ||
| + | carton install | ||
| + | carton install --deployment | ||
| + | </ | ||
| + | |||
| + | test du service ou mode manuel | ||
| + | start | ||
| + | < | ||
| + | carton exec hypnotoad | ||
| + | </ | ||
| + | |||
| + | stop | ||
| + | < | ||
| + | carton exec hypnotoad | ||
| + | </ | ||
| + | |||
| + | |||
| + | Paramétrage de la configuration LDAP | ||
| + | |||
| + | démarrage auto | ||
| + | < | ||
| + | cp utilities/ | ||
| + | |||
| + | vérification des chemins et utilisateurs dans : | ||
| + | < | ||
| + | vim / | ||
| + | </ | ||
| + | |||
| + | utilisation du service | ||
| + | < | ||
| + | systemctl daemon-reload | ||
| + | systemctl enable lstu.service | ||
| + | systemctl start lstu.service | ||
| + | systemctl status lstu.service | ||
| + | </ | ||
| + | |||
| + | vérification du pid | ||
| + | < | ||
| + | ls -la / | ||
| + | </ | ||
| + | |||
| + | au cas ou | ||
| + | < | ||
| + | chown -R lstu: | ||
| + | chmod -R 774 / | ||
| + | </ | ||
| + | |||
| + | |||
| + | entrées dans le Vhost Nginx | ||
| + | < | ||
| + | | ||
| + | error_page 404 = / | ||
| + | proxy_pass http:// | ||
| + | proxy_set_header Host $host; | ||
| + | proxy_http_version 1.1; | ||
| + | } | ||
| + | |||
| + | location /oauth2/ { | ||
| + | proxy_pass | ||
| + | proxy_set_header Host $host; | ||
| + | proxy_set_header X-Real-IP | ||
| + | proxy_set_header X-Scheme $scheme; | ||
| + | proxy_set_header X-Auth-Request-Redirect $request_uri; | ||
| + | # or, if you are handling multiple domains: | ||
| + | # proxy_set_header X-Auth-Request-Redirect $scheme:// | ||
| + | } | ||
| + | |||
| + | location = / | ||
| + | proxy_pass | ||
| + | proxy_set_header Host $host; | ||
| + | proxy_set_header X-Real-IP $remote_addr; | ||
| + | proxy_set_header X-Scheme $scheme; | ||
| + | # nginx auth_request includes headers but not body | ||
| + | proxy_set_header Content-Length | ||
| + | proxy_pass_request_body | ||
| + | } | ||
| + | |||
| + | location | ||
| + | auth_request / | ||
| + | error_page 401 = / | ||
| + | # # pass information via X-User and X-Email headers to backend, | ||
| + | # # requires running with --set-xauthrequest flag | ||
| + | auth_request_set $user | ||
| + | auth_request_set $email | ||
| + | proxy_set_header X-User | ||
| + | proxy_set_header X-Email $email; | ||
| + | # if you enabled --pass-access-token, | ||
| + | auth_request_set $token | ||
| + | proxy_set_header X-Access-Token $token; | ||
| + | # if you enabled --cookie-refresh, | ||
| + | auth_request_set $auth_cookie $upstream_http_set_cookie; | ||
| + | add_header Set-Cookie $auth_cookie; | ||
| + | # When using the --set-authorization-header flag, some provider' | ||
| + | # limit and so the OAuth2 Proxy splits these into multiple parts. | ||
| + | # Nginx normally only copies the first `Set-Cookie` header from the auth_request to the response, | ||
| + | # so if your cookies are larger than 4kb, you will need to extract additional cookies manually. | ||
| + | auth_request_set $auth_cookie_name_upstream_1 $upstream_cookie_auth_cookie_name_1; | ||
| + | # Extract the Cookie attributes from the first Set-Cookie header and append them | ||
| + | # to the second part ($upstream_cookie_* variables only contain the raw cookie content) | ||
| + | if ($auth_cookie ~* "(; .*)") { | ||
| + | set $auth_cookie_name_0 $auth_cookie; | ||
| + | set $auth_cookie_name_1 " | ||
| + | } | ||
| + | # Send both Set-Cookie headers now if there was a second part | ||
| + | if ($auth_cookie_name_upstream_1) { | ||
| + | add_header Set-Cookie $auth_cookie_name_0; | ||
| + | add_header Set-Cookie $auth_cookie_name_1; | ||
| + | } | ||
| + | proxy_pass http:// | ||
| + | # | ||
| + | proxy_set_header Host $host; | ||
| + | proxy_http_version 1.1; | ||
| + | } | ||
| + | </ | ||