mirror of
https://github.com/YunoHost/test_apps.git
synced 2024-09-03 20:06:29 +02:00
Add full_domain_app
This commit is contained in:
parent
43ac419886
commit
6c98bcad86
5 changed files with 76 additions and 0 deletions
5
full_domain_app_ynh/conf/index.html
Normal file
5
full_domain_app_ynh/conf/index.html
Normal file
|
@ -0,0 +1,5 @@
|
|||
<html>
|
||||
<body>
|
||||
This is a dummy app to test the full domain app
|
||||
</body>
|
||||
</html>
|
3
full_domain_app_ynh/conf/nginx.conf
Normal file
3
full_domain_app_ynh/conf/nginx.conf
Normal file
|
@ -0,0 +1,3 @@
|
|||
location / {
|
||||
alias /var/www/FOLDER;
|
||||
}
|
29
full_domain_app_ynh/manifest.json
Normal file
29
full_domain_app_ynh/manifest.json
Normal file
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"name": "Full domain app",
|
||||
"id": "full_domain_app",
|
||||
"description": {
|
||||
"en": "App to test the install of full domain apps"
|
||||
},
|
||||
"license": "GPL-3+",
|
||||
"maintainer": {
|
||||
"name": "Aleks",
|
||||
"email": "alex.aubin@mailoo.org",
|
||||
"url": "https://github.com/alexAubin/"
|
||||
},
|
||||
"requirements": {
|
||||
"yunohost": ">> 3.0.0"
|
||||
},
|
||||
"multi_instance": true,
|
||||
"arguments": {
|
||||
"install" : [
|
||||
{
|
||||
"name": "domain",
|
||||
"type": "domain",
|
||||
"ask": {
|
||||
"en": "Choose a domain"
|
||||
},
|
||||
"example": "domain.org"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
26
full_domain_app_ynh/scripts/install
Normal file
26
full_domain_app_ynh/scripts/install
Normal file
|
@ -0,0 +1,26 @@
|
|||
set -eux
|
||||
|
||||
# Source app helpers
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
# Retrieve arguments
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
domain=$YNH_APP_ARG_DOMAIN
|
||||
path="/"
|
||||
|
||||
# Check domain/path availability
|
||||
ynh_webpath_register $app $domain $path
|
||||
|
||||
# Add config for nginx
|
||||
sed -i "s@FOLDER@$app/@g" ../conf/nginx.conf
|
||||
cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
|
||||
|
||||
# Make directory for app web data
|
||||
mkdir /var/www/$app
|
||||
cp ../conf/index.html /var/www/$app
|
||||
|
||||
# Set the app as public
|
||||
yunohost app setting $app unprotected_uris -v "/"
|
||||
|
||||
# Reload Nginx and regenerate SSOwat conf
|
||||
systemctl reload nginx
|
13
full_domain_app_ynh/scripts/remove
Normal file
13
full_domain_app_ynh/scripts/remove
Normal file
|
@ -0,0 +1,13 @@
|
|||
set -eux
|
||||
|
||||
# Source app helpers
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
# Recover arguments
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
domain=$(sudo yunohost app setting $app domain)
|
||||
|
||||
rm -rf /var/www/$app
|
||||
rm /etc/nginx/conf.d/$domain.d/$app.conf
|
||||
|
||||
systemctl restart nginx
|
Loading…
Add table
Reference in a new issue