1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/nitter_ynh.git synced 2024-09-03 19:46:24 +02:00

Merge pull request #15 from YunoHost-Apps/4.3

4.3
This commit is contained in:
Alexandre Aubin 2021-11-30 18:30:32 +01:00 committed by GitHub
commit cb3d385f83
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 7 additions and 63 deletions

View file

@ -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;
}

View file

@ -25,7 +25,7 @@
"install" : [
{
"name": "domain",
"type": "domain",
"type": "domain"
},
{
"name": "is_public",

View file

@ -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
#=================================================

View file

@ -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

View file

@ -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
#=================================================

View file

@ -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

View file

@ -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
#=================================================