[fix] Backport fixes from my old dev branch.

This commit is contained in:
pitchum 2018-12-02 13:02:39 +01:00
parent e86d83049e
commit 4929faf2be
4 changed files with 59 additions and 32 deletions

View File

@ -14,22 +14,33 @@
"name": "pitchum",
"email": "pitchum@users.noreply.github.com"
},
"multi_instance": "false",
"multi_instance": false,
"requirements": {
"yunohost": ">= 2.2.0",
"moulinette": ">= 2.4.0"
},
"services": [
"nginx",
"php5-fpm",
"ynh-vpnclient"
],
"arguments": {
"install" : [
"install": [
{
"name": "domain",
"type": "domain",
"ask": {
"en": "Choose a domain for the web administration",
"fr": "Choisissez un domaine pour l'administration web"
"en": "Choose a domain for the web administration",
"fr": "Choisissez un domaine pour l'administration web"
},
"example": "domain.org"
},
{
"name": "path",
"type": "path",
"ask": {
"en": "Choose a path for the web administration",
"fr": "Choisissez un chemin pour l'administration web"
"en": "Choose a path for the web administration",
"fr": "Choisissez un chemin pour l'administration web"
},
"example": "/vpnadmin",
"default": "/vpnadmin"

View File

@ -51,17 +51,28 @@ app=$YNH_APP_INSTANCE_NAME
final_path="/var/www/$app"
test ! -e "$final_path" || ynh_die "Path is already in use: ${final_path}."
source ./helpers
source ./prerequisites
# Normalize the url path syntax
path_url=$(ynh_normalize_url_path "$path_url")
# Check domain/path availability
if ! $upgrade; then
ynh_webpath_register vpnclient $domain $url_path || exit 1
fi
# Check web path availability
ynh_webpath_available "$domain" "$path_url"
# Register (book) web path
ynh_webpath_register "$app" "$domain" "$path_url"
# Install packages
packages='php5-fpm sipcalc dnsutils openvpn curl fake-hwclock'
export DEBIAN_FRONTEND=noninteractive
#=================================================
# STORE SETTINGS FROM MANIFEST
#=================================================
ynh_app_setting_set "$app" domain "$domain"
ynh_app_setting_set "$app" final_path "$final_path"
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# INSTALL DEPENDENCIES
#=================================================
ynh_install_app_dependencies "$pkg_dependencies"
#=================================================
# DEPLOY FILES FROM PACKAGE

View File

@ -1,27 +1,40 @@
#!/bin/bash
# VPN Client app for YunoHost
# VPN Client app for YunoHost
# Copyright (C) 2015 Julien Vaubourg <julien@vaubourg.com>
# Contribute at https://github.com/labriqueinternet/vpnclient_ynh
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
source ./helpers
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
# Retrieve arguments
domain=$(sudo yunohost app setting vpnclient domain)
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain)
#=================================================
# The End
ynh_systemctl stop ynh-vpnclient-checker.service
sudo systemctl disable ynh-vpnclient-checker.service

View File

@ -1,21 +1,13 @@
#!/bin/bash
#=================================================
# GENERIC START
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source /usr/share/yunohost/helpers
source _common.sh
ynh_setting() {
app=${1}
setting=${2}
sudo grep "^${setting}:" "/etc/yunohost/apps/${app}/settings.yml" | sed s/^[^:]\\+:\\s*[\"\']\\?// | sed s/\\s*[\"\']\$//
}
source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS