mirror of
https://github.com/YunoHost-Apps/bozon_ynh.git
synced 2024-09-03 18:16:09 +02:00
Register admin of Bozon
This commit is contained in:
parent
edfd2a279c
commit
e7036b0242
2 changed files with 35 additions and 0 deletions
|
@ -71,6 +71,24 @@
|
|||
},
|
||||
"choices": ["Stable","Latest"],
|
||||
"default": "Stable"
|
||||
},
|
||||
{
|
||||
"name": "admin",
|
||||
"type": "user",
|
||||
"ask": {
|
||||
"en": "Choose an admin user for BoZoN",
|
||||
"fr": "Choisissez un administrateur pour BoZoN"
|
||||
},
|
||||
"example": "homer"
|
||||
},
|
||||
{
|
||||
"name": "password",
|
||||
"type": "password",
|
||||
"ask": {
|
||||
"en": "Choose an admin password for BoZoN",
|
||||
"fr": "Choisissez un mot de passe administrateur pour BoZoN"
|
||||
},
|
||||
"example": "super_secret_password"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -10,6 +10,8 @@ is_public=$3
|
|||
default_lang=$4
|
||||
filesize=$5
|
||||
version=$6
|
||||
admin=$7
|
||||
password=$8
|
||||
|
||||
# definie useful vars
|
||||
app=bozon
|
||||
|
@ -81,6 +83,21 @@ sudo sed -i "s@YNH_EXAMPLE_FOLDER@$folder_path@g" ../conf/nginx.conf
|
|||
|
||||
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
|
||||
|
||||
# create the superadmin
|
||||
## set temporary public access
|
||||
sudo yunohost app setting $app unprotected_uris -v "/"
|
||||
## start app
|
||||
sudo service nginx reload
|
||||
sudo yunohost app ssowatconf
|
||||
## fill the superadmin creation form
|
||||
curl_path=$([ "$path" == "/" ] || echo $path)
|
||||
curl -k -X POST \
|
||||
-d creation="1" \
|
||||
-d login=$admin \
|
||||
-d pass=$password \
|
||||
-d confirm=$password \
|
||||
https://$domain$curl_path/index.php?p=admin > /dev/null 2>&1
|
||||
|
||||
# if app is private, remove url to SSOWat conf from skipped_uris
|
||||
if [ "$is_public" = "No" ];
|
||||
then
|
||||
|
|
Loading…
Reference in a new issue