mirror of
https://github.com/YunoHost-Apps/nitter_ynh.git
synced 2024-09-03 19:46:24 +02:00
commit
cb3d385f83
9 changed files with 7 additions and 63 deletions
|
@ -2,11 +2,6 @@ location / {
|
||||||
# Path to source
|
# Path to source
|
||||||
alias __FINALPATH__/public/ ;
|
alias __FINALPATH__/public/ ;
|
||||||
|
|
||||||
# Force usage of https
|
|
||||||
if ($scheme = http) {
|
|
||||||
rewrite ^ https://$server_name$request_uri? permanent;
|
|
||||||
}
|
|
||||||
|
|
||||||
try_files $uri @proxy_to_app;
|
try_files $uri @proxy_to_app;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
"install" : [
|
"install" : [
|
||||||
{
|
{
|
||||||
"name": "domain",
|
"name": "domain",
|
||||||
"type": "domain",
|
"type": "domain"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "is_public",
|
"name": "is_public",
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# dependencies used by the app
|
# dependencies used by the app
|
||||||
pkg_dependencies="acl nim redis-server libsass-dev"
|
pkg_dependencies="acl nim libsass-dev"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# PERSONAL HELPERS
|
# PERSONAL HELPERS
|
||||||
|
@ -33,30 +33,6 @@ function set_permissions {
|
||||||
# EXPERIMENTAL HELPERS
|
# 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
|
# FUTURE OFFICIAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -13,10 +13,6 @@ source /usr/share/yunohost/helpers
|
||||||
# MANAGE SCRIPT FAILURE
|
# 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
|
# Exit if an error occurs during the execution of the script
|
||||||
ynh_abort_if_errors
|
ynh_abort_if_errors
|
||||||
|
|
||||||
|
@ -31,6 +27,7 @@ title=$YNH_APP_ARG_TITLE
|
||||||
theme=$YNH_APP_ARG_THEME
|
theme=$YNH_APP_ARG_THEME
|
||||||
replace_youtube=$YNH_APP_ARG_REPLACE_YOUTUBE
|
replace_youtube=$YNH_APP_ARG_REPLACE_YOUTUBE
|
||||||
replace_instagram=$YNH_APP_ARG_REPLACE_INSTAGRAM
|
replace_instagram=$YNH_APP_ARG_REPLACE_INSTAGRAM
|
||||||
|
architecture=$YNH_ARCH
|
||||||
if [ $YNH_APP_ARG_PROXY_VIDEOS -eq 1 ]; then
|
if [ $YNH_APP_ARG_PROXY_VIDEOS -eq 1 ]; then
|
||||||
proxy_videos="true"
|
proxy_videos="true"
|
||||||
else
|
else
|
||||||
|
@ -55,8 +52,6 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Validating installation parameters..." --weight=1
|
ynh_script_progression --message="Validating installation parameters..." --weight=1
|
||||||
|
|
||||||
arch=$(ynh_detect_arch)
|
|
||||||
|
|
||||||
final_path=/opt/yunohost/$app
|
final_path=/opt/yunohost/$app
|
||||||
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
|
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=infinite_scroll --value=$infinite_scroll
|
||||||
ynh_app_setting_set --app=$app --key=hmac_key --value=$hmac_key
|
ynh_app_setting_set --app=$app --key=hmac_key --value=$hmac_key
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD MODIFICATIONS
|
# 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
|
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
ynh_setup_source --dest_dir="$final_path"
|
ynh_setup_source --dest_dir="$final_path" --source_id="$architecture"
|
||||||
|
|
||||||
ynh_setup_source --source_id="nim_$arch" --dest_dir="$final_path/nim-installation" || ynh_die --message="Your server's architecture is not supported"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
|
@ -179,8 +171,6 @@ ynh_script_progression --message="Configuring permissions..." --weight=1
|
||||||
# Make app public if necessary
|
# Make app public if necessary
|
||||||
if [ $is_public -eq 1 ]
|
if [ $is_public -eq 1 ]
|
||||||
then
|
then
|
||||||
# Everyone can access the app.
|
|
||||||
# The "main" permission is automatically created before the install script.
|
|
||||||
ynh_permission_update --permission="main" --add="visitors"
|
ynh_permission_update --permission="main" --add="visitors"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -65,15 +65,6 @@ ynh_script_progression --message="Removing NGINX web server configuration..." --
|
||||||
# Remove the dedicated NGINX config
|
# Remove the dedicated NGINX config
|
||||||
ynh_remove_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
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -14,9 +14,6 @@ source /usr/share/yunohost/helpers
|
||||||
# MANAGE SCRIPT FAILURE
|
# MANAGE SCRIPT FAILURE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_clean_setup () {
|
|
||||||
true
|
|
||||||
}
|
|
||||||
# Exit if an error occurs during the execution of the script
|
# Exit if an error occurs during the execution of the script
|
||||||
ynh_abort_if_errors
|
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_script_progression --message="Validating restoration parameters..." --weight=1
|
||||||
|
|
||||||
ynh_webpath_available --domain=$domain --path_url=$path_url \
|
test ! -d $final_path || ynh_die --message="There is already a directory: $final_path "
|
||||||
|| ynh_die --message="Path not available: ${domain}${path_url}"
|
|
||||||
test ! -d $final_path \
|
|
||||||
|| ynh_die --message="There is already a directory: $final_path "
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD RESTORATION STEPS
|
# STANDARD RESTORATION STEPS
|
||||||
|
|
|
@ -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)
|
hls_playback=$(ynh_app_setting_get --app=$app --key=hls_playback)
|
||||||
infinite_scroll=$(ynh_app_setting_get --app=$app --key=infinite_scroll)
|
infinite_scroll=$(ynh_app_setting_get --app=$app --key=infinite_scroll)
|
||||||
hmac_key=$(ynh_app_setting_get --app=$app --key=hmac_key)
|
hmac_key=$(ynh_app_setting_get --app=$app --key=hmac_key)
|
||||||
|
architecture=$YNH_ARCH
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK VERSION
|
# CHECK VERSION
|
||||||
|
@ -67,13 +68,10 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Upgrading source files..." --weight=1
|
ynh_script_progression --message="Upgrading source files..." --weight=1
|
||||||
|
|
||||||
arch=$(ynh_detect_arch)
|
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
mv "$final_path/nitter.conf" "$final_path/nitter.conf.bak"
|
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"
|
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
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Reference in a new issue