Custom external dns for sharing

Got an idea? Missing something? Post your feature request here.

Moderator: moderators

Custom external dns for sharing

Postby Josh Hawley » Sat Apr 21, 2012 3:31 am

There are many of us who can/will not use the sharing feature because it is locked down to xxxxxx.subsonic.org domain names only. You mentioned that the subsonic server would have no way of determining it's external ip/dns info as the primary reason for not changing this.

Make 2 modes. Automatic mode is the same as the current setup. Manual mode allows complete configuration of external url string prefix. Everything up to and including the optional port number should be editable. This would allow for port changes, protocol changes(such as https) and allow people to use their own dns or static ip in the url.

From a coding standpoint it seems just like adding an option that is stored with the others, and then doing some string concatenation. Best of all is that it would allow people the option if they want it, and the ease of use if they do not.
Josh Hawley
 
Posts: 9
Joined: Wed Jan 12, 2011 10:14 pm

Re: Custom external dns for sharing

Postby gurutech » Tue Apr 24, 2012 2:21 am

You can use a service like DynDNS.org or No-ip.com if you want your own custom domain (although you are limited to whatever these services offer.)

You will just have to manually configure the site to "port forward" to a specific port number at your IP address, then configure your router to forward that port number to the system actually hosting your SubSonic.
Image
gurutech
 
Posts: 492
Joined: Sun Jan 15, 2012 9:56 pm

Re: Custom external dns for sharing

Postby hakko » Wed Apr 25, 2012 4:01 pm

It's pretty simple to fix this for yourself by altering the source code.

In ShareService.java (http://subsonic.svn.sourceforge.net/vie ... iew=markup), replace

Code: Select all
public String getShareBaseUrl() {
return "http://" + settingsService.getUrlRedirectFrom() + ".subsonic.org/share/";
}


with something like

Code: Select all
public String getShareBaseUrl() {
       String host = settingsService.isUrlRedirectionEnabled() ?
             settingsService.getUrlRedirectFrom() + ".subsonic.org" :
             getCurrentIpAdress() + ":" + settingsService.getPort();
        return "http://" + host + "/share/";
}
   
private String getCurrentIpAdress() {
       String host = "localhost";
       try {
          InetAddress localHost = InetAddress.getLocalHost();
          host = localHost.getCanonicalHostName();
       } catch (UnknownHostException e) {
          LOG.warn("No host name found, are you connected to the internet?", e);
       }
       return host;
    }


And then remove the URL redirection check in http://subsonic.svn.sourceforge.net/vie ... iew=markup
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: Custom external dns for sharing

Postby dsync89 » Thu Oct 25, 2012 12:35 am

Is it possible to send and replace the .class file that has this part changes in the source code?
musicScrape @ Music Cabinet Mod
http://musicscrape.zapto.org:8080
dsync89
 
Posts: 72
Joined: Fri Oct 19, 2012 8:51 am

Re: Custom external dns for sharing

Postby hakko » Thu Oct 25, 2012 8:10 am

No, that'll depend on what version you're running. It's better to build the whole subsonic.war from scratch.
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden


Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 7 guests