mirror of
https://github.com/YunoHost-Apps/etherpad_mypads_ynh.git
synced 2024-09-03 18:36:09 +02:00
Fix n usage
This commit is contained in:
parent
94d5556070
commit
1ff47cf189
6 changed files with 18 additions and 19 deletions
|
@ -18,6 +18,10 @@ This package will install the same plugins than [Framapad](https://framapad.org/
|
|||
|
||||

|
||||
|
||||
## Demo
|
||||
|
||||
* [Official demo](https://oasis.sandstorm.io/appdemo/h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60)
|
||||
|
||||
## Configuration
|
||||
|
||||
You can access to 2 different admin panels, for etherpad by accessing `domain.tld/admin` and for mypads by `domain.tld/mypads/?/admin`.
|
||||
|
@ -37,7 +41,7 @@ Supported, with LDAP.
|
|||
#### Supported architectures
|
||||
|
||||
* x86-64b - [/badge/icon)](https://ci-apps.yunohost.org/jenkins/job/etherpad_mypads%20(Community)/)
|
||||
* ARMv8-A - [%20(%7EARM%7E)/badge/icon)](https://ci-apps.yunohost.org/jenkins/job/etherpad_mypads%20(Community)%20(%7EARM%7E)/)
|
||||
* ARMv8-A - [%20(%7EARM%7E)/badge/icon)](https://ci-apps-arm.yunohost.org/jenkins/job/etherpad_mypads%20(Community)%20(%7EARM%7E)/)
|
||||
|
||||
## Limitations
|
||||
|
||||
|
|
|
@ -18,6 +18,10 @@ Ce paquet installera les mêmes plugins que [Framapad](https://framapad.org/).
|
|||
|
||||

|
||||
|
||||
## Démo
|
||||
|
||||
* [Démo officielle](https://oasis.sandstorm.io/appdemo/h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60)
|
||||
|
||||
## Configuration
|
||||
|
||||
Vous pouvez accéder à 2 panneaux d'administration différents, pour etherpad en accédant à `domain.tld/admin` et pour mypads par `domain.tld/mypads/?/admin`.
|
||||
|
@ -37,7 +41,7 @@ Supportée, avec LDAP.
|
|||
#### Architectures supportées.
|
||||
|
||||
* x86-64b - [/badge/icon)](https://ci-apps.yunohost.org/jenkins/job/etherpad_mypads%20(Community)/)
|
||||
* ARMv8-A - [%20(%7EARM%7E)/badge/icon)](https://ci-apps.yunohost.org/jenkins/job/etherpad_mypads%20(Community)%20(%7EARM%7E)/)
|
||||
* ARMv8-A - [%20(%7EARM%7E)/badge/icon)](https://ci-apps-arm.yunohost.org/jenkins/job/etherpad_mypads%20(Community)%20(%7EARM%7E)/)
|
||||
|
||||
## Limitations
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@ After=syslog.target network.target
|
|||
Type=simple
|
||||
User=__APP__
|
||||
Group=__APP__
|
||||
ExecStartPre=__NODEJS__
|
||||
Environment="PATH=__ENV_PATH__"
|
||||
ExecStart=__FINALPATH__/bin/safeRun.sh /var/log/__APP__/etherpad.log
|
||||
Restart=always
|
||||
|
|
BIN
scripts/._common.sh.kate-swp
Normal file
BIN
scripts/._common.sh.kate-swp
Normal file
Binary file not shown.
|
@ -27,7 +27,7 @@ CHECK_SIZE () { # Vérifie avant chaque backup que l'espace est suffisant
|
|||
#=================================================
|
||||
|
||||
n_install_dir="/opt/node_n"
|
||||
node_version_path="/opt/node_n/n/versions/node"
|
||||
node_version_path="$n_install_dir/n/versions/node"
|
||||
# N_PREFIX is the directory of n, it needs to be loaded as a environment variable.
|
||||
export N_PREFIX="$n_install_dir"
|
||||
|
||||
|
@ -57,28 +57,21 @@ SOURCE_SUM=2ba3c9d4dd3c7e38885b37e02337906a1ee91febe6d5c9159d89a9050f2eea8f" > "
|
|||
# - $nodejs_path: The absolute path of node for the chosen version.
|
||||
# - $nodejs_version: Just the version number of node for this app. Stored as 'nodejs_version' in settings.yml.
|
||||
# And 2 alias stored in variables:
|
||||
# - $nodejs_use_version: An alias to load a node version in the current shell. Especially useful for systemd.
|
||||
# - $nodejs_use_version: An old variable, not used anymore. Keep here to not break old apps
|
||||
# NB: $PATH will contain the path to node, it has to be propagated to any other shell which needs to use it.
|
||||
# - $ynh_node_exec: An alias to execute a command with node.
|
||||
# That's means it have to be added to any systemd script.
|
||||
#
|
||||
# usage: ynh_use_nodejs
|
||||
ynh_use_nodejs () {
|
||||
nodejs_version=$(ynh_app_setting_get $app nodejs_version)
|
||||
|
||||
# Add "$n_install_dir/bin" to the PATH variable if it isn't already added.
|
||||
# And define N_PREFIX in the current shell.
|
||||
load_n_path="[[ :$PATH: == *\":$n_install_dir/bin:\"* ]] || PATH=\"$n_install_dir/bin:$PATH\"; N_PREFIX="$n_install_dir""
|
||||
|
||||
nodejs_use_version="$n_install_dir/bin/n -q $nodejs_version"
|
||||
|
||||
# "Load" a version of node
|
||||
eval $load_n_path; $nodejs_use_version
|
||||
nodejs_use_version="echo \"Deprecated command, should be removed\""
|
||||
|
||||
# Get the absolute path of this version of node
|
||||
nodejs_path="$(n bin $nodejs_version)"
|
||||
nodejs_path="$node_version_path/$nodejs_version/bin"
|
||||
|
||||
# Make an alias for node use
|
||||
ynh_node_exec="eval $load_n_path; n use $nodejs_version"
|
||||
# Load the path of this version of node in $PATH
|
||||
[[ :$PATH: == *":$nodejs_path"* ]] || PATH="$nodejs_path:$PATH"
|
||||
}
|
||||
|
||||
# Install a specific version of nodejs
|
||||
|
@ -109,7 +102,7 @@ ynh_install_nodejs () {
|
|||
test -x /usr/bin/npm && mv /usr/bin/npm /usr/bin/npm_n
|
||||
|
||||
# If n is not previously setup, install it
|
||||
if ! test $(n --version) > /dev/null 2>&1
|
||||
if ! test $(n --version > /dev/null 2>&1)
|
||||
then
|
||||
ynh_install_n
|
||||
fi
|
||||
|
|
|
@ -198,7 +198,6 @@ chmod 600 $final_path/credentials.json # Restrict access to credentials.json
|
|||
# SETUP SYSTEMD
|
||||
#=================================================
|
||||
|
||||
ynh_replace_string "__NODEJS__" "$nodejs_use_version" "../conf/systemd.service"
|
||||
ynh_replace_string "__ENV_PATH__" "$PATH" "../conf/systemd.service"
|
||||
ynh_add_systemd_config
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue