Merge branch 'master' into pr-support-textmsg-in-email
commit 2e9155fbccff0ab2d9450f9e56ce7a364d55e255
2 parents ef67c94 + f33a30c
@Naoki Takezoe Naoki Takezoe authored on 18 Aug 2017
GitHub committed on 18 Aug 2017
Showing 5 changed files
View
4
src/main/scala/gitbucket/core/controller/SystemSettingsController.scala
"mailAttribute" -> trim(label("Mail address attribute", optional(text()))),
"tls" -> trim(label("Enable TLS", optional(boolean()))),
"ssl" -> trim(label("Enable SSL", optional(boolean()))),
"keystore" -> trim(label("Keystore", optional(text())))
)(Ldap.apply))
)(Ldap.apply)),
"skinName" -> trim(label("AdminLTE skin name", text(required)))
)(SystemSettings.apply).verifying { settings =>
Vector(
if(settings.ssh && settings.baseUrl.isEmpty){
Some("baseUrl" -> "Base URL is required if SSH access is enabled.")
View
10
src/main/scala/gitbucket/core/service/SystemSettingsService.scala
ldap.ssl.foreach(x => props.setProperty(LdapSsl, x.toString))
ldap.keystore.foreach(x => props.setProperty(LdapKeystore, x))
}
}
props.setProperty(SkinName, settings.skinName.toString)
using(new java.io.FileOutputStream(GitBucketConf)){ out =>
props.store(out, null)
}
}
getOptionValue[Boolean](props, LdapSsl, None),
getOptionValue(props, LdapKeystore, None)))
} else {
None
}
},
getValue(props, SkinName, "skin-blue")
)
}
}
 
sshPort: Option[Int],
useSMTP: Boolean,
smtp: Option[Smtp],
ldapAuthentication: Boolean,
ldap: Option[Ldap]){
ldap: Option[Ldap],
skinName: String){
def baseUrl(request: HttpServletRequest): String = baseUrl.fold(request.baseUrl)(_.stripSuffix("/"))
 
def sshAddress:Option[SshAddress] =
for {
private val LdapMailAddressAttribute = "ldap.mail_attribute"
private val LdapTls = "ldap.tls"
private val LdapSsl = "ldap.ssl"
private val LdapKeystore = "ldap.keystore"
private val SkinName = "skinName"
 
private def getValue[A: ClassTag](props: java.util.Properties, key: String, default: A): A = {
getSystemProperty(key).getOrElse(getEnvironmentVariable(key).getOrElse {
defining(props.getProperty(key)){ value =>
View
src/main/twirl/gitbucket/core/admin/system.scala.html
View
src/main/twirl/gitbucket/core/main.scala.html
View
src/test/scala/gitbucket/core/view/AvatarImageProviderSpec.scala