1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/calckey_ynh.git synced 2024-09-03 18:16:18 +02:00
This commit is contained in:
eric_G 2024-08-06 08:24:08 +00:00 committed by GitHub
commit 7f4fd39245
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 52 additions and 164 deletions

View file

@ -16,7 +16,6 @@ It shall NOT be edited by hand.
## Overview ## Overview
A greatly enhanced fork of Misskey with better UI/UX, security, features, and more! https://i.calckey.cloud/ A greatly enhanced fork of Misskey with better UI/UX, security, features, and more! https://i.calckey.cloud/
@ -25,7 +24,7 @@ A greatly enhanced fork of Misskey with better UI/UX, security, features, and mo
**Shipped version:** 13.1.4.1~ynh1 **Shipped version:** 14.0.0rc3~ynh1
**Demo:** <https://i.calckey.cloud/> **Demo:** <https://i.calckey.cloud/>

View file

@ -16,7 +16,6 @@ No se debe editar a mano.
## Descripción general ## Descripción general
A greatly enhanced fork of Misskey with better UI/UX, security, features, and more! https://i.calckey.cloud/ A greatly enhanced fork of Misskey with better UI/UX, security, features, and more! https://i.calckey.cloud/
@ -25,7 +24,7 @@ A greatly enhanced fork of Misskey with better UI/UX, security, features, and mo
**Versión actual:** 13.1.4.1~ynh1 **Versión actual:** 14.0.0rc3~ynh1
**Demo:** <https://i.calckey.cloud/> **Demo:** <https://i.calckey.cloud/>

View file

@ -16,7 +16,6 @@ EZ editatu eskuz.
## Aurreikuspena ## Aurreikuspena
A greatly enhanced fork of Misskey with better UI/UX, security, features, and more! https://i.calckey.cloud/ A greatly enhanced fork of Misskey with better UI/UX, security, features, and more! https://i.calckey.cloud/
@ -25,7 +24,7 @@ A greatly enhanced fork of Misskey with better UI/UX, security, features, and mo
**Paketatutako bertsioa:** 13.1.4.1~ynh1 **Paketatutako bertsioa:** 14.0.0rc3~ynh1
**Demoa:** <https://i.calckey.cloud/> **Demoa:** <https://i.calckey.cloud/>

View file

@ -23,7 +23,7 @@ Un fork grandement amélioré de Misskey avec une meilleure UI/UX, sécurité, f
Calckey ajoute de nombreux changements de qualité de vie et des corrections de bogues pour les utilisateurs et les administrateurs d'instance. Calckey ajoute de nombreux changements de qualité de vie et des corrections de bogues pour les utilisateurs et les administrateurs d'instance.
**Version incluse:** 13.1.4.1~ynh1 **Version incluse:** 14.0.0rc3~ynh1
**Démo:** <https://i.calckey.cloud/> **Démo:** <https://i.calckey.cloud/>

View file

@ -16,7 +16,6 @@ NON debe editarse manualmente.
## Vista xeral ## Vista xeral
A greatly enhanced fork of Misskey with better UI/UX, security, features, and more! https://i.calckey.cloud/ A greatly enhanced fork of Misskey with better UI/UX, security, features, and more! https://i.calckey.cloud/
@ -25,7 +24,7 @@ A greatly enhanced fork of Misskey with better UI/UX, security, features, and mo
**Versión proporcionada:** 13.1.4.1~ynh1 **Versión proporcionada:** 14.0.0rc3~ynh1
**Demo:** <https://i.calckey.cloud/> **Demo:** <https://i.calckey.cloud/>

View file

@ -16,7 +16,6 @@ Ini TIDAK boleh diedit dengan tangan.
## Ringkasan ## Ringkasan
A greatly enhanced fork of Misskey with better UI/UX, security, features, and more! https://i.calckey.cloud/ A greatly enhanced fork of Misskey with better UI/UX, security, features, and more! https://i.calckey.cloud/
@ -25,7 +24,7 @@ A greatly enhanced fork of Misskey with better UI/UX, security, features, and mo
**Versi terkirim:** 13.1.4.1~ynh1 **Versi terkirim:** 14.0.0rc3~ynh1
**Demo:** <https://i.calckey.cloud/> **Demo:** <https://i.calckey.cloud/>

View file

