1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/archivebox_ynh.git synced 2024-09-03 18:15:54 +02:00

Merge pull request #17 from YunoHost-Apps/example

Apply last example_ynh
This commit is contained in:
yalh76 2022-02-17 21:00:54 +01:00 committed by GitHub
commit 473cbf98af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 54 additions and 53 deletions

4
.gitignore vendored
View file

@ -1,4 +0,0 @@
*~
*.sw[op]
@
.idea

View file

@ -17,6 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
Archiving solution to collect, save, and view sites you want to preserve offline
**Shipped version:** 0.6.2~ynh9
**Demo:** https://archiveboxdemo.commoninternet.net
@ -32,7 +33,6 @@ Archiving solution to collect, save, and view sites you want to preserve offline
* currently only tested on amd64
* haven't yet implemented single-sign or LDAP integration
## Documentation and resources
* Official app website: https://archivebox.io/

View file

@ -11,7 +11,8 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
## Vue d'ensemble
Solution d'archivage pour collecter, enregistrer et afficher les sites que vous souhaitez conserver hors ligne
Archiving solution to collect, save, and view sites you want to preserve offline
**Version incluse :** 0.6.2~ynh9
@ -28,7 +29,6 @@ Solution d'archivage pour collecter, enregistrer et afficher les sites que vous
* currently only tested on amd64
* haven't yet implemented single-sign or LDAP integration
## Documentations et ressources
* Site officiel de l'app : https://archivebox.io/

View file

@ -15,7 +15,8 @@
setup_private=1
setup_public=1
upgrade=1
#upgrade=1 from_commit=CommitHash
# 0.6.2~ynh9
upgrade=1 from_commit=a2d626f966bc358aea53bbe78d9fa2a0e3783c78
backup_restore=1
multi_instance=1
port_already_use=0
@ -24,6 +25,5 @@
Email=
Notification=none
;;; Upgrade options
; commit=CommitHash
name=Name and date of the commit.
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666&
; commit=a2d626f966bc358aea53bbe78d9fa2a0e3783c78
name=0.6.2~ynh9

View file

@ -1,10 +1,5 @@
location __PATH__/ {
# Force usage of https
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
proxy_set_header Accept-Encoding "";
try_files $uri @proxy;

1
doc/DESCRIPTION.md Normal file
View file

@ -0,0 +1 @@
Archiving solution to collect, save, and view sites you want to preserve offline

View file

@ -2,4 +2,3 @@
* required to be run at the base path / , subpaths not yet supported
* currently only tested on amd64
* haven't yet implemented single-sign or LDAP integration

View file

@ -21,7 +21,7 @@
"email": "max@mfowler.info"
},
"requirements": {
"yunohost": ">= 4.1.7"
"yunohost": ">= 4.3.0"
},
"multi_instance": true,
"services": [

View file

@ -9,7 +9,7 @@ pkg_dependencies="python3-venv expect \
apt-transport-https ca-certificates gnupg2 zlib1g-dev dumb-init gosu cron unzip curl \
fontconfig fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-symbola fonts-noto fonts-freefont-ttf \
wget curl chromium git ffmpeg youtube-dl ripgrep \
build-essential python-dev python3-dev"
build-essential python3-dev"
nodejs_version=14

View file

@ -15,7 +15,6 @@ source /usr/share/yunohost/helpers
#=================================================
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

View file

@ -109,6 +109,7 @@ fi
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1
# Start a systemd service
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
#=================================================

View file

@ -14,7 +14,6 @@ source /usr/share/yunohost/helpers
#=================================================
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
@ -137,9 +136,13 @@ archivebox_cmd="$final_path/venv/bin/archivebox"
#=================================================
# INSTALL NODE DEPENDENCIES
#=================================================
ynh_script_progression --message="Install node dependencies..."
cp ../conf/package.json "$final_path/package.json"
cp ../conf/package-lock.json "$final_path/package-lock.json"
cd $final_path; ynh_npm ci
pushd $final_path
ynh_npm ci
popd
ynh_node_path=$ynh_node
@ -153,7 +156,6 @@ ynh_app_setting_set --app=$app --key=datadir --value=$datadir
mkdir -p $datadir
# permissions
chmod 750 "$datadir"
chmod -R o-rwx "$datadir"
chown -R $app:www-data "$datadir"

View file

@ -21,6 +21,7 @@ port=$(ynh_app_setting_get --app=$app --key=port)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$db_name
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
#=================================================
# STANDARD REMOVE
@ -44,12 +45,12 @@ ynh_script_progression --message="Stopping and removing the systemd service..."
ynh_remove_systemd_config
#=================================================
# REMOVE DEPENDENCIES
# REMOVE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Removing dependencies..." --weight=1
ynh_script_progression --message="Removing logrotate configuration..." --weight=1
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
# Remove the app-specific logrotate config
ynh_remove_logrotate
#=================================================
# REMOVE APP MAIN DIR
@ -59,6 +60,17 @@ ynh_script_progression --message="Removing app main directory..." --weight=1
# Remove the app directory securely
ynh_secure_remove --file="$final_path"
#=================================================
# REMOVE DATA DIR
#=================================================
# Remove the data directory if --purge option is used
if [ "${YNH_APP_PURGE:-0}" -eq 1 ]
then
ynh_script_progression --message="Removing app data directory..."
ynh_secure_remove --file="$datadir"
fi
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
@ -68,12 +80,12 @@ ynh_script_progression --message="Removing NGINX web server configuration..." -
ynh_remove_nginx_config
#=================================================
# REMOVE LOGROTATE CONFIGURATION
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression --message="Removing logrotate configuration..." --weight=1
ynh_script_progression --message="Removing dependencies..." --weight=1
# Remove the app-specific logrotate config
ynh_remove_logrotate
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
#=================================================
# SPECIFIC REMOVE

View file

@ -15,7 +15,6 @@ source /usr/share/yunohost/helpers
#=================================================
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
@ -120,10 +119,8 @@ yunohost service add $app --description="Self-hosted internet archiving" --log="
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Ensuring systemd log folder is restored..." --weight=1
mkdir -p /var/log/$app
ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
#=================================================

View file

@ -25,7 +25,7 @@ admin=$(ynh_app_setting_get --app=$app --key=admin)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
language=$(ynh_app_setting_get --app=$app --key=language)
port=$(ynh_app_setting_get --app=$app --key=port)
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
#=================================================
# SET CORRECT NODE VERSION
@ -35,6 +35,7 @@ ynh_use_nodejs --nodejs_version=$nodejs_version
#=================================================
# CHECK VERSION
#=================================================
ynh_script_progression --message="Checking version..."
upgrade_type=$(ynh_check_app_version_changed)
@ -81,6 +82,14 @@ ynh_script_progression --message="Making sure dedicated system user exists..." -
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1
# Create a dedicated NGINX config
ynh_add_nginx_config
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
@ -97,8 +106,6 @@ fi
# UPGRADE VIA PIP
#=================================================
datadir=/home/yunohost.app/$app
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading via pip" --weight=1
@ -127,14 +134,6 @@ chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1
# Create a dedicated NGINX config
ynh_add_nginx_config
#=================================================
# SETUP SYSTEMD
#=================================================