mirror of
https://github.com/YunoHost-Apps/dotclear2_ynh.git
synced 2024-09-03 18:26:29 +02:00
Merge pull request #2 from Mickael-Martin/master
Fix install not working
This commit is contained in:
commit
51e8994cd8
2 changed files with 12 additions and 9 deletions
|
@ -16,6 +16,7 @@
|
|||
"install" : [
|
||||
{
|
||||
"name": "domain",
|
||||
"type": "domain",
|
||||
"ask": {
|
||||
"en": "Choose a domain for DotClear 2"
|
||||
},
|
||||
|
@ -23,6 +24,7 @@
|
|||
},
|
||||
{
|
||||
"name": "path",
|
||||
"type": "path",
|
||||
"ask": {
|
||||
"en": "Choose a path for DotClear 2"
|
||||
},
|
||||
|
@ -31,6 +33,7 @@
|
|||
},
|
||||
{
|
||||
"name": "admin",
|
||||
"type": "user",
|
||||
"ask": {
|
||||
"en": "Choose a yunohost user as dotclear admin"
|
||||
}
|
||||
|
@ -44,11 +47,11 @@
|
|||
},
|
||||
{
|
||||
"name": "is_public",
|
||||
"type": "boolean",
|
||||
"ask": {
|
||||
"en": "Is it a public application ?"
|
||||
},
|
||||
"choices": ["Yes", "No"],
|
||||
"default": "Yes"
|
||||
"default": "true"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#!/bin/bash
|
||||
# DotClear 2 installation script for YunoHost
|
||||
|
||||
app=dotclear2
|
||||
domain=$1
|
||||
path=$2
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
domain=$YNH_APP_ARG_DOMAIN
|
||||
path=$YNH_APP_ARG_PATH
|
||||
|
||||
# Check domain/path availability asap
|
||||
check=`sudo yunohost app checkurl $domain$path -a $app`
|
||||
|
@ -15,7 +15,8 @@ fi
|
|||
|
||||
admin=$3
|
||||
admin_password=$4
|
||||
is_public=$5
|
||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||
|
||||
directory=/var/www/$app
|
||||
php_config=$directory/inc/config.php
|
||||
master_key=`dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d '[A-Za-z0-9]' | sed -n 's/\(.\{24\}\).*/\1/p'`
|
||||
|
@ -45,8 +46,7 @@ sudo cp $php_config.in $php_config
|
|||
sudo chown www-data:www-data -R $directory
|
||||
|
||||
# Config as if we called in admin/install/wizard.php
|
||||
sudo sed -i -e "s;'DC_DBDRIVER','';'DC_DBDRIVER','mysqli';" -e "s;'DC_DBHOST','';'DC_DBHOST','localhost';" -e "s;'DC_DBUSER','';'DC_DBUSER','$app';" -e "s;'DC_DBPASSWORD','';'DC_DBPASSWORD','$db_password';" -e "s;'DC_DBNAME','';'DC_DBNAME','$app';" -e "s;'DC_MASTER_KEY','';'DC_MASTER_KEY','$master_key';" -e "s;'DC_ADMIN_URL','';'DC_ADMIN_URL','https://$domain$path/admin/index.php';" -e "s;'DC_ADMIN_MAILFROM','';'DC_ADMIN_MAILFROM','$email';" $php_config
|
||||
|
||||
sudo sed -i -e "s;'DC_DBDRIVER', '';'DC_DBDRIVER', 'mysqli';" -e "s;'DC_DBHOST', '';'DC_DBHOST', 'localhost';" -e "s;'DC_DBUSER', '';'DC_DBUSER', '$app';" -e "s;'DC_DBPASSWORD', '';'DC_DBPASSWORD', '$db_password';" -e "s;'DC_DBNAME', '';'DC_DBNAME', '$app';" -e "s;'DC_MASTER_KEY', '';'DC_MASTER_KEY', '$master_key';" -e "s;'DC_ADMIN_URL', '';'DC_ADMIN_URL', 'https://$domain$path/admin/index.php';" -e "s;'DC_ADMIN_MAILFROM', '';'DC_ADMIN_MAILFROM', '$email';" $php_config
|
||||
# Modify Nginx configuration file and copy it to Nginx conf directory
|
||||
sed -i "s@YNH_WWW_PATH@$path@g" ../conf/nginx.conf
|
||||
sed -i "s@YNH_WWW_ALIAS@$directory/@g" ../conf/nginx.conf
|
||||
|
@ -63,7 +63,7 @@ success=`curl -L --cacert /etc/yunohost/certs/$domain/ca.pem -F "u_email=$email"
|
|||
|
||||
# Now that we curl'ed the setup we can lock the UI if it's private
|
||||
# If app is public, leave as it is
|
||||
if [ "$is_public" = "No" ];
|
||||
if [ $is_public -eq 0 ];
|
||||
then
|
||||
# unprotected_uris allows SSO credentials to be passed anyway.
|
||||
sudo yunohost app setting $app protected_uris -v "/"
|
||||
|
|
Loading…
Reference in a new issue