[fix] Backport fixes from my old dev branch.
This commit is contained in:
@@ -14,22 +14,33 @@
|
|||||||
"name": "pitchum",
|
"name": "pitchum",
|
||||||
"email": "pitchum@users.noreply.github.com"
|
"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": {
|
"arguments": {
|
||||||
"install" : [
|
"install": [
|
||||||
{
|
{
|
||||||
"name": "domain",
|
"name": "domain",
|
||||||
|
"type": "domain",
|
||||||
"ask": {
|
"ask": {
|
||||||
"en": "Choose a domain for the web administration",
|
"en": "Choose a domain for the web administration",
|
||||||
"fr": "Choisissez un domaine pour l'administration web"
|
"fr": "Choisissez un domaine pour l'administration web"
|
||||||
},
|
},
|
||||||
"example": "domain.org"
|
"example": "domain.org"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "path",
|
"name": "path",
|
||||||
|
"type": "path",
|
||||||
"ask": {
|
"ask": {
|
||||||
"en": "Choose a path for the web administration",
|
"en": "Choose a path for the web administration",
|
||||||
"fr": "Choisissez un chemin pour l'administration web"
|
"fr": "Choisissez un chemin pour l'administration web"
|
||||||
},
|
},
|
||||||
"example": "/vpnadmin",
|
"example": "/vpnadmin",
|
||||||
"default": "/vpnadmin"
|
"default": "/vpnadmin"
|
||||||
|
@@ -51,17 +51,28 @@ app=$YNH_APP_INSTANCE_NAME
|
|||||||
final_path="/var/www/$app"
|
final_path="/var/www/$app"
|
||||||
test ! -e "$final_path" || ynh_die "Path is already in use: ${final_path}."
|
test ! -e "$final_path" || ynh_die "Path is already in use: ${final_path}."
|
||||||
|
|
||||||
source ./helpers
|
# Normalize the url path syntax
|
||||||
source ./prerequisites
|
path_url=$(ynh_normalize_url_path "$path_url")
|
||||||
|
|
||||||
# Check domain/path availability
|
# Check web path availability
|
||||||
if ! $upgrade; then
|
ynh_webpath_available "$domain" "$path_url"
|
||||||
ynh_webpath_register vpnclient $domain $url_path || exit 1
|
# Register (book) web path
|
||||||
fi
|
ynh_webpath_register "$app" "$domain" "$path_url"
|
||||||
|
|
||||||
# Install packages
|
#=================================================
|
||||||
packages='php5-fpm sipcalc dnsutils openvpn curl fake-hwclock'
|
# STORE SETTINGS FROM MANIFEST
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
#=================================================
|
||||||
|
|
||||||
|
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
|
# DEPLOY FILES FROM PACKAGE
|
||||||
|
@@ -1,27 +1,40 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# VPN Client app for YunoHost
|
# VPN Client app for YunoHost
|
||||||
# Copyright (C) 2015 Julien Vaubourg <julien@vaubourg.com>
|
# Copyright (C) 2015 Julien Vaubourg <julien@vaubourg.com>
|
||||||
# Contribute at https://github.com/labriqueinternet/vpnclient_ynh
|
# Contribute at https://github.com/labriqueinternet/vpnclient_ynh
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# 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
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU Affero General Public License for more details.
|
# GNU Affero General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
# 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/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
source ./helpers
|
#=================================================
|
||||||
|
# GENERIC STARTING
|
||||||
|
#=================================================
|
||||||
|
# IMPORT GENERIC HELPERS
|
||||||
|
#=================================================
|
||||||
|
|
||||||
# Retrieve arguments
|
source _common.sh
|
||||||
domain=$(sudo yunohost app setting vpnclient domain)
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# LOAD SETTINGS
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
domain=$(ynh_app_setting_get $app domain)
|
||||||
|
|
||||||
|
#=================================================
|
||||||
# The End
|
# The End
|
||||||
ynh_systemctl stop ynh-vpnclient-checker.service
|
ynh_systemctl stop ynh-vpnclient-checker.service
|
||||||
sudo systemctl disable ynh-vpnclient-checker.service
|
sudo systemctl disable ynh-vpnclient-checker.service
|
||||||
|
@@ -1,21 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC START
|
# GENERIC STARTING
|
||||||
#=================================================
|
#=================================================
|
||||||
# IMPORT GENERIC HELPERS
|
# IMPORT GENERIC HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
source /usr/share/yunohost/helpers
|
|
||||||
source _common.sh
|
source _common.sh
|
||||||
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
ynh_setting() {
|
|
||||||
app=${1}
|
|
||||||
setting=${2}
|
|
||||||
|
|
||||||
sudo grep "^${setting}:" "/etc/yunohost/apps/${app}/settings.yml" | sed s/^[^:]\\+:\\s*[\"\']\\?// | sed s/\\s*[\"\']\$//
|
|
||||||
}
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
|
Reference in New Issue
Block a user