diff --git a/scripts/functions.sh b/scripts/functions.sh index a55f5c3..bc48788 100644 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -19,6 +19,12 @@ sudo dpkg -i $deb_path > /dev/null sudo rm -f $deb_path } +CONFIGURE_DUNITER () { + sudo duniter config --ipv4 127.0.0.1 --port $port --remoteh $domain --remotep 80 --noupnp + sudo duniter config --addep "BMAS $domain 443" + sudo duniter config --ws2p-host 127.0.0.1 --ws2p-port 20901 --ws2p-remote-host $domain --ws2p-remote-port 443 --ws2p-noupnp +} + CONFIG_SSOWAT () { # Add admin to the allowed users sudo yunohost app addaccess $app -u $admin diff --git a/scripts/install b/scripts/install index 80d1bff..ccf0bdf 100755 --- a/scripts/install +++ b/scripts/install @@ -45,11 +45,7 @@ ynh_app_setting_set "$app" admin "$admin" sudo yunohost firewall allow TCP $port > /dev/null 2>&1 INSTALL_DUNITER_DEBIAN_PACKAGE - -# Configure Duniter node -sudo duniter config --ipv4 127.0.0.1 --port $port --remoteh $domain --remotep 80 --noupnp -sudo duniter config --addep "BMAS $domain 443" -sudo duniter config --ws2p-host 127.0.0.1 --ws2p-port 20901 --ws2p-remote-host $domain --ws2p-remote-port 443 --ws2p-noupnp +CONFIGURE_DUNITER # Reset Duniter node's existing data (blockchain, not conf) sudo duniter reset data > /dev/null diff --git a/scripts/upgrade b/scripts/upgrade index cd65956..3bfe214 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -16,6 +16,7 @@ admin=$(ynh_app_setting_get "$app" admin) REMOVE_DUNITER INSTALL_DUNITER_DEBIAN_PACKAGE +CONFIGURE_DUNITER # Start duniter daemon sudo duniter webstart