From b18357e9cacf7d7c33efdac56ad016aa68a4e129 Mon Sep 17 00:00:00 2001 From: Gofannon <17145502+Gofannon@users.noreply.github.com> Date: Wed, 15 Apr 2020 21:55:47 +0200 Subject: [PATCH 1/8] Upgrade to version 10.6.0 --- README.md | 2 +- conf/app.src | 4 ++-- manifest.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5e361bd..0005039 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ If you have constrained bandwidth, you may set an upper limit for the bit rate o In addition to being a streaming media server, Airsonic works very well as a local jukebox. The intuitive web interface, as well as search and index facilities, are optimized for efficient browsing through large media libraries. Airsonic also comes with an integrated Podcast receiver, with many of the same features as you find in iTunes. -**Shipped version:** 10.5.0 +**Shipped version:** 10.6.0 ## Screenshots diff --git a/conf/app.src b/conf/app.src index e3469e7..7cedc14 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/airsonic/airsonic/releases/download/v10.5.0/airsonic.war -SOURCE_SUM=588e5362351406ac7e4eafede4fe3dae7b1e24eac6b6c330f51f413cfa184a5a +SOURCE_URL=https://github.com/airsonic/airsonic/releases/download/v10.6.0/airsonic.war +SOURCE_SUM=90fe5dbf83d71b83a955abbca8765ba144996ca8530648e93d1bb50d70fde827 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=false SOURCE_IN_SUBDIR=false diff --git a/manifest.json b/manifest.json index 31202d3..75242e7 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Stream and manage your music collection", "fr": "Streamez et gérez votre collection de musique" }, - "version": "10.5.0~ynh3", + "version": "10.6.0~ynh1", "url": "http://airsonic.github.io", "license": "GPL-3.0-or-later", "maintainer": { From c4a729568bf0cd1f1f71621bad9a0b457799b107 Mon Sep 17 00:00:00 2001 From: Gofannon <17145502+Gofannon@users.noreply.github.com> Date: Wed, 15 Apr 2020 21:56:19 +0200 Subject: [PATCH 2/8] Update system config to latest version --- conf/systemd.service | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/conf/systemd.service b/conf/systemd.service index 333c7d9..e05323a 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -20,5 +20,40 @@ ExecStart=/usr/bin/java \ User=__APP__ Group=__APP__ +# See https://www.freedesktop.org/software/systemd/man/systemd.exec.html +# for details +DevicePolicy=closed +DeviceAllow=char-alsa rw +NoNewPrivileges=yes +PrivateTmp=yes +PrivateUsers=yes +ProtectControlGroups=yes +ProtectKernelModules=yes +ProtectKernelTunables=yes +RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 +RestrictNamespaces=yes +RestrictRealtime=yes +SystemCallFilter=~@clock @debug @module @mount @obsolete @privileged @reboot @setuid @swap +ReadWritePaths=/var/airsonic + +# You can uncomment the following line if you're not using the jukebox +# This will prevent airsonic from accessing any real (physical) devices +#PrivateDevices=yes + +# You can change the following line to `strict` instead of `full` +# if you don't want airsonic to be able to +# write anything on your filesystem outside of AIRSONIC_HOME. +ProtectSystem=full + +# You can uncomment the following line if you don't have any media +# in /home/…. This will prevent airsonic from ever reading/writing anything there. +#ProtectHome=true + +# You can uncomment the following line if you're not using the OpenJDK. +# This will prevent processes from having a memory zone that is both writeable +# and executeable, making hacker's lifes a bit harder. +#MemoryDenyWriteExecute=yes + + [Install] WantedBy=multi-user.target \ No newline at end of file From e7e5fd33f540fcfccce95895956c06cbef9dd124 Mon Sep 17 00:00:00 2001 From: Gofannon <17145502+Gofannon@users.noreply.github.com> Date: Wed, 15 Apr 2020 22:55:24 +0200 Subject: [PATCH 3/8] fix startup of systemd service --- conf/systemd.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/systemd.service b/conf/systemd.service index e05323a..da45966 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -34,7 +34,7 @@ RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 RestrictNamespaces=yes RestrictRealtime=yes SystemCallFilter=~@clock @debug @module @mount @obsolete @privileged @reboot @setuid @swap -ReadWritePaths=/var/airsonic +ReadWritePaths=__FINALPATH__ # You can uncomment the following line if you're not using the jukebox # This will prevent airsonic from accessing any real (physical) devices From ad455ac3427ef9ae918a66c0f754e263187ee3e3 Mon Sep 17 00:00:00 2001 From: Gofannon <17145502+Gofannon@users.noreply.github.com> Date: Tue, 21 Apr 2020 00:07:33 +0200 Subject: [PATCH 4/8] update upstream version 10.6.1 (#29) --- README.md | 2 +- conf/app.src | 4 ++-- manifest.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0005039..439b202 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ If you have constrained bandwidth, you may set an upper limit for the bit rate o In addition to being a streaming media server, Airsonic works very well as a local jukebox. The intuitive web interface, as well as search and index facilities, are optimized for efficient browsing through large media libraries. Airsonic also comes with an integrated Podcast receiver, with many of the same features as you find in iTunes. -**Shipped version:** 10.6.0 +**Shipped version:** 10.6.1 ## Screenshots diff --git a/conf/app.src b/conf/app.src index 7cedc14..af99f60 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/airsonic/airsonic/releases/download/v10.6.0/airsonic.war -SOURCE_SUM=90fe5dbf83d71b83a955abbca8765ba144996ca8530648e93d1bb50d70fde827 +SOURCE_URL=https://github.com/airsonic/airsonic/releases/download/v10.6.1/airsonic.war +SOURCE_SUM=6b8bf98a5288fe982ead0c99489a66cbeb8b880fa2ab4fc86d9e07944e4cf335 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=false SOURCE_IN_SUBDIR=false diff --git a/manifest.json b/manifest.json index 75242e7..1371a7c 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Stream and manage your music collection", "fr": "Streamez et gérez votre collection de musique" }, - "version": "10.6.0~ynh1", + "version": "10.6.1~ynh1", "url": "http://airsonic.github.io", "license": "GPL-3.0-or-later", "maintainer": { From d658356895fffc18c1caded700258de9b9db1c3c Mon Sep 17 00:00:00 2001 From: Gofannon <17145502+Gofannon@users.noreply.github.com> Date: Wed, 22 Apr 2020 01:14:31 +0200 Subject: [PATCH 5/8] Remove comment + add new emplty line --- scripts/install | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 7c27ce8..a528c5c 100644 --- a/scripts/install +++ b/scripts/install @@ -67,8 +67,6 @@ ynh_app_setting_set --app=$app --key=port --value=$port #================================================= ynh_script_progression --message="Installing dependencies..." --weight=43 -# FIXME Should run "sudo update-alternatives --config java" -# See https://airsonic.github.io/docs/install/prerequisites/ ynh_install_app_dependencies $pkg_dependencies #================================================= @@ -289,4 +287,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" --last \ No newline at end of file +ynh_script_progression --message="Installation of $app completed" --last From 13feab3442ccfc5b81e6d40cd7f49c988416b59a Mon Sep 17 00:00:00 2001 From: Gofannon <17145502+Gofannon@users.noreply.github.com> Date: Fri, 15 May 2020 10:02:38 +0200 Subject: [PATCH 6/8] Upgrade to 10.6.2 --- README.md | 2 +- conf/app.src | 4 ++-- manifest.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 439b202..9a8700e 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ If you have constrained bandwidth, you may set an upper limit for the bit rate o In addition to being a streaming media server, Airsonic works very well as a local jukebox. The intuitive web interface, as well as search and index facilities, are optimized for efficient browsing through large media libraries. Airsonic also comes with an integrated Podcast receiver, with many of the same features as you find in iTunes. -**Shipped version:** 10.6.1 +**Shipped version:** 10.6.2 ## Screenshots diff --git a/conf/app.src b/conf/app.src index af99f60..2e22a93 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/airsonic/airsonic/releases/download/v10.6.1/airsonic.war -SOURCE_SUM=6b8bf98a5288fe982ead0c99489a66cbeb8b880fa2ab4fc86d9e07944e4cf335 +SOURCE_URL=https://github.com/airsonic/airsonic/releases/download/v10.6.2/airsonic.war +SOURCE_SUM=94b17d6a7859a9c029dcbcdc672f4d49bd605bf46bdf74ac51ea0d593db67860 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=false SOURCE_IN_SUBDIR=false diff --git a/manifest.json b/manifest.json index 1371a7c..a7b94f6 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Stream and manage your music collection", "fr": "Streamez et gérez votre collection de musique" }, - "version": "10.6.1~ynh1", + "version": "10.6.2~ynh1", "url": "http://airsonic.github.io", "license": "GPL-3.0-or-later", "maintainer": { From e1413757955b7cc402db2488e3cc741f15fcc7e7 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Mon, 10 Aug 2020 11:36:27 +0200 Subject: [PATCH 7/8] add ynh_multimedia_addaccess --- scripts/_common.sh | 11 +++++++++++ scripts/install | 2 ++ scripts/restore | 2 ++ scripts/upgrade | 2 ++ 4 files changed, 17 insertions(+) diff --git a/scripts/_common.sh b/scripts/_common.sh index a24a23d..4a86d89 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -60,3 +60,14 @@ ynh_multimedia_addfolder () { ./yunohost.multimedia-master/script/ynh_media_addfolder.sh --source="$source_dir" --dest="$dest_dir" } + +# Grant write access to multimedia directories to a specified user +# +# usage: ynh_multimedia_addaccess user_name +# +# | arg: user_name - User to be granted write access +ynh_multimedia_addaccess () { + local user_name=$1 + groupadd -f multimedia + usermod -a -G multimedia $user_name +} \ No newline at end of file diff --git a/scripts/install b/scripts/install index a528c5c..c5fef64 100644 --- a/scripts/install +++ b/scripts/install @@ -117,6 +117,8 @@ ynh_script_progression --message="Adding multimedia directories..." --weight=3 ynh_multimedia_build_main_dir ynh_multimedia_addfolder --source_dir="/home/yunohost.airsonic/Podcasts" --dest_dir="share/Podcasts" ynh_multimedia_addfolder --source_dir="/home/yunohost.airsonic/Playlists" --dest_dir="share/Playlists" +# Allow airsonic to write into these directories +ynh_multimedia_addaccess $app #================================================= # ENABLE "TRANSCODE" diff --git a/scripts/restore b/scripts/restore index ebe5684..cad5ecb 100644 --- a/scripts/restore +++ b/scripts/restore @@ -153,6 +153,8 @@ ynh_script_progression --message="Adding multimedia directories..." --weight=3 ynh_multimedia_build_main_dir ynh_multimedia_addfolder --source_dir="/home/yunohost.airsonic/Podcasts" --dest_dir="share/Podcasts" ynh_multimedia_addfolder --source_dir="/home/yunohost.airsonic/Playlists" --dest_dir="share/Playlists" +# Allow airsonic to write into these directories +ynh_multimedia_addaccess $app #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index bb53d22..a01bf84 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -138,6 +138,8 @@ ynh_script_progression --message="Adding multimedia directories..." --weight=3 ynh_multimedia_build_main_dir ynh_multimedia_addfolder --source_dir="/home/yunohost.airsonic/Podcasts" --dest_dir="share/Podcasts" ynh_multimedia_addfolder --source_dir="/home/yunohost.airsonic/Playlists" --dest_dir="share/Playlists" +# Allow airsonic to write into these directories +ynh_multimedia_addaccess $app if ! grep -q "PodcastFolder" $final_path/airsonic.properties; then echo "PodcastFolder=/home/yunohost.multimedia/share/Podcasts" >> $final_path/airsonic.properties From 162ed9ba0a04e136cd8217386682e584dbf7600b Mon Sep 17 00:00:00 2001 From: Gofannon <17145502+Gofannon@users.noreply.github.com> Date: Tue, 25 Aug 2020 12:53:26 +0200 Subject: [PATCH 8/8] Fix multimedia (#35) * fix typos * [enh] give write access to multimedia folder So music can be uploaded from web ui * bump version in manifest --- manifest.json | 2 +- scripts/_common.sh | 10 +++++----- scripts/install | 3 +++ scripts/upgrade | 3 +++ 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/manifest.json b/manifest.json index a7b94f6..03d442e 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Stream and manage your music collection", "fr": "Streamez et gérez votre collection de musique" }, - "version": "10.6.2~ynh1", + "version": "10.6.2~ynh2", "url": "http://airsonic.github.io", "license": "GPL-3.0-or-later", "maintainer": { diff --git a/scripts/_common.sh b/scripts/_common.sh index 4a86d89..c019450 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -27,15 +27,15 @@ ynh_multimedia_build_main_dir () { local checksum="806a827ba1902d6911095602a9221181" # Download yunohost.multimedia scripts - wget -nv https://github.com/YunoHost-Apps/yunohost.multimedia/archive/${ynh_media_release}.tar.gz + wget -nv https://github.com/YunoHost-Apps/yunohost.multimedia/archive/${ynh_media_release}.tar.gz # Check the control sum echo "${checksum} ${ynh_media_release}.tar.gz" | md5sum -c --status \ || ynh_die "Corrupt source" - # Check if the package acl is installed. Or install it. - ynh_package_is_installed 'acl' \ - || ynh_package_install acl + # Check if the package acl is installed. Or install it. + ynh_package_is_installed 'acl' \ + || ynh_package_install acl # Extract mkdir yunohost.multimedia-master @@ -70,4 +70,4 @@ ynh_multimedia_addaccess () { local user_name=$1 groupadd -f multimedia usermod -a -G multimedia $user_name -} \ No newline at end of file +} diff --git a/scripts/install b/scripts/install index c5fef64..af47ef7 100644 --- a/scripts/install +++ b/scripts/install @@ -120,6 +120,9 @@ ynh_multimedia_addfolder --source_dir="/home/yunohost.airsonic/Playlists" --dest # Allow airsonic to write into these directories ynh_multimedia_addaccess $app +# Allow Airsonic to write into these directories +ynh_multimedia_addaccess $app + #================================================= # ENABLE "TRANSCODE" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index a01bf84..3ee71ec 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -149,6 +149,9 @@ if ! grep -q "PlaylistFolder" $final_path/airsonic.properties; then echo "PlaylistFolder=/home/yunohost.multimedia/share/Playlists" >> $final_path/airsonic.properties fi +# Allow Airsonic to write into these directories +ynh_multimedia_addaccess $app + #================================================= # ENABLE "TRANSCODE" #=================================================