diff --git a/TODO b/TODO index 6d04085..c2941b0 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,3 @@ -* handle admin user properly * http_auth * user's home dirs * specific php-fpm with output_buffering OFF, higher upload limit, ... diff --git a/conf/bootstrap.json b/conf/bootstrap.json index d7c90ad..9cb33e3 100644 --- a/conf/bootstrap.json +++ b/conf/bootstrap.json @@ -53,7 +53,7 @@ "LDAP_DN":"ou=users,dc=yunohost,dc=org", "AUTO_APPLY_ROLE":"", "AUTOCREATE_AJXPUSER":true, - "AJXP_ADMIN_LOGIN":"test", + "AJXP_ADMIN_LOGIN":"YNH_ADMIN", "group_switch_value":"auth.ldap" }, "MULTI_MODE":{ diff --git a/manifest.json b/manifest.json index b333cc3..ff1f3ff 100644 --- a/manifest.json +++ b/manifest.json @@ -16,17 +16,27 @@ { "name": "domain", "ask": { - "en": "Choose a domain for Pydio" + "en": "Choose a domain for Pydio", + "fr": "Choisissez un domaine pour Pydio" }, "example": "domain.org" }, { "name": "path", "ask": { - "en": "Choose a path for Pydio" + "en": "Choose a path for Pydio", + "fr": "Choisissez un chemin pour Pydio" }, "example": "/pydio", "default": "/pydio" + }, + { + "name": "admin", + "ask": { + "en": "Choose the Pydio admin user", + "fr": "Choisissez l'administrateur Pydio" + }, + "example": "johndoe" } ] } diff --git a/scripts/install b/scripts/install index 963a023..c13a85d 100644 --- a/scripts/install +++ b/scripts/install @@ -3,6 +3,7 @@ # Retrieve arguments domain=$1 path=$2 +admin=$3 # Check domain/path availability sudo yunohost app checkurl $domain$path -a pydio @@ -10,6 +11,13 @@ if [[ ! $? -eq 0 ]]; then exit 1 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 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 @@ -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 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 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/first_run_passed