Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing #143

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions conf/systemd.service
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
[Unit]
Description=Friendica daemon
Description=Friendica: decentralized Social Network
After=network.target mariadb.service
Requires=network.target remote-fs.target nss-lookup.target

[Service]
Type=simple
User=__APP__
Group=__APP__
WorkingDirectory=__INSTALL_DIR__/
Type=simple
StandardOutput=append:/var/log/__APP__/daemon.log
StandardError=inherit
ExecStart=/usr/bin/php__PHPVERSION__ __INSTALL_DIR__/bin/daemon.php start
ExecStop=/usr/bin/php__PHPVERSION__ __INSTALL_DIR__/bin/daemon.php stop
PIDFile=__INSTALL_DIR__/daemon.pid
PrivateTmp=true
InaccessibleDirectories=/home /root /boot /opt /mnt /media
ReadOnlyDirectories=/etc /usr
Restart=always
RestartSec=10
StartLimitBurst=1
Expand Down
2 changes: 1 addition & 1 deletion manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ userdoc = "https://wiki.friendi.ca/"
code = "https://github.com/friendica/friendica"

[integration]
yunohost = ">= 11.2"
yunohost = ">= 11.2.27"
architectures = "all"
multi_instance = true
ldap = true
Expand Down
14 changes: 14 additions & 0 deletions scripts/change_url
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
source _common.sh
source /usr/share/yunohost/helpers

#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Stopping $app's systemd service..." --weight=1

ynh_systemd_action --service_name="$app" --action="stop" --log_path="systemd"

#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
Expand All @@ -25,6 +32,13 @@ ynh_print_info --message="Updating the Friendica config..."
ynh_replace_string --match_string="'url' => 'https://.*'," --replace_string="'url' => 'https://$domain'," --target_file="$install_dir/config/local.config.php"
ynh_store_file_checksum --file="$install_dir/config/local.config.php"

#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting $app's systemd service..." --weight=1

ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd"

#=================================================
# END OF SCRIPT
#=================================================
Expand Down
6 changes: 3 additions & 3 deletions scripts/install
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ ynh_add_systemd_config --service="$app-daemon"
# Create a dedicated nginx config
ynh_add_nginx_config

yunohost service add "$app-daemon" --description="Friendica daemon" --log="/var/log/$app/daemon.log"
yunohost service add "$app-daemon" --description="Decentralized Social Network" --log="/var/log/$app/daemon.log"

# Use logrotate to manage application logfile(s)
ynh_use_logrotate
Expand All @@ -79,7 +79,7 @@ pushd "$install_dir"
ynh_exec_as "$app" "php$phpversion" bin/composer.phar install --no-dev --quiet

# Install application
ynh_exec_as "$app" "php$phpversion" bin/console.php -f "$install_dir/config/local.config.php"
ynh_exec_as "$app" "php$phpversion" bin/console.php autoinstall -f "$install_dir/config/local.config.php"

# Enable LDAP Auth addon
ynh_exec_as "$app" "php$phpversion" bin/console.php addon enable ldapauth
Expand All @@ -90,7 +90,7 @@ popd
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1

ynh_systemd_action --service_name="$app-daemon" --action="start" --log_path="/var/log/$app/daemon.log"
ynh_systemd_action --service_name="$app-daemon" --action="start" --log_path="systemd"

#=================================================
# END OF SCRIPT
Expand Down
4 changes: 2 additions & 2 deletions scripts/restore
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore_file --origin_path="/etc/systemd/system/$app-daemon.service"
systemctl enable "$app-daemon.service" --quiet

yunohost service add "$app-daemon" --description="Friendica daemon" --log="/var/log/$app/daemon.log"
yunohost service add "$app-daemon" --description="Decentralized Social Network" --log="/var/log/$app/daemon.log"

ynh_restore_file --origin_path="/var/log/$app"

Expand All @@ -65,7 +65,7 @@ ynh_systemd_action --service_name="php$phpversion-fpm" --action=reload

ynh_systemd_action --service_name=nginx --action=reload

ynh_systemd_action --service_name="$app-daemon" --action="start" --log_path="/var/log/$app/daemon.log"
ynh_systemd_action --service_name="$app-daemon" --action="start" --log_path="systemd"

#==============
# FINALIZATION
Expand Down
6 changes: 3 additions & 3 deletions scripts/upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ source /usr/share/yunohost/helpers
#=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1

ynh_systemd_action --service_name="$app-daemon" --action="stop" --log_path="/var/log/$app/daemon.log"
ynh_systemd_action --service_name="$app-daemon" --action="stop" --log_path="systemd"

#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
Expand Down Expand Up @@ -54,7 +54,7 @@ fi

ynh_add_systemd_config --service="$app-daemon"

yunohost service add "$app-daemon" --description="Friendica daemon" --log="/var/log/$app/daemon.log"
yunohost service add "$app-daemon" --description="Decentralized Social Network" --log="/var/log/$app/daemon.log"

# Create a dedicated Fail2Ban config
ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="^.*authenticate\: failed login attempt.*\"ip\"\:\"<HOST>\".*$"
Expand Down Expand Up @@ -100,7 +100,7 @@ popd
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1

ynh_systemd_action --service_name="$app-daemon" --action="start" --log_path="/var/log/$app/daemon.log"
ynh_systemd_action --service_name="$app-daemon" --action="start" --log_path="systemd"

#=================================================
# END OF SCRIPT
Expand Down