1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/couchdb_ynh.git synced 2024-09-03 18:16:11 +02:00

Merge pull request #17 from YunoHost-Apps/testing

Fix Bullseye
This commit is contained in:
yalh76 2022-02-06 15:10:17 +01:00 committed by GitHub
commit 7383f47de4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 44 additions and 51 deletions

2
.gitignore vendored
View file

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

View file

@ -3,7 +3,7 @@
domain="domain.tld"
path="/path"
is_public=1
password="strong-password"
password="1Strong-Password"
; Checks
pkg_linter=1
setup_sub_dir=1
@ -12,6 +12,8 @@
setup_private=1
setup_public=1
upgrade=1
# 3.1.1~ynh2
upgrade=1 from_commit=41cae71da176f9028ae5daa4ffcc349d9b16c47e
backup_restore=1
multi_instance=0
change_url=1

View file

@ -1,10 +1,5 @@
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_redirect off;
proxy_set_header Host $host;

1
doc/DESCRIPTION.md Normal file
View file

@ -0,0 +1 @@
CouchDB is a database that completely embraces the web. Store your data with JSON documents. Access your documents with your web browser, via HTTP. Query, combine, and transform your documents with JavaScript. CouchDB works well with modern web and mobile apps. You can distribute your data, efficiently using CouchDBs incremental replication. CouchDB supports master-master setups with automatic conflict detection.

View file

@ -6,7 +6,7 @@
"en": "Open-source document-oriented NoSQL database",
"fr": "Système de gestion de base de données orienté documents"
},
"version": "3.1.1~ynh2",
"version": "3.1.1~ynh3",
"url": "https://couchdb.apache.org/",
"upstream": {
"license": "Apache-2.0",
@ -32,8 +32,7 @@
"install" : [
{
"name": "domain",
"type": "domain",
"example": "example.com"
"type": "domain"
},
{
"name": "path",
@ -44,16 +43,11 @@
{
"name": "is_public",
"type": "boolean",
"help": {
"en": "If enabled, CouchDB will be accessible without YunoHost account on your server, but CouchDB contains it's own user authentication system.",
"fr": "Si cette case est cochée, CouchDB sera accessible aux personnes nayant pas de compte YunoHost sur votre serveur, mais CouchDB a son propre système d'autentification des utilisateurs."
},
"default": true
},
{
"name": "password",
"type": "password",
"example": "Choose a password"
"type": "password"
}
]
}

View file

@ -97,20 +97,22 @@ DEBIAN_FRONTEND=noninteractive # apt-get install -y --force-yes couchdb
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 390EF70BB1EA12B2773962950EE62FB37A00258D 2>/dev/null
ynh_install_extra_app_dependencies --repo="https://apache.jfrog.io/artifactory/couchdb-deb/ buster main" --package="couchdb"
ynh_install_extra_app_dependencies --repo="https://apache.jfrog.io/artifactory/couchdb-deb/ $(lsb_release -c -s) main" --package="couchdb"
#=================================================
# ADD SOME CUSTOM CONFIGURATION TO COUCH
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Customizing CouchDB config..." --weight=2
ynh_script_progression --message="Adding a configuration file..." --weight=2
# customize a bit the couch config
# Customize a bit the couch config
ynh_add_config --template="../conf/couch_ynh.ini" --destination="$final_path/etc/local.d/couch_ynh.ini"
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:$app "$final_path"
#=================================================
# GENERIC FINALIZATION
#=================================================
# SETUP LOGROTATE
#=================================================

View file

@ -26,28 +26,13 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
# REMOVE SERVICE INTEGRATION IN YUNOHOST
#=================================================
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
if ynh_exec_warn_less yunohost service status $app >/dev/null
then
ynh_script_progression --message="Removing $app service integration..." --weight=2
yunohost service remove $app
fi
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression --message="Removing dependencies..." --weight=16
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=2
# Remove the dedicated NGINX config
ynh_remove_nginx_config
#=================================================
# REMOVE LOGROTATE CONFIGURATION
#=================================================
@ -56,10 +41,26 @@ ynh_script_progression --message="Removing logrotate configuration..." --weight=
# Remove the app-specific logrotate config
ynh_remove_logrotate
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=2
# 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
#=================================================
ynh_script_progression --message="Removing Fail2ban configuration..." --weight=2
ynh_script_progression --message="Removing Fail2Ban configuration..." --weight=2
# Remove the dedicated Fail2Ban config
ynh_remove_fail2ban_config

View file

@ -38,8 +38,6 @@ port=$(ynh_app_setting_get --app=$app --key=port)
#=================================================
ynh_script_progression --message="Validating restoration parameters..." --weight=2
ynh_webpath_available --domain=$domain --path_url=$path_url \
|| ynh_die --message="Path not available: ${domain}${path_url}"
test ! -d $final_path \
|| ynh_die --message="There is already a directory: $final_path "
@ -48,6 +46,7 @@ test ! -d $final_path \
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the NGINX web server configuration..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
@ -63,8 +62,8 @@ ynh_restore_file --origin_path="$final_path"
#=================================================
ynh_script_progression --message="Restoring the Fail2Ban configuration..." --weight=2
ynh_restore_file "/etc/fail2ban/jail.d/$app.conf"
ynh_restore_file "/etc/fail2ban/filter.d/$app.conf"
ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf"
ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf"
ynh_systemd_action --action=restart --service_name=fail2ban
#=================================================
@ -95,19 +94,12 @@ DEBIAN_FRONTEND=noninteractive # apt-get install -y --force-yes couchdb
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 390EF70BB1EA12B2773962950EE62FB37A00258D 2>/dev/null
ynh_install_extra_app_dependencies --repo="https://apache.jfrog.io/artifactory/couchdb-deb/ buster main" --package="couchdb"
ynh_install_extra_app_dependencies --repo="https://apache.jfrog.io/artifactory/couchdb-deb/ $(lsb_release -c -s) main" --package="couchdb"
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:$app "$final_path"
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="Open-source document-oriented NoSQL database" --log="/var/log/$app/$app.log" --needs_exposed_ports "$port"
#=================================================
# RESTORE THE LOGROTATE CONFIGURATION
#=================================================
@ -115,6 +107,13 @@ ynh_script_progression --message="Restoring the logrotate configuration..."
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="Open-source document-oriented NoSQL database" --log="/var/log/$app/$app.log" --needs_exposed_ports "$port"
#=================================================
# GENERIC FINALIZATION
#=================================================

View file

@ -25,6 +25,7 @@ password=$(ynh_app_setting_get --app=$app --key=password)
#=================================================
# CHECK VERSION
#=================================================
ynh_script_progression --message="Checking version..."
upgrade_type=$(ynh_check_app_version_changed)
@ -80,7 +81,7 @@ then
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 390EF70BB1EA12B2773962950EE62FB37A00258D 2>/dev/null
ynh_install_extra_app_dependencies --repo="https://apache.jfrog.io/artifactory/couchdb-deb/ buster main" --package="couchdb"
ynh_install_extra_app_dependencies --repo="https://apache.jfrog.io/artifactory/couchdb-deb/ $(lsb_release -c -s) main" --package="couchdb"
fi
#=================================================