1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/akkoma_ynh.git synced 2024-09-03 20:36:17 +02:00

Merge pull request #1 from YunoHost-Apps/testing

Install & restore + front-ends
This commit is contained in:
lapineige 2022-12-20 23:58:27 +01:00 committed by GitHub
commit 9ccecf532b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 31 additions and 25 deletions

View file

@ -21,7 +21,7 @@ Akkoma is a microblogging server software that can federate (= exchange messages
**Shipped version:** 3.5.0~ynh1 **Shipped version:** 3.5.0~ynh2
**Demo:** https://otp.akkoma.dev **Demo:** https://otp.akkoma.dev

View file

@ -21,7 +21,7 @@ Akkoma is a microblogging server software that can federate (= exchange messages
**Version incluse :** 3.5.0~ynh1 **Version incluse :** 3.5.0~ynh2
**Démo :** https://otp.akkoma.dev **Démo :** https://otp.akkoma.dev

View file

@ -1,5 +1,5 @@
config :pleroma, Pleroma.Web.Auth.Authenticator, Pleroma.Web.Auth.LDAPAuthenticator config :akkoma, Akkoma.Web.Auth.Authenticator, Akkoma.Web.Auth.LDAPAuthenticator
config :pleroma, :ldap, config :akkoma, :ldap,
enabled: true, enabled: true,
host: "localhost", host: "localhost",
port: 389, port: 389,

View file

@ -7,20 +7,20 @@ ExecReload=/bin/kill $MAINPID
KillMode=process KillMode=process
Restart=on-failure Restart=on-failure
; Name of the user that runs the Pleroma service. ; Name of the user that runs the Akkoma service.
User=__APP__ User=__APP__
Group=__APP__ Group=__APP__
; Declares that Pleroma runs in production mode. ; Declares that Akkoma runs in production mode.
Environment="MIX_ENV=prod" Environment="MIX_ENV=prod"
; Make sure that all paths fit your installation. ; Make sure that all paths fit your installation.
; Path to the home directory of the user running the Pleroma service. ; Path to the home directory of the user running the Akkoma service.
Environment="HOME=__FINALPATH__/live/" Environment="HOME=__FINALPATH__/live/"
; Path to the folder containing the Pleroma installation. ; Path to the folder containing the Akkoma installation.
WorkingDirectory=__FINALPATH__/live/ WorkingDirectory=__FINALPATH__/live/
; Path to the Pleroma binary. ; Path to the Pleroma binary. ; It has to be Pleroma not Akkoma
ExecStart=__FINALPATH__/live/bin/akkoma start ExecStart=__FINALPATH__/live/bin/pleroma start
ExecStop=__FINALPATH__/live/bin/akkoma stop ExecStop=__FINALPATH__/live/bin/pleroma stop
; Some security directives. ; Some security directives.
; Use private /tmp and /var/tmp folders inside a new file system namespace, which are discarded after the process stops. ; Use private /tmp and /var/tmp folders inside a new file system namespace, which are discarded after the process stops.

View file

@ -6,7 +6,7 @@
"en": "A free, federated social networking server built on ActivityPub open protocol. Derivate of Pleroma.", "en": "A free, federated social networking server built on ActivityPub open protocol. Derivate of Pleroma.",
"fr": "Un serveur de réseautage social fédéré et gratuit basé sur le protocole ouvert ActivityPub. Derivé de Pleroma." "fr": "Un serveur de réseautage social fédéré et gratuit basé sur le protocole ouvert ActivityPub. Derivé de Pleroma."
}, },
"version": "3.5.0~ynh1", "version": "3.5.0~ynh2",
"url": "https://akkoma.social/", "url": "https://akkoma.social/",
"upstream": { "upstream": {
"license": "AGPL-3.0-only", "license": "AGPL-3.0-only",

View file

@ -171,6 +171,9 @@ chown $app:$app /etc/$app
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD
#================================================= #=================================================
### fake akkoma executable
ln -s "$final_path/live/bin/pleroma" "$final_path/live/bin/akkoma"
ynh_script_progression --message="Configuring a systemd service..." --weight=1 ynh_script_progression --message="Configuring a systemd service..." --weight=1
# Create a dedicated systemd config # Create a dedicated systemd config
@ -215,7 +218,7 @@ ynh_replace_string --match_string="registrations_open: true" --replace_string="r
pushd $final_path/live pushd $final_path/live
ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "$final_path/live/bin/pleroma_ctl migrate" ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "$final_path/live/bin/pleroma_ctl migrate"
ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Access akkoma.Web.Endpoint" ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Access Pleroma.Web.Endpoint"
# Add user # Add user
ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "$final_path/live/bin/pleroma_ctl user new $admin $admin_email --password $password --moderator --admin -y" ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "$final_path/live/bin/pleroma_ctl user new $admin $admin_email --password $password --moderator --admin -y"
@ -229,16 +232,6 @@ ynh_store_file_checksum --file="$config"
chmod 400 "$config" chmod 400 "$config"
chown $app:$app "$config" chown $app:$app "$config"
#=================================================
# INSTALL BASIC FRONTENDS
#=================================================
# Pleroma Front-End
ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "$final_path/live/bin/pleroma_ctl frontend install pleroma-fe --ref stable"
# Admin Front-End
ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "$final_path/live/bin/pleroma_ctl frontend install admin-fe --ref stable"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================
@ -254,7 +247,7 @@ yunohost service add $app --description="$app daemon for akkoma"
ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_script_progression --message="Starting a systemd service..." --weight=1
# Start a systemd service # Start a systemd service
ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Access akkoma.Web.Endpoint" ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Access Pleroma.Web.Endpoint"
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT
@ -281,6 +274,19 @@ ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
#=================================================
# INSTALL BASIC FRONTENDS
#=================================================
#### Fontends need Akkoma to be already running, so they are installed at the very end
# Pleroma Front-End
ynh_script_progression --message="Installing Pleroma FrontEnd..." --weight=1
ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "$final_path/live/bin/pleroma_ctl frontend install pleroma-fe --ref stable"
# Admin Front-End
ynh_script_progression --message="Installing Admin FrontEnd..." --weight=1
ynh_exec_warn_less ynh_exec_as $app -s $SHELL -lc "$final_path/live/bin/pleroma_ctl frontend install admin-fe --ref stable"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================