diff --git a/README.md b/README.md
index 0d7c791..67bfba8 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,8 @@ It shall NOT be edited by hand.
# CouchDB for YunoHost
-[](https://dash.yunohost.org/appci/app/couchdb)  
+[](https://dash.yunohost.org/appci/app/couchdb)  
+
[](https://install-app.yunohost.org/?app=couchdb)
*[Lire ce readme en français.](./README_fr.md)*
@@ -30,18 +31,12 @@ And as described in the couchdb official website:

-## Disclaimers / important information
-
-## Configuration
-
-You can do most configuration of CouchDB from fauxton, the web interface, accessible at the domain you specified: `https://domain.tld/_utils/index.html`
-
## Documentation and resources
* Official app website:
* Official admin documentation:
* Upstream app code repository:
-* YunoHost documentation for this app:
+* YunoHost Store:
* Report a bug:
## Developer info
diff --git a/README_fr.md b/README_fr.md
index 01b4ac0..e66e0a4 100644
--- a/README_fr.md
+++ b/README_fr.md
@@ -5,15 +5,16 @@ It shall NOT be edited by hand.
# CouchDB pour YunoHost
-[](https://dash.yunohost.org/appci/app/couchdb)  
+[](https://dash.yunohost.org/appci/app/couchdb)  
+
[](https://install-app.yunohost.org/?app=couchdb)
*[Read this readme in english.](./README.md)*
-> *Ce package vous permet d'installer CouchDB rapidement et simplement sur un serveur YunoHost.
-Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
+> *Ce package vous permet d’installer CouchDB rapidement et simplement sur un serveur YunoHost.
+Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.*
-## Vue d'ensemble
+## Vue d’ensemble
Couchdb est un gestionnaire de bases de données dans lesquelles les entrées sont des documents jsons (avec possibilité de pièces jointes), qui peuvent être manipulées par de simples requêtes http.
@@ -24,22 +25,15 @@ Comme le présente wikipédia:
**Version incluse :** 3.3.0~ynh1
-## Captures d'écran
-
-
-## Avertissements / informations importantes
-
-## Configuration
-
-Vous pouvez effectuer la plupart des configurations de CouchDB à partir de fauxton, l'interface Web, accessible sur le domaine que vous avez spécifié : `https://domain.tld/_utils/index.html`
+
## Documentations et ressources
-* Site officiel de l'app :
-* Documentation officielle de l'admin :
-* Dépôt de code officiel de l'app :
-* Documentation YunoHost pour cette app :
+* Site officiel de l’app :
+* Documentation officielle de l’admin :
+* Dépôt de code officiel de l’app :
+* YunoHost Store:
* Signaler un bug :
## Informations pour les développeurs
@@ -54,4 +48,4 @@ ou
sudo yunohost app upgrade couchdb -u https://github.com/YunoHost-Apps/couchdb_ynh/tree/testing --debug
```
-**Plus d'infos sur le packaging d'applications :**
+**Plus d’infos sur le packaging d’applications :**
\ No newline at end of file
diff --git a/check_process b/check_process
deleted file mode 100644
index 5be5a1a..0000000
--- a/check_process
+++ /dev/null
@@ -1,23 +0,0 @@
-;; Test complet
- ; Manifest
- domain="domain.tld"
- path="/path"
- is_public=1
- password="1Strong-Password"
- ; Checks
- pkg_linter=1
- setup_sub_dir=1
- setup_root=1
- setup_nourl=0
- setup_private=1
- setup_public=1
- upgrade=1
- # 3.1.1~ynh3
- upgrade=1 from_commit=0e91958cfd8406e71e9c4e506620c5e9b7110a5f
- backup_restore=1
- multi_instance=0
- port_already_use=0
- change_url=1
-;;; Options
-Email=squeak@eauchat.org
-Notification=none
diff --git a/doc/DISCLAIMER_fr.md b/doc/ADMIN_fr.md
similarity index 100%
rename from doc/DISCLAIMER_fr.md
rename to doc/ADMIN_fr.md
diff --git a/doc/DISCLAIMER.md b/doc/ADMIn.md
similarity index 100%
rename from doc/DISCLAIMER.md
rename to doc/ADMIn.md
diff --git a/manifest.json b/manifest.json
deleted file mode 100644
index 659d288..0000000
--- a/manifest.json
+++ /dev/null
@@ -1,54 +0,0 @@
-{
- "name": "CouchDB",
- "id": "couchdb",
- "packaging_format": 1,
- "description": {
- "en": "Open-source document-oriented NoSQL database",
- "fr": "Système de gestion de base de données orienté documents"
- },
- "version": "3.3.0~ynh1",
- "url": "https://couchdb.apache.org/",
- "upstream": {
- "license": "Apache-2.0",
- "website": "https://couchdb.apache.org/",
- "admindoc": "https://docs.couchdb.org/en/stable/",
- "code": "https://github.com/apache/couchdb",
- "cpe": "cpe:2.3:a:apache:couchdb"
- },
- "license": "Apache-2.0",
- "maintainer": {
- "name": "Squeak",
- "email": "squeak@eauchat.org",
- "url": "https://squeak.eauchat.org"
- },
- "requirements": {
- "yunohost": ">= 4.2.4"
- },
- "multi_instance": false,
- "services": [
- "nginx"
- ],
- "arguments": {
- "install": [
- {
- "name": "domain",
- "type": "domain"
- },
- {
- "name": "path",
- "type": "path",
- "example": "/couch",
- "default": "/couch"
- },
- {
- "name": "is_public",
- "type": "boolean",
- "default": true
- },
- {
- "name": "password",
- "type": "password"
- }
- ]
- }
-}
diff --git a/manifest.toml b/manifest.toml
new file mode 100644
index 0000000..1bc766a
--- /dev/null
+++ b/manifest.toml
@@ -0,0 +1,70 @@
+#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json
+
+packaging_format = 2
+
+id = "couchdb"
+name = "CouchDB"
+description.en = "Open-source document-oriented NoSQL database"
+description.fr = "Système de gestion de base de données orienté documents"
+
+version = "3.2.2~ynh2"
+
+maintainers = ["Squeak"]
+
+[upstream]
+license = "Apache-2.0"
+website = "https://couchdb.apache.org/"
+admindoc = "https://docs.couchdb.org/en/stable/"
+code = "https://github.com/apache/couchdb"
+cpe = "cpe:2.3:a:apache:couchdb"
+
+[integration]
+yunohost = ">= 11.1"
+architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"]
+multi_instance = false
+ldap = "not_relevant"
+sso = "not_relevant"
+disk = "20M"
+ram.build = "150M"
+ram.runtime = "60M"
+
+[install]
+ [install.domain]
+ # this is a generic question - ask strings are automatically handled by Yunohost's core
+ type = "domain"
+
+ [install.path]
+ # this is a generic question - ask strings are automatically handled by Yunohost's core
+ type = "path"
+ default = "/couch"
+
+ [install.init_main_permission]
+ type = "group"
+ default = "visitors"
+
+ [install.password]
+ # this is a generic question - ask strings are automatically handled by Yunohost's core
+ type = "password"
+
+[resources]
+ [resources.system_user]
+
+ [resources.install_dir]
+ dir = "/opt/couchdb"
+
+ [resources.data_dir]
+
+ [resources.permissions]
+ main.url = "/"
+
+ [resources.ports]
+ main.default = 5984
+
+ [resources.apt]
+ packages = ["gnupg", "ca-certificates"]
+
+ # FIXME : find a way to do that here
+ # [resources.apt.extras.couchdb]
+ # repo = "deb https://apache.jfrog.io/artifactory/couchdb-deb/ $(lsb_release -c -s) main"
+ # key = "https://couchdb.apache.org/repo/keys.asc"
+ # packages = ["couchdb"]
diff --git a/scripts/_common.sh b/scripts/_common.sh
index 196f5af..944a65e 100644
--- a/scripts/_common.sh
+++ b/scripts/_common.sh
@@ -4,9 +4,6 @@
# COMMON VARIABLES
#=================================================
-# dependencies used by the app (must be on a single line)
-pkg_dependencies="gnupg ca-certificates"
-
#=================================================
# PERSONAL HELPERS
#=================================================
diff --git a/scripts/backup b/scripts/backup
index 143d201..907da7a 100755
--- a/scripts/backup
+++ b/scripts/backup
@@ -10,27 +10,6 @@
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
-#=================================================
-# MANAGE SCRIPT FAILURE
-#=================================================
-
-ynh_clean_setup () {
- true
-}
-# Exit if an error occurs during the execution of the script
-ynh_abort_if_errors
-
-#=================================================
-# LOAD SETTINGS
-#=================================================
-ynh_print_info --message="Loading installation settings..."
-
-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)
-datadir=$(ynh_app_setting_get --app=$app --key=datadir)
-
#=================================================
# DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
@@ -40,13 +19,13 @@ ynh_print_info --message="Declaring files to be backed up..."
# BACKUP THE APP MAIN DIR
#=================================================
-ynh_backup --src_path="$final_path"
+ynh_backup --src_path="$install_dir"
#=================================================
# BACKUP THE DATA DIR
#=================================================
-ynh_backup --src_path="$datadir" --is_big
+ynh_backup --src_path="$data_dir" --is_big
#=================================================
# BACKUP THE NGINX CONFIGURATION
diff --git a/scripts/change_url b/scripts/change_url
index 04a206d..16e0f3c 100644
--- a/scripts/change_url
+++ b/scripts/change_url
@@ -9,62 +9,6 @@
source _common.sh
source /usr/share/yunohost/helpers
-#=================================================
-# RETRIEVE ARGUMENTS
-#=================================================
-
-old_domain=$YNH_APP_OLD_DOMAIN
-old_path=$YNH_APP_OLD_PATH
-
-new_domain=$YNH_APP_NEW_DOMAIN
-new_path=$YNH_APP_NEW_PATH
-
-app=$YNH_APP_INSTANCE_NAME
-
-#=================================================
-# LOAD SETTINGS
-#=================================================
-ynh_script_progression --message="Loading installation settings..." --weight=2
-
-# Needed for helper "ynh_add_nginx_config"
-final_path=$(ynh_app_setting_get --app=$app --key=final_path)
-
-# Add settings here as needed by your application
-port=$(ynh_app_setting_get --app=$app --key=port)
-
-#=================================================
-# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP
-#=================================================
-ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=15
-
-# Backup the current version of the app
-ynh_backup_before_upgrade
-ynh_clean_setup () {
- # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location.
- ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
-
- # Restore it if the upgrade fails
- ynh_restore_upgradebackup
-}
-# Exit if an error occurs during the execution of the script
-ynh_abort_if_errors
-
-#=================================================
-# CHECK WHICH PARTS SHOULD BE CHANGED
-#=================================================
-
-change_domain=0
-if [ "$old_domain" != "$new_domain" ]
-then
- change_domain=1
-fi
-
-change_path=0
-if [ "$old_path" != "$new_path" ]
-then
- change_path=1
-fi
-
#=================================================
# STANDARD MODIFICATIONS
#=================================================
@@ -72,38 +16,7 @@ fi
#=================================================
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2
-nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
-
-# Change the path in the NGINX config file
-if [ $change_path -eq 1 ]
-then
- # Make a backup of the original NGINX config file if modified
- ynh_backup_if_checksum_is_different --file="$nginx_conf_path"
- # Set global variables for NGINX helper
- domain="$old_domain"
- path_url="$new_path"
- # Create a dedicated NGINX config
- ynh_add_nginx_config
-fi
-
-# Change the domain for NGINX
-if [ $change_domain -eq 1 ]
-then
- # Delete file checksum for the old conf file location
- ynh_delete_file_checksum --file="$nginx_conf_path"
- mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf
- # Store file checksum for the new config file location
- ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
-fi
-
-#=================================================
-# GENERIC FINALISATION
-#=================================================
-# RELOAD NGINX
-#=================================================
-ynh_script_progression --message="Reloading NGINX web server..." --weight=1
-
-ynh_systemd_action --service_name=nginx --action=reload
+ynh_change_url_nginx_config
#=================================================
# END OF SCRIPT
diff --git a/scripts/install b/scripts/install
index 8ebd4c9..706e974 100755
--- a/scripts/install
+++ b/scripts/install
@@ -9,69 +9,6 @@
source _common.sh
source /usr/share/yunohost/helpers
-#=================================================
-# MANAGE SCRIPT FAILURE
-#=================================================
-
-ynh_clean_setup () {
- true
-}
-# Exit if an error occurs during the execution of the script
-ynh_abort_if_errors
-
-#=================================================
-# RETRIEVE ARGUMENTS FROM THE MANIFEST
-#=================================================
-
-domain=$YNH_APP_ARG_DOMAIN
-path_url=$YNH_APP_ARG_PATH
-is_public=$YNH_APP_ARG_IS_PUBLIC
-password=$YNH_APP_ARG_PASSWORD
-
-app=$YNH_APP_INSTANCE_NAME
-
-#=================================================
-# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
-#=================================================
-ynh_script_progression --message="Validating installation parameters..." --weight=1
-
-final_path=/opt/couchdb
-test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
-
-datadir=/var/lib/$app
-
-# Register (book) web path
-ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
-
-#=================================================
-# STORE SETTINGS FROM MANIFEST
-#=================================================
-ynh_script_progression --message="Storing installation settings..." --weight=1
-
-ynh_app_setting_set --app=$app --key=domain --value=$domain
-ynh_app_setting_set --app=$app --key=path --value=$path_url
-ynh_app_setting_set --app=$app --key=password --value=$password
-ynh_app_setting_set --app=$app --key=final_path --value=$final_path
-ynh_app_setting_set --app=$app --key=datadir --value=$datadir
-
-#=================================================
-# STANDARD MODIFICATIONS
-#=================================================
-# FIND AND OPEN A PORT
-#=================================================
-ynh_script_progression --message="Finding an available port..." --weight=2
-
-# Find an available port
-port=$(ynh_find_port --port=5984)
-ynh_app_setting_set --app=$app --key=port --value=$port
-
-#=================================================
-# INSTALL DEPENDENCIES
-#=================================================
-ynh_script_progression --message="Installing dependencies..." --weight=8
-
-ynh_install_app_dependencies $pkg_dependencies
-
#=================================================
# NGINX CONFIGURATION
#=================================================
@@ -87,19 +24,22 @@ ynh_add_nginx_config
#=================================================
ynh_script_progression --message="Installing CouchDB..." --weight=60
-COUCHDB_PASSWORD=$password
-echo "couchdb couchdb/mode select standalone
+echo "\
+couchdb couchdb/mode select standalone
couchdb couchdb/mode seen true
couchdb couchdb/bindaddress string 127.0.0.1
couchdb couchdb/bindaddress seen true
-couchdb couchdb/cookie string ${COUCHDB_PASSWORD}
-couchdb couchdb/adminpass password ${COUCHDB_PASSWORD}
+couchdb couchdb/cookie string $password
+couchdb couchdb/adminpass password $password
couchdb couchdb/adminpass seen true
-couchdb couchdb/adminpass_again password ${COUCHDB_PASSWORD}
+couchdb couchdb/adminpass_again password $password
couchdb couchdb/adminpass_again seen true" | debconf-set-selections
DEBIAN_FRONTEND=noninteractive # apt-get install -y --force-yes couchdb
-ynh_install_extra_app_dependencies --repo="deb https://apache.jfrog.io/artifactory/couchdb-deb/ $(lsb_release -c -s) main" --package="couchdb" --key="https://couchdb.apache.org/repo/keys.asc"
+ynh_install_extra_app_dependencies \
+ --repo="deb https://apache.jfrog.io/artifactory/couchdb-deb/ $(lsb_release -c -s) main" \
+ --key="https://couchdb.apache.org/repo/keys.asc" \
+ --package="couchdb"
#=================================================
# ADD A CONFIGURATION
@@ -107,11 +47,11 @@ ynh_install_extra_app_dependencies --repo="deb https://apache.jfrog.io/artifacto
ynh_script_progression --message="Adding a configuration file..." --weight=2
# Customize a bit the couch config
-ynh_add_config --template="../conf/couch_ynh.ini" --destination="$final_path/etc/local.d/couch_ynh.ini"
+ynh_add_config --template="../conf/couch_ynh.ini" --destination="$install_dir/etc/local.d/couch_ynh.ini"
-chmod 750 "$final_path"
-chmod -R o-rwx "$final_path"
-chown -R $app:$app "$final_path"
+chmod 750 "$install_dir"
+chmod -R o-rwx "$install_dir"
+chown -R "$app:$app" "$install_dir"
#=================================================
# GENERIC FINALIZATION
@@ -138,29 +78,6 @@ ynh_script_progression --message="Configuring Fail2Ban..." --weight=3
# Create a dedicated Fail2Ban config
ynh_add_fail2ban_config --logpath="/var/log/couchdb/couchdb.log" --failregex="[warning] .*couch_httpd_auth: Authentication failed for user .+ from " --max_retry=5
-#=================================================
-# SETUP SSOWAT
-#=================================================
-ynh_script_progression --message="Configuring permissions..." --weight=3
-
-# Setup that clicking SSO tile opens fauxton UI
-ynh_permission_url --permission="main" --url="/_utils/index.html" --add_url="/" --auth_header=false
-
-# Make app public if necessary
-if [ $is_public -eq 1 ]
-then
- # Everyone can access the app.
- # The "main" permission is automatically created before the install script.
- ynh_permission_update --permission="main" --add="visitors"
-fi
-
-#=================================================
-# RELOAD NGINX
-#=================================================
-ynh_script_progression --message="Reloading NGINX web server..." --weight=3
-
-ynh_systemd_action --service_name=nginx --action=reload
-
#=================================================
# END OF SCRIPT
#=================================================
diff --git a/scripts/remove b/scripts/remove
index a8ba343..681116d 100755
--- a/scripts/remove
+++ b/scripts/remove
@@ -9,18 +9,6 @@
source _common.sh
source /usr/share/yunohost/helpers
-#=================================================
-# LOAD SETTINGS
-#=================================================
-ynh_script_progression --message="Loading installation settings..." --weight=1
-
-app=$YNH_APP_INSTANCE_NAME
-
-domain=$(ynh_app_setting_get --app=$app --key=domain)
-port=$(ynh_app_setting_get --app=$app --key=port)
-final_path=$(ynh_app_setting_get --app=$app --key=final_path)
-datadir=$(ynh_app_setting_get --app=$app --key=datadir)
-
#=================================================
# STANDARD REMOVE
#=================================================
@@ -42,25 +30,6 @@ ynh_script_progression --message="Removing logrotate configuration..." --weight=
# Remove the app-specific logrotate config
ynh_remove_logrotate
-#=================================================
-# REMOVE APP MAIN DIR
-#=================================================
-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..." --weight=1
- ynh_secure_remove --file="$datadir"
-fi
-
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
@@ -69,14 +38,6 @@ ynh_script_progression --message="Removing NGINX web server configuration..." --
# Remove the dedicated NGINX config
ynh_remove_nginx_config
-#=================================================
-# REMOVE DEPENDENCIES
-#=================================================
-ynh_script_progression --message="Removing dependencies..." --weight=16
-
-# Remove metapackage and its dependencies
-ynh_remove_app_dependencies
-
#=================================================
# REMOVE FAIL2BAN CONFIGURATION
#=================================================
@@ -85,16 +46,6 @@ ynh_script_progression --message="Removing Fail2Ban configuration..." --weight=2
# Remove the dedicated Fail2Ban config
ynh_remove_fail2ban_config
-#=================================================
-# GENERIC FINALIZATION
-#=================================================
-# REMOVE DEDICATED USER
-#=================================================
-ynh_script_progression --message="Removing the dedicated system user..." --weight=2
-
-# Delete a system user
-ynh_system_user_delete --username=$app
-
#=================================================
# END OF SCRIPT
#=================================================
diff --git a/scripts/restore b/scripts/restore
index 8556d62..82e7cca 100755
--- a/scripts/restore
+++ b/scripts/restore
@@ -10,38 +10,6 @@
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
-#=================================================
-# MANAGE SCRIPT FAILURE
-#=================================================
-
-ynh_clean_setup () {
- true
-}
-# Exit if an error occurs during the execution of the script
-ynh_abort_if_errors
-
-#=================================================
-# LOAD SETTINGS
-#=================================================
-ynh_script_progression --message="Loading installation settings..." --weight=1
-
-app=$YNH_APP_INSTANCE_NAME
-
-domain=$(ynh_app_setting_get --app=$app --key=domain)
-path_url=$(ynh_app_setting_get --app=$app --key=path)
-final_path=$(ynh_app_setting_get --app=$app --key=final_path)
-password=$(ynh_app_setting_get --app=$app --key=password)
-port=$(ynh_app_setting_get --app=$app --key=port)
-datadir=$(ynh_app_setting_get --app=$app --key=datadir)
-
-#=================================================
-# CHECK IF THE APP CAN BE RESTORED
-#=================================================
-ynh_script_progression --message="Validating restoration parameters..." --weight=2
-
-test ! -d $final_path \
- || ynh_die --message="There is already a directory: $final_path "
-
#=================================================
# STANDARD RESTORATION STEPS
#=================================================
@@ -49,16 +17,16 @@ test ! -d $final_path \
#=================================================
ynh_script_progression --message="Restoring the app main directory..." --weight=10
-ynh_restore_file --origin_path="$final_path"
+ynh_restore_file --origin_path="$install_dir"
#=================================================
# RESTORE THE DATA DIRECTORY
#=================================================
ynh_script_progression --message="Restoring the data directory..." --weight=1
-ynh_restore_file --origin_path="$datadir" --not_mandatory
+ynh_restore_file --origin_path="$data_dir" --not_mandatory
-mkdir -p $datadir
+mkdir -p $data_dir
#=================================================
# RESTORE FAIL2BAN CONFIGURATION
@@ -71,14 +39,6 @@ ynh_systemd_action --action=restart --service_name=fail2ban
#=================================================
# SPECIFIC RESTORATION
-#=================================================
-# REINSTALL DEPENDENCIES
-#=================================================
-ynh_script_progression --message="Reinstalling dependencies..." --weight=6
-
-# Define and install dependencies
-ynh_install_app_dependencies $pkg_dependencies
-
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
@@ -91,27 +51,30 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
ynh_script_progression --message="Reinstalling couchdb..." --weight=40
-COUCHDB_PASSWORD=$password
-echo "couchdb couchdb/mode select standalone
+echo "\
+couchdb couchdb/mode select standalone
couchdb couchdb/mode seen true
couchdb couchdb/bindaddress string 127.0.0.1
couchdb couchdb/bindaddress seen true
-couchdb couchdb/cookie string ${COUCHDB_PASSWORD}
-couchdb couchdb/adminpass password ${COUCHDB_PASSWORD}
+couchdb couchdb/cookie string $password
+couchdb couchdb/adminpass password $password
couchdb couchdb/adminpass seen true
-couchdb couchdb/adminpass_again password ${COUCHDB_PASSWORD}
+couchdb couchdb/adminpass_again password $password
couchdb couchdb/adminpass_again seen true" | debconf-set-selections
DEBIAN_FRONTEND=noninteractive # apt-get install -y --force-yes couchdb
-ynh_install_extra_app_dependencies --repo="deb https://apache.jfrog.io/artifactory/couchdb-deb/ $(lsb_release -c -s) main" --package="couchdb" --key="https://couchdb.apache.org/repo/keys.asc"
+ynh_install_extra_app_dependencies \
+ --repo="deb https://apache.jfrog.io/artifactory/couchdb-deb/ $(lsb_release -c -s) main" \
+ --key="https://couchdb.apache.org/repo/keys.asc" \
+ --package="couchdb"
-chmod 750 "$final_path"
-chmod -R o-rwx "$final_path"
-chown -R $app:$app "$final_path"
+chmod 750 "$install_dir"
+chmod -R o-rwx "$install_dir"
+chown -R $app:$app "$install_dir"
-chmod 750 "$datadir"
-chmod -R o-rwx "$datadir"
-chown -R $app:www-data "$datadir"
+chmod 750 "$data_dir"
+chmod -R o-rwx "$data_dir"
+chown -R $app:www-data "$data_dir"
#=================================================
# RESTORE THE LOGROTATE CONFIGURATION
diff --git a/scripts/upgrade b/scripts/upgrade
index f61ae1d..4ef7419 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -9,47 +9,8 @@
source _common.sh
source /usr/share/yunohost/helpers
-#=================================================
-# LOAD SETTINGS
-#=================================================
-ynh_script_progression --message="Loading installation settings..." --weight=1
-
-app=$YNH_APP_INSTANCE_NAME
-
-domain=$(ynh_app_setting_get --app=$app --key=domain)
-path_url=$(ynh_app_setting_get --app=$app --key=path)
-final_path=$(ynh_app_setting_get --app=$app --key=final_path)
-port=$(ynh_app_setting_get --app=$app --key=port)
-password=$(ynh_app_setting_get --app=$app --key=password)
-
-#=================================================
-# CHECK VERSION
-#=================================================
-ynh_script_progression --message="Checking version..." --weight=1
-
upgrade_type=$(ynh_check_app_version_changed)
-#=================================================
-# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
-#=================================================
-ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=15
-
-# Backup the current version of the app
-ynh_backup_before_upgrade
-ynh_clean_setup () {
- # Restore it if the upgrade fails
- ynh_restore_upgradebackup
-}
-# Exit if an error occurs during the execution of the script
-ynh_abort_if_errors
-
-#=================================================
-# UPGRADE DEPENDENCIES
-#=================================================
-ynh_script_progression --message="Upgrading dependencies..." --weight=15
-
-ynh_install_app_dependencies $pkg_dependencies
-
#=================================================
# NGINX CONFIGURATION
#=================================================
@@ -68,19 +29,22 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading CouchDB..." --weight=50
- COUCHDB_PASSWORD=$password
- echo "couchdb couchdb/mode select standalone
+ echo "\
+ couchdb couchdb/mode select standalone
couchdb couchdb/mode seen true
couchdb couchdb/bindaddress string 127.0.0.1
couchdb couchdb/bindaddress seen true
- couchdb couchdb/cookie string ${COUCHDB_PASSWORD}
- couchdb couchdb/adminpass password ${COUCHDB_PASSWORD}
+ couchdb couchdb/cookie string $password
+ couchdb couchdb/adminpass password $password
couchdb couchdb/adminpass seen true
- couchdb couchdb/adminpass_again password ${COUCHDB_PASSWORD}
+ couchdb couchdb/adminpass_again password $password
couchdb couchdb/adminpass_again seen true" | debconf-set-selections
DEBIAN_FRONTEND=noninteractive # apt-get install -y --force-yes couchdb
- ynh_install_extra_app_dependencies --repo="deb https://apache.jfrog.io/artifactory/couchdb-deb/ $(lsb_release -c -s) main" --package="couchdb" --key="https://couchdb.apache.org/repo/keys.asc"
+ ynh_install_extra_app_dependencies \
+ --repo="deb https://apache.jfrog.io/artifactory/couchdb-deb/ $(lsb_release -c -s) main" \
+ --key="https://couchdb.apache.org/repo/keys.asc" \
+ --package="couchdb"
fi
#=================================================
@@ -88,11 +52,11 @@ fi
#=================================================
ynh_script_progression --message="Updating a configuration file..." --weight=1
-ynh_add_config --template="../conf/couch_ynh.ini" --destination="$final_path/etc/local.d/couch_ynh.ini"
+ynh_add_config --template="../conf/couch_ynh.ini" --destination="$install_dir/etc/local.d/couch_ynh.ini"
-chmod 750 "$final_path"
-chmod -R o-rwx "$final_path"
-chown -R $app:$app "$final_path"
+chmod 750 "$install_dir"
+chmod -R o-rwx "$install_dir"
+chown -R "$app:$app" "$install_dir"
#=================================================
# GENERIC FINALIZATION
@@ -119,13 +83,6 @@ ynh_script_progression --message="Reconfiguring Fail2Ban..." --weight=3
# Create a dedicated Fail2Ban config
ynh_add_fail2ban_config --logpath="/var/log/couchdb/couchdb.log" --failregex="[warning] .*couch_httpd_auth: Authentication failed for user .+ from " --max_retry=5
-#=================================================
-# RELOAD NGINX
-#=================================================
-ynh_script_progression --message="Reloading NGINX web server..." --weight=1
-
-ynh_systemd_action --service_name=nginx --action=reload
-
#=================================================
# END OF SCRIPT
#=================================================
diff --git a/tests.toml b/tests.toml
new file mode 100644
index 0000000..c2deb4d
--- /dev/null
+++ b/tests.toml
@@ -0,0 +1,8 @@
+#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/tests.v1.schema.json
+
+test_format = 1.0
+
+[default]
+
+ [default.test_upgrade_from.0e91958cfd8406e71e9c4e506620c5e9b7110a5f]
+ name = "3.1.1~ynh3"