mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-02 11:36:05 +01:00
Change configuration keys
This commit is contained in:
@@ -255,7 +255,7 @@ object PluginRegistry {
|
||||
})
|
||||
.foreach(_.delete())
|
||||
|
||||
withHttpClient(settings.proxy) { httpClient =>
|
||||
withHttpClient(settings.pluginProxy) { httpClient =>
|
||||
val httpGet = new HttpGet(url.toString)
|
||||
try {
|
||||
val response = httpClient.execute(httpGet)
|
||||
|
||||
@@ -21,7 +21,7 @@ object PluginRepository {
|
||||
try {
|
||||
val url = new java.net.URL("https://plugins.gitbucket-community.org/releases/plugins.json")
|
||||
|
||||
withHttpClient(context.settings.proxy) { httpClient =>
|
||||
withHttpClient(context.settings.pluginProxy) { httpClient =>
|
||||
val httpGet = new HttpGet(url.toString)
|
||||
try {
|
||||
val response = httpClient.execute(httpGet)
|
||||
|
||||
@@ -70,14 +70,14 @@ trait SystemSettingsService {
|
||||
props.setProperty(SkinName, settings.skinName.toString)
|
||||
props.setProperty(ShowMailAddress, settings.showMailAddress.toString)
|
||||
props.setProperty(PluginNetworkInstall, settings.pluginNetworkInstall.toString)
|
||||
settings.proxy.foreach { proxy =>
|
||||
props.setProperty(ProxyHost, proxy.host)
|
||||
props.setProperty(ProxyPort, proxy.port.toString)
|
||||
settings.pluginProxy.foreach { proxy =>
|
||||
props.setProperty(PluginProxyHost, proxy.host)
|
||||
props.setProperty(PluginProxyPort, proxy.port.toString)
|
||||
proxy.user.foreach { user =>
|
||||
props.setProperty(ProxyUser, user)
|
||||
props.setProperty(PluginProxyUser, user)
|
||||
}
|
||||
proxy.password.foreach { password =>
|
||||
props.setProperty(ProxyPassword, password)
|
||||
props.setProperty(PluginProxyPassword, password)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,13 +158,13 @@ trait SystemSettingsService {
|
||||
getValue(props, SkinName, "skin-blue"),
|
||||
getValue(props, ShowMailAddress, false),
|
||||
getValue(props, PluginNetworkInstall, false),
|
||||
if (getValue(props, ProxyHost, "").nonEmpty) {
|
||||
if (getValue(props, PluginProxyHost, "").nonEmpty) {
|
||||
Some(
|
||||
Proxy(
|
||||
getValue(props, ProxyHost, ""),
|
||||
getValue(props, ProxyPort, 8080),
|
||||
getOptionValue(props, ProxyUser, None),
|
||||
getOptionValue(props, ProxyPassword, None)
|
||||
getValue(props, PluginProxyHost, ""),
|
||||
getValue(props, PluginProxyPort, 8080),
|
||||
getOptionValue(props, PluginProxyUser, None),
|
||||
getOptionValue(props, PluginProxyPassword, None)
|
||||
)
|
||||
)
|
||||
} else None
|
||||
@@ -198,7 +198,7 @@ object SystemSettingsService {
|
||||
skinName: String,
|
||||
showMailAddress: Boolean,
|
||||
pluginNetworkInstall: Boolean,
|
||||
proxy: Option[Proxy]
|
||||
pluginProxy: Option[Proxy]
|
||||
) {
|
||||
|
||||
def baseUrl(request: HttpServletRequest): String =
|
||||
@@ -322,10 +322,10 @@ object SystemSettingsService {
|
||||
private val SkinName = "skinName"
|
||||
private val ShowMailAddress = "showMailAddress"
|
||||
private val PluginNetworkInstall = "plugin.networkInstall"
|
||||
private val ProxyHost = "proxy.host"
|
||||
private val ProxyPort = "proxy.port"
|
||||
private val ProxyUser = "proxy.user"
|
||||
private val ProxyPassword = "proxy.password"
|
||||
private val PluginProxyHost = "plugin.proxy.host"
|
||||
private val PluginProxyPort = "plugin.proxy.port"
|
||||
private val PluginProxyUser = "plugin.proxy.user"
|
||||
private val PluginProxyPassword = "plugin.proxy.password"
|
||||
|
||||
private def getValue[A: ClassTag](props: java.util.Properties, key: String, default: A): A = {
|
||||
getSystemProperty(key).getOrElse(getEnvironmentVariable(key).getOrElse {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<hr>
|
||||
<fieldset>
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" id="useProxy" name="useProxy"@if(context.settings.proxy.isDefined){ checked} />
|
||||
<input type="checkbox" id="useProxy" name="useProxy"@if(context.settings.pluginProxy.isDefined){ checked} />
|
||||
Use proxy
|
||||
</label>
|
||||
</fieldset>
|
||||
@@ -17,28 +17,28 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-2" for="proxyHost">Proxy host</label>
|
||||
<div class="col-md-10">
|
||||
<input type="text" id="proxyHost" name="proxy.host" class="form-control" value="@context.settings.proxy.map(_.host)"/>
|
||||
<input type="text" id="proxyHost" name="proxy.host" class="form-control" value="@context.settings.pluginProxy.map(_.host)"/>
|
||||
<span id="error-proxy_host" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-2" for="proxyPort">Proxy port</label>
|
||||
<div class="col-md-10">
|
||||
<input type="text" id="proxyPort" name="proxy.port" class="form-control input-mini" value="@context.settings.proxy.map(_.port)"/>
|
||||
<input type="text" id="proxyPort" name="proxy.port" class="form-control input-mini" value="@context.settings.pluginProxy.map(_.port)"/>
|
||||
<span id="error-proxy_port" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-2" for="proxyUser">Proxy user</label>
|
||||
<div class="col-md-10">
|
||||
<input type="text" id="proxyUser" name="proxy.user" class="form-control" value="@context.settings.proxy.map(_.user)"/>
|
||||
<input type="text" id="proxyUser" name="proxy.user" class="form-control" value="@context.settings.pluginProxy.map(_.user)"/>
|
||||
<span id="error-proxy_user" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-2" for="proxyPassword">Proxy password</label>
|
||||
<div class="col-md-10">
|
||||
<input type="text" id="proxyPassword" name="proxy.password" class="form-control" value="@context.settings.proxy.map(_.password)"/>
|
||||
<input type="text" id="proxyPassword" name="proxy.password" class="form-control" value="@context.settings.pluginProxy.map(_.password)"/>
|
||||
<span id="error-proxy_password" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -139,7 +139,7 @@ class AvatarImageProviderSpec extends FunSpec with MockitoSugar {
|
||||
skinName = "skin-blue",
|
||||
showMailAddress = false,
|
||||
pluginNetworkInstall = false,
|
||||
proxy = None
|
||||
pluginProxy = None
|
||||
)
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user