mirror of
https://github.com/YunoHost-Apps/gotosocial_ynh.git
synced 2024-09-03 19:16:06 +02:00
some cleaning
This commit is contained in:
parent
932fad3a15
commit
5d6f34d50c
1 changed files with 2 additions and 41 deletions
|
@ -78,7 +78,7 @@ ynh_app_setting_set --app=$app --key=email --value=$email
|
|||
ynh_app_setting_set --app=$app --key=password --value=$password
|
||||
ynh_app_setting_set --app=$app --key=registration --value=$registration
|
||||
ynh_app_setting_set --app=$app --key=registration_approval --value=$registration_approval
|
||||
ynh_app_setting_set --app=$app --key=registration_reason --value=$registration_reaso
|
||||
ynh_app_setting_set --app=$app --key=registration_reason --value=$registration_reason
|
||||
|
||||
#=================================================
|
||||
# STANDARD MODIFICATIONS
|
||||
|
@ -89,21 +89,11 @@ ynh_script_progression --message="Finding an available port..." --weight=1
|
|||
|
||||
### Use these lines if you have to open a port for the application
|
||||
### `ynh_find_port` will find the first available port starting from the given port.
|
||||
### If you're not using these lines:
|
||||
### - Remove the section "CLOSE A PORT" in the remove script
|
||||
|
||||
# Find an available port
|
||||
port=$(ynh_find_port --port=8095)
|
||||
ynh_app_setting_set --app=$app --key=port --value=$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..." --weight=1
|
||||
# ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port
|
||||
|
||||
#=================================================
|
||||
# INSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
|
@ -111,11 +101,6 @@ ynh_script_progression --message="Installing dependencies..." --weight=5
|
|||
|
||||
### `ynh_install_app_dependencies` allows you to add any "apt" dependencies to the package.
|
||||
### Those deb packages will be installed as dependencies of this package.
|
||||
### If you're not using this helper:
|
||||
### - Remove the section "REMOVE DEPENDENCIES" in the remove script
|
||||
### - Remove the variable "pkg_dependencies" in _common.sh
|
||||
### - As well as the section "REINSTALL DEPENDENCIES" in the restore script
|
||||
### - And the section "UPGRADE DEPENDENCIES" in the upgrade script
|
||||
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
|
||||
|
@ -187,9 +172,6 @@ ynh_script_progression --message="Creating a data directory..." --weight=1
|
|||
### Use these lines if you need to create a directory to store "persistent files" for the application.
|
||||
### Usually this directory is used to store uploaded files or any file that won't be updated during
|
||||
### an upgrade and that won't be deleted during app removal
|
||||
### If you're not using these lines:
|
||||
### - Remove the section "BACKUP THE DATA DIR" in the backup script
|
||||
### - As well as the section "RESTORE THE DATA DIRECTORY" in the restore script
|
||||
|
||||
datadir=/home/yunohost.app/$app
|
||||
ynh_app_setting_set --app=$app --key=datadir --value=$datadir
|
||||
|
@ -247,12 +229,6 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=1
|
|||
### It can be used for apps that use sysvinit (with adaptation) or systemd.
|
||||
### Have a look at the app to be sure this app needs a systemd script.
|
||||
### `ynh_systemd_config` will use the file conf/systemd.service
|
||||
### If you're not using these lines:
|
||||
### - You can remove those files in conf/.
|
||||
### - Remove the section "BACKUP SYSTEMD" in the backup script
|
||||
### - Remove also the section "STOP AND REMOVE SERVICE" in the remove script
|
||||
### - As well as the section "RESTORE SYSTEMD" in the restore script
|
||||
### - And the section "SETUP SYSTEMD" in the upgrade script
|
||||
|
||||
# Create a dedicated systemd config
|
||||
ynh_add_systemd_config
|
||||
|
@ -287,11 +263,6 @@ ynh_script_progression --message="Configuring log rotation..." --weight=1
|
|||
|
||||
### `ynh_use_logrotate` is used to configure a logrotate configuration for the logs of this app.
|
||||
### Use this helper only if there is effectively a log file for this app.
|
||||
### If you're not using this helper:
|
||||
### - Remove the section "BACKUP LOGROTATE" in the backup script
|
||||
### - Remove also the section "REMOVE LOGROTATE CONFIGURATION" in the remove script
|
||||
### - As well as the section "RESTORE THE LOGROTATE CONFIGURATION" in the restore script
|
||||
### - And the section "SETUP LOGROTATE" in the upgrade script
|
||||
|
||||
# Use logrotate to manage application logfile(s)
|
||||
ynh_use_logrotate
|
||||
|
@ -304,11 +275,6 @@ ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
|||
### `yunohost service add` integrates a service in YunoHost. It then gets
|
||||
### displayed in the admin interface and through the others `yunohost service` commands.
|
||||
### (N.B.: this line only makes sense if the app adds a service to the system!)
|
||||
### If you're not using these lines:
|
||||
### - You can remove these files in conf/.
|
||||
### - Remove the section "REMOVE SERVICE INTEGRATION IN YUNOHOST" in the remove script
|
||||
### - As well as the section "INTEGRATE SERVICE IN YUNOHOST" in the restore script
|
||||
### - And the section "INTEGRATE SERVICE IN YUNOHOST" in the upgrade script
|
||||
|
||||
yunohost service add $app --description="Gotosocial server" --log="/var/log/$app/$app.log"
|
||||
|
||||
|
@ -331,7 +297,7 @@ yunohost service add $app --description="Gotosocial server" --log="/var/log/$app
|
|||
#=================================================
|
||||
# CREATE ADMIN USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Creating admin user..." --weight=1
|
||||
ynh_script_progression --message="Creating gotosocial admin user..." --weight=1
|
||||
|
||||
"$final_path"/gotosocial --config-path "$final_path/config.yaml" admin account create --username "$admin" --email "$email" --password "$password"
|
||||
|
||||
|
@ -346,11 +312,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1
|
|||
|
||||
### `ynh_systemd_action` is used to start a systemd service for an app.
|
||||
### Only needed if you have configure a systemd service
|
||||
### If you're not using these lines:
|
||||
### - Remove the section "STOP SYSTEMD SERVICE" and "START SYSTEMD SERVICE" in the backup script
|
||||
### - As well as the section "START SYSTEMD SERVICE" in the restore script
|
||||
### - As well as the section"STOP SYSTEMD SERVICE" and "START SYSTEMD SERVICE" in the upgrade script
|
||||
### - And the section "STOP SYSTEMD SERVICE" and "START SYSTEMD SERVICE" in the change_url script
|
||||
|
||||
# Start a systemd service
|
||||
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
||||
|
|
Loading…
Add table
Reference in a new issue