| | |
| | | X509Metadata metadata = HttpUtils.getCertificateMetadata(httpRequest);
|
| | | if (user != null) {
|
| | | flagWicketSession(AuthenticationType.CERTIFICATE);
|
| | | logger.info(MessageFormat.format("{0} authenticated by client certificate {1} from {2}",
|
| | | logger.debug(MessageFormat.format("{0} authenticated by client certificate {1} from {2}",
|
| | | user.username, metadata.serialNumber, httpRequest.getRemoteAddr()));
|
| | | return user;
|
| | | } else {
|
| | |
| | | UserModel user = getUserModel(principal.getName());
|
| | | if (user != null) {
|
| | | flagWicketSession(AuthenticationType.CONTAINER);
|
| | | logger.info(MessageFormat.format("{0} authenticated by servlet container principal from {1}",
|
| | | logger.debug(MessageFormat.format("{0} authenticated by servlet container principal from {1}",
|
| | | user.username, httpRequest.getRemoteAddr()));
|
| | | return user;
|
| | | } else {
|
| | |
| | | UserModel user = authenticate(httpRequest.getCookies());
|
| | | if (user != null) {
|
| | | flagWicketSession(AuthenticationType.COOKIE);
|
| | | logger.info(MessageFormat.format("{0} authenticated by cookie from {1}",
|
| | | logger.debug(MessageFormat.format("{0} authenticated by cookie from {1}",
|
| | | user.username, httpRequest.getRemoteAddr()));
|
| | | return user;
|
| | | }
|
| | |
| | | UserModel user = authenticate(username, password);
|
| | | if (user != null) {
|
| | | flagWicketSession(AuthenticationType.CREDENTIALS);
|
| | | logger.info(MessageFormat.format("{0} authenticated by BASIC request header from {1}",
|
| | | logger.debug(MessageFormat.format("{0} authenticated by BASIC request header from {1}",
|
| | | user.username, httpRequest.getRemoteAddr()));
|
| | | return user;
|
| | | } else {
|
| | |
| | | } else {
|
| | | // not caching
|
| | | ProjectModel project = getProjectModel(userProject);
|
| | | if (project == null) {
|
| | | return null;
|
| | | }
|
| | | for (String repository : project.repositories) {
|
| | | if (repository.startsWith(userProject)) {
|
| | | RepositoryModel model = getRepositoryModel(repository);
|
| | |
| | | * @param toAddresses
|
| | | */
|
| | | public void sendMail(String subject, String message, String... toAddresses) {
|
| | | if (toAddresses == null || toAddresses.length == 0) {
|
| | | logger.debug(MessageFormat.format("Dropping message {0} because there are no recipients", subject));
|
| | | return;
|
| | | }
|
| | | try {
|
| | | Message mail = mailExecutor.createMessage(toAddresses);
|
| | | if (mail != null) {
|
| | |
| | | * @param toAddresses
|
| | | */
|
| | | public void sendHtmlMail(String subject, String message, String... toAddresses) {
|
| | | if (toAddresses == null || toAddresses.length == 0) {
|
| | | logger.debug(MessageFormat.format("Dropping message {0} because there are no recipients", subject));
|
| | | return;
|
| | | }
|
| | | try {
|
| | | Message mail = mailExecutor.createMessage(toAddresses);
|
| | | if (mail != null) {
|
| | |
| | | if (!StringUtils.isEmpty(openShift)) {
|
| | | // Gitblit is running in OpenShift/JBoss
|
| | | File base = new File(openShift);
|
| | | logger.info("EXPRESS contextFolder is " + contextFolder.getAbsolutePath());
|
| | |
|
| | | // gitblit.properties setting overrides
|
| | | File overrideFile = new File(base, "gitblit.properties");
|
| | | webxmlSettings.applyOverrides(overrideFile);
|
| | |
|
| | | // Copy the included scripts to the configured groovy folder
|
| | | File localScripts = new File(base, webxmlSettings.getString(Keys.groovy.scriptsFolder, "groovy"));
|
| | | String path = webxmlSettings.getString(Keys.groovy.scriptsFolder, "groovy");
|
| | | File localScripts = com.gitblit.utils.FileUtils.resolveParameter(Constants.baseFolder$, base, path);
|
| | | if (!localScripts.exists()) {
|
| | | File warScripts = new File(contextFolder, "/WEB-INF/data/groovy");
|
| | | if (!warScripts.equals(localScripts)) {
|