From fc3ae457f1e7ed0a4e4560f1fc2dfd51d58c5ef1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Moreau?= Date: Wed, 14 Jun 2017 15:47:51 +0200 Subject: [PATCH 1/6] No initial sync --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index d3584e1..8362215 100755 --- a/scripts/install +++ b/scripts/install @@ -65,8 +65,8 @@ sudo duniter config --addep "BMAS $domain 443" sudo duniter reset data > /dev/null # Synchronize Duniter node -echo "Synchronizing with $sync_node:$sync_port. It may take a while." -sudo duniter sync $sync_node $sync_port --nointeractive > /dev/null +# Secho "Synchronizing with $sync_node:$sync_port. It may take a while." +# Ssudo duniter sync $sync_node $sync_port --nointeractive > /dev/null # Launch Duniter node sudo duniter webstart From 4416f892d95f3d5e7dbf3c137ce953393f243790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Moreau?= Date: Wed, 14 Jun 2017 15:49:19 +0200 Subject: [PATCH 2/6] Remove sync parameters --- scripts/install | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/scripts/install b/scripts/install index 8362215..9f6e58a 100755 --- a/scripts/install +++ b/scripts/install @@ -8,10 +8,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$YNH_APP_ARG_DOMAIN path="/" port=10901 -sync_node=$YNH_APP_ARG_SYNC_NODE -sync_port=$YNH_APP_ARG_SYNC_PORT admin=$YNH_APP_ARG_ADMIN -is_cesium_public=$YNH_APP_ARG_IS_CESIUM_PUBLIC # Source app helpers and functions source /usr/share/yunohost/helpers @@ -27,13 +24,6 @@ if [[ ! $? -eq 0 ]]; then ynh_die "Port not available: ${port}" fi -# Check node availability -if curl --output /dev/null --silent --head --fail "$sync_node:$sync_port/node/summary"; then - echo "Node $sync_node:$sync_port is available" -else - ynh_die "Node $sync_node:$sync_port is not available" 2 -fi - # Check the admin exists in YunoHost users ynh_user_exists $admin @@ -50,7 +40,6 @@ fi ynh_app_setting_set $app port $port ynh_app_setting_set $app arch $arch ynh_app_setting_set "$app" admin "$admin" -ynh_app_setting_set "$app" is_cesium_public "$is_cesium_public" # Open port on firewall sudo yunohost firewall allow TCP $port > /dev/null 2>&1 @@ -64,10 +53,6 @@ sudo duniter config --addep "BMAS $domain 443" # Reset Duniter node's existing data (blockchain, not conf) sudo duniter reset data > /dev/null -# Synchronize Duniter node -# Secho "Synchronizing with $sync_node:$sync_port. It may take a while." -# Ssudo duniter sync $sync_node $sync_port --nointeractive > /dev/null - # Launch Duniter node sudo duniter webstart From 14eb28f88be6fed82c3ec163acd0b5f6a86d7c75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Moreau?= Date: Wed, 14 Jun 2017 15:49:49 +0200 Subject: [PATCH 3/6] Remove sync + cesium parameters --- manifest.json | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/manifest.json b/manifest.json index b012ed9..67375b4 100644 --- a/manifest.json +++ b/manifest.json @@ -31,24 +31,6 @@ }, "example": "duniter.domain.tld" }, - { - "name": "sync_node", - "ask": { - "en": "Node's address (domain name or IP address) to synchronise with", - "fr": "Adresse du nœud (nom de domaine ou adresse IP) avec lequel se synchroniser" - }, - "example": "duniter.org", - "default": "duniter.org" - }, - { - "name": "sync_port", - "ask": { - "en": "Port of synchronization", - "fr": "Port de synchronisation" - }, - "example": "10901", - "default": "10901" - }, { "name": "admin", "type": "user", @@ -57,16 +39,7 @@ "fr": "Administrateur. Ce doit être un utilisateur YunoHost" }, "example": "jon doe" - }, - { - "name": "is_cesium_public", - "ask": { - "en": "Make Cesium available publicly?", - "fr": "Permettre à Cesium d'être consulté publiquement ?" - }, - "choices": ["Yes", "No"], - "default": "Yes" - } + } ] } } From d9494b91de79fbad2e16dbb305d9beeac6597e64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Moreau?= Date: Wed, 14 Jun 2017 15:54:03 +0200 Subject: [PATCH 4/6] Create upgrade --- scripts/upgrade | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index cc74fcc..cd65956 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -13,7 +13,6 @@ domain=$(ynh_app_setting_get "$app" domain) port=$(ynh_app_setting_get "$app" port) arch=$(ynh_app_setting_get "$app" arch) admin=$(ynh_app_setting_get "$app" admin) -is_cesium_public=$(ynh_app_setting_get "$app" is_cesium_public) REMOVE_DUNITER INSTALL_DUNITER_DEBIAN_PACKAGE From b29f4e4465d9baba9d7fb2f68bcfa13ebf354419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Moreau?= Date: Wed, 14 Jun 2017 16:11:49 +0200 Subject: [PATCH 5/6] Protect some URLs --- scripts/functions.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/scripts/functions.sh b/scripts/functions.sh index 7290f22..5de0e15 100644 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -22,14 +22,8 @@ CONFIG_SSOWAT () { # Add admin to the allowed users sudo yunohost app addaccess $app -u $admin -# Allow only allowed users to access admin panel -if [ "$is_cesium_public" = "Yes" ]; then - # Cesium is public, do not protect it - ynh_app_setting_set "$app" protected_uris "/webui","/webmin","/modules" -else - # Cesium is not public, protect it - ynh_app_setting_set "$app" protected_uris "/webui","/webmin","/modules","/cesium" -fi +# Protect senstive sub-routes +ynh_app_setting_set "$app" protected_uris "/webui","/webmin","/modules" # Duniter is public app, with only some parts restricted in nginx.conf ynh_app_setting_set "$app" unprotected_uris "/" From 3689cc85d7c4f071ccb10edeb64597806088e234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Moreau?= Date: Wed, 14 Jun 2017 16:20:17 +0200 Subject: [PATCH 6/6] Remove Cesium related stuff --- scripts/functions.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/scripts/functions.sh b/scripts/functions.sh index 5de0e15..4512d77 100644 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -10,12 +10,6 @@ wget -nc --quiet $url -P /tmp deb="/tmp/duniter-server-$version-linux-$arch.deb" sudo dpkg -i $deb > /dev/null sudo rm -f $deb - -# Patch Cesium to access local instance -# Note by cgeek: Cesium has been removed from Duniter since v1.3 -# cesium_conf="/opt/duniter/sources/node_modules/duniter-ui/public/cesium/config.js" -# sudo sed -i "s@\"host\".*@\"host\": \"$domain\",@" $cesium_conf -# sudo sed -i "s@\"port\".*@\"port\": \"443\"@" $cesium_conf } CONFIG_SSOWAT () {