mirror of
https://github.com/YunoHost-Apps/mongo-express_ynh.git
synced 2024-09-03 19:46:04 +02:00
commit
79f43fb887
8 changed files with 43 additions and 17 deletions
|
@ -38,7 +38,7 @@ You can as well install a Mongo database - version 4, 5 or 6 in your yunohost se
|
||||||
- Supports replica sets
|
- Supports replica sets
|
||||||
|
|
||||||
|
|
||||||
**Shipped version:** 1.0~ynh5
|
**Shipped version:** 1.0.2~ynh1
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ You can as well install a Mongo database - version 4, 5 or 6 in your yunohost se
|
||||||
- Supports replica sets
|
- Supports replica sets
|
||||||
|
|
||||||
|
|
||||||
**Version incluse :** 1.0~ynh5
|
**Version incluse :** 1.0.2~ynh1
|
||||||
|
|
||||||
## Captures d’écran
|
## Captures d’écran
|
||||||
|
|
||||||
|
|
|
@ -2,4 +2,5 @@ ME_CONFIG_SITE_BASEURL=__PATH__
|
||||||
ME_CONFIG_BASICAUTH=false
|
ME_CONFIG_BASICAUTH=false
|
||||||
ME_CONFIG_BASICAUTH_USERNAME=
|
ME_CONFIG_BASICAUTH_USERNAME=
|
||||||
ME_CONFIG_MONGODB_ENABLE_ADMIN=true
|
ME_CONFIG_MONGODB_ENABLE_ADMIN=true
|
||||||
|
ME_CONFIG_SITE_SESSIONSECRET=SomeSecret6533
|
||||||
PORT=__PORT__
|
PORT=__PORT__
|
||||||
|
|
|
@ -7,7 +7,7 @@ name = "Mongo Express"
|
||||||
description.en = "Admin server for Mongo and optionally Mongo database"
|
description.en = "Admin server for Mongo and optionally Mongo database"
|
||||||
description.fr = "Serveur d'administration pour Mongo ainsi qu'optionnellement une base Mongo"
|
description.fr = "Serveur d'administration pour Mongo ainsi qu'optionnellement une base Mongo"
|
||||||
|
|
||||||
version = "1.0~ynh5"
|
version = "1.0.2~ynh1"
|
||||||
|
|
||||||
maintainers = ["Gerard Collin"]
|
maintainers = ["Gerard Collin"]
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ ram.runtime = "50M"
|
||||||
|
|
||||||
[install.init_main_permission]
|
[install.init_main_permission]
|
||||||
type = "group"
|
type = "group"
|
||||||
default = false
|
default = "visitors"
|
||||||
|
|
||||||
[install.mongo_version]
|
[install.mongo_version]
|
||||||
ask.en = "Select the major version of Mongo to install or 'None' if already installed"
|
ask.en = "Select the major version of Mongo to install or 'None' if already installed"
|
||||||
|
@ -50,8 +50,8 @@ ram.runtime = "50M"
|
||||||
|
|
||||||
[resources]
|
[resources]
|
||||||
[resources.sources.main]
|
[resources.sources.main]
|
||||||
url = "https://github.com/mongo-express/mongo-express/archive/refs/tags/v1.0.0.tar.gz"
|
url = "https://github.com/mongo-express/mongo-express/archive/refs/tags/v1.0.2.tar.gz"
|
||||||
sha256 = "584bed4033f4b8f2f16824ec1eabfb3919aa04dfef72673a4e5ca8f4ef9f3b92"
|
sha256 = "c60a764aa71d37c18ec2bb6db8fe77356ca3bdbd91fa70a893106de1632640a1"
|
||||||
|
|
||||||
autoupdate.strategy = "latest_github_release"
|
autoupdate.strategy = "latest_github_release"
|
||||||
autoupdate.asset = "tarball"
|
autoupdate.asset = "tarball"
|
||||||
|
|
|
@ -13,6 +13,11 @@ nodejs_version=16
|
||||||
#=================================================
|
#=================================================
|
||||||
# EXPERIMENTAL HELPERS
|
# EXPERIMENTAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
_install_yarn () {
|
||||||
|
ynh_exec_as "$app" "$ynh_node_load_PATH" $ynh_npm install yarn
|
||||||
|
ynh_yarn="$install_dir/node_modules/.bin/yarn"
|
||||||
|
alias ynh_yarn="$ynh_yarn"
|
||||||
|
}
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# FUTURE OFFICIAL HELPERS
|
# FUTURE OFFICIAL HELPERS
|
||||||
|
|
|
@ -13,7 +13,7 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL DEPENDENCIES
|
# INSTALL DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Installing NodeJS..." --weight=3
|
ynh_script_progression --message="Installing NodeJS & Yarn..." --weight=3
|
||||||
|
|
||||||
ynh_install_nodejs --nodejs_version="$nodejs_version"
|
ynh_install_nodejs --nodejs_version="$nodejs_version"
|
||||||
|
|
||||||
|
@ -46,12 +46,21 @@ chown "$app:$app" "$install_dir/.env"
|
||||||
#=================================================
|
#=================================================
|
||||||
# BUILD NODEJS CODE
|
# BUILD NODEJS CODE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Building NodeJS code and dependencies..." --weight=6
|
ynh_script_progression --message="Building NodeJS code ..." --weight=6
|
||||||
|
|
||||||
# Install Nodejs dependencies
|
# Build using Yarn
|
||||||
pushd "$install_dir"
|
pushd "$install_dir"
|
||||||
ynh_use_nodejs
|
ynh_use_nodejs
|
||||||
ynh_exec_as "$app" "$ynh_node_load_PATH" "$ynh_npm" install
|
# We must use npm to install yarn but without installing other dependencies as npm fails with them
|
||||||
|
if [ -f "package.json" ]; then
|
||||||
|
mv package.json package.json.mov
|
||||||
|
fi
|
||||||
|
_install_yarn
|
||||||
|
if [ -f "package.json.mov" ]; then
|
||||||
|
mv package.json.mov package.json
|
||||||
|
fi
|
||||||
|
ynh_exec_as "$app" "$ynh_node_load_PATH" "$ynh_yarn" install
|
||||||
|
ynh_exec_as "$app" "$ynh_node_load_PATH" "$ynh_npm" run build
|
||||||
popd
|
popd
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -22,7 +22,7 @@ ynh_systemd_action --service_name="$app" --action="stop" --log_path="/var/log/$a
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL DEPENDENCIES
|
# INSTALL DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Installing NodeJS..." --weight=3
|
ynh_script_progression --message="Installing NodeJS & Yarn" --weight=3
|
||||||
|
|
||||||
ynh_install_nodejs --nodejs_version="$nodejs_version"
|
ynh_install_nodejs --nodejs_version="$nodejs_version"
|
||||||
|
|
||||||
|
@ -55,12 +55,21 @@ chown "$app:$app" "$install_dir/.env"
|
||||||
#=================================================
|
#=================================================
|
||||||
# BUILD NODEJS CODE
|
# BUILD NODEJS CODE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Building NodeJS code and dependencies..." --weight=6
|
ynh_script_progression --message="Installing Yarn and Buuilding application..." --weight=6
|
||||||
|
|
||||||
# Install Nodejs dependencies
|
# Build using Yarn
|
||||||
pushd "$install_dir"
|
pushd "$install_dir"
|
||||||
ynh_use_nodejs
|
ynh_use_nodejs
|
||||||
ynh_exec_as "$app" "$ynh_node_load_PATH" "$ynh_npm" install
|
# We must use npm to install yarn but without installing other dependencies as npm fails with them
|
||||||
|
if [ -f "package.json" ]; then
|
||||||
|
mv package.json package.json.mov
|
||||||
|
fi
|
||||||
|
_install_yarn
|
||||||
|
if [ -f "package.json.mov" ]; then
|
||||||
|
mv package.json.mov package.json
|
||||||
|
fi
|
||||||
|
ynh_exec_as "$app" "$ynh_node_load_PATH" "$ynh_yarn" install
|
||||||
|
ynh_exec_as "$app" "$ynh_node_load_PATH" "$ynh_npm" run build
|
||||||
popd
|
popd
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -314,17 +314,19 @@ ynh_install_mongo() {
|
||||||
|
|
||||||
ynh_print_info --message="Installing MongoDB Community Edition ..."
|
ynh_print_info --message="Installing MongoDB Community Edition ..."
|
||||||
local mongo_debian_release=$(ynh_get_debian_release)
|
local mongo_debian_release=$(ynh_get_debian_release)
|
||||||
|
local mongo_packages="mongodb-org-server mongodb-database-tools mongodb-org-shell"
|
||||||
|
|
||||||
if [[ $(cat /proc/cpuinfo) != *"avx"* && "$mongo_version" != "4.4" ]]; then
|
if [[ $(cat /proc/cpuinfo) != *"avx"* && "$mongo_version" != "4.4" ]]; then
|
||||||
ynh_print_warn --message="Installing Mongo 4.4 as $mongo_version is not compatible with your cpu (see https://docs.mongodb.com/manual/administration/production-notes/#x86_64)."
|
ynh_print_warn --message="Installing Mongo 4.4 as $mongo_version is not compatible with your cpu (see https://docs.mongodb.com/manual/administration/production-notes/#x86_64)."
|
||||||
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" ]]; then
|
||||||
ynh_print_warn --message="Switched to buster install as Mongo 4.4 is not compatible with $mongo_debian_release."
|
ynh_print_warn --message="Switching to buster package install for Mongo 4.4."
|
||||||
mongo_debian_release=buster
|
mongo_debian_release=buster
|
||||||
|
mongo_packages="mongodb-org-server mongodb-database-tools mongodb-mongosh-shared-openssl11"
|
||||||
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="$mongo_packages" --key="https://www.mongodb.org/static/pgp/server-$mongo_version.asc"
|
||||||
mongodb_servicename=mongod
|
mongodb_servicename=mongod
|
||||||
|
|
||||||
# Make sure MongoDB is started and enabled
|
# Make sure MongoDB is started and enabled
|
||||||
|
|
Loading…
Reference in a new issue