1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/jackett_ynh.git synced 2024-09-03 19:26:28 +02:00

Cleaning up

This commit is contained in:
ericgaspar 2021-08-03 22:21:36 +02:00
parent 9bfe8d694a
commit 4a9d710c33
No known key found for this signature in database
GPG key ID: 574F281483054D44
9 changed files with 9 additions and 87 deletions

View file

@ -1,8 +1,3 @@
# See here for more information
# https://github.com/YunoHost/package_check#syntax-check_process-file
# Move this file from check_process.default to check_process when you have filled it.
;; Test complet
; Manifest
domain="domain.tld"
@ -20,7 +15,6 @@
upgrade=1 from_commit=CommitHash
backup_restore=1
multi_instance=1
port_already_use=0
change_url=1
;;; Options
Email=

View file

@ -1,17 +1,18 @@
#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:9117;
proxy_pass http://127.0.0.1:__PORT__;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $http_host;
proxy_redirect off;
# Allow the Jackett API
location __PATH__/api {
auth_request off;

View file

@ -3,17 +3,15 @@
"id": "jackett",
"packaging_format": 1,
"description": {
"en": "It provides API support for your favorite torrent trackers.",
"fr": "Expliquez en *quelques* (10~15) mots l'utilité de l'app ou ce qu'elle fait (l'objectif est de donner une idée grossière pour des utilisateurs qui naviguent dans un catalogue de 100+ apps)"
"en": "API Support for your favorite torrent trackers",
"fr": "Expliquez en *qe idée grossière pour des utilisateurs qui naviguent dans un catalogue de 100+ apps)"
},
"version": "0.18.98~ynh1",
"url": "https://example.com",
"upstream": {
"license": "GPL-2.0",
"website": "https://github.com/Jackett/Jackett",
"demo": "https://github.com/Jackett/Jackett",
"admindoc": "https://yunohost.org/packaging_apps",
"userdoc": "https://yunohost.org/apps",
"code": "https://github.com/Jackett/Jackett"
},
"license": "GPL-2.0",
@ -22,7 +20,7 @@
"email": "navanchauhan+yunohost@gmail.com"
},
"requirements": {
"yunohost": ">= 4.1.3"
"yunohost": ">= 4.2.0"
},
"multi_instance": true,
"services": [
@ -43,9 +41,6 @@
},
{
"name": "is_public",
"help": {
"en": "Should the user interface be exposed to the public"
},
"type": "boolean",
"default": true
}

View file

@ -30,8 +30,6 @@ app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
domain=$(ynh_app_setting_get --app=$app --key=domain)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
# DECLARE DATA AND CONF FILES TO BACKUP

View file

@ -28,7 +28,7 @@ ynh_script_progression --message="Loading installation settings..."
# Needed for helper "ynh_add_nginx_config"
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
app_port=$()ynh_app_setting_get --app=$app --key=port)
port=$()ynh_app_setting_get --app=$app --key=port)
#=================================================
# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP
@ -87,7 +87,6 @@ then
# Set global variables for NGINX helper
domain="$old_domain"
path_url="$new_path"
port="$app_port"
match_string=$(echo \"BasePathOverride\": \"$old_path\")
target_string=$(echo \"BasePathOverride\": \"$new_path\")
sed --in-place "s@${match_string}@${target_string}@g" "$final_path/.config/Jackett/ServerConfig.json"

View file

@ -76,12 +76,6 @@ 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" --source_id="app.$architecture"
# FIXME: this should be managed by the core in the future
# Here, as a packager, you may have to tweak the ownerhsip/permissions
# such that the appropriate users (e.g. maybe www-data) can access
# files in some cases.
# But FOR THE LOVE OF GOD, do not allow r/x for "others" on the entire folder -
# this will be treated as a security issue.
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app: $final_path
@ -91,8 +85,6 @@ chown -R $app: $final_path
#=================================================
ynh_script_progression --message="Configuring NGINX web server..."
### `ynh_add_nginx_config` will use the file conf/nginx.conf
# Create a dedicated NGINX config
ynh_add_nginx_config
@ -102,7 +94,6 @@ ynh_add_nginx_config
ynh_script_progression --message="Configuring a systemd service..."
# Create a dedicated systemd config
ynh_replace_string --match_string=__PORT__ --replace_string="$port" --target_file="../conf/systemd.service"
ynh_add_systemd_config
#=================================================

View file

@ -65,16 +65,6 @@ ynh_script_progression --message="Removing logrotate configuration..."
# Remove the app-specific logrotate config
ynh_remove_logrotate
#=================================================
# CLOSE A PORT
#=================================================
if yunohost firewall list | grep -q "\- $port$"
then
ynh_script_progression --message="Closing port $port..."
ynh_exec_warn_less yunohost firewall disallow TCP $port
fi
#=================================================
# SPECIFIC REMOVE
#=================================================

View file

@ -66,23 +66,10 @@ ynh_script_progression --message="Restoring the app main directory..."
ynh_restore_file --origin_path="$final_path"
# FIXME: this should be managed by the core in the future
# Here, as a packager, you may have to tweak the ownerhsip/permissions
# such that the appropriate users (e.g. maybe www-data) can access
# files in some cases.
# But FOR THE LOVE OF GOD, do not allow r/x for "others" on the entire folder -
# this will be treated as a security issue.
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#=================================================
# SPECIFIC RESTORATION
#=================================================
# RESTORE VARIOUS FILES
#=================================================
ynh_script_progression --message="Restoring various files..."
#=================================================
# RESTORE SYSTEMD
#=================================================
@ -125,4 +112,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Restoration completed for $app" --time --last
ynh_script_progression --message="Restoration completed for $app" --last

View file

@ -24,12 +24,6 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
# CHECK VERSION
#=================================================
### This helper will compare the version of the currently installed app and the version of the upstream package.
### $upgrade_type can have 2 different values
### - UPGRADE_APP if the upstream app version has changed
### - UPGRADE_PACKAGE if only the YunoHost package has changed
### ynh_check_app_version_changed will stop the upgrade if the app is up to date.
### UPGRADE_APP should be used to upgrade the core app only if there's an upgrade to do.
upgrade_type=$(ynh_check_app_version_changed)
#=================================================
@ -60,27 +54,6 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..."
#
# N.B. : the followings setting migrations snippets are provided as *EXAMPLES*
# of what you may want to do in some cases (e.g. a setting was not defined on
# some legacy installs and you therefore want to initiaze stuff during upgrade)
#
# If db_name doesn't exist, create it
#if [ -z "$db_name" ]; then
# db_name=$(ynh_sanitize_dbid --db_name=$app)
# ynh_app_setting_set --app=$app --key=db_name --value=$db_name
#fi
# If final_path doesn't exist, create it
#if [ -z "$final_path" ]; then
# final_path=/var/www/$app
# ynh_app_setting_set --app=$app --key=final_path --value=$final_path
#fi
### If nobody installed your app before 4.1,
### then you may safely remove these lines
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
@ -120,12 +93,6 @@ then
ynh_setup_source --dest_dir="$final_path" --source_id="app.$architecture"
fi
# FIXME: this should be managed by the core in the future
# Here, as a packager, you may have to tweak the ownerhsip/permissions
# such that the appropriate users (e.g. maybe www-data) can access
# files in some cases.
# But FOR THE LOVE OF GOD, do not allow r/x for "others" on the entire folder -
# this will be treated as a security issue.
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
@ -181,4 +148,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Upgrade of $app completed" --time --last
ynh_script_progression --message="Upgrade of $app completed" --last