diff --git a/conf/nim_x86-64.src b/conf/amd64.src similarity index 100% rename from conf/nim_x86-64.src rename to conf/amd64.src diff --git a/conf/nim_i386.src b/conf/i386.src similarity index 100% rename from conf/nim_i386.src rename to conf/i386.src diff --git a/conf/nginx.conf b/conf/nginx.conf index 6d81029..ee3b1be 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -2,11 +2,6 @@ location / { # Path to source alias __FINALPATH__/public/ ; - # Force usage of https - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - try_files $uri @proxy_to_app; } diff --git a/manifest.json b/manifest.json index 88a09f5..04aff5a 100644 --- a/manifest.json +++ b/manifest.json @@ -25,7 +25,7 @@ "install" : [ { "name": "domain", - "type": "domain", + "type": "domain" }, { "name": "is_public", diff --git a/scripts/_common.sh b/scripts/_common.sh index 9686c57..3b36634 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,7 @@ #================================================= # dependencies used by the app -pkg_dependencies="acl nim redis-server libsass-dev" +pkg_dependencies="acl nim libsass-dev" #================================================= # PERSONAL HELPERS @@ -33,30 +33,6 @@ function set_permissions { # EXPERIMENTAL HELPERS #================================================= -# Check the architecture -# -# example: architecture=$(ynh_detect_arch) -# -# usage: ynh_detect_arch -# -# Requires YunoHost version 2.2.4 or higher. - -ynh_detect_arch(){ - local architecture - if [ -n "$(uname -m | grep arm64)" ] || [ -n "$(uname -m | grep aarch64)" ]; then - architecture="arm64" - elif [ -n "$(uname -m | grep 64)" ]; then - architecture="x86-64" - elif [ -n "$(uname -m | grep 86)" ]; then - architecture="i386" - elif [ -n "$(uname -m | grep arm)" ]; then - architecture="arm" - else - architecture="unknown" - fi - echo $architecture -} - #================================================= # FUTURE OFFICIAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index cfdc825..39324c2 100755 --- a/scripts/install +++ b/scripts/install @@ -13,10 +13,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - ### Remove this function if there's nothing to clean before calling the remove script. - true -} # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -31,6 +27,7 @@ title=$YNH_APP_ARG_TITLE theme=$YNH_APP_ARG_THEME replace_youtube=$YNH_APP_ARG_REPLACE_YOUTUBE replace_instagram=$YNH_APP_ARG_REPLACE_INSTAGRAM +architecture=$YNH_ARCH if [ $YNH_APP_ARG_PROXY_VIDEOS -eq 1 ]; then proxy_videos="true" else @@ -55,8 +52,6 @@ app=$YNH_APP_INSTANCE_NAME #================================================= ynh_script_progression --message="Validating installation parameters..." --weight=1 -arch=$(ynh_detect_arch) - final_path=/opt/yunohost/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" @@ -79,7 +74,6 @@ ynh_app_setting_set --app=$app --key=hls_playback --value=$hls_playback ynh_app_setting_set --app=$app --key=infinite_scroll --value=$infinite_scroll ynh_app_setting_set --app=$app --key=hmac_key --value=$hmac_key - #================================================= # STANDARD MODIFICATIONS #================================================= @@ -105,9 +99,7 @@ ynh_script_progression --message="Setting up source files..." --weight=1 ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" - -ynh_setup_source --source_id="nim_$arch" --dest_dir="$final_path/nim-installation" || ynh_die --message="Your server's architecture is not supported" +ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" #================================================= # NGINX CONFIGURATION @@ -179,8 +171,6 @@ ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public if necessary if [ $is_public -eq 1 ] then - # Everyone can access the app. - # The "main" permission is automatically created before the install script. ynh_permission_update --permission="main" --add="visitors" fi diff --git a/scripts/remove b/scripts/remove index 667f14a..9a9c83e 100755 --- a/scripts/remove +++ b/scripts/remove @@ -65,15 +65,6 @@ ynh_script_progression --message="Removing NGINX web server configuration..." -- # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# CLOSE A PORT -#================================================= -if yunohost firewall list | grep -q "\- $port$" -then - ynh_script_progression --message="Closing port $port..." --weight=1 - ynh_exec_warn_less yunohost firewall disallow TCP $port -fi - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/restore b/scripts/restore index ee2bfa5..71d2e88 100755 --- a/scripts/restore +++ b/scripts/restore @@ -14,9 +14,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - true -} # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -36,10 +33,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=1 -ynh_webpath_available --domain=$domain --path_url=$path_url \ - || ynh_die --message="Path not available: ${domain}${path_url}" -test ! -d $final_path \ - || ynh_die --message="There is already a directory: $final_path " +test ! -d $final_path || ynh_die --message="There is already a directory: $final_path " #================================================= # STANDARD RESTORATION STEPS diff --git a/scripts/upgrade b/scripts/upgrade index 22275db..c49f52e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -29,6 +29,7 @@ proxy_videos=$(ynh_app_setting_get --app=$app --key=proxy_videos) hls_playback=$(ynh_app_setting_get --app=$app --key=hls_playback) infinite_scroll=$(ynh_app_setting_get --app=$app --key=infinite_scroll) hmac_key=$(ynh_app_setting_get --app=$app --key=hmac_key) +architecture=$YNH_ARCH #================================================= # CHECK VERSION @@ -67,13 +68,10 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=1 - arch=$(ynh_detect_arch) - # Download, check integrity, uncompress and patch the source from app.src mv "$final_path/nitter.conf" "$final_path/nitter.conf.bak" - ynh_setup_source --dest_dir="$final_path" + ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" mv "$final_path/nitter.conf.bak" "$final_path/nitter.conf" - ynh_setup_source --source_id="nim_$arch" --dest_dir="$final_path/nim-installation" || ynh_die --message="Your server's architecture is not supported" fi #=================================================