@ -16,7 +16,6 @@
## 概况 ## 概况
A greatly enhanced fork of Misskey with better UI/UX, security, features, and more! https://i.calckey.cloud/ A greatly enhanced fork of Misskey with better UI/UX, security, features, and more! https://i.calckey.cloud/
@ -25,7 +24,7 @@ A greatly enhanced fork of Misskey with better UI/UX, security, features, and mo
**分发版本:** 13.1.4.1~ynh1 **分发版本:** 14.0.0rc3~ynh1
**演示:** <https://i.calckey.cloud/> **演示:** <https://i.calckey.cloud/>

View file

@ -1,7 +1,6 @@
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
location __PATH__/ { location __PATH__/ {
proxy_pass http://127.0.0.1:__PORT__; proxy_pass http://127.0.0.1:__PORT__;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;

View file

@ -1,4 +1,3 @@
A greatly enhanced fork of Misskey with better UI/UX, security, features, and more! https://i.calckey.cloud/ A greatly enhanced fork of Misskey with better UI/UX, security, features, and more! https://i.calckey.cloud/

View file

@ -3,9 +3,9 @@ packaging_format = 2
id = "calckey" id = "calckey"
name = "Calckey" name = "Calckey"
description.en = "Fork of Misskey with better UI/UX, security, features" description.en = "Fork of Misskey with better UI/UX, security, features"
description.fr = "Un fork de Misskey avec une meilleure interface utilisateur, la sécurité, les fonctionnalités" description.fr = "Fork de Misskey avec une meilleure interface utilisateur, la sécurité, les fonctionnalités"
version = "13.1.4.1~ynh1" version = "14.0.0rc3~ynh1"
maintainers = ["oufmilo"] maintainers = ["oufmilo"]
@ -42,8 +42,8 @@ ram.runtime = "2G"
[resources] [resources]
[resources.sources.main] [resources.sources.main]
url = "https://git.joinfirefish.org/firefish/firefish/-/archive/v13.1.4.1/firefish-v13.1.4.1.tar.gz" url = "https://git.joinfirefish.org/firefish/firefish/-/archive/v14.0.0-rc3/firefish-v14.0.0-rc3.tar.gz"
sha256 = "658965f878fb0f5b22a6f29b5c63723f052a64f6b9bd8d9a3da93849231e3e62" sha256 = "628c455a3f7bb5203ff98f3130c75ca168384379ddec20905b98b5e8c97ce285"
[resources.system_user] [resources.system_user]
@ -56,7 +56,7 @@ ram.runtime = "2G"
main.default = 3020 main.default = 3020
[resources.apt] [resources.apt]
packages = "ffmpeg, postgresql, build-essential, redis-server" packages = "ffmpeg, postgresql, build-essential, redis-server, curl"
[resources.database] [resources.database]
type = "postgresql" type = "postgresql"

View file

@ -10,7 +10,6 @@
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= #=================================================
# DECLARE DATA AND CONF FILES TO BACKUP # DECLARE DATA AND CONF FILES TO BACKUP
#================================================= #=================================================

View file

@ -9,10 +9,14 @@
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
# Configure redis
redis_db=$(ynh_redis_get_free_db)
ynh_app_setting_set --app="$app" --key=redis_db --value="$redis_db"
#================================================= #=================================================
# INSTALL DEPENDENCIES # INSTALL DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Installing dependencies... This might take some time." --weight=3 ynh_script_progression --message="Installing Node..." --weight=3
ynh_install_nodejs --nodejs_version=$NODEJS_VERSION ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
@ -24,30 +28,17 @@ ynh_script_progression --message="Setting up source files..." --weight=3
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir" ynh_setup_source --dest_dir="$install_dir"
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R $app:www-data "$install_dir"
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring NGINX web server..." --weight=3
# Create a dedicated NGINX config
ynh_add_nginx_config
#================================================= #=================================================
# ADD A CONFIGURATION # ADD A CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=1 ynh_script_progression --message="Adding a configuration file..." --weight=1
# Configure redis ynh_add_config --template="default.yml" --destination="$install_dir/.config/default.yml"
redis_db=$(ynh_redis_get_free_db)
ynh_app_setting_set --app="$app" --key=redis_db --value="$redis_db"
ynh_add_config --template="../conf/default.yml" --destination="$install_dir/.config/default.yml"
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
chmod 400 "$install_dir/.config/default.yml" chmod 400 "$install_dir/.config/default.yml"
chown $app:$app "$install_dir/.config/default.yml" chown $app:$app "$install_dir/.config/default.yml"
@ -57,12 +48,13 @@ chown $app:$app "$install_dir/.config/default.yml"
ynh_script_progression --message="Building app... This will take some time." --weight=15 ynh_script_progression --message="Building app... This will take some time." --weight=15
pushd "$install_dir" pushd "$install_dir"
curl https://sh.rustup.rs -sSf | ynh_exec_warn_less ynh_exec_as $app sh -s -- -y
export PATH="$install_dir/.cargo/bin:$PATH"
ynh_use_nodejs ynh_use_nodejs
corepack enable ynh_exec_warn_less env $ynh_node_load_PATH corepack enable && COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack prepare pnpm@latest --activate
corepack prepare pnpm@latest --activate ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH corepack pnpm install
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH pnpm install ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_ENV=production corepack pnpm build
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_ENV=production pnpm build ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH corepack pnpm run init
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH pnpm run init
popd popd
#================================================= #=================================================
@ -70,23 +62,15 @@ popd
#================================================= #=================================================
ynh_script_progression --message="Configuring a systemd service..." --weight=1 ynh_script_progression --message="Configuring a systemd service..." --weight=1
env_path="$PATH" # Create a dedicated NGINX config
ynh_add_nginx_config
# Create a dedicated systemd config # Create a dedicated systemd config
ynh_add_systemd_config ynh_add_systemd_config
#=================================================
# SETUP LOGROTATE
#=================================================
ynh_script_progression --message="Configuring log rotation..." --weight=1
# Use logrotate to manage application logfile(s) # Use logrotate to manage application logfile(s)
ynh_use_logrotate ynh_use_logrotate
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="A interplanetary blogging platform" --log="/var/log/$app/$app.log" yunohost service add $app --description="A interplanetary blogging platform" --log="/var/log/$app/$app.log"
#================================================= #=================================================
@ -97,7 +81,6 @@ 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="All workers started" ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="All workers started"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================

View file

@ -10,15 +10,6 @@
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
ynh_script_progression --message="Restoring the app main directory..." --weight=1
ynh_restore_file --origin_path="$install_dir"
#=================================================
# SPECIFIC RESTORATION
#================================================= #=================================================
# REINSTALL DEPENDENCIES # REINSTALL DEPENDENCIES
#================================================= #=================================================
@ -28,42 +19,15 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=5
ynh_install_nodejs --nodejs_version=$NODEJS_VERSION ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
#================================================= #=================================================
# ADD A CONFIGURATION # RESTORE THE APP MAIN DIR
#================================================= #=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=1 ynh_script_progression --message="Restoring the app main directory..." --weight=1
# Configure redis ynh_restore_file --origin_path="$install_dir"
redis_db=$(ynh_redis_get_free_db)
ynh_app_setting_set --app="$app" --key=redis_db --value="$redis_db"
ynh_add_config --template="../conf/default.yml" --destination="$install_dir/.config/default.yml"
chmod 750 "$install_dir" chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R $app:www-data "$install_dir"
chmod 400 "$install_dir/.config/default.yml"
chown $app:$app "$install_dir/.config/default.yml"
#=================================================
# REINSTALL PNPM
#=================================================
ynh_script_progression --message="Reinstalling pnpm..." --weight=1
# Define and install pnpm
pushd "$install_dir"
ynh_use_nodejs
corepack enable
corepack prepare pnpm@latest --activate
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH pnpm install
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_ENV=production pnpm build
popd
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the NGINX web server configuration..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# RESTORE THE POSTGRESQL DATABASE # RESTORE THE POSTGRESQL DATABASE
@ -72,34 +36,18 @@ ynh_script_progression --message="Restoring the PostgreSQL database..." --weight
ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
# Set permissions to app files
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
#================================================= #=================================================
# RESTORE SYSTEMD # RESTORE SYSTEMD
#================================================= #=================================================
ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 ynh_script_progression --message="Restoring the systemd configuration..." --weight=1
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore_file --origin_path="/etc/systemd/system/$app.service" ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
systemctl enable $app.service --quiet systemctl enable $app.service --quiet
#=================================================
# RESTORE THE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1
ynh_restore_file --origin_path="/etc/logrotate.d/$app" ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="A interplanetary blogging platform" --log="/var/log/$app/$app.log" yunohost service add $app --description="A interplanetary blogging platform" --log="/var/log/$app/$app.log"
#================================================= #=================================================
@ -109,13 +57,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="All workers started" ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="All workers started"
#=================================================
# GENERIC FINALIZATION
#=================================================
# RELOAD NGINX
#=================================================
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
#================================================= #=================================================

View file

@ -9,18 +9,11 @@
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#=================================================
# CHECK VERSION
#=================================================
ynh_script_progression --message="Checking version..."
upgrade_type=$(ynh_check_app_version_changed)
#================================================= #=================================================
# ENSURE DOWNWARD COMPATIBILITY # ENSURE DOWNWARD COMPATIBILITY
#================================================= #=================================================
if ynh_compare_current_package_version --comparison lt --version 12.105.0~ynh1 if ynh_compare_current_package_version --comparison lt --version 13.0.5~ynh1
then then
ynh_die --message="Sorry, this version is not upgradable to the latest version :(" ynh_die --message="Sorry, this version is not upgradable to the latest version :("
fi fi
@ -31,7 +24,7 @@ fi
ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_script_progression --message="Stopping a systemd service..." --weight=1
# Stop service before backup, to not loose message in case of failed upgrade and restore # Stop service before backup, to not loose message in case of failed upgrade and restore
ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd
#================================================= #=================================================
# STANDARD UPGRADE STEPS # STANDARD UPGRADE STEPS
@ -55,14 +48,10 @@ fi
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_script_progression --message="Upgrading source files..."
if [ "$upgrade_type" == "UPGRADE_APP" ] # Download, check integrity, uncompress and patch the source from app.src
then ynh_setup_source --dest_dir="$install_dir" --keep=".config/default.yml"
ynh_script_progression --message="Upgrading source files..."
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir" --keep=".config/default.yml"
fi
chmod 750 "$install_dir" chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
@ -79,26 +68,20 @@ ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
ynh_script_progression --message="Removing old version dependency..." ynh_script_progression --message="Removing old version dependency..."
ynh_secure_remove --file="$install_dir/.yarn" ynh_secure_remove --file="$install_dir/.yarn"
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1
# Create a dedicated NGINX config
ynh_add_nginx_config
#================================================= #=================================================
# BUILD APP # BUILD APP
#================================================= #=================================================
ynh_script_progression --message="Building app..." ynh_script_progression --message="Installing rust and building app…"
pushd "$install_dir" pushd "$install_dir"
corepack enable curl https://sh.rustup.rs -sSf | ynh_exec_warn_less ynh_exec_as $app sh -s -- -y
corepack prepare pnpm@latest --activate export PATH="$install_dir/.cargo/bin:$PATH"
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH pnpm clean-all ynh_use_nodejs
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH pnpm install ynh_exec_warn_less env $ynh_node_load_PATH corepack enable && COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack prepare pnpm@latest --activate
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_ENV=production pnpm run build ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH pnpm clean-all
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH pnpm run migrate ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH pnpm install
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_ENV=production pnpm run build
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH pnpm run migrate
popd popd
#================================================= #=================================================
@ -106,24 +89,15 @@ popd
#================================================= #=================================================
ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 ynh_script_progression --message="Upgrading systemd configuration..." --weight=1
# Create a dedicated NGINX config
ynh_add_nginx_config
# Create a dedicated systemd config # Create a dedicated systemd config
ynh_add_systemd_config ynh_add_systemd_config
#=================================================
# GENERIC FINALIZATION
#=================================================
# SETUP LOGROTATE
#=================================================
ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1
# Use logrotate to manage app-specific logfile(s) # Use logrotate to manage app-specific logfile(s)
ynh_use_logrotate --non-append ynh_use_logrotate --non-append
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="A interplanetary blogging platform" --log="/var/log/$app/$app.log" yunohost service add $app --description="A interplanetary blogging platform" --log="/var/log/$app/$app.log"
#================================================= #=================================================
@ -133,7 +107,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path=systemd ynh_systemd_action --service_name=$app --action="start" --log_path=systemd
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================

View file

@ -14,4 +14,4 @@ test_format = 1.0
# Commits to test upgrade from # Commits to test upgrade from
# ------------------------------- # -------------------------------
test_upgrade_from.89f4f52.name = "Upgrade from 13.0.5" test_upgrade_from.89f4f52.name = "13.1.4.1"