From 2c6a4a144299d27243994af4c2bd793b3d84fa54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Wed, 6 May 2020 00:02:17 +0200 Subject: [PATCH] Create app for test ldap app user --- ldap_user_app_ynh/conf/empty | 1 + ldap_user_app_ynh/manifest.json | 29 ++++++++++++++++++++++++++++ ldap_user_app_ynh/scripts/backup | 11 +++++++++++ ldap_user_app_ynh/scripts/change_url | 13 +++++++++++++ ldap_user_app_ynh/scripts/install | 17 ++++++++++++++++ ldap_user_app_ynh/scripts/remove | 11 +++++++++++ ldap_user_app_ynh/scripts/restore | 11 +++++++++++ 7 files changed, 93 insertions(+) create mode 100644 ldap_user_app_ynh/conf/empty create mode 100644 ldap_user_app_ynh/manifest.json create mode 100644 ldap_user_app_ynh/scripts/backup create mode 100644 ldap_user_app_ynh/scripts/change_url create mode 100644 ldap_user_app_ynh/scripts/install create mode 100644 ldap_user_app_ynh/scripts/remove create mode 100644 ldap_user_app_ynh/scripts/restore diff --git a/ldap_user_app_ynh/conf/empty b/ldap_user_app_ynh/conf/empty new file mode 100644 index 0000000..8d1c8b6 --- /dev/null +++ b/ldap_user_app_ynh/conf/empty @@ -0,0 +1 @@ + diff --git a/ldap_user_app_ynh/manifest.json b/ldap_user_app_ynh/manifest.json new file mode 100644 index 0000000..678b544 --- /dev/null +++ b/ldap_user_app_ynh/manifest.json @@ -0,0 +1,29 @@ +{ + "name": "LDAP user app Test", + "id": "ldap_user_app", + "description": { + "en": "Dummy app to test permissions" + }, + "license": "GPL-3+", + "license": "Apache-2.0", + "maintainer": { + "name": "Josué Tille", + "email": "josue@tille.ch" + }, + "requirements": { + "yunohost": ">> 3.3.0" + }, + "multi_instance": false, + "arguments": { + "install" : [ + { + "name": "domain", + "type": "domain", + "ask": { + "en": "Choose a domain for permissions_app" + }, + "example": "domain.org" + } + ] + } +} diff --git a/ldap_user_app_ynh/scripts/backup b/ldap_user_app_ynh/scripts/backup new file mode 100644 index 0000000..ea57cd3 --- /dev/null +++ b/ldap_user_app_ynh/scripts/backup @@ -0,0 +1,11 @@ +#!/bin/bash + +#================================================= +# GENERIC START +#================================================= + +# Source YunoHost helpers +source /usr/share/yunohost/helpers + +# Stop script if errors +ynh_abort_if_errors diff --git a/ldap_user_app_ynh/scripts/change_url b/ldap_user_app_ynh/scripts/change_url new file mode 100644 index 0000000..94dd777 --- /dev/null +++ b/ldap_user_app_ynh/scripts/change_url @@ -0,0 +1,13 @@ +#!/bin/bash + +#================================================= +# GENERIC START +#================================================= + +# Source YunoHost helpers +source /usr/share/yunohost/helpers + +# Stop script if errors +ynh_abort_if_errors + +# Nothing to do ... Permission using relative urls don't need to be changed, only the domain/path setting (handled in the core) diff --git a/ldap_user_app_ynh/scripts/install b/ldap_user_app_ynh/scripts/install new file mode 100644 index 0000000..c8cba5e --- /dev/null +++ b/ldap_user_app_ynh/scripts/install @@ -0,0 +1,17 @@ +#!/bin/bash + +#================================================= +# GENERIC START +#================================================= + +# Source YunoHost helpers +source /usr/share/yunohost/helpers + +# Stop script if errors +ynh_abort_if_errors + +# Retrieve arguments +app=$YNH_APP_INSTANCE_NAME +domain=$YNH_APP_ARG_DOMAIN + +ynh_ldap_user_create --password="RAND0MP4sSw0RO" --home_dir=/var/www/$app --mail=$app@$domain --use_shell diff --git a/ldap_user_app_ynh/scripts/remove b/ldap_user_app_ynh/scripts/remove new file mode 100644 index 0000000..ea57cd3 --- /dev/null +++ b/ldap_user_app_ynh/scripts/remove @@ -0,0 +1,11 @@ +#!/bin/bash + +#================================================= +# GENERIC START +#================================================= + +# Source YunoHost helpers +source /usr/share/yunohost/helpers + +# Stop script if errors +ynh_abort_if_errors diff --git a/ldap_user_app_ynh/scripts/restore b/ldap_user_app_ynh/scripts/restore new file mode 100644 index 0000000..ea57cd3 --- /dev/null +++ b/ldap_user_app_ynh/scripts/restore @@ -0,0 +1,11 @@ +#!/bin/bash + +#================================================= +# GENERIC START +#================================================= + +# Source YunoHost helpers +source /usr/share/yunohost/helpers + +# Stop script if errors +ynh_abort_if_errors