1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/lychee_ynh.git synced 2024-09-03 19:36:36 +02:00
* Update demo URL (#126)

* Auto-update READMEs

* [autopatch] Automatic patch attempt for helpers 2.1 (#127)

* [autopatch] Automatic patch attempt for helpers 2.1

* cleaning

---------

Co-authored-by: Yunohost-Bot <>
Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>

* Update manifest.toml

* Auto-update READMEs

---------

Co-authored-by: Marie <marie.jeammet@protonmail.com>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>
Co-authored-by: YunoHost Bot <yunohost-bot@users.noreply.github.com>
This commit is contained in:
eric_G 2024-09-01 21:29:01 +02:00 committed by GitHub
parent fa0cf5819b
commit e9ff45b992
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 191 additions and 286 deletions

View file

@ -5,4 +5,6 @@
- [Irakurri README euskaraz](README_eu.md) - [Irakurri README euskaraz](README_eu.md)
- [Lire le README en français](README_fr.md) - [Lire le README en français](README_fr.md)
- [Le o README en galego](README_gl.md) - [Le o README en galego](README_gl.md)
- [Baca README dalam bahasa bahasa Indonesia](README_id.md)
- [Прочитать README на русский](README_ru.md)
- [阅读中文(简体)的 README](README_zh_Hans.md) - [阅读中文(简体)的 README](README_zh_Hans.md)

View file

@ -21,9 +21,9 @@ Upload, manage and share photos like from a native application.
Lychee comes with everything you need and all your photos are stored securely. Lychee comes with everything you need and all your photos are stored securely.
**Shipped version:** 5.5.1~ynh1 **Shipped version:** 5.5.1~ynh2
**Demo:** <https://lycheeorg.github.io/demo/> **Demo:** <https://lychee-demo.fly.dev/landing>
## Screenshots ## Screenshots

View file

@ -21,9 +21,9 @@ Upload, manage and share photos like from a native application.
Lychee comes with everything you need and all your photos are stored securely. Lychee comes with everything you need and all your photos are stored securely.
**Versión actual:** 5.5.1~ynh1 **Versión actual:** 5.5.1~ynh2
**Demo:** <https://lycheeorg.github.io/demo/> **Demo:** <https://lychee-demo.fly.dev/landing>
## Capturas ## Capturas

View file

@ -21,9 +21,9 @@ Upload, manage and share photos like from a native application.
Lychee comes with everything you need and all your photos are stored securely. Lychee comes with everything you need and all your photos are stored securely.
**Paketatutako bertsioa:** 5.5.1~ynh1 **Paketatutako bertsioa:** 5.5.1~ynh2
**Demoa:** <https://lycheeorg.github.io/demo/> **Demoa:** <https://lychee-demo.fly.dev/landing>
## Pantaila-argazkiak ## Pantaila-argazkiak

View file

@ -21,9 +21,9 @@ Téléchargez, gérez et partagez des photos comme à partir d'une application n
Lychee est livré avec tout ce dont vous avez besoin et toutes vos photos sont stockées en toute sécurité. Lychee est livré avec tout ce dont vous avez besoin et toutes vos photos sont stockées en toute sécurité.
**Version incluse:** 5.5.1~ynh1 **Version incluse:** 5.5.1~ynh2
**Démo:** <https://lycheeorg.github.io/demo/> **Démo:** <https://lychee-demo.fly.dev/landing>
## Captures décran ## Captures décran

View file

@ -21,9 +21,9 @@ Upload, manage and share photos like from a native application.
Lychee comes with everything you need and all your photos are stored securely. Lychee comes with everything you need and all your photos are stored securely.
**Versión proporcionada:** 5.5.1~ynh1 **Versión proporcionada:** 5.5.1~ynh2
**Demo:** <https://lycheeorg.github.io/demo/> **Demo:** <https://lychee-demo.fly.dev/landing>
## Capturas de pantalla ## Capturas de pantalla

52
README_id.md Normal file
View file

@ -0,0 +1,52 @@
<!--
N.B.: README ini dibuat secara otomatis oleh <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
Ini TIDAK boleh diedit dengan tangan.
-->
# Lychee untuk YunoHost
[![Tingkat integrasi](https://dash.yunohost.org/integration/lychee.svg)](https://ci-apps.yunohost.org/ci/apps/lychee/) ![Status kerja](https://ci-apps.yunohost.org/ci/badges/lychee.status.svg) ![Status pemeliharaan](https://ci-apps.yunohost.org/ci/badges/lychee.maintain.svg)
[![Pasang Lychee dengan YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=lychee)
*[Baca README ini dengan bahasa yang lain.](./ALL_README.md)*
> *Paket ini memperbolehkan Anda untuk memasang Lychee secara cepat dan mudah pada server YunoHost.*
> *Bila Anda tidak mempunyai YunoHost, silakan berkonsultasi dengan [panduan](https://yunohost.org/install) untuk mempelajari bagaimana untuk memasangnya.*
## Ringkasan
Lychee is a free photo-management tool, which runs on your server or web-space.
Upload, manage and share photos like from a native application.
Lychee comes with everything you need and all your photos are stored securely.
**Versi terkirim:** 5.5.1~ynh2
**Demo:** <https://lychee-demo.fly.dev/landing>
## Tangkapan Layar
![Tangkapan Layar pada Lychee](./doc/screenshots/screenshot.jpg)
## Dokumentasi dan sumber daya
- Website aplikasi resmi: <https://lycheeorg.github.io/>
- Dokumentasi admin resmi: <https://lycheeorg.github.io/docs/>
- Depot kode aplikasi hulu: <https://github.com/LycheeOrg/Lychee>
- Gudang YunoHost: <https://apps.yunohost.org/app/lychee>
- Laporkan bug: <https://github.com/YunoHost-Apps/lychee_ynh/issues>
## Info developer
Silakan kirim pull request ke [`testing` branch](https://github.com/YunoHost-Apps/lychee_ynh/tree/testing).
Untuk mencoba branch `testing`, silakan dilanjutkan seperti:
```bash
sudo yunohost app install https://github.com/YunoHost-Apps/lychee_ynh/tree/testing --debug
atau
sudo yunohost app upgrade lychee -u https://github.com/YunoHost-Apps/lychee_ynh/tree/testing --debug
```
**Info lebih lanjut mengenai pemaketan aplikasi:** <https://yunohost.org/packaging_apps>

52
README_ru.md Normal file
View file

@ -0,0 +1,52 @@
<!--
Важно: этот README был автоматически сгенерирован <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
Он НЕ ДОЛЖЕН редактироваться вручную.
-->
# Lychee для YunoHost
[![Уровень интеграции](https://dash.yunohost.org/integration/lychee.svg)](https://ci-apps.yunohost.org/ci/apps/lychee/) ![Состояние работы](https://ci-apps.yunohost.org/ci/badges/lychee.status.svg) ![Состояние сопровождения](https://ci-apps.yunohost.org/ci/badges/lychee.maintain.svg)
[![Установите Lychee с YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=lychee)
*[Прочтите этот README на других языках.](./ALL_README.md)*
> *Этот пакет позволяет Вам установить Lychee быстро и просто на YunoHost-сервер.*
> *Если у Вас нет YunoHost, пожалуйста, посмотрите [инструкцию](https://yunohost.org/install), чтобы узнать, как установить его.*
## Обзор
Lychee is a free photo-management tool, which runs on your server or web-space.
Upload, manage and share photos like from a native application.
Lychee comes with everything you need and all your photos are stored securely.
**Поставляемая версия:** 5.5.1~ynh2
**Демо-версия:** <https://lychee-demo.fly.dev/landing>
## Снимки экрана
![Снимок экрана Lychee](./doc/screenshots/screenshot.jpg)
## Документация и ресурсы
- Официальный веб-сайт приложения: <https://lycheeorg.github.io/>
- Официальная документация администратора: <https://lycheeorg.github.io/docs/>
- Репозиторий кода главной ветки приложения: <https://github.com/LycheeOrg/Lychee>
- Магазин YunoHost: <https://apps.yunohost.org/app/lychee>
- Сообщите об ошибке: <https://github.com/YunoHost-Apps/lychee_ynh/issues>
## Информация для разработчиков
Пришлите Ваш запрос на слияние в [ветку `testing`](https://github.com/YunoHost-Apps/lychee_ynh/tree/testing).
Чтобы попробовать ветку `testing`, пожалуйста, сделайте что-то вроде этого:
```bash
sudo yunohost app install https://github.com/YunoHost-Apps/lychee_ynh/tree/testing --debug
или
sudo yunohost app upgrade lychee -u https://github.com/YunoHost-Apps/lychee_ynh/tree/testing --debug
```
**Больше информации о пакетировании приложений:** <https://yunohost.org/packaging_apps>

View file

@ -21,9 +21,9 @@ Upload, manage and share photos like from a native application.
Lychee comes with everything you need and all your photos are stored securely. Lychee comes with everything you need and all your photos are stored securely.
**分发版本:** 5.5.1~ynh1 **分发版本:** 5.5.1~ynh2
**演示:** <https://lycheeorg.github.io/demo/> **演示:** <https://lychee-demo.fly.dev/landing>
## 截图 ## 截图

View file

@ -1,7 +1,5 @@
; Additional php.ini defines, specific to this pool of workers. ; Additional php.ini defines, specific to this pool of workers.
php_admin_value[upload_max_filesize] = 1G
php_admin_value[post_max_size] = 1G
php_admin_value[max_execution_time] = 200 php_admin_value[max_execution_time] = 200
php_admin_value[upload_max_size] = 1G php_admin_value[upload_max_size] = 1G
php_admin_value[memory_limit]= 256M php_admin_value[memory_limit]= 256M

View file

@ -16,7 +16,7 @@ location ^~ __PATH__/ {
rewrite ^__PATH__/?(.*)$ __PATH__/index.php?/$1 last; rewrite ^__PATH__/?(.*)$ __PATH__/index.php?/$1 last;
break; break;
} }
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; fastcgi_pass unix:/var/run/php/php__PHP_VERSION__-fpm-__APP__.sock;
fastcgi_index index.php; fastcgi_index index.php;
include fastcgi_params; include fastcgi_params;

View file

@ -1,30 +0,0 @@
version = "1.0"
[main]
name = "Lychee configuration"
[main.php_fpm_config]
name = "PHP-FPM configuration"
[main.php_fpm_config.fpm_footprint]
ask = "Memory footprint"
type = "select"
choices.low = "Low, <= 20Mb per pool"
choices.medium = "Medium, between 20Mb and 40Mb per pool"
choices.high = "High, > 40Mb per pool"
choices.specific = "Use specific value"
default = "low"
[main.php_fpm_config.fpm_free_footprint]
visible = "fpm_footprint == 'specific'"
ask = "Memory footprint of the service?"
type = "number"
default = "0"
help = "Free field to specify exactly the footprint in Mb if you don't want to use one of the three previous values."
[main.php_fpm_config.fpm_usage]
ask = "Expected usage"
type = "select"
choices = ["low", "medium", "high"]
default = "low"
help = "low: Personal usage, behind the SSO. No RAM footprint when not used, but the impact on the processor can be high if many users are using the service.<br>medium: Low usage, few people or/and publicly accessible. Low RAM footprint, medium processor footprint when used.<br>high: High usage, frequently visited website. High RAM footprint, but lower on processor usage and quickly responding."

View file

@ -5,19 +5,20 @@ name = "Lychee"
description.en = "Photo-management-system to manage and share photos" description.en = "Photo-management-system to manage and share photos"
description.fr = "Système de gestion de photos pour gérer et partager des photos" description.fr = "Système de gestion de photos pour gérer et partager des photos"
version = "5.5.1~ynh1" version = "5.5.1~ynh2"
maintainers = [] maintainers = []
[upstream] [upstream]
license = "MIT" license = "MIT"
website = "https://lycheeorg.github.io/" website = "https://lycheeorg.github.io/"
demo = "https://lycheeorg.github.io/demo/" demo = "https://lychee-demo.fly.dev/landing"
admindoc = "https://lycheeorg.github.io/docs/" admindoc = "https://lycheeorg.github.io/docs/"
code = "https://github.com/LycheeOrg/Lychee" code = "https://github.com/LycheeOrg/Lychee"
[integration] [integration]
yunohost = ">= 11.2" yunohost = ">= 11.2.29"
helpers_version = "2.1"
architectures = ["arm64", "amd64"] architectures = ["arm64", "amd64"]
multi_instance = true multi_instance = true
@ -54,6 +55,7 @@ ram.runtime = "50M"
allow_email = true allow_email = true
[resources.install_dir] [resources.install_dir]
group = "www-data:r-x"
[resources.data_dir] [resources.data_dir]
subdirs = ["uploads/big", "uploads/import", "uploads/medium", "uploads/raw", "uploads/small", "uploads/thumb"] subdirs = ["uploads/big", "uploads/import", "uploads/medium", "uploads/raw", "uploads/small", "uploads/thumb"]

View file

@ -1,20 +1,7 @@
#!/bin/bash #!/bin/bash
#================================================= #=================================================
# COMMON VARIABLES # COMMON VARIABLES AND CUSTOM HELPERS
#================================================= #=================================================
# Composer version composer_version="2.7.7"
YNH_COMPOSER_VERSION="2.7.7"
#=================================================
# PERSONAL HELPERS
#=================================================
#=================================================
# EXPERIMENTAL HELPERS
#=================================================
#=================================================
# FUTURE OFFICIAL HELPERS
#=================================================

View file

@ -1,51 +1,39 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= ynh_print_info "Declaring files to be backed up..."
# DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
ynh_print_info --message="Declaring files to be backed up..."
#================================================= #=================================================
# BACKUP THE APP MAIN DIR # BACKUP THE APP MAIN DIR
#================================================= #=================================================
ynh_backup --src_path="$install_dir" ynh_backup "$install_dir"
#================================================= #=================================================
# BACKUP THE DATA DIR # BACKUP THE DATA DIR
#================================================= #=================================================
ynh_backup --src_path="$data_dir" --is_big ynh_backup "$data_dir"
#================================================= #=================================================
# SYSTEM CONFIGURATION # SYSTEM CONFIGURATION
#================================================= #=================================================
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_backup "/etc/php/$php_version/fpm/pool.d/$app.conf"
#=================================================
# SPECIFIC BACKUP
#================================================= #=================================================
# BACKUP THE MYSQL DATABASE # BACKUP THE MYSQL DATABASE
#================================================= #=================================================
ynh_print_info --message="Backing up the MySQL database..." ynh_print_info "Backing up the MySQL database..."
ynh_mysql_dump_db --database="$db_name" > db.sql ynh_mysql_dump_db > db.sql
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."

View file

@ -1,23 +1,17 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= #=================================================
# MODIFY URL IN NGINX CONF # MODIFY URL IN NGINX CONF
#================================================= #=================================================
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=3 ynh_script_progression "Updating NGINX web server configuration..."
ynh_change_url_nginx_config ynh_config_change_url_nginx
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Change of URL completed for $app" --last ynh_script_progression "Change of URL completed for $app"

View file

@ -1,95 +0,0 @@
#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
ynh_abort_if_errors
#=================================================
# RETRIEVE ARGUMENTS
#=================================================
phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion)
current_fpm_footprint=$(ynh_app_setting_get --app="$app" --key=fpm_footprint)
#=================================================
# SPECIFIC GETTERS FOR TOML SHORT KEY
#=================================================
get__fpm_footprint() {
# Free footprint value for php-fpm
# Check if current_fpm_footprint is an integer
if [ "$current_fpm_footprint" -eq "$current_fpm_footprint" ] 2> /dev/null
then
echo "specific"
else
echo "$current_fpm_footprint"
fi
}
get__free_footprint() {
# Free footprint value for php-fpm
# Check if current_fpm_footprint is an integer
if [ "$current_fpm_footprint" -eq "$current_fpm_footprint" ] 2> /dev/null
then
# If current_fpm_footprint is an integer, that's a numeric value for the footprint
echo "$current_fpm_footprint"
else
echo "0"
fi
}
#=================================================
# SPECIFIC SETTERS FOR TOML SHORT KEYS
#=================================================
set__fpm_footprint() {
if [ "$fpm_footprint" != "specific" ]
then
ynh_app_setting_set --app="$app" --key=fpm_footprint --value="$fpm_footprint"
fi
}
set__fpm_free_footprint() {
if [ "$fpm_footprint" = "specific" ]
then
ynh_app_setting_set --app="$app" --key=fpm_footprint --value="$fpm_free_footprint"
fi
}
#=================================================
# GENERIC FINALIZATION
#=================================================
ynh_app_config_validate() {
_ynh_app_config_validate
if [ "${changed[fpm_usage]}" == "true" ] || [ "${changed[fpm_footprint]}" == "true" ] || [ "${changed[fpm_free_footprint]}" == "true" ]; then
# If fpm_footprint is set to 'specific', use $fpm_free_footprint value.
if [ "$fpm_footprint" = "specific" ]
then
fpm_footprint=$fpm_free_footprint
fi
if [ "$fpm_footprint" == "0" ]
then
ynh_print_err --message="When selecting 'specific', you have to set a footprint value into the field below."
exit 0
fi
fi
}
ynh_app_config_apply() {
_ynh_app_config_apply
ynh_add_fpm_config --phpversion="$phpversion" --usage="$fpm_usage" --footprint="$fpm_footprint"
}
ynh_app_config_run "$1"

View file

@ -1,14 +1,10 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
ynh_app_setting_set --key=php_upload_max_filesize --value=1G
#================================================= #=================================================
# INITIALIZE AND STORE SETTINGS # INITIALIZE AND STORE SETTINGS
#================================================= #=================================================
@ -18,55 +14,46 @@ timezone="$(cat /etc/timezone)"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_script_progression --message="Setting up source files..." --weight=3 ynh_script_progression "Setting up source files..."
# 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 o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir"
#================================================= #=================================================
# APP INITIAL CONFIGURATION # APP INITIAL CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Adding $app's configuration files..." --weight=1 ynh_script_progression "Adding $app's configuration files..."
ynh_add_config --template=".env" --destination="$install_dir/.env" ynh_config_add --template=".env" --destination="$install_dir/.env"
chmod 400 "$install_dir/.env"
chown "$app:$app" "$install_dir/.env"
#================================================= #=================================================
# SYSTEM CONFIGURATION # SYSTEM CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 ynh_script_progression "Adding system configurations related to $app..."
# Create a dedicated PHP-FPM config ynh_config_add_phpfpm
ynh_add_fpm_config
# Create a dedicated NGINX config ynh_config_add_nginx
ynh_add_nginx_config
#================================================= #=================================================
# INSTALL APP WITH COMPOSER # INSTALL APP WITH COMPOSER
#================================================= #=================================================
ynh_script_progression --message="Installing app with Composer..." --weight=15 ynh_script_progression "Installing app with Composer..."
ynh_install_composer ynh_composer_install
ynh_composer_exec install --no-dev
#================================================= #=================================================
# BUILDING # BUILDING
#================================================= #=================================================
ynh_script_progression --message="configuring $app..." --weight=10 ynh_script_progression "configuring $app..."
pushd "$install_dir" pushd "$install_dir"
"php$phpversion" artisan key:generate -n --force --env "php$php_version" artisan key:generate -n --force --env
"php$phpversion" artisan migrate -n --force "php$php_version" artisan migrate -n --force
"php$phpversion" artisan config:clear -n "php$php_version" artisan config:clear -n
"php$phpversion" artisan config:cache -n "php$php_version" artisan config:cache -n
popd popd
chown -R "$app:www-data" "$install_dir"
chmod -R 775 /home/yunohost.app/$app/ chmod -R 775 /home/yunohost.app/$app/
chgrp "$app" -R "$install_dir/storage" "$install_dir/public/dist" "$install_dir/public/sym" "$data_dir/uploads" chgrp "$app" -R "$install_dir/storage" "$install_dir/public/dist" "$install_dir/public/sym" "$data_dir/uploads"
chmod -R 2775 "$install_dir/storage" "$install_dir/app" "$install_dir/public/dist" "$install_dir/public/sym" "$data_dir/uploads" "$install_dir/bootstrap/" chmod -R 2775 "$install_dir/storage" "$install_dir/app" "$install_dir/public/dist" "$install_dir/public/sym" "$data_dir/uploads" "$install_dir/bootstrap/"
@ -75,4 +62,4 @@ chmod -R 2775 "$install_dir/storage" "$install_dir/app" "$install_dir/public/dis
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Installation of $app completed" --last ynh_script_progression "Installation of $app completed"

View file

@ -1,27 +1,19 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= #=================================================
# REMOVE SYSTEM CONFIGURATIONS # REMOVE SYSTEM CONFIGURATIONS
#================================================= #=================================================
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 ynh_script_progression "Removing system configurations related to $app..."
# Remove the dedicated NGINX config ynh_config_remove_nginx
ynh_remove_nginx_config
# Remove the dedicated PHP-FPM config ynh_config_remove_phpfpm
ynh_remove_fpm_config
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Removal of $app completed" --last ynh_script_progression "Removal of $app completed"

View file

@ -1,33 +1,24 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
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 # RESTORE THE APP MAIN DIR
#================================================= #=================================================
ynh_script_progression --message="Restoring the app main directory..." --weight=2 ynh_script_progression "Restoring the app main directory..."
ynh_restore_file --origin_path="$install_dir" ynh_restore "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir"
chgrp "$app" -R "$install_dir/storage" "$install_dir/public/dist" "$install_dir/public/sym" chgrp "$app" -R "$install_dir/storage" "$install_dir/public/dist" "$install_dir/public/sym"
chmod -R 2775 "$install_dir/storage" "$install_dir/app" "$install_dir/public/dist" "$install_dir/public/sym" "$install_dir/bootstrap/" chmod -R 2775 "$install_dir/storage" "$install_dir/app" "$install_dir/public/dist" "$install_dir/public/sym" "$install_dir/bootstrap/"
#================================================= #=================================================
# RESTORE THE DATA DIRECTORY # RESTORE THE DATA DIRECTORY
#================================================= #=================================================
ynh_script_progression --message="Restoring the data directory..." --weight=1 ynh_script_progression "Restoring the data directory..."
ynh_restore_file --origin_path="$data_dir" --not_mandatory ynh_restore "$data_dir"
chmod -R 775 "$data_dir" chmod -R 775 "$data_dir"
chown -R "$app:www-data" "$data_dir" chown -R "$app:www-data" "$data_dir"
@ -37,31 +28,29 @@ chmod -R 2775 "$data_dir/uploads"
#================================================= #=================================================
# RESTORE THE MYSQL DATABASE # RESTORE THE MYSQL DATABASE
#================================================= #=================================================
ynh_script_progression --message="Restoring the MySQL database..." --weight=1 ynh_script_progression "Restoring the MySQL database..."
ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < ./db.sql ynh_mysql_db_shell < ./db.sql
#================================================= #=================================================
# RESTORE SYSTEM CONFIGURATIONS # RESTORE SYSTEM CONFIGURATIONS
#================================================= #=================================================
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 ynh_script_progression "Restoring system configurations related to $app..."
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_restore "/etc/php/$php_version/fpm/pool.d/$app.conf"
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# GENERIC FINALIZATION
#================================================= #=================================================
# RELOAD NGINX AND PHP-FPM # RELOAD NGINX AND PHP-FPM
#================================================= #=================================================
ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=1 ynh_script_progression "Reloading NGINX web server and PHP-FPM..."
ynh_systemd_action --service_name="php$phpversion-fpm" --action=reload ynh_systemctl --service="php$php_version-fpm" --action=reload
ynh_systemd_action --service_name=nginx --action=reload ynh_systemctl --service=nginx --action=reload
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Restoration completed for $app" --last ynh_script_progression "Restoration completed for $app"

View file

@ -1,71 +1,58 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
ynh_app_setting_set_default --key=php_upload_max_filesize --value=1G
timezone="$(cat /etc/timezone)" timezone="$(cat /etc/timezone)"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_script_progression --message="Upgrading source files..." --weight=4 ynh_script_progression "Upgrading source files..."
# Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" --keep=".env public/uploads/" --full_replace
ynh_setup_source --dest_dir="$install_dir" --keep=".env public/uploads/" --full_replace=1
chmod o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir"
#================================================= #=================================================
# UPDATE A CONFIG FILE # UPDATE A CONFIG FILE
#================================================= #=================================================
ynh_script_progression --message="Updating a configuration file..." --weight=1 ynh_script_progression "Updating configuration..."
ynh_add_config --template=".env" --destination="$install_dir/.env" ynh_config_add --template=".env" --destination="$install_dir/.env"
chmod 400 "$install_dir/.env"
chown "$app:$app" "$install_dir/.env"
#================================================= #=================================================
# REAPPLY SYSTEM CONFIGURATIONS # REAPPLY SYSTEM CONFIGURATIONS
#================================================= #=================================================
ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 ynh_script_progression "Upgrading system configurations related to $app..."
# Create a dedicated PHP-FPM config ynh_config_add_phpfpm
ynh_add_fpm_config
# Create a dedicated NGINX config ynh_config_add_nginx
ynh_add_nginx_config
#================================================= #=================================================
# INSTALL APP WITH COMPOSER # INSTALL APP WITH COMPOSER
#================================================= #=================================================
ynh_script_progression --message="Installing app with Composer..." --weight=1 ynh_script_progression "Installing app with Composer..."
ynh_install_composer ynh_composer_install
ynh_composer_exec install --no-dev
#================================================= #=================================================
# BUILDING # BUILDING
#================================================= #=================================================
ynh_script_progression --message="Configuring $app..." --weight=4 ynh_script_progression "Configuring $app..."
ynh_exec_warn_less ynh_composer_exec --commands="dump-autoload" ynh_composer_exec dump-autoload
pushd "$install_dir" pushd "$install_dir"
"php$phpversion" artisan key:generate -n --force --env "php$php_version" artisan key:generate -n --force --env
"php$phpversion" artisan migrate -n --force "php$php_version" artisan migrate -n --force
"php$phpversion" artisan config:clear -n "php$php_version" artisan config:clear -n
"php$phpversion" artisan config:cache -n "php$php_version" artisan config:cache -n
"php$phpversion" artisan view:clear "php$php_version" artisan view:clear
popd popd
chown -R "$app:www-data" "$install_dir"
chmod -R 775 /home/yunohost.app/$app/ chmod -R 775 /home/yunohost.app/$app/
chgrp "$app" -R "$install_dir/storage" "$install_dir/public/dist" "$install_dir/public/sym" "$data_dir/uploads" chgrp "$app" -R "$install_dir/storage" "$install_dir/public/dist" "$install_dir/public/sym" "$data_dir/uploads"
chmod -R 2775 "$install_dir/storage" "$install_dir/app" "$install_dir/public/dist" "$install_dir/public/sym" "$data_dir/uploads" "$install_dir/bootstrap/" chmod -R 2775 "$install_dir/storage" "$install_dir/app" "$install_dir/public/dist" "$install_dir/public/sym" "$data_dir/uploads" "$install_dir/bootstrap/"
@ -74,4 +61,4 @@ chmod -R 2775 "$install_dir/storage" "$install_dir/app" "$install_dir/public/dis
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Upgrade of $app completed" --last ynh_script_progression "Upgrade of $app completed"