mirror of
https://github.com/YunoHost-Apps/halcyon_ynh.git
synced 2024-09-03 20:36:21 +02:00
parent
08fb653ce3
commit
8f1cf67034
14 changed files with 166 additions and 179 deletions
|
@ -1,4 +1,3 @@
|
|||
|
||||
---
|
||||
name: Bug report
|
||||
about: When creating a bug report, please use the following template to provide all the relevant information and help debugging efficiently.
|
||||
|
@ -9,7 +8,7 @@ about: When creating a bug report, please use the following template to provide
|
|||
1. *Read this whole template first.*
|
||||
2. *Determine if you are on the right place:*
|
||||
- *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!*
|
||||
- *Otherwise, the issue may be due to Halcyon itself. Refer to its documentation or repository for help.*
|
||||
- *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.*
|
||||
- *When in doubt, post here and we will figure it out together.*
|
||||
3. *Delete the italic comments as you write over them below, and remove this guide.*
|
||||
---
|
||||
|
@ -32,7 +31,7 @@ about: When creating a bug report, please use the following template to provide
|
|||
|
||||
- *If you performed a command from the CLI, the command itself is enough. For example:*
|
||||
```sh
|
||||
sudo yunohost app install Halcyon
|
||||
sudo yunohost app install the_app
|
||||
```
|
||||
- *If you used the webadmin, please perform the equivalent command from the CLI first.*
|
||||
- *If the error occurs in your browser, explain what you did:*
|
16
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
16
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
## Problem
|
||||
|
||||
- *Description of why you made this PR*
|
||||
|
||||
## Solution
|
||||
|
||||
- *And how do you fix that problem*
|
||||
|
||||
## PR Status
|
||||
|
||||
- [ ] Code finished and ready to be reviewed/tested
|
||||
- [ ] The fix/enhancement were manually tested (if applicable)
|
||||
|
||||
## Automatic tests
|
||||
|
||||
Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ *after creating the PR*, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)
|
40
README.md
40
README.md
|
@ -1,3 +1,8 @@
|
|||
<!--
|
||||
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
|
||||
It shall NOT be edited by hand.
|
||||
-->
|
||||
|
||||
# Halcyon for YunoHost
|
||||
|
||||
[![Integration level](https://dash.yunohost.org/integration/halcyon.svg)](https://dash.yunohost.org/appci/app/halcyon) ![](https://ci-apps.yunohost.org/ci/badges/halcyon.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/halcyon.maintain.svg)
|
||||
|
@ -5,36 +10,27 @@
|
|||
|
||||
*[Lire ce readme en français.](./README_fr.md)*
|
||||
|
||||
> *This package allows you to install Halcyon quickly and simply on a YunoHost server.
|
||||
> *This package allows you to install Halcyon quickly and simply on a YunoHost server.
|
||||
If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.*
|
||||
|
||||
## Overview
|
||||
Halcyon is a webclient for Mastodon and Pleroma which looks like Twitter.
|
||||
|
||||
**Shipped version:** 2.4.9
|
||||
Webclient for Mastodon and Pleroma.
|
||||
|
||||
**Shipped version:** 2.4.9~ynh1
|
||||
|
||||
|
||||
|
||||
## Screenshots
|
||||
|
||||
![](https://halcyon.cybre.space/login/assets/images/preview0.png)
|
||||
![](./doc/screenshots/preview0.png)
|
||||
|
||||
## Limitations
|
||||
## Documentation and resources
|
||||
|
||||
* Halcyon requires a dedicated domain like `halcyon.domain.tld`.
|
||||
|
||||
#### Supported architectures
|
||||
|
||||
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/halcyon%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/halcyon/)
|
||||
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/halcyon%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/halcyon/)
|
||||
|
||||
## Links
|
||||
|
||||
* Report a bug: https://github.com/YunoHost-Apps/halcyon_ynh/issues
|
||||
* App website: https://notabug.org/halcyon-suite/halcyon
|
||||
* Upstream app repository: https://notabug.org/halcyon-suite/halcyon
|
||||
* Other Halcyon instances: https://www.halcyon.social/instances.php
|
||||
* YunoHost website: https://yunohost.org/
|
||||
|
||||
---
|
||||
* Official app website: https://notabug.org/halcyon-suite/halcyon
|
||||
* Upstream app code repository: https://notabug.org/halcyon-suite/halcyon
|
||||
* YunoHost documentation for this app: https://yunohost.org/app_halcyon
|
||||
* Report a bug: https://github.com/YunoHost-Apps/halcyon_ynh/issues
|
||||
|
||||
## Developer info
|
||||
|
||||
|
@ -46,3 +42,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/halcyon_ynh/tree/test
|
|||
or
|
||||
sudo yunohost app upgrade halcyon -u https://github.com/YunoHost-Apps/halcyon_ynh/tree/testing --debug
|
||||
```
|
||||
|
||||
**More info regarding app packaging:** https://yunohost.org/packaging_apps
|
42
README_fr.md
42
README_fr.md
|
@ -1,40 +1,32 @@
|
|||
# Halcyon pour YunoHost
|
||||
|
||||
[![Niveau d'intégration](https://dash.yunohost.org/integration/halcyon.svg)](https://dash.yunohost.org/appci/app/halcyon) ![](https://ci-apps.yunohost.org/ci/badges/halcyon.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/halcyon.maintain.svg)
|
||||
[![Install Halcyon with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=halcyon)
|
||||
[![Installer Halcyon avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=halcyon)
|
||||
|
||||
*[Read this readme in english.](./README.md)*
|
||||
|
||||
> *Ce package vous permet d'installer Halcyon rapidement et simplement sur un serveur YunoHost.
|
||||
Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install) pour apprendre comment l'installer.*
|
||||
*[Read this readme in english.](./README.md)*
|
||||
*[Lire ce readme en français.](./README_fr.md)*
|
||||
|
||||
> *Ce package vous permet d'installer Halcyon rapidement et simplement sur un serveur YunoHost.
|
||||
Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
|
||||
|
||||
## Vue d'ensemble
|
||||
Halcyon est un client Web pour Mastodon et Pleroma qui ressemble à Twitter.
|
||||
|
||||
**Version incluse :** 2.4.9
|
||||
Client web pour Mastodon et Pleroma.
|
||||
|
||||
**Version incluse :** 2.4.9~ynh1
|
||||
|
||||
|
||||
|
||||
## Captures d'écran
|
||||
|
||||
![](https://halcyon.cybre.space/login/assets/images/preview0.png)
|
||||
![](./doc/screenshots/preview0.png)
|
||||
|
||||
## Limitations
|
||||
## Documentations et ressources
|
||||
|
||||
* Halcyon nécessite un domaine dédié comme `halcyon.domain.tld`.
|
||||
|
||||
#### Architectures supportées
|
||||
|
||||
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/halcyon%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/halcyon/)
|
||||
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/halcyon%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/halcyon/)
|
||||
|
||||
## Liens
|
||||
|
||||
* Signaler un bug : https://github.com/YunoHost-Apps/halcyon_ynh/issues
|
||||
* Site de l'application : https://notabug.org/halcyon-suite/halcyon
|
||||
* Dépôt de l'application principale : https://notabug.org/halcyon-suite/halcyon
|
||||
* Autres instances Halcyon : https://www.halcyon.social/instances.php
|
||||
* Site web YunoHost : https://yunohost.org/
|
||||
---
|
||||
* Site officiel de l'app : https://notabug.org/halcyon-suite/halcyon
|
||||
* Dépôt de code officiel de l'app : https://notabug.org/halcyon-suite/halcyon
|
||||
* Documentation YunoHost pour cette app : https://yunohost.org/app_halcyon
|
||||
* Signaler un bug : https://github.com/YunoHost-Apps/halcyon_ynh/issues
|
||||
|
||||
## Informations pour les développeurs
|
||||
|
||||
|
@ -46,3 +38,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/halcyon_ynh/tree/test
|
|||
ou
|
||||
sudo yunohost app upgrade halcyon -u https://github.com/YunoHost-Apps/halcyon_ynh/tree/testing --debug
|
||||
```
|
||||
|
||||
**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps
|
|
@ -1,16 +1,12 @@
|
|||
# See here for more information
|
||||
# https://github.com/YunoHost/package_check#syntax-check_process-file
|
||||
|
||||
# Move this file from check_process.default to check_process when you have filled it.
|
||||
|
||||
;; Test complet
|
||||
; Manifest
|
||||
domain="domain.tld" (DOMAIN)
|
||||
is_public=1 (PUBLIC|public=1|private=0)
|
||||
domain="domain.tld"
|
||||
path="/path"
|
||||
is_public=1
|
||||
language="en_US"
|
||||
; Checks
|
||||
pkg_linter=1
|
||||
setup_sub_dir=1
|
||||
setup_sub_dir=0
|
||||
setup_root=1
|
||||
setup_nourl=0
|
||||
setup_private=1
|
||||
|
@ -18,7 +14,6 @@
|
|||
upgrade=1
|
||||
backup_restore=1
|
||||
multi_instance=1
|
||||
port_already_use=0
|
||||
change_url=0
|
||||
;;; Options
|
||||
Email=anmol@datamol.org
|
||||
|
|
33
conf/config.ini.sample
Normal file
33
conf/config.ini.sample
Normal file
|
@ -0,0 +1,33 @@
|
|||
; Register App Settings
|
||||
; The URL Unshortener automatically parses links to URL Shorteners like bit.ly and displays the long version so that the user knows where a link goes
|
||||
[App]
|
||||
api_client_name = YunoHost Halcyon
|
||||
api_client_website = https://__DOMAIN__/
|
||||
who_to_follow_provider = https://vinayaka.tsia.de/cgi-bin/vinayaka-user-match-osa-api.cgi?{{host}}+{{user}}
|
||||
default_language = __LANGUAGE__
|
||||
debug_mode = false
|
||||
url_unshortener = true
|
||||
|
||||
; Media embed settings
|
||||
; YouPlay resolves YouTube MP4s on your server and sends this link to the user for privacy-friendly watching
|
||||
; Vimeo embeds work in the same way as YouPlay embeds here because the official players contain too much spyware
|
||||
; YouPlay Fallback uses a proprietary API of https://unblockvideos.com and can be used if your own server IP has been blocked by Google
|
||||
; Invidous is a external service to watch YouTube videos in a privacy-friendly way - Halcyon can automatically rewrite links to a instance you can set here
|
||||
; Nitter is a external service to view Twitter contents in a privacy-friendly way - Halcyon can automatically rewrite links to a instance you can set here
|
||||
; Bibliogram is a external service to view Instagram contents in a privacy-friendly way - Halcyon can automatically rewrite links to a instance you can set here
|
||||
[Media]
|
||||
youplay = true
|
||||
vimeo = true
|
||||
youplay_fallback = true
|
||||
invidious = invidious.snopyta.org
|
||||
nitter = nitter.13ad.de
|
||||
bibliogram = bibliogram.ggc-project.de
|
||||
|
||||
; The proxy can be used optionally to resolve data for privacy-friendly media embeds on the server side - It is not used for Mastodon API requests on login
|
||||
; Proxy type can be set to none, socks5, socks4, http or https
|
||||
[Proxy]
|
||||
type = none
|
||||
domain =
|
||||
port =
|
||||
username =
|
||||
password =
|
BIN
doc/.DS_Store
vendored
Normal file
BIN
doc/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
doc/screenshots/preview0.png
Normal file
BIN
doc/screenshots/preview0.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 510 KiB |
|
@ -8,13 +8,18 @@
|
|||
},
|
||||
"version": "2.4.9~ynh1",
|
||||
"url": "https://notabug.org/halcyon-suite/halcyon",
|
||||
"upstream": {
|
||||
"license": "AGPL-3.0-only",
|
||||
"website": "https://notabug.org/halcyon-suite/halcyon",
|
||||
"code": "https://notabug.org/halcyon-suite/halcyon"
|
||||
},
|
||||
"license": "AGPL-3.0-only",
|
||||
"maintainer": {
|
||||
"name": "Anmol Sharma",
|
||||
"email": "anmol@datamol.org"
|
||||
},
|
||||
"requirements": {
|
||||
"yunohost": ">= 3.8.1"
|
||||
"yunohost": ">= 4.2.4"
|
||||
},
|
||||
"multi_instance": true,
|
||||
"services": [
|
||||
|
@ -26,19 +31,11 @@
|
|||
{
|
||||
"name": "domain",
|
||||
"type": "domain",
|
||||
"ask": {
|
||||
"en": "Choose a domain name for Halcyon",
|
||||
"fr": "Choisissez un nom de domaine pour Halcyon"
|
||||
},
|
||||
"example": "example.com"
|
||||
},
|
||||
{
|
||||
"name": "is_public",
|
||||
"type": "boolean",
|
||||
"ask": {
|
||||
"en": "Is it a public application?",
|
||||
"fr": "Est-ce une application publique ?"
|
||||
},
|
||||
"help": {
|
||||
"en": "If enabled, Halcyon will be accessible by people who do not have an account. This can be changed later via the webadmin.",
|
||||
"fr": "Si cette case est cochée, Halcyon sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin."
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
## Problem
|
||||
- *Description of why you made this PR*
|
||||
|
||||
## Solution
|
||||
- *And how do you fix that problem*
|
||||
|
||||
## PR Status
|
||||
- [ ] Code finished.
|
||||
- [ ] Tested with Package_check.
|
||||
- [ ] Fix or enhancement tested.
|
||||
- [ ] Upgrade from last version tested.
|
||||
- [ ] Can be reviewed and tested.
|
||||
|
||||
## Package_check results
|
||||
---
|
||||
*If you have access to [App Continuous Integration for packagers](https://yunohost.org/#/packaging_apps_ci) you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results*
|
||||
|
||||
[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/halcyon_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/halcyon_ynh%20PR-NUM-%20(USERNAME)/)
|
|
@ -29,6 +29,23 @@ ynh_script_progression --message="Loading installation settings..." --weight=1
|
|||
# Needed for helper "ynh_add_nginx_config"
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1
|
||||
|
||||
# Backup the current version of the app
|
||||
ynh_backup_before_upgrade
|
||||
ynh_clean_setup () {
|
||||
# Remove the new domain config file, the remove script won't do it as it doesn't know yet its location.
|
||||
ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
|
||||
|
||||
# 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
|
||||
#=================================================
|
||||
|
@ -84,9 +101,9 @@ fi
|
|||
### (It's compatible with sed regular expressions syntax)
|
||||
ynh_replace_string "$old_domain" "$new_domain" "$final_path/config/config.ini"
|
||||
|
||||
# Set permissions to app files
|
||||
chown -R $app: $final_path
|
||||
chmod -R 755 $final_path/data
|
||||
# # Set permissions to app files
|
||||
# chown -R $app $final_path
|
||||
# chmod -R 755 $final_path/data
|
||||
|
||||
### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script.
|
||||
### And create a backup of this file if the checksum is different. So the file will be backed up if the admin had modified it.
|
||||
|
|
|
@ -45,9 +45,16 @@ ynh_script_progression --message="Storing installation settings..." --weight=1
|
|||
|
||||
ynh_app_setting_set --app=$app --key=domain --value=$domain
|
||||
ynh_app_setting_set --app=$app --key=path --value=$path_url
|
||||
ynh_app_setting_set --app=$app --key=is_public --value=$is_public
|
||||
ynh_app_setting_set --app=$app --key=language --value=$language
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring system user..." --weight=2
|
||||
|
||||
# Create a system user
|
||||
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||
|
||||
#=================================================
|
||||
# STANDARD MODIFICATIONS
|
||||
#=================================================
|
||||
|
@ -59,6 +66,10 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
|||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$final_path"
|
||||
|
||||
chmod 750 "$final_path"
|
||||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
@ -67,14 +78,6 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=2
|
|||
# Create a dedicated nginx config
|
||||
ynh_add_nginx_config
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring system user..." --weight=2
|
||||
|
||||
# Create a system user
|
||||
ynh_system_user_create --username=$app
|
||||
|
||||
#=================================================
|
||||
# PHP-FPM CONFIGURATION
|
||||
#=================================================
|
||||
|
@ -90,39 +93,20 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
|||
# MODIFY A CONFIG FILE
|
||||
#=================================================
|
||||
|
||||
### `ynh_replace_string` is used to replace a string in a file.
|
||||
### (It's compatible with sed regular expressions syntax)
|
||||
cp $final_path/config/config.ini.sample $final_path/config/config.ini
|
||||
ynh_replace_string --match_string="Your application name" --replace_string="Yunohost Halcyon" --target_file="$final_path/config/config.ini"
|
||||
ynh_replace_string --match_string="example.com" --replace_string="$domain" --target_file="$final_path/config/config.ini"
|
||||
ynh_replace_string --match_string="en_US" --replace_string="$language" --target_file="$final_path/config/config.ini"
|
||||
ynh_add_config --template="../conf/config.ini.sample" --destination="$final_path/config/config.ini"
|
||||
|
||||
#=================================================
|
||||
# STORE THE CONFIG FILE CHECKSUM
|
||||
#=================================================
|
||||
|
||||
# Calculate and store the config file checksum into the app settings
|
||||
ynh_store_file_checksum --file="$final_path/config/config.ini"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
# SECURE FILES AND DIRECTORIES
|
||||
#=================================================
|
||||
|
||||
# Set permissions to app files
|
||||
chown -R $app: $final_path
|
||||
chmod -R 755 $final_path/data
|
||||
chmod 400 "$final_path/config/config.ini"
|
||||
chown $app "$final_path/config/config.ini"
|
||||
|
||||
#=================================================
|
||||
# SETUP SSOWAT
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring SSOwat..." --weight=10
|
||||
ynh_script_progression --message="Configuring permissions..." --weight=10
|
||||
|
||||
# Make app public if necessary or protect it
|
||||
if [ $is_public -eq 1 ]
|
||||
then
|
||||
ynh_permission_update --permission "main" --add "visitors"
|
||||
ynh_permission_update --permission="main" --add="visitors"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -47,6 +47,14 @@ test ! -d $final_path \
|
|||
|
||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# RECREATE THE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Recreating the dedicated system user..." --weight=3
|
||||
|
||||
# Create the dedicated user (if not existing)
|
||||
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE APP MAIN DIR
|
||||
#=================================================
|
||||
|
@ -54,21 +62,9 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
|
|||
|
||||
ynh_restore_file --origin_path="$final_path"
|
||||
|
||||
#=================================================
|
||||
# RECREATE THE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Recreating the dedicated system user..." --weight=3
|
||||
|
||||
# Create the dedicated user (if not existing)
|
||||
ynh_system_user_create --username=$app
|
||||
|
||||
#=================================================
|
||||
# RESTORE USER RIGHTS
|
||||
#=================================================
|
||||
|
||||
# Restore permissions on app files
|
||||
chown -R $app: $final_path
|
||||
chmod -R 755 $final_path/data
|
||||
chmod 750 "$final_path"
|
||||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE PHP-FPM CONFIGURATION
|
||||
|
|
|
@ -18,7 +18,6 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
|
||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
language=$(ynh_app_setting_get --app=$app --key=language)
|
||||
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||
|
@ -34,21 +33,19 @@ upgrade_type=$(ynh_check_app_version_changed)
|
|||
#=================================================
|
||||
ynh_script_progression --message="Ensuring downward compatibility..." --weight=3
|
||||
|
||||
# Fix is_public as a boolean value
|
||||
if [ "$is_public" = "Yes" ]; then
|
||||
ynh_app_setting_set --app=$app --key=is_public --value=1
|
||||
is_public=1
|
||||
elif [ "$is_public" = "No" ]; then
|
||||
ynh_app_setting_set --app=$app --key=is_public --value=0
|
||||
is_public=0
|
||||
fi
|
||||
|
||||
# If final_path doesn't exist, create it
|
||||
if [ -z "$final_path" ]; then
|
||||
final_path=/var/www/$app
|
||||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||
fi
|
||||
|
||||
# Cleaning legacy permissions
|
||||
if ynh_legacy_permissions_exists; then
|
||||
ynh_legacy_permissions_delete_all
|
||||
|
||||
ynh_app_setting_delete --app=$app --key=is_public
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
|
@ -63,6 +60,14 @@ ynh_clean_setup () {
|
|||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=2
|
||||
|
||||
# Create a dedicated user (if not existing)
|
||||
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||
|
||||
#=================================================
|
||||
# STANDARD UPGRADE STEPS
|
||||
#=================================================
|
||||
|
@ -74,9 +79,13 @@ then
|
|||
ynh_script_progression --message="Upgrading source files..." --weight=2
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$final_path"
|
||||
ynh_setup_source --dest_dir="$final_path" --keep="$final_path/config/config.ini"
|
||||
fi
|
||||
|
||||
chmod 750 "$final_path"
|
||||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
@ -85,14 +94,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." -
|
|||
# Create a dedicated nginx config
|
||||
ynh_add_nginx_config
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=2
|
||||
|
||||
# Create a dedicated user (if not existing)
|
||||
ynh_system_user_create --username=$app
|
||||
|
||||
#=================================================
|
||||
# PHP-FPM CONFIGURATION
|
||||
#=================================================
|
||||
|
@ -101,31 +102,6 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1
|
|||
# Create a dedicated PHP-FPM config
|
||||
ynh_add_fpm_config --package="$extra_php_dependencies"
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
|
||||
# Create a dedicated user (if not existing)
|
||||
ynh_system_user_create --username=$app
|
||||
|
||||
#=================================================
|
||||
# STORE THE CONFIG FILE CHECKSUM
|
||||
#=================================================
|
||||
|
||||
ynh_backup_if_checksum_is_different --file="$final_path/config/config.ini"
|
||||
# Recalculate and store the checksum of the file for the next upgrade.
|
||||
ynh_store_file_checksum --file="$final_path/config/config.ini"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
# SECURE FILES AND DIRECTORIES
|
||||
#=================================================
|
||||
|
||||
# Set permissions on app files
|
||||
chown -R $app: $final_path
|
||||
chmod -R 755 $final_path/data
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue