Skip to content
This repository was archived by the owner on Sep 8, 2021. It is now read-only.

Fix DLNA/UPNP port, and expose them in Docker #1380

Merged
merged 3 commits into from
Nov 23, 2019

Conversation

randomnicode
Copy link
Contributor

@randomnicode randomnicode commented Oct 31, 2019

In response to and possible fix for #1379

  • Fixes the listening port to 4041 for UPNP/DLNA (otherwise an ephemeral port is auto-assigned)
    • Can be customized by a JVM variable UPNP_PORT
      • E.g. java -DUPNP_PORT=4042 -jar airsonic.war
  • Exposes tcp port 4041 in Dockerfile
  • Exposes udp port 1900 in Dockerfile (needed for SSDP in UPnP)
  • Removes an extraneous class

Note that if the default port is modified using UPNP_PORT, then user needs to expose and bind the custom port manually if running a container.

@randomnicode
Copy link
Contributor Author

@muff1nman moved port to SettingsService

@fxthomas fxthomas added the in: docker Issues in the test module. label Nov 10, 2019
@@ -290,6 +292,10 @@ private static String getFileSystemAppName() {
public static String getDefaultJDBCurl("") {
return "jdbc:hsqldb:file:" + getAirsonicHome().getPath() + "/db/" + getFileSystemAppName();
}

public static int getDefaultUPnpPort() {
return Optional.ofNullable(System.getProperty("UPNP_PORT")).map(x -> Integer.parseInt(x)).orElse(DEFAULT_UPNP_PORT);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency with all other settings, could you use the same kind of casing (e.g. UpnpPort) as the other keys and store it at the top of the file in a constant?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
in: docker Issues in the test module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants