mirror of
https://github.com/YunoHost-Apps/mobilizon_ynh.git
synced 2024-09-03 19:46:19 +02:00
fix mobilizon_config_path
This commit is contained in:
parent
62cad43cbc
commit
9ae02e08bf
2 changed files with 11 additions and 9 deletions
|
@ -7,6 +7,7 @@ Type=simple
|
||||||
User=__APP__
|
User=__APP__
|
||||||
Group=__APP__
|
Group=__APP__
|
||||||
Environment=MIX_ENV=prod
|
Environment=MIX_ENV=prod
|
||||||
|
Environment=MOBILIZON_CONFIG_PATH="__INSTALL_DIR__/config.exs"
|
||||||
WorkingDirectory=__INSTALL_DIR__/live/
|
WorkingDirectory=__INSTALL_DIR__/live/
|
||||||
ExecStart=__INSTALL_DIR__/live/bin/mobilizon start
|
ExecStart=__INSTALL_DIR__/live/bin/mobilizon start
|
||||||
ExecStop=__INSTALL_DIR__/live/bin/mobilizon stop
|
ExecStop=__INSTALL_DIR__/live/bin/mobilizon stop
|
||||||
|
|
|
@ -55,11 +55,12 @@ chown -R "$app:www-data" "$install_dir"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Making setup..."
|
ynh_script_progression --message="Making setup..."
|
||||||
|
|
||||||
config_file="$install_dir/config.exs"
|
MOBILIZON_CONFIG_PATH="$install_dir/config.exs"
|
||||||
|
|
||||||
pushd "$install_dir/live"
|
pushd "$install_dir/live"
|
||||||
ynh_exec_as "$app" MIX_ENV=prod ./bin/mobilizon_ctl instance gen --force \
|
ynh_exec_as "$app" MOBILIZON_CONFIG_PATH="$MOBILIZON_CONFIG_PATH" MIX_ENV=prod \
|
||||||
--output "$config_file" \
|
./bin/mobilizon_ctl instance gen --force \
|
||||||
|
--output "$MOBILIZON_CONFIG_PATH" \
|
||||||
--output-psql "$install_dir/setub_db.psql" \
|
--output-psql "$install_dir/setub_db.psql" \
|
||||||
--domain "$domain" \
|
--domain "$domain" \
|
||||||
--instance-name "Mobilizon" \
|
--instance-name "Mobilizon" \
|
||||||
|
@ -76,24 +77,24 @@ ynh_add_config --template="ldap.exs" --destination="$install_dir/ldap.exs"
|
||||||
ynh_add_config --template="mail.exs" --destination="$install_dir/mail.exs"
|
ynh_add_config --template="mail.exs" --destination="$install_dir/mail.exs"
|
||||||
ynh_add_config --template="uploads.exs" --destination="$install_dir/uploads.exs"
|
ynh_add_config --template="uploads.exs" --destination="$install_dir/uploads.exs"
|
||||||
|
|
||||||
cat "$install_dir/ldap.exs" "$install_dir/mail.exs" "$install_dir/uploads.exs" >> "$config_file"
|
cat "$install_dir/ldap.exs" "$install_dir/mail.exs" "$install_dir/uploads.exs" >> "$MOBILIZON_CONFIG_PATH"
|
||||||
ynh_store_file_checksum --file="$config_file"
|
ynh_store_file_checksum --file="$MOBILIZON_CONFIG_PATH"
|
||||||
|
|
||||||
ynh_secure_remove --file="$install_dir/ldap.exs"
|
ynh_secure_remove --file="$install_dir/ldap.exs"
|
||||||
ynh_secure_remove --file="$install_dir/mail.exs"
|
ynh_secure_remove --file="$install_dir/mail.exs"
|
||||||
ynh_secure_remove --file="$install_dir/uploads.exs"
|
ynh_secure_remove --file="$install_dir/uploads.exs"
|
||||||
|
|
||||||
chmod 400 "$config_file"
|
chmod 400 "$MOBILIZON_CONFIG_PATH"
|
||||||
chown "$app:$app" "$config_file"
|
chown "$app:$app" "$MOBILIZON_CONFIG_PATH"
|
||||||
|
|
||||||
pushd "$install_dir/live"
|
pushd "$install_dir/live"
|
||||||
ynh_exec_as "$app" ./bin/mobilizon_ctl migrate
|
ynh_exec_as "$app" MOBILIZON_CONFIG_PATH="$MOBILIZON_CONFIG_PATH" ./bin/mobilizon_ctl migrate
|
||||||
|
|
||||||
# ynh_systemd_action --service_name="$app" --action="start" --log_path=systemd --line_match="Access Mobilizon.Web.Endpoint at"
|
# ynh_systemd_action --service_name="$app" --action="start" --log_path=systemd --line_match="Access Mobilizon.Web.Endpoint at"
|
||||||
|
|
||||||
# We generate a dummy password ... this will actually *not* be used because the admin is supposed to connect via the ldap
|
# We generate a dummy password ... this will actually *not* be used because the admin is supposed to connect via the ldap
|
||||||
password=$(ynh_string_random --length=30)
|
password=$(ynh_string_random --length=30)
|
||||||
ynh_exec_as "$app" ./bin/mobilizon_ctl users.new "$admin_email" --admin --password "$password"
|
ynh_exec_as "$app" MOBILIZON_CONFIG_PATH="$MOBILIZON_CONFIG_PATH" ./bin/mobilizon_ctl users.new "$admin_email" --admin --password "$password"
|
||||||
|
|
||||||
# ynh_systemd_action --service_name="$app" --action="stop" --log_path=systemd
|
# ynh_systemd_action --service_name="$app" --action="stop" --log_path=systemd
|
||||||
popd
|
popd
|
||||||
|
|
Loading…
Add table
Reference in a new issue