| | |
| | | import java.nio.charset.Charset; |
| | | import java.security.Principal; |
| | | import java.text.MessageFormat; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | |
| | | import javax.mail.MessagingException; |
| | | import javax.mail.internet.MimeBodyPart; |
| | | import javax.mail.internet.MimeMultipart; |
| | | import javax.naming.Context; |
| | | import javax.naming.InitialContext; |
| | | import javax.naming.NamingException; |
| | | import javax.servlet.ServletContext; |
| | | import javax.servlet.ServletContextEvent; |
| | | import javax.servlet.ServletContextListener; |
| | |
| | | model.description = getConfig(config, "description", ""); |
| | | model.originRepository = getConfig(config, "originRepository", null); |
| | | model.addOwners(ArrayUtils.fromString(getConfig(config, "owner", ""))); |
| | | model.useTickets = getConfig(config, "useTickets", false); |
| | | model.useDocs = getConfig(config, "useDocs", false); |
| | | model.useIncrementalPushTags = getConfig(config, "useIncrementalPushTags", false); |
| | | model.incrementalPushTagPrefix = getConfig(config, "incrementalPushTagPrefix", null); |
| | |
| | | model.verifyCommitter = getConfig(config, "verifyCommitter", false); |
| | | model.showRemoteBranches = getConfig(config, "showRemoteBranches", hasOrigin); |
| | | model.isFrozen = getConfig(config, "isFrozen", false); |
| | | model.showReadme = getConfig(config, "showReadme", false); |
| | | model.skipSizeCalculation = getConfig(config, "skipSizeCalculation", false); |
| | | model.skipSummaryMetrics = getConfig(config, "skipSummaryMetrics", false); |
| | | model.commitMessageRenderer = CommitMessageRenderer.fromName(getConfig(config, "commitMessageRenderer", |
| | |
| | | config.setString(Constants.CONFIG_GITBLIT, null, "description", repository.description); |
| | | config.setString(Constants.CONFIG_GITBLIT, null, "originRepository", repository.originRepository); |
| | | config.setString(Constants.CONFIG_GITBLIT, null, "owner", ArrayUtils.toString(repository.owners)); |
| | | config.setBoolean(Constants.CONFIG_GITBLIT, null, "useTickets", repository.useTickets); |
| | | config.setBoolean(Constants.CONFIG_GITBLIT, null, "useDocs", repository.useDocs); |
| | | config.setBoolean(Constants.CONFIG_GITBLIT, null, "useIncrementalPushTags", repository.useIncrementalPushTags); |
| | | if (StringUtils.isEmpty(repository.incrementalPushTagPrefix) || |
| | |
| | | config.setBoolean(Constants.CONFIG_GITBLIT, null, "verifyCommitter", repository.verifyCommitter); |
| | | config.setBoolean(Constants.CONFIG_GITBLIT, null, "showRemoteBranches", repository.showRemoteBranches); |
| | | config.setBoolean(Constants.CONFIG_GITBLIT, null, "isFrozen", repository.isFrozen); |
| | | config.setBoolean(Constants.CONFIG_GITBLIT, null, "showReadme", repository.showReadme); |
| | | config.setBoolean(Constants.CONFIG_GITBLIT, null, "skipSizeCalculation", repository.skipSizeCalculation); |
| | | config.setBoolean(Constants.CONFIG_GITBLIT, null, "skipSummaryMetrics", repository.skipSummaryMetrics); |
| | | config.setString(Constants.CONFIG_GITBLIT, null, "federationStrategy", |
| | |
| | | try { |
| | | String prepared = processCommitMessageRegex(repository.name, text); |
| | | return MarkdownUtils.transformMarkdown(prepared); |
| | | } catch (ParseException e) { |
| | | } catch (Exception e) { |
| | | logger.error("Failed to render commit message as markdown", e); |
| | | } |
| | | break; |
| | |
| | | logger.error(""); |
| | | } |
| | | |
| | | try { |
| | | // try to lookup JNDI env-entry for the baseFolder |
| | | InitialContext ic = new InitialContext(); |
| | | Context env = (Context) ic.lookup("java:comp/env"); |
| | | String val = (String) env.lookup("baseFolder"); |
| | | if (!StringUtils.isEmpty(val)) { |
| | | path = val; |
| | | } |
| | | } catch (NamingException n) { |
| | | logger.error("Failed to get JNDI env-entry: " + n.getExplanation()); |
| | | } |
| | | |
| | | File base = com.gitblit.utils.FileUtils.resolveParameter(Constants.contextFolder$, contextFolder, path); |
| | | base.mkdirs(); |
| | | |