mirror of
https://github.com/YunoHost-Apps/peertube_ynh.git
synced 2024-09-03 19:56:29 +02:00
Merge pull request #356 from YunoHost-Apps/testing
Fix config local.yaml file wiped out on app upgrade
This commit is contained in:
commit
a0bdfd9c50
4 changed files with 5 additions and 30 deletions
|
@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
|
||||||
Federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser, using <a href="https://github.com/feross/webtorrent">WebTorrent</a>.
|
Federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser, using <a href="https://github.com/feross/webtorrent">WebTorrent</a>.
|
||||||
|
|
||||||
|
|
||||||
**Shipped version:** 4.3.1~ynh1
|
**Shipped version:** 4.3.1~ynh2
|
||||||
|
|
||||||
**Demo:** http://peertube.cpy.re
|
**Demo:** http://peertube.cpy.re
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
|
||||||
Plateforme de streaming vidéo fédérée (ActivityPub) utilisant P2P (BitTorrent) directement dans le navigateur Web, en utilisant <a href="https://github.com/feross/webtorrent"> WebTorrent </a>
|
Plateforme de streaming vidéo fédérée (ActivityPub) utilisant P2P (BitTorrent) directement dans le navigateur Web, en utilisant <a href="https://github.com/feross/webtorrent"> WebTorrent </a>
|
||||||
|
|
||||||
|
|
||||||
**Version incluse :** 4.3.1~ynh1
|
**Version incluse :** 4.3.1~ynh2
|
||||||
|
|
||||||
**Démo :** http://peertube.cpy.re
|
**Démo :** http://peertube.cpy.re
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"en": "Video streaming platform using P2P directly in the web browser, connected to a federated network",
|
"en": "Video streaming platform using P2P directly in the web browser, connected to a federated network",
|
||||||
"fr": "Plateforme de diffusion vidéo par P2P directement dans le navigateur, et connectée à un réseau fédéralisé"
|
"fr": "Plateforme de diffusion vidéo par P2P directement dans le navigateur, et connectée à un réseau fédéralisé"
|
||||||
},
|
},
|
||||||
"version": "4.3.1~ynh1",
|
"version": "4.3.1~ynh2",
|
||||||
"url": "https://github.com/Chocobozzz/PeerTube",
|
"url": "https://github.com/Chocobozzz/PeerTube",
|
||||||
"upstream": {
|
"upstream": {
|
||||||
"license": "AGPL-3.0-only",
|
"license": "AGPL-3.0-only",
|
||||||
|
|
|
@ -165,34 +165,9 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Upgrading source files..."
|
ynh_script_progression --message="Upgrading source files..."
|
||||||
|
|
||||||
# Create a temporary directory
|
|
||||||
tmpdir="$(mktemp -d)"
|
|
||||||
|
|
||||||
# Backup the config file in the temp dir
|
|
||||||
cp -af "$final_path/config/production.yaml" "$tmpdir/production.yaml"
|
|
||||||
if [ -s "$final_path/config/local-production.json" ]
|
|
||||||
then
|
|
||||||
cp -af "$final_path/config/local-production.json" "$tmpdir/local-production.json"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Remove the app directory securely
|
|
||||||
ynh_secure_remove --file="$final_path"
|
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
ynh_setup_source --dest_dir="$final_path"
|
ynh_setup_source --full_replace=1 --dest_dir="$final_path" \
|
||||||
|
--keep="config/production.yaml config/local-production.json config/local.yaml"
|
||||||
#Copy the admin saved settings from tmp directory to final path
|
|
||||||
cp -af "$tmpdir/production.yaml" "$final_path/config/production.yaml"
|
|
||||||
|
|
||||||
if [ -s "$tmpdir/local-production.json" ]
|
|
||||||
then
|
|
||||||
cp -af "$tmpdir/local-production.json" "$final_path/config/local-production.json"
|
|
||||||
else
|
|
||||||
cp ../conf/local-production.json "$final_path/config/local-production.json"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Remove the tmp directory securely
|
|
||||||
ynh_secure_remove --file="$tmpdir"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
chmod 750 "$final_path"
|
chmod 750 "$final_path"
|
||||||
|
|
Loading…
Reference in a new issue