diff --git a/bump-version.rb b/bump-version.rb index b2a5c65..37dd75a 100755 --- a/bump-version.rb +++ b/bump-version.rb @@ -69,4 +69,4 @@ Yunohost::AppSrcFile.new().update(url, sum) # Update manifest file Yunohost::ManifestFile.new().update_with_version(version) -puts "Done!" +puts "Done!" \ No newline at end of file diff --git a/manifest.json b/manifest.json index 4e741cc..69f6a28 100644 --- a/manifest.json +++ b/manifest.json @@ -30,6 +30,18 @@ "name": "domain", "type": "domain" }, + { + "name": "username", + "type": "user" + }, + { + "name": "email", + "type": "email" + }, + { + "name": "password", + "type": "password" + }, { "name": "is_public", "type": "boolean", diff --git a/scripts/install b/scripts/install index 8791302..d7a1351 100644 --- a/scripts/install +++ b/scripts/install @@ -28,6 +28,9 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url="/" is_public=$YNH_APP_ARG_IS_PUBLIC +username=$YNH_APP_ARG_USERNAME +email=$YNH_APP_ARG_EMAIL +password=$YNH_APP_ARG_PASSWORD ### If it's a multi-instance app, meaning it can be installed several times independently ### The id of the app as stated in the manifest is available as $YNH_APP_ID @@ -247,13 +250,15 @@ pushd "$final_path" sudo -u $app $ynh_ruby_load_path bin/bundle install --full-index popd -ynh_script_progression --message="Preparing the database..." +ynh_script_progression --message="Preparing the database and create initial admin user..." pushd "$final_path" rake_exec="sudo -u $app $ynh_ruby_load_path RAILS_ENV=production bin/rake" ynh_exec_warn_less $rake_exec db:migrate ynh_exec_warn_less $rake_exec assets:precompile + ynh_exec_warn_less $rake_exec "admin:create[$username, $email, $password]" popd + #================================================= # SETUP THE CRON FILE #=================================================