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**.
|
||||
Currently, it:
|
||||
|
||||
- Install Duniter ≥ 0.20.0
|
||||
- Install Duniter ≥ 0.22.0a7
|
||||
- Configure
|
||||
- Synchronize
|
||||
- Start
|
||||
|
||||
Extra features:
|
||||
|
||||
- Will come soon: graphical interface to manage the node.
|
||||
- Path access through a proxy_pass instead through the port cause it failed.
|
||||
- Graphical interface to manage the node.
|
||||
- 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
|
||||
|
||||
## License
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
location YNH_EXAMPLE_PATH/ {
|
||||
location / {
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-NgninX-Porxy true;
|
||||
|
||||
proxy_pass http://localhost:9220/;
|
||||
proxy_pass http://localhost:9220;
|
||||
proxy_redirect off;
|
||||
|
||||
# Socket.io support
|
||||
|
@ -12,7 +12,7 @@ location YNH_EXAMPLE_PATH/ {
|
|||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
|
||||
location ^~ YNH_EXAMPLE_PATH/api/ {
|
||||
location ^~ /api/ {
|
||||
proxy_pass http://YNH_EXAMPLE_DOMAIN:YNH_EXAMPLE_PORT/;
|
||||
}
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
v0.21.3
|
||||
v0.22.0a7
|
||||
|
|
|
@ -35,11 +35,11 @@
|
|||
"name": "path",
|
||||
"type": "path",
|
||||
"ask": {
|
||||
"en": "Path on which install the proxy",
|
||||
"fr": "Chemin sur lequel ajouter le proxy"
|
||||
"en": "Path on which install the web admin (installable only on root path)",
|
||||
"fr": "Chemin sur lequel ajouter l’administration web (installable uniquement sur la racine)"
|
||||
},
|
||||
"example": "/duniter",
|
||||
"default": "/duniter"
|
||||
"example": "/",
|
||||
"default": "/"
|
||||
},
|
||||
{
|
||||
"name": "port",
|
||||
|
|
|
@ -23,6 +23,11 @@ source /usr/share/yunohost/helpers
|
|||
sudo yunohost app checkurl "${domain}${path}" -a "$app" \
|
||||
|| 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
|
||||
sudo yunohost app checkport $port
|
||||
if [[ ! $? -eq 0 ]]; then
|
||||
|
@ -86,7 +91,7 @@ ynh_app_setting_set "$app" unprotected_uris "/" # "api/"
|
|||
|
||||
# Configure Nginx
|
||||
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_DOMAIN@$domain@" $nginx_conf
|
||||
sudo cp $nginx_conf /etc/nginx/conf.d/$domain.d/$app.conf
|
||||
|
|
Loading…
Add table
Reference in a new issue