mirror of
https://github.com/YunoHost-Apps/streams_ynh.git
synced 2024-09-03 20:26:20 +02:00
fix
This commit is contained in:
parent
a89ada37d6
commit
bb8ee187f5
12 changed files with 57 additions and 124 deletions
40
README.md
40
README.md
|
@ -1,27 +1,18 @@
|
|||
# ZAP for YunoHost
|
||||
|
||||
[](https://dash.yunohost.org/appci/app/zap)  
|
||||
|
||||
[](https://install-app.yunohost.org/?app=zap)
|
||||
|
||||
> *This package allow you to install ZAP quickly and simply on a YunoHost server.
|
||||
If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.*
|
||||
|
||||
Version: 2020-12-07
|
||||
|
||||
|
||||
### Interesting links
|
||||
|
||||
- [YunoHost project](https://yunohost.org)
|
||||
- [Zap website](https://zotlabs.com/zap/)
|
||||
- [Zap code on codeberg](https://codeberg.org/zot/zap)
|
||||
- [Zap addons on codeberg](https://codeberg.org/zot/zap-addons)
|
||||
|
||||
## ZAP
|
||||
## Overview
|
||||
[Zap](https://zotlabs.com/zap/) is an an ethical alternative to Fediverse that provides powerful features for creating interconnected websites featuring a decentralized identity, communications, and permissions framework built using common webserver technology.
|
||||
|
||||
Compatible with **Mastodon**, **Pleroma**, **Pixelfed**, **Friendica**, **Hubzilla**, **Funkwhale**, **Peertube**, **Plume**, **WriteFreely** and many, many more.
|
||||
|
||||
**Shipped version:** 2020-12-07
|
||||
|
||||
## Unique Features of ZAP
|
||||
|
||||
- **Groups** : public, private, and moderated.
|
||||
|
@ -32,8 +23,6 @@ Compatible with **Mastodon**, **Pleroma**, **Pixelfed**, **Friendica**, **Hubzil
|
|||
- **Lists**: Sometimes referred to as circles or aspects, this lets you define your own groups of related friends and- communicate with them as a private group.
|
||||
- **Extend** : Change or upgrade your software functionality as desired by installing additional features from addons and- the free app collection.
|
||||
|
||||
|
||||
|
||||
## This app claims following features:
|
||||
- [X] Ldap integration
|
||||
- [X] Multi-instance
|
||||
|
@ -41,7 +30,6 @@ Compatible with **Mastodon**, **Pleroma**, **Pixelfed**, **Friendica**, **Hubzil
|
|||
- [X] Fail2ban
|
||||
- [X] Option to choose between **Mysql** and **PostgreSQL**.
|
||||
|
||||
|
||||
## Installation
|
||||
Before installing, read the [Zap installation instructions](https://codeberg.org/zot/zap/src/branch/release/install/INSTALL.txt) for important information about:
|
||||
|
||||
|
@ -64,5 +52,25 @@ Before installing, read the [Zap installation instructions](https://codeberg.org
|
|||
|
||||
#### Supported architectures
|
||||
|
||||
* x86-64b - [](https://ci-apps.yunohost.org/ci/apps/zap/)
|
||||
* x86-64 - [](https://ci-apps.yunohost.org/ci/apps/zap/)
|
||||
* ARMv8-A - [](https://ci-apps-arm.yunohost.org/ci/apps/zap/)
|
||||
|
||||
## Links
|
||||
|
||||
* YunoHost project: https://yunohost.org
|
||||
* Zap website: https://zotlabs.com/zap/
|
||||
* Zap code on codeberg: https://codeberg.org/zot/zap
|
||||
* Zap addons on codeberg: https://codeberg.org/zot/zap-addons
|
||||
|
||||
---
|
||||
|
||||
## Developer info
|
||||
|
||||
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/zap_ynh/tree/testing).
|
||||
|
||||
To try the testing branch, please proceed like that.
|
||||
```
|
||||
sudo yunohost app install https://github.com/YunoHost-Apps/zap_ynh/tree/testing --debug
|
||||
or
|
||||
sudo yunohost app upgrade zap -u https://github.com/YunoHost-Apps/zap_ynh/tree/testing --debug
|
||||
```
|
||||
|
|
|
@ -20,11 +20,8 @@
|
|||
#upgrade=1 from_commit=a2a416d743aaab3c01f36baec81b36b21720235f
|
||||
backup_restore=1
|
||||
multi_instance=1
|
||||
incorrect_path=1
|
||||
port_already_use=0
|
||||
change_url=0
|
||||
;;; Levels
|
||||
Level 5=auto
|
||||
;;; Options
|
||||
Email=anmol@datamol.org
|
||||
Notification=change
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
# 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" (DOMAIN)
|
||||
path="/path" (PATH)
|
||||
admin="john" (USER)
|
||||
language="fr"
|
||||
is_public=1 (PUBLIC|public=1|private=0)
|
||||
password="pass"
|
||||
port="666" (PORT)
|
||||
; Checks
|
||||
pkg_linter=1
|
||||
setup_sub_dir=1
|
||||
setup_root=1
|
||||
setup_nourl=0
|
||||
setup_private=1
|
||||
setup_public=1
|
||||
upgrade=1
|
||||
upgrade=1 from_commit=CommitHash
|
||||
backup_restore=1
|
||||
multi_instance=1
|
||||
# This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version.
|
||||
# incorrect_path=1
|
||||
port_already_use=0
|
||||
change_url=1
|
||||
;;; Levels
|
||||
# If the level 5 (Package linter) is forced to 1. Please add justifications here.
|
||||
Level 5=auto
|
||||
;;; Options
|
||||
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&
|
||||
|
|
@ -33,7 +33,7 @@ group = __USER__
|
|||
; (IPv6 and IPv4-mapped) on a specific port;
|
||||
; '/path/to/unix/socket' - to listen on a unix socket.
|
||||
; Note: This value is mandatory.
|
||||
listen = /var/run/php/php7.0-fpm-__NAMETOCHANGE__.sock
|
||||
listen = /var/run/php/php__PHPVERSION__-fpm-__NAMETOCHANGE__.sock
|
||||
|
||||
; Set listen(2) backlog.
|
||||
; Default Value: 511 (-1 on FreeBSD and OpenBSD)
|
||||
|
|
|
@ -5,16 +5,14 @@
|
|||
"description": {
|
||||
"en": "A fediverse server."
|
||||
},
|
||||
|
||||
"version": "2020-12-07~ynh1",
|
||||
|
||||
"url": "https://zotlabs.com/zap/",
|
||||
"license": "MIT",
|
||||
"maintainer": {
|
||||
"name": "Anmol Sharma"
|
||||
},
|
||||
"requirements": {
|
||||
"yunohost": ">= 3.8.1"
|
||||
"yunohost": ">= 4.0.0"
|
||||
},
|
||||
"multi_instance": true,
|
||||
"services": [
|
||||
|
@ -51,9 +49,6 @@
|
|||
"choices": ["1", "2"],
|
||||
"default": "1"
|
||||
}
|
||||
|
||||
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,4 +16,4 @@
|
|||
---
|
||||
*If you have access to [App Continuous Integration for packagers](https://yunohost.org/#/packaging_apps_ci) you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results*
|
||||
|
||||
[/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/REPLACEBYYOURAPP_ynh%20PR-NUM-%20(USERNAME)/)
|
||||
[/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/zap_ynh%20PR-NUM-%20(USERNAME)/)
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
# dependencies used by the app
|
||||
YNH_PHP_VERSION="7.3"
|
||||
|
||||
extra_php_dependencies="php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-pgsql php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-gd"
|
||||
extra_php_dependencies="php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-pgsql php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-gd"
|
||||
# dependencies used by the app
|
||||
pkg_dependencies="postgresql postgresql-contrib"
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
|
||||
source ../settings/scripts/_common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
|
@ -15,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
|
||||
|
@ -24,7 +22,7 @@ ynh_abort_if_errors
|
|||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Loading installation settings..."
|
||||
ynh_print_info --message="Loading installation settings..."
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
|
@ -34,49 +32,46 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
|||
database=$(ynh_app_setting_get --app=$app --key=database)
|
||||
|
||||
#=================================================
|
||||
# STANDARD BACKUP STEPS
|
||||
# DECLARE DATA AND CONF FILES TO BACKUP
|
||||
#=================================================
|
||||
ynh_print_info --message="Declaring files to be backed up..."
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE APP MAIN DIR
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up the main app directory..."
|
||||
|
||||
ynh_backup --src_path="$final_path"
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up nginx web server configuration..."
|
||||
|
||||
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE PHP-FPM CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up php-fpm configuration..."
|
||||
|
||||
ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# BACKUP OF THE DATABASE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up the MySQL database..."
|
||||
|
||||
if [ $database -eq 1 ]; then
|
||||
ynh_script_progression --message="Backup of the MySQL database..."
|
||||
ynh_print_info --message="Backup of the MySQL database..."
|
||||
ynh_mysql_dump_db --database="$db_name" > db.sql
|
||||
elif [ $database -eq 2 ]; then
|
||||
# Removing postgresql database
|
||||
ynh_script_progression --message="Backup of the postgresql database..."
|
||||
# Removing postgresSQL database
|
||||
ynh_print_info --message="Backup of the postgreSQL database..."
|
||||
ynh_psql_dump_db --database="$db_name" > db.sql
|
||||
fi
|
||||
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC BACKUP
|
||||
#=================================================
|
||||
# BACKUP LOGROTATE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up logrotate configuration..."
|
||||
|
||||
ynh_backup --src_path="/etc/logrotate.d/$app"
|
||||
|
||||
|
@ -89,7 +84,6 @@ ynh_backup --src_path="/etc/cron.d/$app"
|
|||
#=================================================
|
||||
# BACKUP FAIL2BAN CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up fail2ban configuration..."
|
||||
|
||||
ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf"
|
||||
ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
|
||||
|
@ -98,4 +92,4 @@ ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
|
|||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
|
||||
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
|
||||
|
|
|
@ -132,11 +132,8 @@ elif [ $database -eq 2 ]; then
|
|||
ynh_psql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name" < $final_path/install/schema_postgres.sql
|
||||
else
|
||||
ynh_die --message="Some problem occured in creating the database, contact maintainer"
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
#=================================================
|
||||
# MODIFY A CONFIG FILE
|
||||
#=================================================
|
||||
|
@ -163,7 +160,7 @@ cat ../conf/ldap_conf.php >> $final_path/.htconfig.php
|
|||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring nginx web server..."
|
||||
ynh_script_progression --message="Configuring NGINX web server..."
|
||||
|
||||
# Create a dedicated nginx config
|
||||
ynh_add_nginx_config
|
||||
|
@ -179,7 +176,7 @@ ynh_system_user_create --username=$app
|
|||
#=================================================
|
||||
# PHP-FPM CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring php-fpm..."
|
||||
ynh_script_progression --message="Configuring PHP-FPM..."
|
||||
|
||||
# Create a dedicated php-fpm config
|
||||
ynh_add_fpm_config --package="$extra_php_dependencies"
|
||||
|
@ -214,19 +211,20 @@ ynh_use_logrotate "$final_path/php.log"
|
|||
# SETUP FAIL2BAN
|
||||
#=================================================
|
||||
ynh_script_progression --message="Add Fail2Ban..."
|
||||
|
||||
ynh_add_fail2ban_config --logpath="$final_path/php.log" --failregex="^.*auth\.php.*failed login attempt.*from IP <HOST>.*$" --max_retry="5"
|
||||
|
||||
#=================================================
|
||||
# SETUP SSOWAT
|
||||
#=================================================
|
||||
# As Zap is social network and have its own permission there is no need to keep Zap behind SSO
|
||||
ynh_script_progression --message="Configuring SSOwat..."
|
||||
# As Zap is social network and have its own permission there is no need to keep Zap behind SSO
|
||||
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading nginx web server..."
|
||||
ynh_script_progression --message="Reloading NGINX web server..."
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
|
|
|
@ -22,37 +22,23 @@ db_user="$db_name"
|
|||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
database=$(ynh_app_setting_get --app=$app --key=database)
|
||||
|
||||
#=================================================
|
||||
# STANDARD REMOVE
|
||||
#=================================================
|
||||
|
||||
#=================================================
|
||||
# STANDARD REMOVE
|
||||
#=================================================
|
||||
|
||||
#=================================================
|
||||
# REMOVE THE DATABASE
|
||||
#=================================================
|
||||
|
||||
if [ $database -eq 1 ]; then
|
||||
ynh_script_progression --message="Removing MySQL database..."
|
||||
ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name
|
||||
elif [ $database -eq 2 ]; then
|
||||
# Removing postgresql database
|
||||
ynh_script_progression --message="Removing postgresql database..."
|
||||
ynh_script_progression --message="Removing postgreSQL database..."
|
||||
ynh_psql_remove_db --db_user=$db_user --db_name=$db_name
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# REMOVE DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_print_info "Removing dependencies"
|
||||
|
||||
# Remove metapackage and its dependencies
|
||||
ynh_remove_app_dependencies
|
||||
#=================================================
|
||||
# REMOVE DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing dependencies..."
|
||||
ynh_script_progression --message="Removing dependencies"
|
||||
|
||||
# Remove metapackage and its dependencies
|
||||
ynh_remove_app_dependencies
|
||||
|
@ -68,15 +54,15 @@ ynh_secure_remove --file="$final_path"
|
|||
#=================================================
|
||||
# REMOVE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing nginx web server configuration..."
|
||||
ynh_script_progression --message="Removing NGINX web server configuration..."
|
||||
|
||||
# Remove the dedicated nginx config
|
||||
# Remove the dedicated NGINX config
|
||||
ynh_remove_nginx_config
|
||||
|
||||
#=================================================
|
||||
# REMOVE PHP-FPM CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing php-fpm configuration..."
|
||||
ynh_script_progression --message="Removing PHP-FPM configuration..."
|
||||
|
||||
# Remove the dedicated php-fpm config
|
||||
ynh_remove_fpm_config
|
||||
|
@ -96,11 +82,10 @@ ynh_remove_logrotate
|
|||
# Remove a cron file
|
||||
ynh_secure_remove --file="/etc/cron.d/$app"
|
||||
|
||||
|
||||
#=================================================
|
||||
# REMOVE FAIL2BAN CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing fail2ban configuration..."
|
||||
ynh_script_progression --message="Removing Fail2Ban configuration..."
|
||||
|
||||
ynh_remove_fail2ban_config
|
||||
|
||||
|
|
|
@ -105,7 +105,6 @@ ynh_add_fpm_config --package="$extra_php_dependencies"
|
|||
#=================================================
|
||||
# SPECIFIC RESTORATION
|
||||
#=================================================
|
||||
#=================================================
|
||||
# RESTORE THE CRON FILE
|
||||
#=================================================
|
||||
|
||||
|
@ -120,7 +119,7 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
|||
#=================================================
|
||||
# RESTORE FAIL2BAN CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the fail2ban configuration..."
|
||||
ynh_script_progression --message="Restoring the Fail2Ban configuration..."
|
||||
|
||||
ynh_restore_file "/etc/fail2ban/jail.d/$app.conf"
|
||||
ynh_restore_file "/etc/fail2ban/filter.d/$app.conf"
|
||||
|
@ -134,7 +133,7 @@ ynh_app_setting_set $app skipped_uris "/"
|
|||
#=================================================
|
||||
# RELOAD NGINX AND PHP-FPM
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading nginx web server and php-fpm..."
|
||||
ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..."
|
||||
|
||||
ynh_systemd_action --service_name=php$phpversion-fpm --action=reload
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
|
|
@ -35,7 +35,6 @@ if [ -z "$db_name" ]; then
|
|||
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
||||
fi
|
||||
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
|
@ -56,7 +55,8 @@ ynh_abort_if_errors
|
|||
#=================================================
|
||||
# REMOVE APP MAIN DIR
|
||||
#=================================================
|
||||
ynh_print_info "Upgrading source files..."
|
||||
ynh_script_progression --message="Upgrading source files..."
|
||||
|
||||
# Create a temporary directory
|
||||
tmpdir="$(ynh_smart_mktemp 6000)"
|
||||
# Backup the config file in the temp dir
|
||||
|
@ -80,13 +80,11 @@ fi
|
|||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Upgrading source files..."
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$final_path"
|
||||
|
||||
|
||||
#=================================================
|
||||
# STANDARD UPGRADE STEPS
|
||||
#=================================================
|
||||
|
@ -106,11 +104,10 @@ chmod -R 777 $final_path/store
|
|||
mkdir $final_path/addon
|
||||
ynh_setup_source --dest_dir="$final_path/addon" --source_id="app_addons"
|
||||
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading nginx web server configuration..."
|
||||
ynh_script_progression --message="Upgrading NGINX web server configuration..."
|
||||
|
||||
# Create a dedicated nginx config
|
||||
ynh_add_nginx_config
|
||||
|
@ -129,7 +126,7 @@ chown -R $app: $final_path
|
|||
#=================================================
|
||||
# PHP-FPM CONFIGURATION
|
||||
#=================================================
|
||||
ynh_print_info "Upgrading php-fpm configuration..."
|
||||
ynh_script_progression --message="Upgrading PHP-FPM configuration..."
|
||||
|
||||
# Create a dedicated php-fpm config
|
||||
ynh_add_fpm_config --package="$extra_php_dependencies"
|
||||
|
|
Loading…
Add table
Reference in a new issue