Merge remote-tracking branch 'airsonic/pr/849'

Conflicts:
	airsonic-main/cve-suppressed.xml
	airsonic-main/src/main/java/org/airsonic/player/controller/JAXBWriter.java
	airsonic-main/src/main/java/org/airsonic/player/service/PodcastService.java
	pom.xml
master
Andrew DeMaria 6 years ago
commit 143a220719
No known key found for this signature in database
GPG Key ID: 0A3F5E91F8364EDF
  1. 59
      airsonic-main/pom.xml
  2. 8
      airsonic-main/src/main/java/org/airsonic/player/ajax/LyricsService.java
  3. 4
      airsonic-main/src/main/java/org/airsonic/player/controller/JAXBWriter.java
  4. 6
      airsonic-main/src/main/java/org/airsonic/player/controller/StatusChartController.java
  5. 8
      airsonic-main/src/main/java/org/airsonic/player/controller/UploadController.java
  6. 4
      airsonic-main/src/main/java/org/airsonic/player/controller/UserChartController.java
  7. 5
      airsonic-main/src/main/java/org/airsonic/player/service/JWTSecurityService.java
  8. 16
      airsonic-main/src/main/java/org/airsonic/player/service/PodcastService.java
  9. 8
      airsonic-main/src/main/java/org/airsonic/player/service/upnp/ApacheUpnpServiceConfiguration.java
  10. 2
      airsonic-main/src/main/java/org/airsonic/player/util/XMLUtil.java
  11. 9
      integration-test/pom.xml
  12. 9
      pom.xml

@ -13,7 +13,6 @@
</parent>
<properties>
<metrics.version>3.1.0</metrics.version>
<chameleon.version>1.2.1-RELEASE</chameleon.version>
<tomcat.server.scope>provided</tomcat.server.scope>
</properties>
@ -58,7 +57,6 @@
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-core</artifactId>
<version>${metrics.version}</version>
</dependency>
<!-- END Metrics -->
@ -76,7 +74,7 @@
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>2.3.1</version>
<version>2.3.3</version>
<scope>provided</scope>
</dependency>
<dependency>
@ -104,7 +102,7 @@
<dependency>
<groupId>com.auth0</groupId>
<artifactId>java-jwt</artifactId>
<version>3.3.0</version>
<version>3.4.1</version>
</dependency>
<dependency>
<groupId>org.springframework.ldap</groupId>
@ -139,7 +137,14 @@
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>2.1_3</version>
<version>3.2.9</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.10.3</version>
<scope>runtime</scope>
</dependency>
@ -169,13 +174,11 @@
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.10</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
</dependency>
<dependency>
@ -187,7 +190,6 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.3.2</version>
</dependency>
<dependency>
@ -218,27 +220,20 @@
<version>1.0-b2</version>
</dependency>
<dependency>
<groupId>org.directwebremoting</groupId>
<artifactId>dwr</artifactId>
<version>3.0.rc1</version>
<version>3.0.2-RELEASE</version>
</dependency>
<!--Needed by dwr-->
<dependency>
<groupId>com.yahoo.platform.yui</groupId>
<artifactId>yuicompressor</artifactId>
<version>2.3.6</version>
<version>2.4.8</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>ant-zip</groupId>
<artifactId>ant-zip</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>net.jthink</groupId>
<artifactId>jaudiotagger</artifactId>
@ -246,9 +241,9 @@
</dependency>
<dependency>
<groupId>jfree</groupId>
<groupId>org.jfree</groupId>
<artifactId>jfreechart</artifactId>
<version>1.0.11</version>
<version>1.5.0</version>
<exclusions>
<exclusion>
<groupId>junit</groupId>
@ -262,9 +257,9 @@
</dependency>
<dependency>
<groupId>jdom</groupId>
<groupId>org.jdom</groupId>
<artifactId>jdom</artifactId>
<version>1.0</version>
<version>2.0.2</version>
</dependency>
<dependency>
@ -276,20 +271,18 @@
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.moxy</artifactId>
<version>2.5.1</version>
<version>2.7.3</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
<scope>runtime</scope>
</dependency>
@ -302,7 +295,6 @@
<dependency>
<groupId>javax.mail</groupId>
<artifactId>javax.mail-api</artifactId>
<version>1.5.5</version>
</dependency>
<dependency>
@ -314,7 +306,6 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
@ -327,7 +318,6 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.10.19</version>
<scope>test</scope>
</dependency>
<dependency>
@ -339,19 +329,19 @@
<dependency>
<groupId>org.fourthline.cling</groupId>
<artifactId>cling-core</artifactId>
<version>2.0.1</version>
<version>2.1.2</version>
</dependency>
<dependency>
<groupId>org.fourthline.cling</groupId>
<artifactId>cling-support</artifactId>
<version>2.0.1</version>
<version>2.1.2</version>
</dependency>
<dependency>
<groupId>org.seamless</groupId>
<artifactId>seamless-util</artifactId>
<version>1.1.0</version>
<version>1.1.2</version>
</dependency>
<dependency>
@ -407,7 +397,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-configuration2</artifactId>
<version>2.1.1</version>
<version>2.4</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
@ -419,13 +409,12 @@
<dependency>
<groupId>com.mattbertolini</groupId>
<artifactId>liquibase-slf4j</artifactId>
<version>1.2.1</version>
<version>2.0.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.3</version>
<!-- commons-configuration2 requires during runtime -->
<scope>runtime</scope>
</dependency>
@ -438,7 +427,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>3.3.9</version>
<version>3.6.0</version>
</dependency>
<dependency>
@ -464,7 +453,6 @@
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.1.0.Final</version>
</dependency>
<dependency>
@ -510,7 +498,6 @@
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<version>1.5.5</version>
<scope>runtime</scope>
</dependency>
<dependency>

