mirror of
https://github.com/YunoHost-Apps/duniter_ynh.git
synced 2024-09-03 18:26:35 +02:00
[enh] #12 web admin: retrict install to root path.
- Install: add check to install only on root path, comment sed line - Nginx conf: remove path choice sed - Manifest: set root path as default, add explaination. - Update upstream to 0.22.0a7 which handle proxy with https for webadmin - Update readme: add information about webadmin on root path and how to access api. -
This commit is contained in:
parent
e2c49b599b
commit
2b091dc805
5 changed files with 17 additions and 12 deletions
|
@ -15,15 +15,15 @@ sudo yunohost app install https://github.com/duniter/duniter_ynh
|
||||||
The package is **in progress**.
|
The package is **in progress**.
|
||||||
Currently, it:
|
Currently, it:
|
||||||
|
|
||||||
- Install Duniter ≥ 0.20.0
|
- Install Duniter ≥ 0.22.0a7
|
||||||
- Configure
|
- Configure
|
||||||
- Synchronize
|
- Synchronize
|
||||||
- Start
|
- Start
|
||||||
|
|
||||||
Extra features:
|
Extra features:
|
||||||
|
|
||||||
- Will come soon: graphical interface to manage the node.
|
- Graphical interface to manage the node.
|
||||||
- Path access through a proxy_pass instead through the port cause it failed.
|
- Path access on `https://duniter.domain.tld/api` to the node API and not through the port because it fail.
|
||||||
- Duniter logs are displayed on the YunoHost admin interface
|
- Duniter logs are displayed on the YunoHost admin interface
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
location YNH_EXAMPLE_PATH/ {
|
location / {
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
proxy_set_header X-NgninX-Porxy true;
|
proxy_set_header X-NgninX-Porxy true;
|
||||||
|
|
||||||
proxy_pass http://localhost:9220/;
|
proxy_pass http://localhost:9220;
|
||||||
proxy_redirect off;
|
proxy_redirect off;
|
||||||
|
|
||||||
# Socket.io support
|
# Socket.io support
|
||||||
|
@ -12,7 +12,7 @@ location YNH_EXAMPLE_PATH/ {
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection "upgrade";
|
proxy_set_header Connection "upgrade";
|
||||||
|
|
||||||
location ^~ YNH_EXAMPLE_PATH/api/ {
|
location ^~ /api/ {
|
||||||
proxy_pass http://YNH_EXAMPLE_DOMAIN:YNH_EXAMPLE_PORT/;
|
proxy_pass http://YNH_EXAMPLE_DOMAIN:YNH_EXAMPLE_PORT/;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
v0.21.3
|
v0.22.0a7
|
||||||
|
|
|
@ -35,11 +35,11 @@
|
||||||
"name": "path",
|
"name": "path",
|
||||||
"type": "path",
|
"type": "path",
|
||||||
"ask": {
|
"ask": {
|
||||||
"en": "Path on which install the proxy",
|
"en": "Path on which install the web admin (installable only on root path)",
|
||||||
"fr": "Chemin sur lequel ajouter le proxy"
|
"fr": "Chemin sur lequel ajouter l’administration web (installable uniquement sur la racine)"
|
||||||
},
|
},
|
||||||
"example": "/duniter",
|
"example": "/",
|
||||||
"default": "/duniter"
|
"default": "/"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "port",
|
"name": "port",
|
||||||
|
|
|
@ -23,6 +23,11 @@ source /usr/share/yunohost/helpers
|
||||||
sudo yunohost app checkurl "${domain}${path}" -a "$app" \
|
sudo yunohost app checkurl "${domain}${path}" -a "$app" \
|
||||||
|| ynh_die "Path not available: ${domain}${path}"
|
|| ynh_die "Path not available: ${domain}${path}"
|
||||||
|
|
||||||
|
# Check path is root
|
||||||
|
if [[ $path != '/' ]]; then
|
||||||
|
ynh_die "Web admin can only be installed on root path for now"
|
||||||
|
fi
|
||||||
|
|
||||||
# Check port availability
|
# Check port availability
|
||||||
sudo yunohost app checkport $port
|
sudo yunohost app checkport $port
|
||||||
if [[ ! $? -eq 0 ]]; then
|
if [[ ! $? -eq 0 ]]; then
|
||||||
|
@ -86,7 +91,7 @@ ynh_app_setting_set "$app" unprotected_uris "/" # "api/"
|
||||||
|
|
||||||
# Configure Nginx
|
# Configure Nginx
|
||||||
nginx_conf="../conf/nginx.conf"
|
nginx_conf="../conf/nginx.conf"
|
||||||
sudo sed -i "s@YNH_EXAMPLE_PATH@$path@g" $nginx_conf
|
#sudo sed -i "s@YNH_EXAMPLE_PATH@$path@g" $nginx_conf
|
||||||
sudo sed -i "s@YNH_EXAMPLE_PORT@$port@" $nginx_conf
|
sudo sed -i "s@YNH_EXAMPLE_PORT@$port@" $nginx_conf
|
||||||
sudo sed -i "s@YNH_EXAMPLE_DOMAIN@$domain@" $nginx_conf
|
sudo sed -i "s@YNH_EXAMPLE_DOMAIN@$domain@" $nginx_conf
|
||||||
sudo cp $nginx_conf /etc/nginx/conf.d/$domain.d/$app.conf
|
sudo cp $nginx_conf /etc/nginx/conf.d/$domain.d/$app.conf
|
||||||
|
|
Loading…
Add table
Reference in a new issue