mirror of
https://github.com/YunoHost-Apps/dont-code_ynh.git
synced 2024-09-03 18:26:34 +02:00
Merge pull request #26 from YunoHost-Apps/main
Trying Mongodb 4.4 for CI & Java certificates
This commit is contained in:
commit
609477d11a
10 changed files with 41 additions and 14 deletions
|
@ -6,6 +6,7 @@ It shall NOT be edited by hand.
|
||||||
# Dont-code Services for YunoHost
|
# Dont-code Services for YunoHost
|
||||||
|
|
||||||
[![Integration level](https://dash.yunohost.org/integration/dont-code.svg)](https://dash.yunohost.org/appci/app/dont-code) ![Working status](https://ci-apps.yunohost.org/ci/badges/dont-code.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/dont-code.maintain.svg)
|
[![Integration level](https://dash.yunohost.org/integration/dont-code.svg)](https://dash.yunohost.org/appci/app/dont-code) ![Working status](https://ci-apps.yunohost.org/ci/badges/dont-code.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/dont-code.maintain.svg)
|
||||||
|
|
||||||
[![Install Dont-code Services with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=dont-code)
|
[![Install Dont-code Services with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=dont-code)
|
||||||
|
|
||||||
*[Lire ce readme en français.](./README_fr.md)*
|
*[Lire ce readme en français.](./README_fr.md)*
|
||||||
|
@ -31,7 +32,7 @@ This Yunohost app installs the server part (services + mongo database) needed to
|
||||||
- As well any documents or images uploaded by users will be backed up
|
- As well any documents or images uploaded by users will be backed up
|
||||||
|
|
||||||
|
|
||||||
**Shipped version:** 0.2~ynh3
|
**Shipped version:** 0.2~ynh4
|
||||||
|
|
||||||
**Demo:** https://dont-code.net/apps.html
|
**Demo:** https://dont-code.net/apps.html
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ It shall NOT be edited by hand.
|
||||||
# Dont-code Services pour YunoHost
|
# Dont-code Services pour YunoHost
|
||||||
|
|
||||||
[![Niveau d’intégration](https://dash.yunohost.org/integration/dont-code.svg)](https://dash.yunohost.org/appci/app/dont-code) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/dont-code.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/dont-code.maintain.svg)
|
[![Niveau d’intégration](https://dash.yunohost.org/integration/dont-code.svg)](https://dash.yunohost.org/appci/app/dont-code) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/dont-code.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/dont-code.maintain.svg)
|
||||||
|
|
||||||
[![Installer Dont-code Services avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=dont-code)
|
[![Installer Dont-code Services avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=dont-code)
|
||||||
|
|
||||||
*[Read this readme in english.](./README.md)*
|
*[Read this readme in english.](./README.md)*
|
||||||
|
@ -31,7 +32,7 @@ This Yunohost app installs the server part (services + mongo database) needed to
|
||||||
- As well any documents or images uploaded by users will be backed up
|
- As well any documents or images uploaded by users will be backed up
|
||||||
|
|
||||||
|
|
||||||
**Version incluse :** 0.2~ynh3
|
**Version incluse :** 0.2~ynh4
|
||||||
|
|
||||||
**Démo :** https://dont-code.net/apps.html
|
**Démo :** https://dont-code.net/apps.html
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"en": "Install services and databases needed to support Dont-code platform",
|
"en": "Install services and databases needed to support Dont-code platform",
|
||||||
"fr": "Installe les services et base de données nécessaires pour utiliser la plateforme Dont-code"
|
"fr": "Installe les services et base de données nécessaires pour utiliser la plateforme Dont-code"
|
||||||
},
|
},
|
||||||
"version": "0.2~ynh3",
|
"version": "0.2~ynh4",
|
||||||
"url": "https://dont-code.net",
|
"url": "https://dont-code.net",
|
||||||
"upstream": {
|
"upstream": {
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
|
|
|
@ -33,6 +33,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||||
html_path=$(ynh_app_setting_get --app=$app --key=html_path)
|
html_path=$(ynh_app_setting_get --app=$app --key=html_path)
|
||||||
document_path=$(ynh_app_setting_get --app=$app --key=document_path)
|
document_path=$(ynh_app_setting_get --app=$app --key=document_path)
|
||||||
|
public_key=$(ynh_app_setting_get --app=$app --key=public_key)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DECLARE DATA AND CONF FILES TO BACKUP
|
# DECLARE DATA AND CONF FILES TO BACKUP
|
||||||
|
@ -65,7 +66,10 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC BACKUP
|
# SPECIFIC BACKUP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
if [ -n "$public_key" ]
|
||||||
|
then
|
||||||
ynh_backup --src_path="/etc/sudoers.d/$app-sudoers"
|
ynh_backup --src_path="/etc/sudoers.d/$app-sudoers"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# BACKUP LOGROTATE
|
# BACKUP LOGROTATE
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source ynh_mongo_db__2
|
source ynh_mongo_db__2
|
||||||
source ynh_java
|
source ynh_install_java
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -77,7 +77,7 @@ ynh_app_setting_set --app=$app --key=path --value=$path_url
|
||||||
#=================================================
|
#=================================================
|
||||||
# FIND AND OPEN A PORT
|
# FIND AND OPEN A PORT
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Finding an available ports..." --weight=1
|
ynh_script_progression --message="Finding available ports..." --weight=1
|
||||||
|
|
||||||
### Use these lines if you have to open a port for the application
|
### Use these lines if you have to open a port for the application
|
||||||
### `ynh_find_port` will find the first available port starting from the given port.
|
### `ynh_find_port` will find the first available port starting from the given port.
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source ynh_mongo_db__2
|
source ynh_mongo_db__2
|
||||||
source ynh_java
|
source ynh_install_java
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -103,14 +103,20 @@ ynh_script_progression --message="Removing NGINX web server configuration..." --
|
||||||
# Remove the dedicated NGINX config
|
# Remove the dedicated NGINX config
|
||||||
ynh_remove_nginx_config
|
ynh_remove_nginx_config
|
||||||
|
|
||||||
|
if [ -n "$public_key" ]
|
||||||
|
then
|
||||||
ynh_secure_remove --file="/etc/sudoers.d/$app-sudoers"
|
ynh_secure_remove --file="/etc/sudoers.d/$app-sudoers"
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE DEPENDENCIES
|
# REMOVE DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Removing dependencies..." --weight=1
|
ynh_script_progression --message="Removing dependencies..." --weight=1
|
||||||
|
|
||||||
# Remove metapackage and its dependencies, including java
|
# Remove java
|
||||||
|
ynh_remove_java
|
||||||
|
|
||||||
|
# Remove apackage and its dependencies, including Java if needed
|
||||||
ynh_remove_app_dependencies
|
ynh_remove_app_dependencies
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
|
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
|
||||||
source ../settings/scripts/_common.sh
|
source ../settings/scripts/_common.sh
|
||||||
source ../settings/scripts/ynh_mongo_db__2
|
source ../settings/scripts/ynh_mongo_db__2
|
||||||
source ../settings/scripts/ynh_java
|
source ../settings/scripts/ynh_install_java
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source ynh_mongo_db__2
|
source ynh_mongo_db__2
|
||||||
source ynh_java
|
source ynh_install_java
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -104,7 +104,7 @@ ynh_install_java() {
|
||||||
package_name=${package_name}-${java_engine}
|
package_name=${package_name}-${java_engine}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ynh_install_app_dependencies ${package_name}
|
ynh_install_app_dependencies ca-certificates-java ${package_name}
|
||||||
|
|
||||||
# Store java_version into the config of this app
|
# Store java_version into the config of this app
|
||||||
ynh_app_setting_set --app=$app --key=java_version --value=$java_version
|
ynh_app_setting_set --app=$app --key=java_version --value=$java_version
|
||||||
|
@ -114,6 +114,21 @@ ynh_install_java() {
|
||||||
ynh_use_java
|
ynh_use_java
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Remove the version of Java used by the app.
|
||||||
|
#
|
||||||
|
# As Java is installed using ynh_install_app_dependencies, it will be removed as well when you call ynh_remove_app_dependencies in your remove script
|
||||||
|
#
|
||||||
|
# usage: ynh_remove_java
|
||||||
|
ynh_remove_java () {
|
||||||
|
local java_version=$(ynh_app_setting_get --app=$YNH_APP_INSTANCE_NAME --key=java_version)
|
||||||
|
|
||||||
|
# Remove the lines for this app
|
||||||
|
ynh_app_setting_delete --app=$YNH_APP_INSTANCE_NAME --key=java_version
|
||||||
|
ynh_app_setting_delete --app=$YNH_APP_INSTANCE_NAME --key=jdk_type
|
||||||
|
ynh_app_setting_delete --app=$YNH_APP_INSTANCE_NAME --key=java_engine
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
# Extract the architecture used to run this script
|
# Extract the architecture used to run this script
|
||||||
# sets ynh_architecture as arm64 or amd64
|
# sets ynh_architecture as arm64 or amd64
|
||||||
#
|
#
|
|
@ -320,8 +320,8 @@ ynh_install_mongo() {
|
||||||
mongo_version="4.4"
|
mongo_version="4.4"
|
||||||
fi
|
fi
|
||||||
if [[ "$mongo_version" == "4.4" && "$mongo_debian_release" != "buster" ]]; then
|
if [[ "$mongo_version" == "4.4" && "$mongo_debian_release" != "buster" ]]; then
|
||||||
ynh_print_warn --message="Switched to buster install as Mongo 4.4 is not compatible with $mongo_debian_release."
|
ynh_print_warn --message="Keeping $mongo_debian_release install for Mongo 4.4 to see if that works."
|
||||||
mongo_debian_release=buster
|
#mongo_debian_release=buster
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ynh_install_extra_app_dependencies --repo="deb http://repo.mongodb.org/apt/debian $mongo_debian_release/mongodb-org/$mongo_version main" --package="mongodb-org mongodb-org-server mongodb-org-tools mongodb-mongosh" --key="https://www.mongodb.org/static/pgp/server-$mongo_version.asc"
|
ynh_install_extra_app_dependencies --repo="deb http://repo.mongodb.org/apt/debian $mongo_debian_release/mongodb-org/$mongo_version main" --package="mongodb-org mongodb-org-server mongodb-org-tools mongodb-mongosh" --key="https://www.mongodb.org/static/pgp/server-$mongo_version.asc"
|
||||||
|
|
Loading…
Reference in a new issue