mirror of
https://github.com/YunoHost-Apps/UMS_ynh.git
synced 2024-10-01 13:35:01 +02:00
commit
3399f57a24
26 changed files with 181 additions and 886 deletions
131
.github/workflows/updater.sh
vendored
131
.github/workflows/updater.sh
vendored
|
@ -1,131 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# FETCHING LATEST RELEASE AND ITS ASSETS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
# Fetching information
|
|
||||||
current_version=$(cat manifest.json | jq -j '.version|split("~")[0]')
|
|
||||||
repo=$(cat manifest.json | jq -j '.upstream.code|split("https://github.com/")[1]')
|
|
||||||
# Some jq magic is needed, because the latest upstream release is not always the latest version (e.g. security patches for older versions)
|
|
||||||
version=$(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '.[] | select( .prerelease != true ) | .tag_name' | sort -V | tail -1)
|
|
||||||
assets=($(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '[ .[] | select(.tag_name=="'$version'").assets[].browser_download_url ] | join(" ") | @sh' | tr -d "'"))
|
|
||||||
|
|
||||||
# Later down the script, we assume the version has only digits and dots
|
|
||||||
# Sometimes the release name starts with a "v", so let's filter it out.
|
|
||||||
# You may need more tweaks here if the upstream repository has different naming conventions.
|
|
||||||
if [[ ${version:0:1} == "v" || ${version:0:1} == "V" ]]; then
|
|
||||||
version=${version:1}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Setting up the environment variables
|
|
||||||
echo "Current version: $current_version"
|
|
||||||
echo "Latest release from upstream: $version"
|
|
||||||
echo "VERSION=$version" >> $GITHUB_ENV
|
|
||||||
# For the time being, let's assume the script will fail
|
|
||||||
echo "PROCEED=false" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
# Proceed only if the retrieved version is greater than the current one
|
|
||||||
if ! dpkg --compare-versions "$current_version" "lt" "$version" ; then
|
|
||||||
echo "::warning ::No new version available"
|
|
||||||
exit 0
|
|
||||||
# Proceed only if a PR for this new version does not already exist
|
|
||||||
elif git ls-remote -q --exit-code --heads https://github.com/$GITHUB_REPOSITORY.git ci-auto-update-v$version ; then
|
|
||||||
echo "::warning ::A branch already exists for this update"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Each release can hold multiple assets (e.g. binaries for different architectures, source code, etc.)
|
|
||||||
echo "${#assets[@]} available asset(s)"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# UPDATE SOURCE FILES
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
# Here we use the $assets variable to get the resources published in the upstream release.
|
|
||||||
# Here is an example for Grav, it has to be adapted in accordance with how the upstream releases look like.
|
|
||||||
|
|
||||||
# Let's loop over the array of assets URLs
|
|
||||||
for asset_url in ${assets[@]}; do
|
|
||||||
|
|
||||||
echo "Handling asset at $asset_url"
|
|
||||||
|
|
||||||
# Assign the asset to a source file in conf/ directory
|
|
||||||
# Here we base the source file name upon a unique keyword in the assets url
|
|
||||||
# Leave $src empty to ignore the asset
|
|
||||||
case $asset_url in
|
|
||||||
*"arm64.tgz"*)
|
|
||||||
src="arm64"
|
|
||||||
;;
|
|
||||||
*"armhf.tgz"*)
|
|
||||||
src="armhf"
|
|
||||||
;;
|
|
||||||
*"x86_64.tgz"*)
|
|
||||||
src="amd64"
|
|
||||||
;;
|
|
||||||
*"x86.tgz"*)
|
|
||||||
src="i386"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
src=""
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# If $src is not empty, let's process the asset
|
|
||||||
if [ ! -z "$src" ]; then
|
|
||||||
|
|
||||||
# Create the temporary directory
|
|
||||||
tempdir="$(mktemp -d)"
|
|
||||||
|
|
||||||
# Download sources and calculate checksum
|
|
||||||
filename=${asset_url##*/}
|
|
||||||
curl --silent -4 -L $asset_url -o "$tempdir/$filename"
|
|
||||||
checksum=$(sha256sum "$tempdir/$filename" | head -c 64)
|
|
||||||
|
|
||||||
# Delete temporary directory
|
|
||||||
rm -rf $tempdir
|
|
||||||
|
|
||||||
# Get extension
|
|
||||||
if [[ $filename == *.tgz ]]; then
|
|
||||||
extension=tgz
|
|
||||||
else
|
|
||||||
extension=${filename##*.}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Rewrite source file
|
|
||||||
cat <<EOT > conf/$src.src
|
|
||||||
SOURCE_URL=$asset_url
|
|
||||||
SOURCE_SUM=$checksum
|
|
||||||
SOURCE_SUM_PRG=sha256sum
|
|
||||||
SOURCE_FORMAT=tar.gz
|
|
||||||
SOURCE_EXTRACT=true
|
|
||||||
SOURCE_IN_SUBDIR=true
|
|
||||||
EOT
|
|
||||||
echo "... conf/$src.src updated"
|
|
||||||
|
|
||||||
else
|
|
||||||
echo "... asset ignored"
|
|
||||||
fi
|
|
||||||
|
|
||||||
done
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SPECIFIC UPDATE STEPS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
# Any action on the app's source code can be done.
|
|
||||||
# The GitHub Action workflow takes care of committing all changes after this script ends.
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC FINALIZATION
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
# Replace new version in manifest
|
|
||||||
echo "$(jq -s --indent 4 ".[] | .version = \"$version~ynh1\"" manifest.json)" > manifest.json
|
|
||||||
echo "$(jq -s --indent 4 ".[] | .upstream.version = \"$version\"" manifest.json)" > manifest.json
|
|
||||||
|
|
||||||
# No need to update the README, yunohost-bot takes care of it
|
|
||||||
|
|
||||||
# The Action will proceed only if the PROCEED environment variable is set to true
|
|
||||||
echo "PROCEED=true" >> $GITHUB_ENV
|
|
||||||
exit 0
|
|
50
.github/workflows/updater.yml
vendored
50
.github/workflows/updater.yml
vendored
|
@ -1,50 +0,0 @@
|
||||||
# This workflow allows GitHub Actions to automagically update your app whenever a new upstream release is detected.
|
|
||||||
# You need to enable Actions in your repository settings, and fetch this Action from the YunoHost-Apps organization.
|
|
||||||
# This file should be enough by itself, but feel free to tune it to your needs.
|
|
||||||
# It calls updater.sh, which is where you should put the app-specific update steps.
|
|
||||||
name: Check for new upstream releases
|
|
||||||
on:
|
|
||||||
# Allow to manually trigger the workflow
|
|
||||||
workflow_dispatch:
|
|
||||||
# Run it every day at 6:00 UTC
|
|
||||||
schedule:
|
|
||||||
- cron: '0 6 * * *'
|
|
||||||
jobs:
|
|
||||||
updater:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Fetch the source code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: Run the updater script
|
|
||||||
id: run_updater
|
|
||||||
run: |
|
|
||||||
# Setting up Git user
|
|
||||||
git config --global user.name 'yunohost-bot'
|
|
||||||
git config --global user.email 'yunohost-bot@users.noreply.github.com'
|
|
||||||
# Run the updater script
|
|
||||||
/bin/bash .github/workflows/updater.sh
|
|
||||||
- name: Commit changes
|
|
||||||
id: commit
|
|
||||||
if: ${{ env.PROCEED == 'true' }}
|
|
||||||
run: |
|
|
||||||
git commit -am "Upgrade to v$VERSION"
|
|
||||||
- name: Create Pull Request
|
|
||||||
id: cpr
|
|
||||||
if: ${{ env.PROCEED == 'true' }}
|
|
||||||
uses: peter-evans/create-pull-request@v4
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
commit-message: Update to version ${{ env.VERSION }}
|
|
||||||
committer: 'yunohost-bot <yunohost-bot@users.noreply.github.com>'
|
|
||||||
author: 'yunohost-bot <yunohost-bot@users.noreply.github.com>'
|
|
||||||
signoff: false
|
|
||||||
base: testing
|
|
||||||
branch: ci-auto-update-v${{ env.VERSION }}
|
|
||||||
delete-branch: true
|
|
||||||
title: 'Upgrade to version ${{ env.VERSION }}'
|
|
||||||
body: |
|
|
||||||
Upgrade to v${{ env.VERSION }}
|
|
||||||
[See upstream release page](https://github.com/${{ env.REPO }}/releases/tag/v${{ env.VERSION }})
|
|
||||||
draft: false
|
|
32
README.md
32
README.md
|
@ -17,42 +17,14 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
Universal Media Server is a DLNA-compliant UPnP Media Server. It is capable of sharing video, audio and images between most modern devices.
|
Universal Media Server is a DLNA-compliant UPnP Media Server. It is capable of sharing video, audio and images between most modern devices.
|
||||||
|
|
||||||
The program streams or transcodes many different media formats with little or no configuration. It is powered by FFmpeg, MediaInfo, OpenSubtitles, Crowdin, MEncoder, tsMuxeR, AviSynth, VLC and more, which combine to offer support for a wide range of media formats.
|
The program streams or transcodes many different media formats with little or no configuration. It is powered by FFmpeg, MediaInfo, OpenSubtitles, Crowdin, MEncoder, tsMuxeR, AviSynth, VLC and more, which combine to offer support for a wide range of media formats.
|
||||||
|
|
||||||
**Shipped version:** 13.5.0
|
**Shipped version:** 13.5.0~ynh2
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Disclaimers / important information
|
|
||||||
|
|
||||||
### Configuration
|
|
||||||
|
|
||||||
At first run, UMS will ask you to create an admin user. This can be disable later on in the settings
|
|
||||||
|
|
||||||
Once installed, UMS will create config file in `/home/yunohost.app/ums/.config/UMS/`
|
|
||||||
|
|
||||||
All settings are pretty well documented directly in the files.
|
|
||||||
The default setting will use the shared multimedia directory by default (located into `/home/yunohost.multimedia/share`), you may change this setting in `/home/yunohost.app/ums/.config/UMS/UMS.conf` with the setting "folders"
|
|
||||||
|
|
||||||
### Limitations
|
|
||||||
|
|
||||||
- No multi-instance
|
|
||||||
- No User integration with Yunohost
|
|
||||||
- work only on its own subdomain (ums.mydomain.tld, not on mydomain.tld/ums)
|
|
||||||
|
|
||||||
### Other infos
|
|
||||||
|
|
||||||
If you can't find the server on a renderer, you may try the following trouble shooting :
|
|
||||||
- Wait a little bit : the first start up will intialized the database and if you have a lot of media, this may take a while
|
|
||||||
- Wait a little more : the server will broadcast an ALIVE message every 30 sec, so it may take this long for a renderer to find it
|
|
||||||
- check if the service ums is running in the yunohost admin
|
|
||||||
- check on which network interface the server is annoucing : You may find the network and address used in `/home/yunohost.app/ums/.config/UMS/debug.log` or `/var/log/ums/ums.log`. Search for a line like `Using address /192.168.0.54 found on network interface: name:enp0s3 (enp0s3)`
|
|
||||||
The subnet to be used should be the same as your renderer (ie : if your TV is on 192.168.0.X and ums on 192.168.1.X, this will not work)
|
|
||||||
|
|
||||||
On small device (Raspberry for example), transco may be requiring too much power : try some alternate transcoder.
|
|
||||||
|
|
||||||
## Documentation and resources
|
## Documentation and resources
|
||||||
|
|
||||||
* Official app website: <www.universalmediaserver.com>
|
* Official app website: <www.universalmediaserver.com>
|
||||||
|
|
30
README_fr.md
30
README_fr.md
|
@ -19,38 +19,12 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po
|
||||||
Universal Media Server est un serveur multimédia UPnP compatible DLNA. Il peut partager des vidéos, de l'audio et des images avec la pluparts des équipements modernes.
|
Universal Media Server est un serveur multimédia UPnP compatible DLNA. Il peut partager des vidéos, de l'audio et des images avec la pluparts des équipements modernes.
|
||||||
Le programme stream ou transcode de nombreux formats média différents avec peu ou pas de configuration. Il utilise par FFmpeg, MediaInfo, OpenSubtitles, Crowdin, MEncoder, tsMuxeR, AviSynth, VLC et d'autres, qui se combinent pour offrir une grande variété de formats.
|
Le programme stream ou transcode de nombreux formats média différents avec peu ou pas de configuration. Il utilise par FFmpeg, MediaInfo, OpenSubtitles, Crowdin, MEncoder, tsMuxeR, AviSynth, VLC et d'autres, qui se combinent pour offrir une grande variété de formats.
|
||||||
|
|
||||||
**Version incluse :** 13.5.0
|
**Version incluse :** 13.5.0~ynh2
|
||||||
|
|
||||||
## Captures d’écran
|
## Captures d’écran
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Avertissements / informations importantes
|
|
||||||
|
|
||||||
### Configuration
|
|
||||||
|
|
||||||
A la première connexion, UMS vous demandera de créer un user administrateur. Cela peut-être désactivé plus tard dans les réglages.
|
|
||||||
|
|
||||||
Une fois installé, tous les réglages peuvent être trouvés dans `/home/yunohost.app/ums/.config/UMS/`
|
|
||||||
Les réglages sont plutôt bien documentés, vous pouvez les changer directement dans le fichier.
|
|
||||||
Le réglage par défaut utilisera le répertoire multimédia partagé (situé dans `/home/yunohost.multimedia/share`). Vous pouvez changer ce réglage dans le fichier `/home/yunohost.app/ums/.config/UMS/UMS.conf` sur le réglage "folders".
|
|
||||||
|
|
||||||
### Limitations
|
|
||||||
|
|
||||||
- pas de multiinstance
|
|
||||||
- Pas d'intégration des utilisateurs avec Yunohost
|
|
||||||
- fonctionne uniquement en sous-domaine (ums.mydomain.tld, et non mydomain.tld/ums)
|
|
||||||
- pas énormément testé
|
|
||||||
|
|
||||||
### Autres infos
|
|
||||||
|
|
||||||
Si vous ne trouvez pas le serveur sur vos renderer, vous pouvez essayer les trucs suivants :
|
|
||||||
- Attendez un petit peu : lors du premier démarrage, UMS va indexer tous vos médias et ceci peut prendre un certain temps si vous en avez beaucoup
|
|
||||||
- Attendez encore un peu : le serveur s'annonce par un message ALIVE toutes les 30 sec, donc cela peut prendre tout ce temps avant qu'un renderer ne le trouve
|
|
||||||
- Vérifiez bien que le service ums tourne dans l'interface d'administration de yunohost
|
|
||||||
- Vérifiez sur quel interface réseau ums s'annonce. Vous pouvez trouver l'adresse utilisée et le réseau dans `/home/yunohost.app/ums/.config/UMS/debug.log` ou `/var/log/ums/ums.log`. Cherchez une ligne ressemblant à `Using address /192.168.0.54 found on network interface: name:enp0s3 (enp0s3)`. Le sous-réseau utilisé doit être le même que le renderer (ie : si votre TV est sur 192.168.0.X et ums sur 192.168.1.X, cela ne marchera pas)
|
|
||||||
|
|
||||||
Sur de petits appareils (par exemple un raspberry), la transco peut demander trop de puissance, n'hésitez par à utiliser des transcodeur alternatifs.
|
|
||||||
|
|
||||||
## Documentations et ressources
|
## Documentations et ressources
|
||||||
|
|
||||||
* Site officiel de l’app : <www.universalmediaserver.com>
|
* Site officiel de l’app : <www.universalmediaserver.com>
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
;; Test complet
|
|
||||||
; Manifest
|
|
||||||
domain="domain.tld"
|
|
||||||
is_public=1
|
|
||||||
name=MyUMS
|
|
||||||
interface=eth0
|
|
||||||
; Checks
|
|
||||||
pkg_linter=1
|
|
||||||
#Only work w/ root domain
|
|
||||||
setup_sub_dir=0
|
|
||||||
setup_root=1
|
|
||||||
setup_nourl=0
|
|
||||||
setup_private=1
|
|
||||||
setup_public=1
|
|
||||||
upgrade=1
|
|
||||||
upgrade=1 from_commit=3ceb411ac9affdffba7108b3e6e1f1057ef8ba7c
|
|
||||||
backup_restore=1
|
|
||||||
multi_instance=0
|
|
||||||
port_already_use=1
|
|
||||||
change_url=1
|
|
||||||
;;; Options
|
|
||||||
Email=
|
|
||||||
Notification=none
|
|
||||||
;;; Upgrade options
|
|
||||||
; commit=3ceb411ac9affdffba7108b3e6e1f1057ef8ba7c
|
|
||||||
name=13.2.0
|
|
|
@ -1341,7 +1341,7 @@ upnp_enable =
|
||||||
# is assigned dynamically.
|
# is assigned dynamically.
|
||||||
# Example: 7000, which means the web interface is at localhost:7000
|
# Example: 7000, which means the web interface is at localhost:7000
|
||||||
# Default: 9001
|
# Default: 9001
|
||||||
web_port =__PORT_WEB__
|
web_port =__PORT__
|
||||||
|
|
||||||
# Web enable
|
# Web enable
|
||||||
# ----------
|
# ----------
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
SOURCE_URL=https://github.com/UniversalMediaServer/UniversalMediaServer/releases/download/13.5.0/UMS-13.5.0-x86_64.tgz
|
|
||||||
SOURCE_SUM=1243c598fa2b3c4790399e7a13656b85fefefbe76c6332a38c7ae6bf15355c7b
|
|
||||||
SOURCE_SUM_PRG=sha256sum
|
|
||||||
SOURCE_FORMAT=tar.gz
|
|
||||||
SOURCE_EXTRACT=true
|
|
||||||
SOURCE_IN_SUBDIR=true
|
|
|
@ -1,6 +0,0 @@
|
||||||
SOURCE_URL=https://github.com/UniversalMediaServer/UniversalMediaServer/releases/download/13.5.0/UMS-13.5.0-arm64.tgz
|
|
||||||
SOURCE_SUM=b916a56a24e70d5454cbffdbd6140e4d20837f1187e6f6f437574c0244b100de
|
|
||||||
SOURCE_SUM_PRG=sha256sum
|
|
||||||
SOURCE_FORMAT=tar.gz
|
|
||||||
SOURCE_EXTRACT=true
|
|
||||||
SOURCE_IN_SUBDIR=true
|
|
|
@ -1,6 +0,0 @@
|
||||||
SOURCE_URL=https://github.com/UniversalMediaServer/UniversalMediaServer/releases/download/13.5.0/UMS-13.5.0-armhf.tgz
|
|
||||||
SOURCE_SUM=ac00cf598c0e1b572416c289ec36bb1578993fdf45348faf70558be2ecedb12b
|
|
||||||
SOURCE_SUM_PRG=sha256sum
|
|
||||||
SOURCE_FORMAT=tar.gz
|
|
||||||
SOURCE_EXTRACT=true
|
|
||||||
SOURCE_IN_SUBDIR=true
|
|
|
@ -1,6 +0,0 @@
|
||||||
SOURCE_URL=https://github.com/UniversalMediaServer/UniversalMediaServer/releases/download/13.5.0/UMS-13.5.0-x86.tgz
|
|
||||||
SOURCE_SUM=4535f500d19916aaf4c4d88d8448e8363898fbec81fac250db95b585f9542b8d
|
|
||||||
SOURCE_SUM_PRG=sha256sum
|
|
||||||
SOURCE_FORMAT=tar.gz
|
|
||||||
SOURCE_EXTRACT=true
|
|
||||||
SOURCE_IN_SUBDIR=true
|
|
|
@ -10,10 +10,9 @@ location __PATH__/ {
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection $connection_upgrade;
|
proxy_set_header Connection $connection_upgrade;
|
||||||
more_set_headers "X-Frame-Options: SAMEORIGIN";
|
more_set_headers "X-Frame-Options: SAMEORIGIN";
|
||||||
proxy_pass http://localhost:__PORT_WEB__/;
|
proxy_pass http://127.0.0.1:__PORT__/;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
|
|
||||||
|
|
||||||
# Include SSOWAT user panel.
|
# Include SSOWAT user panel.
|
||||||
include conf.d/yunohost_panel.conf.inc;
|
include conf.d/yunohost_panel.conf.inc;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,8 @@ After=network.target
|
||||||
Type=simple
|
Type=simple
|
||||||
User=__APP__
|
User=__APP__
|
||||||
Group=__APP__
|
Group=__APP__
|
||||||
WorkingDirectory=__FINALPATH__/
|
WorkingDirectory=__INSTALL_DIR__/
|
||||||
ExecStart=__FINALPATH__/UMS.sh headless
|
ExecStart=__INSTALL_DIR__/UMS.sh headless
|
||||||
StandardOutput=append:/var/log/__APP__/__APP__.log
|
StandardOutput=append:/var/log/__APP__/__APP__.log
|
||||||
StandardError=inherit
|
StandardError=inherit
|
||||||
|
|
||||||
|
|
|
@ -2,16 +2,14 @@
|
||||||
|
|
||||||
At first run, UMS will ask you to create an admin user. This can be disable later on in the settings
|
At first run, UMS will ask you to create an admin user. This can be disable later on in the settings
|
||||||
|
|
||||||
Once installed, UMS will create config file in `/home/yunohost.app/ums/.config/UMS/`
|
Once installed, UMS will create config file in `__DATA_DIR__/.config/UMS/`
|
||||||
|
|
||||||
All settings are pretty well documented directly in the files.
|
All settings are pretty well documented directly in the files.
|
||||||
The default setting will use the shared multimedia directory by default (located into `/home/yunohost.multimedia/share`), you may change this setting in `/home/yunohost.app/ums/.config/UMS/UMS.conf` with the setting "folders"
|
The default setting will use the shared multimedia directory by default (located into `/home/yunohost.multimedia/share`), you may change this setting in `__DATA_DIR__/.config/UMS/UMS.conf` with the setting "folders"
|
||||||
|
|
||||||
### Limitations
|
### Limitations
|
||||||
|
|
||||||
- No multi-instance
|
|
||||||
- No User integration with Yunohost
|
- No User integration with Yunohost
|
||||||
- work only on its own subdomain (ums.mydomain.tld, not on mydomain.tld/ums)
|
|
||||||
|
|
||||||
### Other infos
|
### Other infos
|
||||||
|
|
||||||
|
@ -19,7 +17,7 @@ If you can't find the server on a renderer, you may try the following trouble sh
|
||||||
- Wait a little bit : the first start up will intialized the database and if you have a lot of media, this may take a while
|
- Wait a little bit : the first start up will intialized the database and if you have a lot of media, this may take a while
|
||||||
- Wait a little more : the server will broadcast an ALIVE message every 30 sec, so it may take this long for a renderer to find it
|
- Wait a little more : the server will broadcast an ALIVE message every 30 sec, so it may take this long for a renderer to find it
|
||||||
- check if the service ums is running in the yunohost admin
|
- check if the service ums is running in the yunohost admin
|
||||||
- check on which network interface the server is annoucing : You may find the network and address used in `/home/yunohost.app/ums/.config/UMS/debug.log` or `/var/log/ums/ums.log`. Search for a line like `Using address /192.168.0.54 found on network interface: name:enp0s3 (enp0s3)`
|
- check on which network interface the server is annoucing : You may find the network and address used in `__DATA_DIR__/.config/UMS/debug.log` or `/var/log/ums/ums.log`. Search for a line like `Using address /192.168.0.54 found on network interface: name:enp0s3 (enp0s3)`
|
||||||
The subnet to be used should be the same as your renderer (ie : if your TV is on 192.168.0.X and ums on 192.168.1.X, this will not work)
|
The subnet to be used should be the same as your renderer (ie : if your TV is on 192.168.0.X and ums on 192.168.1.X, this will not work). You may check the network interface for you system with `ip address`
|
||||||
|
|
||||||
On small device (Raspberry for example), transco may be requiring too much power : try some alternate transcoder.
|
On small device (Raspberry for example), transco may be requiring too much power: try some alternate transcoder.
|
|
@ -2,16 +2,13 @@
|
||||||
|
|
||||||
A la première connexion, UMS vous demandera de créer un user administrateur. Cela peut-être désactivé plus tard dans les réglages.
|
A la première connexion, UMS vous demandera de créer un user administrateur. Cela peut-être désactivé plus tard dans les réglages.
|
||||||
|
|
||||||
Une fois installé, tous les réglages peuvent être trouvés dans `/home/yunohost.app/ums/.config/UMS/`
|
Une fois installé, tous les réglages peuvent être trouvés dans `__DATA_DIR__/.config/UMS/`
|
||||||
Les réglages sont plutôt bien documentés, vous pouvez les changer directement dans le fichier.
|
Les réglages sont plutôt bien documentés, vous pouvez les changer directement dans le fichier.
|
||||||
Le réglage par défaut utilisera le répertoire multimédia partagé (situé dans `/home/yunohost.multimedia/share`). Vous pouvez changer ce réglage dans le fichier `/home/yunohost.app/ums/.config/UMS/UMS.conf` sur le réglage "folders".
|
Le réglage par défaut utilisera le répertoire multimédia partagé (situé dans `/home/yunohost.multimedia/share`). Vous pouvez changer ce réglage dans le fichier `__DATA_DIR__/.config/UMS/UMS.conf` sur le réglage "folders".
|
||||||
|
|
||||||
### Limitations
|
### Limitations
|
||||||
|
|
||||||
- pas de multiinstance
|
- Pas d'intégration des utilisateurs avec YunoHost
|
||||||
- Pas d'intégration des utilisateurs avec Yunohost
|
|
||||||
- fonctionne uniquement en sous-domaine (ums.mydomain.tld, et non mydomain.tld/ums)
|
|
||||||
- pas énormément testé
|
|
||||||
|
|
||||||
### Autres infos
|
### Autres infos
|
||||||
|
|
||||||
|
@ -19,6 +16,6 @@ Si vous ne trouvez pas le serveur sur vos renderer, vous pouvez essayer les truc
|
||||||
- Attendez un petit peu : lors du premier démarrage, UMS va indexer tous vos médias et ceci peut prendre un certain temps si vous en avez beaucoup
|
- Attendez un petit peu : lors du premier démarrage, UMS va indexer tous vos médias et ceci peut prendre un certain temps si vous en avez beaucoup
|
||||||
- Attendez encore un peu : le serveur s'annonce par un message ALIVE toutes les 30 sec, donc cela peut prendre tout ce temps avant qu'un renderer ne le trouve
|
- Attendez encore un peu : le serveur s'annonce par un message ALIVE toutes les 30 sec, donc cela peut prendre tout ce temps avant qu'un renderer ne le trouve
|
||||||
- Vérifiez bien que le service ums tourne dans l'interface d'administration de yunohost
|
- Vérifiez bien que le service ums tourne dans l'interface d'administration de yunohost
|
||||||
- Vérifiez sur quel interface réseau ums s'annonce. Vous pouvez trouver l'adresse utilisée et le réseau dans `/home/yunohost.app/ums/.config/UMS/debug.log` ou `/var/log/ums/ums.log`. Cherchez une ligne ressemblant à `Using address /192.168.0.54 found on network interface: name:enp0s3 (enp0s3)`. Le sous-réseau utilisé doit être le même que le renderer (ie : si votre TV est sur 192.168.0.X et ums sur 192.168.1.X, cela ne marchera pas)
|
- Vérifiez sur quel interface réseau ums s'annonce. Vous pouvez trouver l'adresse utilisée et le réseau dans `__DATA_DIR__/.config/UMS/debug.log` ou `/var/log/ums/ums.log`. Cherchez une ligne ressemblant à `Using address /192.168.0.54 found on network interface: name:enp0s3 (enp0s3)`. Le sous-réseau utilisé doit être le même que le renderer (ie : si votre TV est sur 192.168.0.X et ums sur 192.168.1.X, cela ne marchera pas). Vous pouvez vérifier les réseaux de votre système avec `ip address`
|
||||||
|
|
||||||
Sur de petits appareils (par exemple un raspberry), la transco peut demander trop de puissance, n'hésitez par à utiliser des transcodeur alternatifs.
|
Sur de petits appareils (par exemple un raspberry), la transco peut demander trop de puissance, n'hésitez pas à utiliser des transcodeurs alternatifs.
|
|
@ -1,3 +1,2 @@
|
||||||
Universal Media Server is a DLNA-compliant UPnP Media Server. It is capable of sharing video, audio and images between most modern devices.
|
Universal Media Server is a DLNA-compliant UPnP Media Server. It is capable of sharing video, audio and images between most modern devices.
|
||||||
|
|
||||||
The program streams or transcodes many different media formats with little or no configuration. It is powered by FFmpeg, MediaInfo, OpenSubtitles, Crowdin, MEncoder, tsMuxeR, AviSynth, VLC and more, which combine to offer support for a wide range of media formats.
|
The program streams or transcodes many different media formats with little or no configuration. It is powered by FFmpeg, MediaInfo, OpenSubtitles, Crowdin, MEncoder, tsMuxeR, AviSynth, VLC and more, which combine to offer support for a wide range of media formats.
|
7
doc/PRE_UPGRADE.d/13.5.0~ynh2.md
Normal file
7
doc/PRE_UPGRADE.d/13.5.0~ynh2.md
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
Changelog:
|
||||||
|
|
||||||
|
News:
|
||||||
|
- Package is now in v2
|
||||||
|
|
||||||
|
Fixes:
|
||||||
|
- it is now possible to log into the UMS webserver in case authentication is activated
|
|
@ -1,78 +0,0 @@
|
||||||
{
|
|
||||||
"name": "Universal Media Server",
|
|
||||||
"id": "ums",
|
|
||||||
"packaging_format": 1,
|
|
||||||
"description": {
|
|
||||||
"en": "A DLNA, UPnP and HTTP(S) Media Server",
|
|
||||||
"fr": "Un Serveur Multimedia DLNA, UPnP et HTTP(S)"
|
|
||||||
},
|
|
||||||
"version": "13.5.0~ynh1",
|
|
||||||
"url": "www.universalmediaserver.com",
|
|
||||||
"upstream": {
|
|
||||||
"version": "13.5.0",
|
|
||||||
"license": "GPL-2.0-or-later",
|
|
||||||
"website": "www.universalmediaserver.com",
|
|
||||||
"admindoc": "https://github.com/UniversalMediaServer/UniversalMediaServer/wiki",
|
|
||||||
"code": "https://github.com/UniversalMediaServer/UniversalMediaServer"
|
|
||||||
},
|
|
||||||
"license": "GPL-2.0-or-later",
|
|
||||||
"maintainer": {
|
|
||||||
"name": "Krakinou",
|
|
||||||
"email": "misterl56@hotmail.com"
|
|
||||||
},
|
|
||||||
"requirements": {
|
|
||||||
"yunohost": ">= 11.0.9"
|
|
||||||
},
|
|
||||||
"multi_instance": false,
|
|
||||||
"services": [
|
|
||||||
"nginx"
|
|
||||||
],
|
|
||||||
"arguments": {
|
|
||||||
"install": [
|
|
||||||
{
|
|
||||||
"name": "domain",
|
|
||||||
"type": "domain",
|
|
||||||
"help": {
|
|
||||||
"en": "UMS require its own subdomain",
|
|
||||||
"fr": "UMS a besoin de son propre sous-domaine"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "is_public",
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true,
|
|
||||||
"help": {
|
|
||||||
"en": "Everybody will be able to access your media on the internet without connecting to Yunohost",
|
|
||||||
"fr": "Tout le monde pourra voir vos media sans se connecter à Yunohost"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "server_name",
|
|
||||||
"type": "string",
|
|
||||||
"example": "MyUMS",
|
|
||||||
"default": "UniversalMediaServer",
|
|
||||||
"ask": {
|
|
||||||
"en": "By which name should UMS be identified by your renderer",
|
|
||||||
"fr": "Par quel nom UMS doit-il être identifié par vos appareils"
|
|
||||||
},
|
|
||||||
"help": {
|
|
||||||
"en": "This has no impact on the way the server will work and is only use to identify it on the network",
|
|
||||||
"fr": "Ceci n a aucun impact sur le fonctionnement du serveur et sert uniquement à l identifier sur le réseau"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "interface",
|
|
||||||
"type": "string",
|
|
||||||
"default": "eth0",
|
|
||||||
"ask": {
|
|
||||||
"en": "Which network interface do you want to use?",
|
|
||||||
"fr": "Quel réseau souhaitez vous utiliser?"
|
|
||||||
},
|
|
||||||
"help": {
|
|
||||||
"en": "On lan, the interface is usually eth0, on wifi it s usually wlan0",
|
|
||||||
"fr": "En filaire, l interface est souvent eth0, en wifi wlan0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
93
manifest.toml
Normal file
93
manifest.toml
Normal file
|
@ -0,0 +1,93 @@
|
||||||
|
packaging_format = 2
|
||||||
|
|
||||||
|
id = "ums"
|
||||||
|
name = "Universal Media Server"
|
||||||
|
description.en = "A DLNA, UPnP and HTTP(S) Media Server"
|
||||||
|
description.fr = "Un Serveur Multimedia DLNA, UPnP et HTTP(S)"
|
||||||
|
|
||||||
|
version = "13.5.0~ynh2"
|
||||||
|
|
||||||
|
maintainers = ["Krakinou"]
|
||||||
|
|
||||||
|
[upstream]
|
||||||
|
license = "GPL-2.0-or-later"
|
||||||
|
website = "www.universalmediaserver.com"
|
||||||
|
admindoc = "https://github.com/UniversalMediaServer/UniversalMediaServer/wiki"
|
||||||
|
code = "https://github.com/UniversalMediaServer/UniversalMediaServer"
|
||||||
|
|
||||||
|
[integration]
|
||||||
|
yunohost = ">= 11.1.18"
|
||||||
|
architectures = "all"
|
||||||
|
multi_instance = false
|
||||||
|
ldap = false
|
||||||
|
sso = false
|
||||||
|
disk = "270M"
|
||||||
|
ram.build = "350M"
|
||||||
|
ram.runtime = "350M"
|
||||||
|
|
||||||
|
[install]
|
||||||
|
[install.domain]
|
||||||
|
help.en = "UMS require its own subdomain"
|
||||||
|
help.fr = "UMS a besoin de son propre sous-domaine"
|
||||||
|
type = "domain"
|
||||||
|
|
||||||
|
[install.init_main_permission]
|
||||||
|
help.en = "Everybody will be able to access your media on the internet without connecting to Yunohost"
|
||||||
|
help.fr = "Tout le monde pourra voir vos media sans se connecter à Yunohost"
|
||||||
|
type = "group"
|
||||||
|
default = "visitors"
|
||||||
|
|
||||||
|
[install.server_name]
|
||||||
|
ask.en = "By which name should UMS be identified by your renderer"
|
||||||
|
ask.fr = "Par quel nom UMS doit-il être identifié par vos appareils"
|
||||||
|
help.en = "This has no impact on the way the server will work and is only use to identify it on the network"
|
||||||
|
help.fr = "Ceci n a aucun impact sur le fonctionnement du serveur et sert uniquement à l identifier sur le réseau"
|
||||||
|
type = "string"
|
||||||
|
example = "MyUMS"
|
||||||
|
default = "UniversalMediaServer"
|
||||||
|
|
||||||
|
[install.interface]
|
||||||
|
ask.en = "Which network interface do you want to use?"
|
||||||
|
ask.fr = "Quel réseau souhaitez vous utiliser?"
|
||||||
|
help.en = "On lan, the interface is usually eth0, on wifi it s usually wlan0"
|
||||||
|
help.fr = "En filaire, l interface est souvent eth0, en wifi wlan0"
|
||||||
|
type = "string"
|
||||||
|
default = "eth0"
|
||||||
|
|
||||||
|
[resources]
|
||||||
|
[resources.sources.main]
|
||||||
|
arm64.url = "https://github.com/UniversalMediaServer/UniversalMediaServer/releases/download/13.5.0/UMS-13.5.0-arm64.tgz"
|
||||||
|
arm64.sha256 = "b916a56a24e70d5454cbffdbd6140e4d20837f1187e6f6f437574c0244b100de"
|
||||||
|
amd64.url = "https://github.com/UniversalMediaServer/UniversalMediaServer/releases/download/13.5.0/UMS-13.5.0-x86_64.tgz"
|
||||||
|
amd64.sha256 = "1243c598fa2b3c4790399e7a13656b85fefefbe76c6332a38c7ae6bf15355c7b"
|
||||||
|
armhf.url = "https://github.com/UniversalMediaServer/UniversalMediaServer/releases/download/13.5.0/UMS-13.5.0-armhf.tgz"
|
||||||
|
armhf.sha256 = "ac00cf598c0e1b572416c289ec36bb1578993fdf45348faf70558be2ecedb12b"
|
||||||
|
i386.url = "https://github.com/UniversalMediaServer/UniversalMediaServer/releases/download/13.5.0/UMS-13.5.0-x86.tgz"
|
||||||
|
i386.sha256 = "4535f500d19916aaf4c4d88d8448e8363898fbec81fac250db95b585f9542b8d"
|
||||||
|
|
||||||
|
autoupdate.strategy = "latest_github_release"
|
||||||
|
|
||||||
|
autoupdate.asset.arm64 = "*-arm64.tgz"
|
||||||
|
autoupdate.asset.amd64 = "*-x86_64.tgz"
|
||||||
|
autoupdate.asset.armhf = "*-armhf.tgz"
|
||||||
|
autoupdate.asset.i386 = "*-x86.tgz"
|
||||||
|
|
||||||
|
[resources.ports]
|
||||||
|
main.default = 9001
|
||||||
|
rend.default = 5001
|
||||||
|
rend.exposed = "TCP"
|
||||||
|
|
||||||
|
[resources.system_user]
|
||||||
|
#UMS require a home path for the user as config files are stored in there
|
||||||
|
home = '/home/yunohost.app/__APP__'
|
||||||
|
|
||||||
|
[resources.install_dir]
|
||||||
|
|
||||||
|
[resources.data_dir]
|
||||||
|
|
||||||
|
[resources.permissions]
|
||||||
|
main.url = "/"
|
||||||
|
main.auth_header=false
|
||||||
|
|
||||||
|
[resources.apt]
|
||||||
|
packages = "mediainfo dcraw"
|
|
@ -3,11 +3,18 @@
|
||||||
#=================================================
|
#=================================================
|
||||||
# COMMON VARIABLES
|
# COMMON VARIABLES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# dependencies used by the app
|
|
||||||
pkg_dependencies="mediainfo dcraw p7zip"
|
|
||||||
|
|
||||||
if [[ "$YNH_ARCH" == "armhf" ]] || [[ "$YNH_ARCH" == "arm64" ]]
|
if [[ "$YNH_ARCH" == "armhf" ]] || [[ "$YNH_ARCH" == "arm64" ]]
|
||||||
then
|
then
|
||||||
pkg_dependencies+=" openjdk-17-jre"
|
pkg_dependencies+=" openjdk-17-jre"
|
||||||
fi
|
fi
|
||||||
|
#=================================================
|
||||||
|
# PERSONAL HELPERS
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# EXPERIMENTAL HELPERS
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# FUTURE OFFICIAL HELPERS
|
||||||
|
#=================================================
|
|
@ -10,30 +10,6 @@
|
||||||
source ../settings/scripts/_common.sh
|
source ../settings/scripts/_common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# MANAGE SCRIPT FAILURE
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
ynh_clean_setup () {
|
|
||||||
### Remove this function if there's nothing to clean before calling the remove script.
|
|
||||||
true
|
|
||||||
}
|
|
||||||
# Exit if an error occurs during the execution of the script
|
|
||||||
ynh_abort_if_errors
|
|
||||||
|
|
||||||
ynh_print_warn --message="This script will only backup the app, no media will be saved"
|
|
||||||
ynh_print_warn --message="To save your media, please use a backup tool such as borg"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# LOAD SETTINGS
|
|
||||||
#=================================================
|
|
||||||
ynh_print_info --message="Loading installation settings..."
|
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
|
||||||
|
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
|
||||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DECLARE DATA AND CONF FILES TO BACKUP
|
# DECLARE DATA AND CONF FILES TO BACKUP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -43,7 +19,13 @@ ynh_print_info --message="Declaring files to be backed up..."
|
||||||
# BACKUP THE APP MAIN DIR
|
# BACKUP THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_backup --src_path="$final_path"
|
ynh_backup --src_path="$install_dir"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# BACKUP THE DATA DIR
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_backup --src_path="$data_dir" --is_big
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE NGINX CONFIGURATION
|
# BACKUP THE NGINX CONFIGURATION
|
||||||
|
@ -51,13 +33,6 @@ ynh_backup --src_path="$final_path"
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# BACKUP FAIL2BAN CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
#ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf"
|
|
||||||
#ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC BACKUP
|
# SPECIFIC BACKUP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -72,12 +47,6 @@ ynh_backup --src_path="/etc/logrotate.d/$app"
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/systemd/system/$app.service"
|
ynh_backup --src_path="/etc/systemd/system/$app.service"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# BACKUP VARIOUS FILES
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
ynh_backup --src_path="/home/yunohost.app/$app/"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -10,60 +10,6 @@
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RETRIEVE ARGUMENTS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
old_domain=$YNH_APP_OLD_DOMAIN
|
|
||||||
old_path=$YNH_APP_OLD_PATH
|
|
||||||
|
|
||||||
new_domain=$YNH_APP_NEW_DOMAIN
|
|
||||||
new_path=$YNH_APP_NEW_PATH
|
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# LOAD SETTINGS
|
|
||||||
#=================================================
|
|
||||||
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)
|
|
||||||
port_web=$(ynh_app_setting_get --app=$app --key=port_web)
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=7
|
|
||||||
|
|
||||||
# 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
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
change_domain=0
|
|
||||||
if [ "$old_domain" != "$new_domain" ]
|
|
||||||
then
|
|
||||||
change_domain=1
|
|
||||||
fi
|
|
||||||
|
|
||||||
change_path=0
|
|
||||||
if [ "$old_path" != "$new_path" ]
|
|
||||||
then
|
|
||||||
change_path=1
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD MODIFICATIONS
|
# STANDARD MODIFICATIONS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -78,29 +24,7 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2
|
||||||
|
|
||||||
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
|
ynh_change_url_nginx_config
|
||||||
|
|
||||||
# Change the path in the NGINX config file
|
|
||||||
if [ $change_path -eq 1 ]
|
|
||||||
then
|
|
||||||
# Make a backup of the original NGINX config file if modified
|
|
||||||
ynh_backup_if_checksum_is_different --file="$nginx_conf_path"
|
|
||||||
# Set global variables for NGINX helper
|
|
||||||
domain="$old_domain"
|
|
||||||
path_url="$new_path"
|
|
||||||
# Create a dedicated NGINX config
|
|
||||||
ynh_add_nginx_config "port_web"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Change the domain for NGINX
|
|
||||||
if [ $change_domain -eq 1 ]
|
|
||||||
then
|
|
||||||
# Delete file checksum for the old conf file location
|
|
||||||
ynh_delete_file_checksum --file="$nginx_conf_path"
|
|
||||||
mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf
|
|
||||||
# Store file checksum for the new config file location
|
|
||||||
ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALISATION
|
# GENERIC FINALISATION
|
||||||
|
@ -111,13 +35,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=2
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RELOAD NGINX
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=2
|
|
||||||
|
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
130
scripts/install
130
scripts/install
|
@ -9,85 +9,12 @@
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# MANAGE SCRIPT FAILURE
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
ynh_clean_setup () {
|
|
||||||
### Remove this function if there's nothing to clean before calling the remove script.
|
|
||||||
true
|
|
||||||
}
|
|
||||||
# Exit if an error occurs during the execution of the script
|
|
||||||
ynh_abort_if_errors
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
domain=$YNH_APP_ARG_DOMAIN
|
|
||||||
path_url=/
|
|
||||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
|
||||||
server_name=$YNH_APP_ARG_SERVER_NAME
|
|
||||||
interface=$YNH_APP_ARG_INTERFACE
|
|
||||||
#upstream_version=$YNH_APP_MANIFEST_VERSION
|
|
||||||
upstream_version=$(ynh_app_upstream_version)
|
upstream_version=$(ynh_app_upstream_version)
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Validating installation parameters..." --weight=1
|
|
||||||
|
|
||||||
final_path=/opt/yunohost/$app
|
|
||||||
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
|
|
||||||
|
|
||||||
# Register (book) web path
|
|
||||||
ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# STORE SETTINGS FROM MANIFEST
|
|
||||||
#=================================================
|
|
||||||
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
|
|
||||||
#will be used when restoring
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# STANDARD MODIFICATIONS
|
|
||||||
#=================================================
|
|
||||||
# FIND AND OPEN A PORT
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Finding an available port..." --weight=1
|
|
||||||
|
|
||||||
# Find an available port
|
|
||||||
#port_web is used for the web interface while port_rend is used by video renderer
|
|
||||||
port_web=$(ynh_find_port --port=9001)
|
|
||||||
ynh_app_setting_set --app=$app --key=port_web --value=$port_web
|
|
||||||
port_rend=$(ynh_find_port --port=5001)
|
|
||||||
ynh_app_setting_set --app=$app --key=port_rend --value=$port_rend
|
|
||||||
|
|
||||||
# Open the port -- TO BE CHECKED IF REQUIRED
|
|
||||||
ynh_script_progression --message="Configuring firewall..." --weight=3
|
|
||||||
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port_rend
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# INSTALL DEPENDENCIES
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Installing dependencies..." --weight=30
|
|
||||||
|
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# CREATE DEDICATED USER
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Configuring system user..." --weight=1
|
|
||||||
|
|
||||||
# Create a system user
|
|
||||||
#UMS require a home path for the user as config files are stored in there
|
|
||||||
ynh_system_user_create --username=$app --home_dir=/home/yunohost.app/$app
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
#SETTING MULTIMEDIA DIRECTORY
|
#SETTING MULTIMEDIA DIRECTORY
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -101,24 +28,21 @@ ynh_multimedia_addaccess $app
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Setting up source files..." --weight=12
|
ynh_script_progression --message="Setting up source files..." --weight=12
|
||||||
|
|
||||||
ynh_app_setting_set --app=$app --key=final_path --value=$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" --source_id="$YNH_ARCH"
|
ynh_setup_source --dest_dir="$install_dir"
|
||||||
|
|
||||||
chmod 750 "$final_path"
|
chmod 750 "$install_dir"
|
||||||
chmod -R o-rwx "$final_path"
|
chmod -R o-rwx "$install_dir"
|
||||||
chown -R root:$app "$final_path"
|
chown -R $app:$app "$install_dir"
|
||||||
chown root:$app "$final_path/UMS.sh"
|
chown $app:$app "$install_dir/UMS.sh"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring NGINX web server..." --weight=4
|
ynh_script_progression --message="Configuring NGINX web server..." --weight=4
|
||||||
|
|
||||||
### `ynh_add_nginx_config` will use the file conf/nginx.conf
|
|
||||||
|
|
||||||
# Create a dedicated NGINX config
|
# Create a dedicated NGINX config
|
||||||
ynh_add_nginx_config "port_web"
|
ynh_add_nginx_config
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SYSTEMD
|
# SETUP SYSTEMD
|
||||||
|
@ -138,16 +62,15 @@ mkdir -p "/home/yunohost.app/$app/.config/UMS"
|
||||||
ynh_add_config --template="UMS.conf.default" --destination="/home/yunohost.app/$app/.config/UMS/UMS.conf"
|
ynh_add_config --template="UMS.conf.default" --destination="/home/yunohost.app/$app/.config/UMS/UMS.conf"
|
||||||
ynh_add_config --template="WEB.conf.default" --destination="/home/yunohost.app/$app/.config/UMS/WEB.conf"
|
ynh_add_config --template="WEB.conf.default" --destination="/home/yunohost.app/$app/.config/UMS/WEB.conf"
|
||||||
ynh_add_config --template="VirtualFolders.conf.default" --destination="/home/yunohost.app/$app/.config/UMS/VirtualFolders.conf"
|
ynh_add_config --template="VirtualFolders.conf.default" --destination="/home/yunohost.app/$app/.config/UMS/VirtualFolders.conf"
|
||||||
|
|
||||||
chown -R $app:$app "/home/yunohost.app/$app/.config"
|
chown -R $app:$app "/home/yunohost.app/$app/.config"
|
||||||
chmod -R 700 "/home/yunohost.app/$app/.config"
|
chmod -R 700 "/home/yunohost.app/$app/.config"
|
||||||
#chmod 600 "/home/yunohost.app/$app/.config/UMS/*"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
# SECURE FILES AND DIRECTORIES
|
# SECURE FILES AND DIRECTORIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Configuring log rotation..." --weight=1
|
ynh_script_progression --message="Configuring log rotation..." --weight=1
|
||||||
|
|
||||||
#TO BE CHECKED : debug.log file in ~/.config/UMS/
|
#TO BE CHECKED : debug.log file in ~/.config/UMS/
|
||||||
|
@ -170,45 +93,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||||
# Start a systemd service
|
# Start a systemd service
|
||||||
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SETUP FAIL2BAN
|
|
||||||
#=================================================
|
|
||||||
#ynh_script_progression --message="Configuring Fail2Ban..." --time --weight=1
|
|
||||||
|
|
||||||
# Create a dedicated Fail2Ban config
|
|
||||||
#ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SETUP SSOWAT
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Configuring permissions..." --weight=1
|
|
||||||
|
|
||||||
# Make app public if necessary
|
|
||||||
if [ $is_public -eq 1 ]
|
|
||||||
then
|
|
||||||
# Everyone can access the app.
|
|
||||||
# The "main" permission is automatically created before the install script.
|
|
||||||
ynh_permission_update --permission="main" --add="visitors"
|
|
||||||
fi
|
|
||||||
|
|
||||||
### N.B. : the following extra permissions only make sense if your app
|
|
||||||
### does have for example an admin interface or an api.
|
|
||||||
|
|
||||||
# Only the admin can access the admin panel of the app (if the app has an admin panel)
|
|
||||||
#ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin
|
|
||||||
|
|
||||||
# Everyone can access to the api part
|
|
||||||
# We don't want to display the tile in the sso so we put --show_tile="false"
|
|
||||||
# And we don't want that the YunoHost Admin can remove visitors group to this permission, so we put --protected="true"
|
|
||||||
#ynh_permission_create --permission="api" --url "/api" --allowed="visitors" --show_tile="false" --protected="true"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RELOAD NGINX
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
|
||||||
|
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -9,18 +9,6 @@
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# LOAD SETTINGS
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Loading installation settings..." --weight=1
|
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
|
||||||
|
|
||||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
|
||||||
port_web=$(ynh_app_setting_get --app=$app --key=port_web)
|
|
||||||
port_rend=$(ynh_app_setting_get --app=$app --key=port_rend)
|
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD REMOVE
|
# STANDARD REMOVE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -42,22 +30,6 @@ ynh_script_progression --message="Stopping and removing the systemd service..."
|
||||||
# Remove the dedicated systemd config
|
# Remove the dedicated systemd config
|
||||||
ynh_remove_systemd_config
|
ynh_remove_systemd_config
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# REMOVE DEPENDENCIES
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Removing dependencies..." --weight=5
|
|
||||||
|
|
||||||
# Remove metapackage and its dependencies
|
|
||||||
ynh_remove_app_dependencies
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# REMOVE APP MAIN DIR
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Removing app main directory..." --weight=2
|
|
||||||
|
|
||||||
# Remove the app directory securely
|
|
||||||
ynh_secure_remove --file="$final_path"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE NGINX CONFIGURATION
|
# REMOVE NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -74,22 +46,6 @@ ynh_script_progression --message="Removing logrotate configuration..." --weight=
|
||||||
# Remove the app-specific logrotate config
|
# Remove the app-specific logrotate config
|
||||||
ynh_remove_logrotate
|
ynh_remove_logrotate
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# CLOSE PORTS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
if yunohost firewall list | grep -q "\- $port_web$"
|
|
||||||
then
|
|
||||||
ynh_script_progression --message="Closing port $port_web..." --weight=2
|
|
||||||
ynh_exec_warn_less yunohost firewall disallow TCP $port_web
|
|
||||||
fi
|
|
||||||
|
|
||||||
if yunohost firewall list | grep -q "\- $port_rend$"
|
|
||||||
then
|
|
||||||
ynh_script_progression --message="Closing port $port_rend..." --weight=2
|
|
||||||
ynh_exec_warn_less yunohost firewall disallow TCP $port_rend
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC REMOVE
|
# SPECIFIC REMOVE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -99,16 +55,8 @@ fi
|
||||||
# Remove the log files
|
# Remove the log files
|
||||||
ynh_secure_remove --file="/var/log/$app"
|
ynh_secure_remove --file="/var/log/$app"
|
||||||
|
|
||||||
#=================================================
|
# remove the home folder
|
||||||
# GENERIC FINALIZATION
|
ynh_secure_remove --file="$data_dir"
|
||||||
#=================================================
|
|
||||||
# REMOVE DEDICATED USER
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Removing the dedicated system user..." --weight=1
|
|
||||||
|
|
||||||
# Delete a system user
|
|
||||||
ynh_system_user_delete --username=$app
|
|
||||||
ynh_secure_remove --file="/home/yunohost.app/$app"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
110
scripts/restore
110
scripts/restore
|
@ -10,65 +10,18 @@
|
||||||
source ../settings/scripts/_common.sh
|
source ../settings/scripts/_common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# MANAGE SCRIPT FAILURE
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
ynh_clean_setup () {
|
|
||||||
#### Remove this function if there's nothing to clean before calling the remove script.
|
|
||||||
true
|
|
||||||
}
|
|
||||||
# Exit if an error occurs during the execution of the script
|
|
||||||
ynh_abort_if_errors
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# LOAD SETTINGS
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Loading installation settings..." --weight=1
|
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
|
||||||
|
|
||||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
|
||||||
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
|
||||||
port_web=$(ynh_app_setting_get --app=$app --key=port_web)
|
|
||||||
port_rend=$(ynh_app_setting_get --app=$app --key=port_rend)
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# CHECK IF THE APP CAN BE RESTORED
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Validating restoration parameters..." --weight=1
|
|
||||||
|
|
||||||
test ! -d $final_path \
|
|
||||||
|| ynh_die --message="There is already a directory: $final_path "
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# STANDARD RESTORATION STEPS
|
|
||||||
#=================================================
|
|
||||||
# RESTORE THE NGINX CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE APP MAIN DIR
|
# RESTORE THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Restoring the app main directory..." --weight=5
|
ynh_script_progression --message="Restoring the app main directory..." --weight=5
|
||||||
|
|
||||||
ynh_restore_file --origin_path="$final_path"
|
ynh_restore_file --origin_path="$install_dir"
|
||||||
|
|
||||||
# Open the port -- TO BE CHECKED IF REQUIRED
|
chmod 750 "$install_dir"
|
||||||
ynh_script_progression --message="Configuring firewall..." --weight=3
|
chmod -R o-rwx "$install_dir"
|
||||||
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port_rend
|
chown -R $app:$app "$install_dir"
|
||||||
|
chown $app:$app "$install_dir/UMS.sh"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RECREATE THE DEDICATED USER
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Recreating the dedicated system user..." --weight=3
|
|
||||||
|
|
||||||
# Create the dedicated user (if not existing)
|
|
||||||
#UMS require a home path for the user as config files are stored in there
|
|
||||||
ynh_system_user_create --username=$app --home_dir=/home/yunohost.app/$app
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
#SETTING MULTIMEDIA DIRECTORY
|
#SETTING MULTIMEDIA DIRECTORY
|
||||||
|
@ -77,50 +30,23 @@ ynh_system_user_create --username=$app --home_dir=/home/yunohost.app/$app
|
||||||
ynh_multimedia_build_main_dir
|
ynh_multimedia_build_main_dir
|
||||||
ynh_multimedia_addaccess $app
|
ynh_multimedia_addaccess $app
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RESTORE USER RIGHTS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
# Restore permissions on app files
|
|
||||||
chmod 750 "$final_path"
|
|
||||||
chmod -R o-rwx "$final_path"
|
|
||||||
chown -R root:$app "$final_path"
|
|
||||||
chown root:$app "$final_path/UMS.sh"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RESTORE FAIL2BAN CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
#ynh_script_progression --message="Restoring the Fail2Ban configuration..." --time --weight=1
|
|
||||||
|
|
||||||
#ynh_restore_file "/etc/fail2ban/jail.d/$app.conf"
|
|
||||||
#ynh_restore_file "/etc/fail2ban/filter.d/$app.conf"
|
|
||||||
#ynh_systemd_action --action=restart --service_name=fail2ban
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SPECIFIC RESTORATION
|
|
||||||
#=================================================
|
|
||||||
# REINSTALL DEPENDENCIES
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Reinstalling dependencies..." --weight=15
|
|
||||||
|
|
||||||
# Define and install dependencies
|
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE SYSTEMD
|
# RESTORE SYSTEMD
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Restoring the systemd configuration..." --weight=1
|
ynh_script_progression --message="Restoring the systemd configuration..." --weight=1
|
||||||
|
|
||||||
|
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
|
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
|
||||||
systemctl enable $app.service --quiet
|
systemctl enable $app.service --quiet
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# INTEGRATE SERVICE IN YUNOHOST
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Integrating service in YunoHost..." --weight=2
|
|
||||||
|
|
||||||
yunohost service add $app --description="A DLNA, UPnP and HTTP(S) Media Server." --log=/var/log/$app/$app.log --needs_exposed_ports $port_rend
|
yunohost service add $app --description="A DLNA, UPnP and HTTP(S) Media Server." --log=/var/log/$app/$app.log --needs_exposed_ports $port_rend
|
||||||
|
|
||||||
|
|
||||||
|
mkdir -p /var/log/$app
|
||||||
|
|
||||||
|
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE VARIOUS FILES
|
# RESTORE VARIOUS FILES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -129,11 +55,6 @@ ynh_restore_file --origin_path="/home/yunohost.app/$app/"
|
||||||
chown -R $app:$app "/home/yunohost.app/$app/.config"
|
chown -R $app:$app "/home/yunohost.app/$app/.config"
|
||||||
chmod -R 700 "/home/yunohost.app/$app/.config"
|
chmod -R 700 "/home/yunohost.app/$app/.config"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RESTORE THE LOGROTATE CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
|
@ -142,13 +63,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC FINALIZATION
|
|
||||||
#=================================================
|
|
||||||
# RELOAD NGINX
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
|
||||||
|
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
115
scripts/upgrade
115
scripts/upgrade
|
@ -12,15 +12,7 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Loading installation settings..." --weight=1
|
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
|
||||||
|
|
||||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
|
||||||
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
|
||||||
port_web=$(ynh_app_setting_get --app=$app --key=port_web)
|
|
||||||
port_rend=$(ynh_app_setting_get --app=$app --key=port_rend)
|
|
||||||
upstream_version=$(ynh_app_upstream_version)
|
upstream_version=$(ynh_app_upstream_version)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -29,20 +21,6 @@ upstream_version=$(ynh_app_upstream_version)
|
||||||
|
|
||||||
upgrade_type=$(ynh_check_app_version_changed)
|
upgrade_type=$(ynh_check_app_version_changed)
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=10
|
|
||||||
|
|
||||||
# Backup the current version of the app
|
|
||||||
ynh_backup_before_upgrade
|
|
||||||
ynh_clean_setup () {
|
|
||||||
# Restore it if the upgrade fails
|
|
||||||
ynh_restore_upgradebackup
|
|
||||||
}
|
|
||||||
# Exit if an error occurs during the execution of the script
|
|
||||||
ynh_abort_if_errors
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ENSURE DOWNWARD COMPATIBILITY
|
# ENSURE DOWNWARD COMPATIBILITY
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -53,7 +31,7 @@ ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
||||||
if [ ! $(getent passwd $app | cut -d: -f6 | grep yunohost.app) ]
|
if [ ! $(getent passwd $app | cut -d: -f6 | grep yunohost.app) ]
|
||||||
then
|
then
|
||||||
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
|
||||||
usermod -m -d /home/yunohost.app/$app $app
|
usermod -m -d $install_dir $app
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#10.17.0, 10.17.1 & 10.16.0 had a bug that overwrite the media path at startup of the service.
|
#10.17.0, 10.17.1 & 10.16.0 had a bug that overwrite the media path at startup of the service.
|
||||||
|
@ -63,14 +41,22 @@ current_version=$(ynh_app_upstream_version --manifest="/etc/yunohost/apps/$app/m
|
||||||
if [ $current_version == "10.17.0" ] || [ $current_version == "10.16.0" ]
|
if [ $current_version == "10.17.0" ] || [ $current_version == "10.16.0" ]
|
||||||
then
|
then
|
||||||
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
|
||||||
ynh_replace_string --match_string="folders =/opt/yunohost/$app,/home/yunohost.app/$app" \
|
ynh_replace_string --match_string="folders =/opt/yunohost/$app,$install_dir" \
|
||||||
--replace_string="folders=/home/yunohost.multimedia/share" \
|
--replace_string="folders=/home/yunohost.multimedia/share" \
|
||||||
--target_file="/home/yunohost.app/$app/.config/UMS/UMS.conf"
|
--target_file="/home/yunohost.app/$app/.config/UMS/UMS.conf"
|
||||||
ynh_replace_string --match_string="folders_monitored =/opt/yunohost/$app,/home/yunohost.app/$app" \
|
ynh_replace_string --match_string="folders_monitored =/opt/yunohost/$app,$install_dir" \
|
||||||
--replace_string="folders_monitored=/home/yunohost.multimedia/share" \
|
--replace_string="folders_monitored=/home/yunohost.multimedia/share" \
|
||||||
--target_file="/home/yunohost.app/$app/.config/UMS/UMS.conf"
|
--target_file="/home/yunohost.app/$app/.config/UMS/UMS.conf"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#From packaging v1 to packaging v2 : "port_web" become "port". We need to handle this manually or
|
||||||
|
#the core go for a new port.
|
||||||
|
if [ ! -z $(ynh_app_setting_get --app=$app --key=port_web) ]; then
|
||||||
|
port=$port_web
|
||||||
|
ynh_app_setting_delete --app=$app --key=port_web
|
||||||
|
ynh_app_setting_set --app=$app --key=port --value=$port
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD UPGRADE STEPS
|
# STANDARD UPGRADE STEPS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -87,78 +73,28 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app
|
||||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Upgrading source files..." --weight=5
|
ynh_script_progression --message="Upgrading source files..." --weight=5
|
||||||
ynh_setup_source --dest_dir="$final_path" --source_id="$YNH_ARCH"
|
ynh_setup_source --dest_dir="$install_dir"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
chmod 750 "$install_dir"
|
||||||
|
chmod -R o-rwx "$install_dir"
|
||||||
|
chown -R $app:$app "$install_dir"
|
||||||
|
chown $app:$app "$install_dir/UMS.sh"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2
|
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2
|
||||||
|
|
||||||
# Create a dedicated NGINX config
|
# Create a dedicated NGINX config
|
||||||
ynh_add_nginx_config "port_web"
|
ynh_add_nginx_config
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# UPGRADE DEPENDENCIES
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Upgrading dependencies..." --weight=4
|
|
||||||
|
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# CREATE DEDICATED USER
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
|
|
||||||
|
|
||||||
# Create a dedicated user (if not existing)
|
|
||||||
ynh_system_user_create --username=$app --home_dir=/home/yunohost.app/$app
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SPECIFIC UPGRADE
|
|
||||||
#=================================================
|
|
||||||
# ...
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
#Close unwanted open port in firewall
|
|
||||||
if yunohost firewall list | grep -q "\- $port_web$"
|
|
||||||
then
|
|
||||||
ynh_script_progression --message="Closing port $port_web as it shouldn't be open..."
|
|
||||||
yunohost firewall disallow TCP $port_web 2>&1
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SETUP SYSTEMD
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Upgrading systemd configuration..." --weight=1
|
|
||||||
|
|
||||||
# Create a dedicated systemd config
|
# Create a dedicated systemd config
|
||||||
ynh_add_systemd_config
|
ynh_add_systemd_config
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC FINALIZATION
|
|
||||||
#=================================================
|
|
||||||
# SECURE FILES AND DIRECTORIES
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
# Set permissions on app files
|
|
||||||
chmod 750 "$final_path"
|
|
||||||
chmod -R o-rwx "$final_path"
|
|
||||||
chown -R root:$app "$final_path"
|
|
||||||
chown root:$app "$final_path/UMS.sh"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SETUP LOGROTATE
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1
|
|
||||||
|
|
||||||
# Use logrotate to manage app-specific logfile(s)
|
# Use logrotate to manage app-specific logfile(s)
|
||||||
ynh_use_logrotate --non-append
|
ynh_use_logrotate --non-append
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# INTEGRATE SERVICE IN YUNOHOST
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Integrating service in YunoHost..." --weight=2
|
|
||||||
|
|
||||||
yunohost service add $app --description="A DLNA, UPnP and HTTP(S) Media Server." --log=/var/log/$app/$app.log --needs_exposed_ports $port_rend
|
yunohost service add $app --description="A DLNA, UPnP and HTTP(S) Media Server." --log=/var/log/$app/$app.log --needs_exposed_ports $port_rend
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -168,21 +104,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=2
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# UPGRADE FAIL2BAN
|
|
||||||
#=================================================
|
|
||||||
#ynh_script_progression --message="Reconfiguring Fail2Ban..." --weight=1
|
|
||||||
|
|
||||||
# Create a dedicated Fail2Ban config
|
|
||||||
#ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RELOAD NGINX
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
|
||||||
|
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
5
tests.toml
Normal file
5
tests.toml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
test_format = 1.0
|
||||||
|
|
||||||
|
[default]
|
||||||
|
test_upgrade_from.fb78609.name = "13.5.0~ynh1"
|
||||||
|
test_upgrade_from.8e8e839.name = "13.4.1~ynh1"
|
Loading…
Add table
Reference in a new issue