@ -27,10 +27,10 @@ import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.BasicResponseHandler;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.Namespace;
import org.jdom.input.SAXBuilder;
import org.jdom2.Document;
import org.jdom2.Element;
import org.jdom2.Namespace;
import org.jdom2.input.SAXBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

@ -23,8 +23,8 @@ import org.airsonic.player.util.StringUtil;
import org.apache.commons.io.IOUtils;
import org.eclipse.persistence.jaxb.JAXBContext;
import org.eclipse.persistence.jaxb.MarshallerProperties;
import org.jdom.Attribute;
import org.jdom.Document;
import org.jdom2.Attribute;
import org.jdom2.Document;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.subsonic.restapi.Error;

@ -22,7 +22,7 @@ package org.airsonic.player.controller;
import org.airsonic.player.domain.TransferStatus;
import org.airsonic.player.service.StatusService;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartUtilities;
import org.jfree.chart.ChartUtils;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.AxisLocation;
import org.jfree.chart.axis.ValueAxis;
@ -79,7 +79,7 @@ public class StatusChartController extends AbstractChartController {
}
TransferStatus status = statuses.get(index);
TimeSeries series = new TimeSeries("Kbps", Millisecond.class);
TimeSeries series = new TimeSeries("Kbps");
TransferStatus.SampleHistory history = status.getHistory();
long to = System.currentTimeMillis();
long from = to - status.getHistoryLengthMillis();
@ -154,7 +154,7 @@ public class StatusChartController extends AbstractChartController {
rangeAxis.setTickMarkPaint(fgColor);
rangeAxis.setAxisLinePaint(fgColor);
ChartUtilities.writeChartAsPNG(response.getOutputStream(), chart, IMAGE_WIDTH, IMAGE_HEIGHT);
ChartUtils.writeChartAsPNG(response.getOutputStream(), chart, IMAGE_WIDTH, IMAGE_HEIGHT);
return null;
}

