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

Packaging v2 #56

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 0 additions & 6 deletions conf/amd64.src

This file was deleted.

8 changes: 4 additions & 4 deletions conf/systemd.service
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ Environment="MIX_ENV=prod"

; Make sure that all paths fit your installation.
; Path to the home directory of the user running the Akkoma service.
Environment="HOME=__FINALPATH__/live/"
Environment="HOME=__INSTALL_DIR__/live/"
; Path to the folder containing the Akkoma installation.
WorkingDirectory=__FINALPATH__/live/
WorkingDirectory=__INSTALL_DIR__/live/
; Path to the Pleroma binary. ; It has to be Pleroma not Akkoma
ExecStart=__FINALPATH__/live/bin/pleroma start
ExecStop=__FINALPATH__/live/bin/pleroma stop
ExecStart=__INSTALL_DIR__/live/bin/pleroma start
ExecStop=__INSTALL_DIR__/live/bin/pleroma stop

; Some security directives.
; Use private /tmp and /var/tmp folders inside a new file system namespace, which are discarded after the process stops.
Expand Down
99 changes: 0 additions & 99 deletions manifest.json

This file was deleted.

96 changes: 96 additions & 0 deletions manifest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
packaging_format = 2

id = "akkoma"
name = "Akkoma"
description.en = "Federated social networking server built on ActivityPub open protocol"
description.fr = "Serveur de réseautage social fédéré basé sur le protocole ouvert ActivityPub"

version = "3.10.4~ynh3"

maintainers = ["Lapineige"]

[upstream]
license = "AGPL-3.0-only"
website = "https://akkoma.social/"
demo = "https://otp.akkoma.dev"
admindoc = "https://docs.akkoma.dev/stable/"
code = "https://akkoma.dev/AkkomaGang/akkoma/"

[integration]
yunohost = ">= 12.0"
architectures = ["amd64"] # FIXME HELPWANTED "arm64"
multi_instance = false
ldap = false
sso = false
disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ...
ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ...
ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ...

[install]
[install.domain]
# this is a generic question - ask strings are automatically handled by Yunohost's core
type = "domain"

[install.init_main_permission]
type = "group"
default = "visitors"

[install.admin]
# this is a generic question - ask strings are automatically handled by Yunohost's core
type = "user"

[install.password]
# this is a generic question - ask strings are automatically handled by Yunohost's core
type = "password"

[install.instance_name]
ask.en = "Choose a name for your Akkoma instance"
ask.fr = "Choisissez un nom pour votre instance Akkoma"
type = "string"
example = "My_akkoma"
default = "My_akkoma"

[install.registration]
ask.en = "Should registration be open to users who do not have a YunoHost account on the system?"
ask.fr = "L'inscription doit-elle être ouverte aux utilisateurs qui n'ont pas de compte YunoHost sur le système ?"
type = "boolean"
default = false

[install.cache]
ask.en = "Enable media-cache for your instance: downloaded media won't be downloaded twice, at the price of storage capacity."
ask.fr = "Activer le cache média pour votre instance : les médias téléchargés le seront pas deux fois, au prix d'un plus grande utilisation de l'espace de stockage."
type = "boolean"
default = true

[install.size]
ask.en = "Select the media-cache size (in GB). If you did not enabled media-cache in above option then this option will have no effect. This can be tweaked afterwards."
ask.fr = "Sélectionner la taille du cache média (en Go). Si vous n'avez pas activé le cache média ci-dessus, cette option n'aura aucun effet. Cela peut être ajusté après-coup."
type = "select"
choices = ["1g", "2g", "5g", "10g", "20g", "40g", "60g", "100g", "150g"]
default = "5g"

[resources]

[resources.sources.main]
url = "https://akkoma-updates.s3-website.fr-par.scw.cloud/stable/akkoma-amd64.zip"
sha256 = "146b148be0e71482e7614246b8a0c563a5c45ed6581e20f70035b3e3a2377ba2"
# autoupdate.strategy = "latest_github_release" # How to implement this ?
# autoupdate.asset = ".*\\.zip"

[resources.system_user]

[resources.install_dir]

[resources.data_dir]

[resources.permissions]
main.url = "/"

[resources.ports]
main.default = 8095 # FIXME

[resources.apt]
packages = "curl, unzip, libncurses5, postgresql, postgresql-contrib, imagemagick, ffmpeg, exiftool, libimage-exiftool-perl"

[resources.database]
type = "postgresql"
3 changes: 2 additions & 1 deletion scripts/_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
#=================================================

# dependencies used by the app (must be on a single line)
pkg_dependencies="curl unzip libncurses5 postgresql postgresql-contrib imagemagick ffmpeg exiftool libimage-exiftool-perl"
#REMOVEME? pkg_dependencies="curl unzip libncurses5 postgresql postgresql-contrib imagemagick ffmpeg exiftool libimage-exiftool-perl"
export FLAVOUR="amd64-debian-bookworm" #FIXME : arm arch ?

#=================================================
# PERSONAL HELPERS
Expand Down
26 changes: 8 additions & 18 deletions scripts/backup
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,18 @@
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers

#=================================================
# MANAGE SCRIPT FAILURE
#=================================================

ynh_clean_setup () {
true
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors

#=================================================
# LOAD SETTINGS
#=================================================
ynh_print_info --message="Loading settings..."

app=$YNH_APP_INSTANCE_NAME
#REMOVEME? app=$YNH_APP_INSTANCE_NAME

final_path=$(ynh_app_setting_get --app=$app --key=final_path)
domain=$(ynh_app_setting_get --app=$app --key=domain)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
cache=$(ynh_app_setting_get --app=$app --key=cache)
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir)
#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain)
#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name)
#REMOVEME? cache=$(ynh_app_setting_get --app=$app --key=cache)
#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir)

#=================================================
# DECLARE DATA AND CONF FILES TO BACKUP
Expand All @@ -42,14 +32,14 @@ ynh_print_info --message="Declaring files to be backed up..."
# BACKUP THE APP MAIN DIR
#=================================================

ynh_backup --src_path="$final_path"
ynh_backup --src_path="$install_dir"

#=================================================
# BACKUP THE DATA DIR
#=================================================

# When using BACKUP_CORE_ONLY (default), this folder will not be saved. This saves a lot of space and time, in particular during upgrades.
ynh_backup --src_path="$datadir" --is_big
ynh_backup --src_path="$data_dir" --is_big

#=================================================
# BACKUP THE NGINX CONFIGURATION
Expand Down
2 changes: 0 additions & 2 deletions scripts/change_url
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ ynh_clean_setup () {
# Restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors

#=================================================
# CHECK WHICH PARTS SHOULD BE CHANGED
Expand Down
Loading