mirror of
https://github.com/YunoHost-Apps/peertube_ynh.git
synced 2024-09-03 19:56:29 +02:00
commit
5a74f4033e
11 changed files with 108 additions and 130 deletions
|
@ -72,7 +72,7 @@ Want to see in action?
|
||||||
|
|
||||||
* Report a bug: https://github.com/YunoHost-Apps/peertube_ynh/issues
|
* Report a bug: https://github.com/YunoHost-Apps/peertube_ynh/issues
|
||||||
* App website: https://joinpeertube.org/fr/
|
* App website: https://joinpeertube.org/fr/
|
||||||
* GitHub App website: https://github.com/Chocobozzz/PeerTube/
|
* Upstream app repository: https://github.com/Chocobozzz/PeerTube/
|
||||||
* YunoHost website: https://yunohost.org/
|
* YunoHost website: https://yunohost.org/
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
10
README_fr.md
10
README_fr.md
|
@ -1,7 +1,7 @@
|
||||||
# PeerTube pour YunoHost
|
# PeerTube pour YunoHost
|
||||||
|
|
||||||
[![Niveau d'intégration](https://dash.yunohost.org/integration/peertube.svg)](https://dash.yunohost.org/appci/app/peertube) ![](https://ci-apps.yunohost.org/ci/badges/peertube.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/peertube.maintain.svg)
|
[![Niveau d'intégration](https://dash.yunohost.org/integration/peertube.svg)](https://dash.yunohost.org/appci/app/peertube) ![](https://ci-apps.yunohost.org/ci/badges/peertube.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/peertube.maintain.svg)
|
||||||
[![Installer PeerTube pour YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=peertube)
|
[![Installer PeerTube avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=peertube)
|
||||||
|
|
||||||
*[Read this readme in english.](./README.md)*
|
*[Read this readme in english.](./README.md)*
|
||||||
|
|
||||||
|
@ -72,13 +72,13 @@ En regardant une vidéo, vous aidez l'hébergeur à la diffuser en devenant vous
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Developer info
|
## Informations pour les développeurs
|
||||||
|
|
||||||
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/peertube_ynh/tree/testing).
|
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/peertube_ynh/tree/testing).
|
||||||
|
|
||||||
To try the testing branch, please proceed like that.
|
Pour essayer la branche testing, procédez comme suit.
|
||||||
```
|
```
|
||||||
sudo yunohost app install https://github.com/YunoHost-Apps/peertube_ynh/tree/testing --debug
|
sudo yunohost app install https://github.com/YunoHost-Apps/peertube_ynh/tree/testing --debug
|
||||||
or
|
ou
|
||||||
sudo yunohost app upgrade peertube -u https://github.com/YunoHost-Apps/peertube_ynh/tree/testing --debug
|
sudo yunohost app upgrade peertube -u https://github.com/YunoHost-Apps/peertube_ynh/tree/testing --debug
|
||||||
```
|
```
|
||||||
|
|
|
@ -37,8 +37,8 @@ database:
|
||||||
hostname: 'localhost'
|
hostname: 'localhost'
|
||||||
port: 5432
|
port: 5432
|
||||||
ssl: false
|
ssl: false
|
||||||
suffix: '___DB_NAME__'
|
suffix: '___APP__'
|
||||||
username: '__DB_NAME__'
|
username: '__DB_USER__'
|
||||||
password: '__DB_PWD__'
|
password: '__DB_PWD__'
|
||||||
pool:
|
pool:
|
||||||
max: 5
|
max: 5
|
||||||
|
@ -203,7 +203,7 @@ cache:
|
||||||
admin:
|
admin:
|
||||||
# Used to generate the root user at first startup
|
# Used to generate the root user at first startup
|
||||||
# And to receive emails from the contact form
|
# And to receive emails from the contact form
|
||||||
email: '__EMAIL__'
|
email: '__ADMIN_EMAIL__'
|
||||||
|
|
||||||
contact_form:
|
contact_form:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
name: Bug report
|
name: Bug report
|
||||||
about: Create a report to help us debug, it would be nice to fill the template as much as you can to help us, help you and help us all.
|
about: When creating a bug report, please use the following template to provide all the relevant information and help debugging efficiently.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -9,24 +9,26 @@ about: Create a report to help us debug, it would be nice to fill the template a
|
||||||
2. *Determine if you are on the right place:*
|
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!*
|
- *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 PeerTube itself. Refer to its documentation or repository for help.*
|
- *Otherwise, the issue may be due to PeerTube itself. Refer to its documentation or repository for help.*
|
||||||
- *If you have a doubt, post here, we will figure it out together.*
|
- *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.*
|
3. *Delete the italic comments as you write over them below, and remove this guide.*
|
||||||
---
|
---
|
||||||
|
|
||||||
**Describe the bug**
|
### Describe the bug
|
||||||
|
|
||||||
*A clear and concise description of what the bug is.*
|
*A clear and concise description of what the bug is.*
|
||||||
|
|
||||||
**Versions**
|
### Context
|
||||||
|
|
||||||
- Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...*
|
- Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...*
|
||||||
- YunoHost version: x.x.x
|
- YunoHost version: x.x.x
|
||||||
- I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...*
|
- I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...*
|
||||||
- Are you in a special context or did you perform some particular tweaking on your YunoHost instance ?: *no / yes*
|
- Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes*
|
||||||
- If yes, please explain:
|
- If yes, please explain:
|
||||||
- Using, or trying to install package version/branch:
|
- Using, or trying to install package version/branch:
|
||||||
- If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`*
|
- If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`*
|
||||||
|
|
||||||
**To Reproduce**
|
### Steps to reproduce
|
||||||
*Steps to reproduce the behavior.*
|
|
||||||
- *If you performed a command from the CLI, the command itself is enough. For example:*
|
- *If you performed a command from the CLI, the command itself is enough. For example:*
|
||||||
```sh
|
```sh
|
||||||
sudo yunohost app install peertube
|
sudo yunohost app install peertube
|
||||||
|
@ -38,9 +40,16 @@ about: Create a report to help us debug, it would be nice to fill the template a
|
||||||
3. *Scroll down to '...'*
|
3. *Scroll down to '...'*
|
||||||
4. *See error*
|
4. *See error*
|
||||||
|
|
||||||
**Expected behavior**
|
### Expected behavior
|
||||||
|
|
||||||
*A clear and concise description of what you expected to happen. You can remove this section if the command above is enough to understand your intent.*
|
*A clear and concise description of what you expected to happen. You can remove this section if the command above is enough to understand your intent.*
|
||||||
|
|
||||||
**Logs**
|
### Logs
|
||||||
*After a failed command, YunoHost makes the log available to you, but also to others, thanks to `yunohost log display [log name] --share`. The actual command, with the correct log name, is displayed at the end of the failed attempt in the CLI. Execute it and copy here the share link it outputs.*
|
|
||||||
|
*When an operation fails, YunoHost provides a simple way to share the logs.*
|
||||||
|
- *In the webadmin, the error message contains a link to the relevant log page. On that page, you will be able to 'Share with Yunopaste'. If you missed it, the logs of previous operations are also available under Tools > Logs.*
|
||||||
|
- *In command line, the command to share the logs is displayed at the end of the operation and looks like `yunohost log display [log name] --share`. If you missed it, you can find the log ID of a previous operation using `yunohost log list`.*
|
||||||
|
|
||||||
|
*After sharing the log, please copypaste directly the link provided by YunoHost (to help readability, no need to copypaste the entire content of the log here, just the link is enough...)*
|
||||||
|
|
||||||
*If applicable and useful, add screenshots to help explain your problem.*
|
*If applicable and useful, add screenshots to help explain your problem.*
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"requirements": {
|
"requirements": {
|
||||||
"yunohost": ">= 3.8.1"
|
"yunohost": ">= 4.1.7.3"
|
||||||
},
|
},
|
||||||
"multi_instance": false,
|
"multi_instance": false,
|
||||||
"services": [
|
"services": [
|
||||||
|
@ -37,13 +37,13 @@
|
||||||
"example": "example.com"
|
"example": "example.com"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "email",
|
"name": "admin",
|
||||||
"type": "string",
|
"type": "user",
|
||||||
"ask": {
|
"ask": {
|
||||||
"en": "Choose an admin email (can be changed after installation)",
|
"en": "Choose an admin user",
|
||||||
"fr": "Choisissez une adresse e-mail d'administrateur (peut être modifiée après l'installation)"
|
"fr": "Choisissez l'administrateur"
|
||||||
},
|
},
|
||||||
"example": "johndoe@example.com"
|
"example": "johndoe"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "is_public",
|
"name": "is_public",
|
||||||
|
|
|
@ -13,6 +13,4 @@
|
||||||
|
|
||||||
## Package_check results
|
## 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*
|
* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"*
|
||||||
|
|
||||||
[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/peertube_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/peertube_ynh%20PR-NUM-%20(USERNAME)/)
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=psql_db)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -26,9 +26,10 @@ ynh_abort_if_errors
|
||||||
|
|
||||||
domain=$YNH_APP_ARG_DOMAIN
|
domain=$YNH_APP_ARG_DOMAIN
|
||||||
path_url="/"
|
path_url="/"
|
||||||
admin_email=$YNH_APP_ARG_EMAIL
|
admin=$YNH_APP_ARG_ADMIN
|
||||||
admin_pass=$(ynh_string_random --length=24)
|
|
||||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||||
|
admin_email=$(ynh_user_get_info --username=$admin --key="mail")
|
||||||
|
admin_pass=$(ynh_string_random --length=24)
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
@ -52,9 +53,7 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
|
||||||
ynh_script_progression --message="Storing installation settings..."
|
ynh_script_progression --message="Storing installation settings..."
|
||||||
|
|
||||||
ynh_app_setting_set --app=$app --key=domain --value=$domain
|
ynh_app_setting_set --app=$app --key=domain --value=$domain
|
||||||
ynh_app_setting_set --app=$app --key=admin_email --value=$admin_email
|
ynh_app_setting_set --app=$app --key=admin --value=$admin
|
||||||
ynh_app_setting_set --app=$app --key=admin_pass --value=$admin_pass
|
|
||||||
ynh_app_setting_set --app=$app --key=is_public --value=$is_public
|
|
||||||
ynh_app_setting_set --app=$app --key=datadir --value=$datadir
|
ynh_app_setting_set --app=$app --key=datadir --value=$datadir
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -106,8 +105,8 @@ ynh_script_progression --message="Creating a PostgreSQL database..."
|
||||||
db_name="peertube_${app}"
|
db_name="peertube_${app}"
|
||||||
db_user=$app
|
db_user=$app
|
||||||
db_pwd=$(ynh_string_random --length=30)
|
db_pwd=$(ynh_string_random --length=30)
|
||||||
ynh_app_setting_set --app=$app --key=psql_db --value=$db_name
|
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
||||||
ynh_app_setting_set --app=$app --key=psqlpwd --value=$db_pwd
|
ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd
|
||||||
ynh_psql_test_if_first_run
|
ynh_psql_test_if_first_run
|
||||||
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
|
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
|
||||||
|
|
||||||
|
@ -157,28 +156,9 @@ chown -R "$app":"$app" "$datadir"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Modifying a config file..."
|
ynh_script_progression --message="Modifying a config file..."
|
||||||
|
|
||||||
config="$final_path/config/production.yaml"
|
ynh_add_config --template="../conf/production.yaml" --destination="$final_path/config/production.yaml"
|
||||||
cp ../conf/production.yaml "$config"
|
|
||||||
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$config"
|
|
||||||
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$app" --target_file="$config"
|
|
||||||
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$config"
|
|
||||||
ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$config"
|
|
||||||
ynh_replace_string --match_string="__EMAIL__" --replace_string="$admin_email" --target_file="$config"
|
|
||||||
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config"
|
|
||||||
ynh_replace_string --match_string="__DATADIR__" --replace_string="$datadir" --target_file="$config"
|
|
||||||
|
|
||||||
#Create the admin settings file
|
ynh_add_config --template="../conf/local-production.json" --destination="$final_path/config/local-production.json"
|
||||||
local_config="$final_path/config/local-production.json"
|
|
||||||
cp ../conf/local-production.json "$local_config"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# STORE THE CHECKSUM OF THE CONFIG FILE
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Storing the config file checksum..."
|
|
||||||
|
|
||||||
# Calculate and store the config file checksum into the app settings
|
|
||||||
ynh_store_file_checksum --file="$config"
|
|
||||||
ynh_store_file_checksum --file="$local_config"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BUILD YARN DEPENDENCIES
|
# BUILD YARN DEPENDENCIES
|
||||||
|
@ -236,15 +216,18 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --l
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SSOWAT
|
# SETUP SSOWAT
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring SSOwat..."
|
ynh_script_progression --message="Configuring permissions..."
|
||||||
|
|
||||||
# Make app public if necessary
|
# Make app public if necessary
|
||||||
if [ $is_public -eq 1 ]
|
if [ $is_public -eq 1 ]
|
||||||
then
|
then
|
||||||
# unprotected_uris allows SSO credentials to be passed anyway.
|
# Everyone can access the app.
|
||||||
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
|
# The "main" permission is automatically created before the install script.
|
||||||
|
ynh_permission_update --permission="main" --add="visitors"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --auth_header="false" --show_tile="false" --protected="true"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -266,13 +249,8 @@ popd
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Sending a readme for the admin..."
|
ynh_script_progression --message="Sending a readme for the admin..."
|
||||||
|
|
||||||
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/message_install"
|
ynh_add_config --template="../conf/message_install" --destination="../conf/msg_install"
|
||||||
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/message_install"
|
ynh_send_readme_to_admin --app_message="../conf/msg_install" --recipients=$admin_email --type='install'
|
||||||
ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="../conf/message_install"
|
|
||||||
ynh_replace_string --match_string="__ADMIN_PASS__" --replace_string="$admin_pass" --target_file="../conf/message_install"
|
|
||||||
ynh_replace_string --match_string="__RTMP_PORT__" --replace_string="$rtmp_port" --target_file="../conf/message_install"
|
|
||||||
|
|
||||||
ynh_send_readme_to_admin --app_message="../conf/message_install" --recipients=$admin_email --type='install'
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
|
@ -20,11 +20,13 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||||
port=$(ynh_app_setting_get --app=$app --key=port)
|
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||||
rtmp_port=$(ynh_app_setting_get --app=$app --key=rtmp_port)
|
rtmp_port=$(ynh_app_setting_get --app=$app --key=rtmp_port)
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=psql_db)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
db_user=$app
|
db_user=$app
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
admin_email=$(ynh_app_setting_get --app=$app --key=admin_email)
|
admin=$(ynh_app_setting_get --app=$app --key=admin)
|
||||||
|
admin_email=$(ynh_user_get_info --username=$admin --key="mail")
|
||||||
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
||||||
|
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD REMOVE
|
# STANDARD REMOVE
|
||||||
|
@ -53,7 +55,7 @@ ynh_remove_systemd_config
|
||||||
ynh_script_progression --message="Removing the PostgreSQL database..."
|
ynh_script_progression --message="Removing the PostgreSQL database..."
|
||||||
|
|
||||||
# Remove a database if it exists, along with the associated user
|
# Remove a database if it exists, along with the associated user
|
||||||
ynh_psql_remove_db --db_user="$db_user" --db_name="$db_name"
|
ynh_psql_remove_db --db_user=$db_user --db_name=$db_name
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE DEPENDENCIES
|
# REMOVE DEPENDENCIES
|
||||||
|
@ -61,9 +63,8 @@ ynh_psql_remove_db --db_user="$db_user" --db_name="$db_name"
|
||||||
ynh_script_progression --message="Removing dependencies..."
|
ynh_script_progression --message="Removing dependencies..."
|
||||||
|
|
||||||
# Remove metapackage and its dependencies
|
# Remove metapackage and its dependencies
|
||||||
ynh_remove_app_dependencies
|
|
||||||
|
|
||||||
ynh_remove_nodejs
|
ynh_remove_nodejs
|
||||||
|
ynh_remove_app_dependencies
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE APP MAIN DIR
|
# REMOVE APP MAIN DIR
|
||||||
|
@ -120,13 +121,8 @@ ynh_system_user_delete --username=$app
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Sending a readme for the admin..."
|
ynh_script_progression --message="Sending a readme for the admin..."
|
||||||
|
|
||||||
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/message_remove"
|
ynh_add_config --template="../conf/message_remove" --destination="../conf/msg_remove"
|
||||||
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/message_remove"
|
ynh_send_readme_to_admin --app_message="../conf/msg_remove" --recipients=$admin_email --type='remove'
|
||||||
ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="../conf/message_remove"
|
|
||||||
ynh_replace_string --match_string="__DATADIR__" --replace_string="$datadir" --target_file="../conf/message_remove"
|
|
||||||
ynh_replace_string --match_string="__RTMP_PORT__" --replace_string="$rtmp_port" --target_file="../conf/message"
|
|
||||||
|
|
||||||
ynh_send_readme_to_admin --app_message="../conf/message_remove" --recipients=$admin_email --type='remove'
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
|
@ -32,9 +32,9 @@ path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
port=$(ynh_app_setting_get --app=$app --key=port)
|
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||||
rtmp_port=$(ynh_app_setting_get --app=$app --key=rtmp_port)
|
rtmp_port=$(ynh_app_setting_get --app=$app --key=rtmp_port)
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=psql_db)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
db_user=$app
|
db_user=$app
|
||||||
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
|
db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
|
||||||
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -18,14 +18,15 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||||
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||||
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
|
|
||||||
admin_email=$(ynh_app_setting_get --app=$app --key=admin_email)
|
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
port=$(ynh_app_setting_get --app=$app --key=port)
|
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||||
rtmp_port=$(ynh_app_setting_get --app=$app --key=rtmp_port)
|
rtmp_port=$(ynh_app_setting_get --app=$app --key=rtmp_port)
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=psql_db)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
|
db_user=$app
|
||||||
|
db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
|
||||||
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
||||||
|
admin=$(ynh_app_setting_get --app=$app --key=admin)
|
||||||
|
admin_email=$(ynh_user_get_info --username=$admin --key="mail")
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK VERSION
|
# CHECK VERSION
|
||||||
|
@ -39,13 +40,19 @@ upgrade_type=$(ynh_check_app_version_changed)
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Ensuring downward compatibility..."
|
ynh_script_progression --message="Ensuring downward compatibility..."
|
||||||
|
|
||||||
# Fix is_public as a boolean value
|
ynh_app_setting_delete --app=$app --key=admin_pass
|
||||||
if [ "$is_public" = "Yes" ]; then
|
ynh_app_setting_delete --app=$app --key=admin_email
|
||||||
ynh_app_setting_set --app=$app --key=is_public --value=1
|
|
||||||
is_public=1
|
# If db_name doesn't exist, create it
|
||||||
elif [ "$is_public" = "No" ]; then
|
if [ -z "$db_name" ]; then
|
||||||
ynh_app_setting_set --app=$app --key=is_public --value=0
|
db_name="peertube_${app}"
|
||||||
is_public=0
|
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If db_pwd doesn't exist, create it
|
||||||
|
if [ -z "$db_pwd" ]; then
|
||||||
|
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
|
||||||
|
ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$datadir" ];
|
if [ -z "$datadir" ];
|
||||||
|
@ -80,6 +87,18 @@ then
|
||||||
ynh_exec_warn_less yunohost firewall allow TCP $rtmp_port
|
ynh_exec_warn_less yunohost firewall allow TCP $rtmp_port
|
||||||
fi
|
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
|
||||||
|
|
||||||
|
# Create a permission if needed
|
||||||
|
if ! ynh_permission_exists --permission="api"; then
|
||||||
|
ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --auth_header="false" --show_tile="false" --protected="true"
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -212,17 +231,7 @@ chown -R "$app":"$app" "$datadir"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Modifying a config file..."
|
ynh_script_progression --message="Modifying a config file..."
|
||||||
|
|
||||||
config="$final_path/config/production.yaml"
|
ynh_add_config --template="../conf/production.yaml" --destination="$final_path/config/production.yaml"
|
||||||
ynh_backup_if_checksum_is_different --file="$config"
|
|
||||||
cp ../conf/production.yaml "$config"
|
|
||||||
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$config"
|
|
||||||
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$app" --target_file="$config"
|
|
||||||
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$config"
|
|
||||||
ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$config"
|
|
||||||
ynh_replace_string --match_string="__EMAIL__" --replace_string="$admin_email" --target_file="$config"
|
|
||||||
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config"
|
|
||||||
ynh_replace_string --match_string="__DATADIR__" --replace_string="$datadir" --target_file="$config"
|
|
||||||
ynh_store_file_checksum --file="$config"
|
|
||||||
|
|
||||||
local_config="$final_path/config/local-production.json"
|
local_config="$final_path/config/local-production.json"
|
||||||
ynh_backup_if_checksum_is_different --file="$local_config"
|
ynh_backup_if_checksum_is_different --file="$local_config"
|
||||||
|
@ -280,18 +289,6 @@ ynh_script_progression --message="Starting a systemd service..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Server listening on localhost"
|
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Server listening on localhost"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SETUP SSOWAT
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Upgrading SSOwat configuration..."
|
|
||||||
|
|
||||||
# Make app public if necessary
|
|
||||||
if [ $is_public -eq 1 ]
|
|
||||||
then
|
|
||||||
# unprotected_uris allows SSO credentials to be passed anyway
|
|
||||||
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Reference in a new issue