@ -32,8 +32,6 @@ import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.apache.commons.io.IOUtils;
import org.apache.tools.zip.ZipEntry;
import org.apache.tools.zip.ZipFile;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -49,6 +47,8 @@ import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.*;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
/**
* Controller which receives uploaded files.
@ -170,7 +170,7 @@ public class UploadController {
try {
Enumeration<?> entries = zipFile.getEntries();
Enumeration<?> entries = zipFile.entries();
while (entries.hasMoreElements()) {
ZipEntry entry = (ZipEntry) entries.nextElement();
@ -231,10 +231,12 @@ public class UploadController {
start = System.currentTimeMillis();
}
@Override
public void start(String fileName) {
status.setFile(new File(fileName));
}
@Override
public void bytesRead(long bytesRead) {
// Throttle bitrate.

@ -22,7 +22,7 @@ package org.airsonic.player.controller;
import org.airsonic.player.domain.User;
import org.airsonic.player.service.SecurityService;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartUtilities;
import org.jfree.chart.ChartUtils;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.AxisLocation;
import org.jfree.chart.axis.CategoryAxis;
@ -69,7 +69,7 @@ public class UserChartController extends AbstractChartController {
int imageHeight = Math.max(IMAGE_MIN_HEIGHT, 15 * dataset.getColumnCount());
ChartUtilities.writeChartAsPNG(response.getOutputStream(), chart, IMAGE_WIDTH, imageHeight);
ChartUtils.writeChartAsPNG(response.getOutputStream(), chart, IMAGE_WIDTH, imageHeight);
return null;
}

@ -13,7 +13,6 @@ import org.springframework.stereotype.Service;
import org.springframework.web.util.UriComponents;
import org.springframework.web.util.UriComponentsBuilder;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.security.SecureRandom;
import java.util.Date;
@ -41,11 +40,7 @@ public class JWTSecurityService {
}
public static Algorithm getAlgorithm(String jwtKey) {
try {
return Algorithm.HMAC256(jwtKey);
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
}
private static String createToken(String jwtKey, String path, Date expireDate) {

@ -42,9 +42,9 @@ import org.apache.http.client.methods.HttpGet;
import org.apache.http.entity.ContentType;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.Namespace;
import org.jdom2.Document;
import org.jdom2.Element;
import org.jdom2.Namespace;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -95,6 +95,7 @@ public class PodcastService {
public PodcastService() {
ThreadFactory threadFactory = new ThreadFactory() {
@Override
public Thread newThread(Runnable r) {
Thread t = Executors.defaultThreadFactory().newThread(r);
t.setDaemon(true);
@ -126,6 +127,7 @@ public class PodcastService {
public synchronized void schedule() {
Runnable task = new Runnable() {
@Override
public void run() {
LOG.info("Starting scheduled Podcast refresh.");
refreshAllChannels(true);
@ -233,7 +235,7 @@ public class PodcastService {
}
private List<PodcastEpisode> filterAllowed(List<PodcastEpisode> episodes) {
List<PodcastEpisode> result = new ArrayList<PodcastEpisode>(episodes.size());
List<PodcastEpisode> result = new ArrayList<>(episodes.size());
for (PodcastEpisode episode : episodes) {
if (episode.getPath() == null || securityService.isReadAllowed(new File(episode.getPath()))) {
result.add(episode);
@ -292,6 +294,7 @@ public class PodcastService {
private void refreshChannels(final List<PodcastChannel> channels, final boolean downloadEpisodes) {
for (final PodcastChannel channel : channels) {
Runnable task = new Runnable() {
@Override
public void run() {
doRefreshChannel(channel, downloadEpisodes);
}
@ -300,7 +303,6 @@ public class PodcastService {
}
}
@SuppressWarnings({"unchecked"})
private void doRefreshChannel(PodcastChannel channel, boolean downloadEpisodes) {
InputStream in = null;
@ -409,6 +411,7 @@ public class PodcastService {
public void downloadEpisode(final PodcastEpisode episode) {
Runnable task = new Runnable() {
@Override
public void run() {
doDownloadEpisode(episode);
}
@ -418,7 +421,7 @@ public class PodcastService {
private void refreshEpisodes(PodcastChannel channel, List<Element> episodeElements) {
List<PodcastEpisode> episodes = new ArrayList<PodcastEpisode>();
List<PodcastEpisode> episodes = new ArrayList<>();
for (Element episodeElement : episodeElements) {
@ -462,6 +465,7 @@ public class PodcastService {
// Sort episode in reverse chronological order (newest first)
Collections.sort(episodes, new Comparator<PodcastEpisode>() {
@Override
public int compare(PodcastEpisode a, PodcastEpisode b) {
long timeA = a.getPublishDate() == null ? 0L : a.getPublishDate().getTime();
long timeB = b.getPublishDate() == null ? 0L : b.getPublishDate().getTime();

@ -20,10 +20,10 @@
package org.airsonic.player.service.upnp;
import org.fourthline.cling.DefaultUpnpServiceConfiguration;
import org.fourthline.cling.transport.impl.apache.StreamClientConfigurationImpl;
import org.fourthline.cling.transport.impl.apache.StreamClientImpl;
import org.fourthline.cling.transport.impl.apache.StreamServerConfigurationImpl;
import org.fourthline.cling.transport.impl.apache.StreamServerImpl;
import org.fourthline.cling.transport.impl.StreamClientConfigurationImpl;
import org.fourthline.cling.transport.impl.StreamClientImpl;
import org.fourthline.cling.transport.impl.StreamServerConfigurationImpl;
import org.fourthline.cling.transport.impl.StreamServerImpl;
import org.fourthline.cling.transport.spi.NetworkAddressFactory;
import org.fourthline.cling.transport.spi.StreamClient;
import org.fourthline.cling.transport.spi.StreamServer;

@ -1,6 +1,6 @@
package org.airsonic.player.util;
import org.jdom.input.SAXBuilder;
import org.jdom2.input.SAXBuilder;
public class XMLUtil {

@ -13,7 +13,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<cucumber.version>2.3.1</cucumber.version>
<cucumber.version>4.2.0</cucumber.version>
</properties>
<dependencies>
@ -59,7 +59,6 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
@ -90,7 +89,7 @@
<dependency>
<groupId>com.spotify</groupId>
<artifactId>docker-client</artifactId>
<version>8.13.1</version>
<version>8.14.5</version>
<scope>test</scope>
</dependency>
<dependency>
@ -116,13 +115,13 @@
<dependency>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-core</artifactId>
<version>2.6.0</version>
<version>2.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-matchers</artifactId>
<version>2.6.0</version>
<version>2.6.2</version>
<scope>test</scope>
</dependency>
<dependency>

@ -94,8 +94,7 @@
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
<!-- Cannot use 3.5.3/2 due to https://liquibase.jira.com/browse/CORE-2944 -->
<version>3.5.1</version>
<version>3.6.2</version>
</dependency>
<!-- Fix convergence issues -->
@ -107,12 +106,12 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.3.2</version>
<version>3.8.1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
<version>2.6</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
@ -132,7 +131,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>27.0-jre</version>
<version>27.0.1-jre</version>
</dependency>
</dependencies>
</dependencyManagement>

Loading…
Cancel
Save