mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 01:15:44 +01:00
added server port configuration for mod_jk and mod_proxy
This commit is contained in:
@@ -94,6 +94,17 @@ public class ScmConfiguration
|
|||||||
return pluginUrl;
|
return pluginUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method description
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int getPort()
|
||||||
|
{
|
||||||
|
return port;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method description
|
* Method description
|
||||||
*
|
*
|
||||||
@@ -173,6 +184,17 @@ public class ScmConfiguration
|
|||||||
this.pluginUrl = pluginUrl;
|
this.pluginUrl = pluginUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method description
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param port
|
||||||
|
*/
|
||||||
|
public void setPort(int port)
|
||||||
|
{
|
||||||
|
this.port = port;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method description
|
* Method description
|
||||||
*
|
*
|
||||||
@@ -201,6 +223,9 @@ public class ScmConfiguration
|
|||||||
@XmlElement(name = "plugin-url")
|
@XmlElement(name = "plugin-url")
|
||||||
private String pluginUrl = DEFAULT_PLUGINURL;
|
private String pluginUrl = DEFAULT_PLUGINURL;
|
||||||
|
|
||||||
|
/** Field description */
|
||||||
|
private int port = -1;
|
||||||
|
|
||||||
/** Field description */
|
/** Field description */
|
||||||
private String servername = "localhost";
|
private String servername = "localhost";
|
||||||
|
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ public class RepositoryResource extends AbstractResource<Repository>
|
|||||||
StringBuilder url = new StringBuilder(request.getScheme());
|
StringBuilder url = new StringBuilder(request.getScheme());
|
||||||
|
|
||||||
url.append("://").append(configuration.getServername());
|
url.append("://").append(configuration.getServername());
|
||||||
url.append(":").append(request.getLocalPort());
|
url.append(":").append(getPort(request));
|
||||||
|
|
||||||
String ctxPath = request.getContextPath();
|
String ctxPath = request.getContextPath();
|
||||||
|
|
||||||
@@ -271,6 +271,35 @@ public class RepositoryResource extends AbstractResource<Repository>
|
|||||||
|
|
||||||
//~--- get methods ----------------------------------------------------------
|
//~--- get methods ----------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method description
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private int getPort(HttpServletRequest request)
|
||||||
|
{
|
||||||
|
int port = 0;
|
||||||
|
|
||||||
|
if (configuration.isEnableSSL())
|
||||||
|
{
|
||||||
|
port = configuration.getSslPort();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
port = configuration.getPort();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (port <= 0)
|
||||||
|
{
|
||||||
|
port = request.getLocalPort();
|
||||||
|
}
|
||||||
|
|
||||||
|
return port;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method description
|
* Method description
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -98,6 +98,11 @@ Sonia.config.ScmConfigPanel = Ext.extend(Sonia.config.ConfigPanel,{
|
|||||||
fieldLabel: 'Servername',
|
fieldLabel: 'Servername',
|
||||||
name: 'servername',
|
name: 'servername',
|
||||||
allowBlank: false
|
allowBlank: false
|
||||||
|
},{
|
||||||
|
xtype: 'textfield',
|
||||||
|
fieldLabel: 'Serverport',
|
||||||
|
name: 'port',
|
||||||
|
allowBlank: false
|
||||||
},{
|
},{
|
||||||
xtype: 'textfield',
|
xtype: 'textfield',
|
||||||
fieldLabel: 'Plugin repository',
|
fieldLabel: 'Plugin repository',
|
||||||
|
|||||||
Reference in New Issue
Block a user