1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/simple-torrent_ynh.git synced 2024-09-03 20:26:18 +02:00
This commit is contained in:
ericgaspar 2021-12-04 23:50:03 +01:00
parent 316db7a247
commit 4681c08ae8
No known key found for this signature in database
GPG key ID: 574F281483054D44
8 changed files with 12 additions and 44 deletions

View file

@ -3,4 +3,5 @@ SOURCE_SUM=d2f535e4cd0449b357a563cfce79c1f6afcac9b7b3af94e758defc44faa52ebf
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=gz SOURCE_FORMAT=gz
SOURCE_IN_SUBDIR=false SOURCE_IN_SUBDIR=false
SOURCE_FILENAME=simple-torrent
SOURCE_EXTRACT=false SOURCE_EXTRACT=false

View file

@ -3,4 +3,5 @@ SOURCE_SUM=6f48f8b59bc8d834c6ede1d27ecc1a598b8a0be1dab00622caa6fd047e51eed6
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=gz SOURCE_FORMAT=gz
SOURCE_IN_SUBDIR=false SOURCE_IN_SUBDIR=false
SOURCE_FILENAME=simple-torrent
SOURCE_EXTRACT=false SOURCE_EXTRACT=false

View file

@ -3,4 +3,5 @@ SOURCE_SUM=583898eb907c21dbbcb6f33934eae3dc1d6ec2620fdc7689c70a3479049af52b
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=gz SOURCE_FORMAT=gz
SOURCE_IN_SUBDIR=false SOURCE_IN_SUBDIR=false
SOURCE_FILENAME=simple-torrent
SOURCE_EXTRACT=false SOURCE_EXTRACT=false

View file

@ -1,10 +1,5 @@
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
location __PATH__/ { location __PATH__/ {
# Force usage of https
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
proxy_pass http://127.0.0.1:__PORT__/; proxy_pass http://127.0.0.1:__PORT__/;
proxy_redirect off; proxy_redirect off;

View file

@ -15,24 +15,3 @@
#================================================= #=================================================
# FUTURE OFFICIAL HELPERS # FUTURE OFFICIAL 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 86)" ]; then
architecture="i386"
elif [ -n "$(uname -m | grep 64)" ]; then
architecture="x86_64"
else
architecture="unknown"
fi
echo $architecture
}

View file

@ -23,7 +23,7 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_DOMAIN domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH path_url=$YNH_APP_ARG_PATH
is_public=$YNH_APP_ARG_IS_PUBLIC is_public=$YNH_APP_ARG_IS_PUBLIC
architecture=$(ynh_detect_arch) architecture=$YNH_ARCH
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -88,11 +88,6 @@ 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 --source_id="$architecture" ynh_setup_source --dest_dir=$final_path --source_id="$architecture"
pushd "$final_path"
gzip --decompress $(ynh_detect_arch).gz
mv $(ynh_detect_arch) $app
popd
chmod 750 "$final_path" chmod 750 "$final_path"
chmod -R o-rwx "$final_path" chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path" chown -R $app:www-data "$final_path"

View file

@ -55,12 +55,13 @@ ynh_secure_remove --file="$final_path"
# REMOVE DATA DIR # REMOVE DATA DIR
#================================================= #=================================================
# # Remove the app data directory with the command `yunohost app remove --purge` # Remove the app data directory with the command `yunohost app remove --purge`
# if [ "${YNH_APP_PURGE:-0}" -eq 1 ] # Remove the data directory if --purge option is used
# then if [ "${YNH_APP_PURGE:-0}" -eq 1 ]
# ynh_script_progression --message="Removing $app data directory..." --weight=2 then
# ynh_secure_remove --file="$datadir" ynh_script_progression --message="Removing app data directory..." --weight=1
# fi ynh_secure_remove --file="$datadir"
fi
#================================================= #=================================================
# REMOVE NGINX CONFIGURATION # REMOVE NGINX CONFIGURATION

View file

@ -21,7 +21,7 @@ path_url=$(ynh_app_setting_get --app=$app --key=path)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
port=$(ynh_app_setting_get --app=$app --key=port) port=$(ynh_app_setting_get --app=$app --key=port)
peer_port=$(ynh_app_setting_get --app=$app --key=peer_port) peer_port=$(ynh_app_setting_get --app=$app --key=peer_port)
architecture=$(ynh_detect_arch) architecture=$YNH_ARCH
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
@ -88,11 +88,6 @@ then
# 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 --source_id="$architecture" --keep="$final_path/config.yml" ynh_setup_source --dest_dir=$final_path --source_id="$architecture" --keep="$final_path/config.yml"
pushd "$final_path"
gzip --decompress $(ynh_detect_arch).gz
mv $(ynh_detect_arch) $app
popd
fi fi
chmod 750 "$final_path" chmod 750 "$final_path"