mirror of
https://github.com/YunoHost-Apps/prosody_ynh.git
synced 2024-09-03 20:15:57 +02:00
without metronome
This commit is contained in:
parent
01b736e1a8
commit
21af25d4a8
5 changed files with 77 additions and 18 deletions
|
@ -1,22 +1,17 @@
|
|||
# See here for more information
|
||||
# https://github.com/YunoHost/package_check#syntax-check_process-file
|
||||
|
||||
# Move this file from check_process.default to check_process when you have filled it.
|
||||
|
||||
;; Test complet
|
||||
; Manifest
|
||||
domain="domain.tld"
|
||||
admin="john"
|
||||
language="fr"
|
||||
password="1Strong-Password"
|
||||
port="666"
|
||||
port="5222"
|
||||
; Checks
|
||||
pkg_linter=1
|
||||
setup_sub_dir=1
|
||||
setup_root=1
|
||||
setup_nourl=0
|
||||
setup_private=1
|
||||
setup_public=1
|
||||
setup_sub_dir=0
|
||||
setup_root=0
|
||||
setup_nourl=1
|
||||
setup_private=0
|
||||
setup_public=0
|
||||
upgrade=1
|
||||
# upgrade=1 from_commit=CommitHash
|
||||
backup_restore=1
|
||||
|
|
|
@ -30,6 +30,14 @@ password=$YNH_APP_ARG_PASSWORD
|
|||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
#=================================================
|
||||
# DISABLE METRONOME
|
||||
#=================================================
|
||||
ynh_script_progression --message="Disabling Metronome..."
|
||||
|
||||
ynh_systemd_action --service_name="metronome" --action="stop"
|
||||
systemctl disable metronome.service --quiet
|
||||
|
||||
#=================================================
|
||||
# STORE SETTINGS FROM MANIFEST
|
||||
#=================================================
|
||||
|
@ -47,16 +55,34 @@ ynh_app_setting_set --app=$app --key=language --value=$language
|
|||
ynh_script_progression --message="Finding an available port..."
|
||||
|
||||
# Find an available port
|
||||
port=$(ynh_find_port --port=8095)
|
||||
ynh_app_setting_set --app=$app --key=port --value=$port
|
||||
file_port=5000
|
||||
client_port=5222
|
||||
server_port=5269
|
||||
http_port=5280
|
||||
https_port=5281
|
||||
component_port=5347
|
||||
telnet_port=5582
|
||||
ynh_app_setting_set --app=$app --key=file_port --value=$file_port
|
||||
ynh_app_setting_set --app=$app --key=client_port --value=$client_port
|
||||
ynh_app_setting_set --app=$app --key=server_port --value=$server_port
|
||||
ynh_app_setting_set --app=$app --key=http_port --value=$http_port
|
||||
ynh_app_setting_set --app=$app --key=https_port --value=$https_port
|
||||
ynh_app_setting_set --app=$app --key=component_port --value=$component_port
|
||||
ynh_app_setting_set --app=$app --key=telnet_port --value=$telnet_port
|
||||
|
||||
# Optional: Expose this port publicly
|
||||
# (N.B.: you only need to do this if the app actually needs to expose the port publicly.
|
||||
# If you do this and the app doesn't actually need you are CREATING SECURITY HOLES IN THE SERVER !)
|
||||
|
||||
# Open the port
|
||||
# ynh_script_progression --message="Configuring firewall..."
|
||||
# ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port
|
||||
ynh_script_progression --message="Configuring firewall..."
|
||||
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $file_port
|
||||
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $client_port
|
||||
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $server_port
|
||||
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $http_port
|
||||
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $https_port
|
||||
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $component_port
|
||||
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $telnet_port
|
||||
|
||||
#=================================================
|
||||
# INSTALL DEPENDENCIES
|
||||
|
@ -167,7 +193,7 @@ ynh_use_logrotate
|
|||
#=================================================
|
||||
ynh_script_progression --message="Integrating service in YunoHost..."
|
||||
|
||||
yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log"
|
||||
yunohost service add $app --log="/var/log/$app/$app.log" --needs_exposed_ports="$file_port,$client_port,$server_port,$http_port,$https_port,$component_port,$telnet_port"
|
||||
|
||||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
|
|
|
@ -107,6 +107,14 @@ ynh_script_progression --message="Removing the dedicated system user..."
|
|||
# Delete a system user
|
||||
ynh_system_user_delete --username=$app
|
||||
|
||||
#=================================================
|
||||
# ENABLE METRONOME
|
||||
#=================================================
|
||||
ynh_script_progression --message="Enabling Metronome..."
|
||||
|
||||
systemctl enable metronome.service --quiet
|
||||
ynh_systemd_action --service_name="metronome" --action="start"
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
|
|
@ -30,6 +30,21 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
||||
config_path=$(ynh_app_setting_get --app=$app --key=config_path)
|
||||
file_port=$(ynh_app_setting_get --app=$app --key=file_port)
|
||||
client_port=$(ynh_app_setting_get --app=$app --key=client_port)
|
||||
server_port=$(ynh_app_setting_get --app=$app --key=server_port)
|
||||
http_port=$(ynh_app_setting_get --app=$app --key=http_port)
|
||||
https_port=$(ynh_app_setting_get --app=$app --key=https_port)
|
||||
component_port=$(ynh_app_setting_get --app=$app --key=component_port)
|
||||
config_path=$(ynh_app_setting_get --app=$app --key=telnet_port)
|
||||
|
||||
#=================================================
|
||||
# DISABLE METRONOME
|
||||
#=================================================
|
||||
ynh_script_progression --message="Disabling Metronome..."
|
||||
|
||||
ynh_systemd_action --service_name="metronome" --action="stop"
|
||||
systemctl disable metronome.service --quiet
|
||||
|
||||
#=================================================
|
||||
# STANDARD RESTORATION STEPS
|
||||
|
@ -122,7 +137,7 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
|||
#=================================================
|
||||
ynh_script_progression --message="Integrating service in YunoHost..."
|
||||
|
||||
yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log"
|
||||
yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log" --needs_exposed_ports="$file_port,$client_port,$server_port,$http_port,$https_port,$component_port,$telnet_port"
|
||||
|
||||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
|
|
|
@ -21,6 +21,13 @@ admin=$(ynh_app_setting_get --app=$app --key=admin)
|
|||
language=$(ynh_app_setting_get --app=$app --key=language)
|
||||
config_path=$(ynh_app_setting_get --app=$app --key=config_path)
|
||||
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
||||
file_port=$(ynh_app_setting_get --app=$app --key=file_port)
|
||||
client_port=$(ynh_app_setting_get --app=$app --key=client_port)
|
||||
server_port=$(ynh_app_setting_get --app=$app --key=server_port)
|
||||
http_port=$(ynh_app_setting_get --app=$app --key=http_port)
|
||||
https_port=$(ynh_app_setting_get --app=$app --key=https_port)
|
||||
component_port=$(ynh_app_setting_get --app=$app --key=component_port)
|
||||
config_path=$(ynh_app_setting_get --app=$app --key=telnet_port)
|
||||
|
||||
#=================================================
|
||||
# CHECK VERSION
|
||||
|
@ -43,6 +50,14 @@ ynh_clean_setup () {
|
|||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# DISABLE METRONOME
|
||||
#=================================================
|
||||
ynh_script_progression --message="Disabling Metronome..."
|
||||
|
||||
ynh_systemd_action --service_name="metronome" --action="stop"
|
||||
systemctl disable metronome.service --quiet
|
||||
|
||||
#=================================================
|
||||
# STANDARD UPGRADE STEPS
|
||||
#=================================================
|
||||
|
@ -154,7 +169,7 @@ ynh_use_logrotate --non-append
|
|||
#=================================================
|
||||
ynh_script_progression --message="Integrating service in YunoHost..."
|
||||
|
||||
yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log"
|
||||
yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log" --needs_exposed_ports="$file_port,$client_port,$server_port,$http_port,$https_port,$component_port,$telnet_port"
|
||||
|
||||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
|
|
Loading…
Add table
Reference in a new issue