[enh] handle admin user

This commit is contained in:
Julien Malik 2014-09-25 08:00:27 +02:00
parent 12f9f724ff
commit 97c28f9ae7
4 changed files with 23 additions and 4 deletions

1
TODO
View file

@ -1,4 +1,3 @@
* handle admin user properly
* http_auth * http_auth
* user's home dirs * user's home dirs
* specific php-fpm with output_buffering OFF, higher upload limit, ... * specific php-fpm with output_buffering OFF, higher upload limit, ...

View file

@ -53,7 +53,7 @@
"LDAP_DN":"ou=users,dc=yunohost,dc=org", "LDAP_DN":"ou=users,dc=yunohost,dc=org",
"AUTO_APPLY_ROLE":"", "AUTO_APPLY_ROLE":"",
"AUTOCREATE_AJXPUSER":true, "AUTOCREATE_AJXPUSER":true,
"AJXP_ADMIN_LOGIN":"test", "AJXP_ADMIN_LOGIN":"YNH_ADMIN",
"group_switch_value":"auth.ldap" "group_switch_value":"auth.ldap"
}, },
"MULTI_MODE":{ "MULTI_MODE":{

View file

@ -16,17 +16,27 @@
{ {
"name": "domain", "name": "domain",
"ask": { "ask": {
"en": "Choose a domain for Pydio" "en": "Choose a domain for Pydio",
"fr": "Choisissez un domaine pour Pydio"
}, },
"example": "domain.org" "example": "domain.org"
}, },
{ {
"name": "path", "name": "path",
"ask": { "ask": {
"en": "Choose a path for Pydio" "en": "Choose a path for Pydio",
"fr": "Choisissez un chemin pour Pydio"
}, },
"example": "/pydio", "example": "/pydio",
"default": "/pydio" "default": "/pydio"
},
{
"name": "admin",
"ask": {
"en": "Choose the Pydio admin user",
"fr": "Choisissez l'administrateur Pydio"
},
"example": "johndoe"
} }
] ]
} }

View file

@ -3,6 +3,7 @@
# Retrieve arguments # Retrieve arguments
domain=$1 domain=$1
path=$2 path=$2
admin=$3
# Check domain/path availability # Check domain/path availability
sudo yunohost app checkurl $domain$path -a pydio sudo yunohost app checkurl $domain$path -a pydio
@ -10,6 +11,13 @@ if [[ ! $? -eq 0 ]]; then
exit 1 exit 1
fi fi
# Check that admin user is an existing account
sudo yunohost user list --json | grep -q "\"username\": \"$admin\""
if [[ ! $? -eq 0 ]]; then
echo "Error : the chosen admin user does not exist"
exit 1
fi
mkdir ../upstream mkdir ../upstream
version=$(cat version) version=$(cat version)
wget -O ../upstream/pydio-core.tar.gz http://sourceforge.net/projects/ajaxplorer/files/pydio/dev-channel/$version/pydio-core-$version.tar.gz wget -O ../upstream/pydio-core.tar.gz http://sourceforge.net/projects/ajaxplorer/files/pydio/dev-channel/$version/pydio-core-$version.tar.gz
@ -31,8 +39,10 @@ sudo yunohost app initdb $db_user -p $db_pwd -s $(readlink -e ../conf/create.mys
sudo yunohost app setting pydio mysqlpwd -v $db_pwd sudo yunohost app setting pydio mysqlpwd -v $db_pwd
sed -i "s@YNH_MYSQL_PWD@$db_pwd@g" ../conf/bootstrap.json sed -i "s@YNH_MYSQL_PWD@$db_pwd@g" ../conf/bootstrap.json
sed -i "s@YNH_ADMIN@$admin@g" ../conf/bootstrap.json
sudo mkdir -p $final_path/data/plugins/boot.conf sudo mkdir -p $final_path/data/plugins/boot.conf
sudo cp ../conf/bootstrap.json $final_path/data/plugins/boot.conf/bootstrap.json sudo cp ../conf/bootstrap.json $final_path/data/plugins/boot.conf/bootstrap.json
sudo yunohost app setting pydio admin -v $admin
sudo touch $final_path/data/cache/admin_counted sudo touch $final_path/data/cache/admin_counted
sudo touch $final_path/data/cache/first_run_passed sudo touch $final_path/data/cache/first_run_passed