├── .dockerignore ├── jira ├── site │ ├── conf │ │ ├── web.xml │ │ └── server.xml │ ├── temp │ │ └── dummy │ ├── classes │ │ └── templates │ │ │ └── email │ │ │ └── subject │ │ │ ├── issueassigned.vm │ │ │ ├── issueclosed.vm │ │ │ ├── issuecreated.vm │ │ │ ├── issuedeleted.vm │ │ │ ├── issuemoved.vm │ │ │ ├── issuereopened.vm │ │ │ ├── issueresolved.vm │ │ │ ├── issueupdated.vm │ │ │ ├── issuecommented.vm │ │ │ ├── issuecommentedited.vm │ │ │ ├── issuegenericevent.vm │ │ │ ├── issueworklogged.vm │ │ │ ├── issueworkstarted.vm │ │ │ ├── issueworkstopped.vm │ │ │ ├── issueworklogdeleted.vm │ │ │ ├── issueworklogupdated.vm │ │ │ └── subject.vm │ ├── cron.conf │ └── bin │ │ └── setenv.sh ├── launch.bash ├── Dockerfile └── common.bash ├── .gitignore ├── tweak.sql ├── Jenkinsfile ├── Makefile ├── UPGRADE.md └── README.md /.dockerignore: -------------------------------------------------------------------------------- 1 | .git* 2 | data 3 | build 4 | -------------------------------------------------------------------------------- /jira/site/conf/web.xml: -------------------------------------------------------------------------------- 1 | /srv/jira/base/conf/web.xml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | backup.db.gz 2 | backup.fs.gz 3 | data 4 | build 5 | -------------------------------------------------------------------------------- /jira/site/temp/dummy: -------------------------------------------------------------------------------- 1 | This directory needs to be available 2 | -------------------------------------------------------------------------------- /jira/site/classes/templates/email/subject/issueassigned.vm: -------------------------------------------------------------------------------- 1 | subject.vm -------------------------------------------------------------------------------- /jira/site/classes/templates/email/subject/issueclosed.vm: -------------------------------------------------------------------------------- 1 | subject.vm -------------------------------------------------------------------------------- /jira/site/classes/templates/email/subject/issuecreated.vm: -------------------------------------------------------------------------------- 1 | subject.vm -------------------------------------------------------------------------------- /jira/site/classes/templates/email/subject/issuedeleted.vm: -------------------------------------------------------------------------------- 1 | subject.vm -------------------------------------------------------------------------------- /jira/site/classes/templates/email/subject/issuemoved.vm: -------------------------------------------------------------------------------- 1 | subject.vm -------------------------------------------------------------------------------- /jira/site/classes/templates/email/subject/issuereopened.vm: -------------------------------------------------------------------------------- 1 | subject.vm -------------------------------------------------------------------------------- /jira/site/classes/templates/email/subject/issueresolved.vm: -------------------------------------------------------------------------------- 1 | subject.vm -------------------------------------------------------------------------------- /jira/site/classes/templates/email/subject/issueupdated.vm: -------------------------------------------------------------------------------- 1 | subject.vm -------------------------------------------------------------------------------- /jira/site/classes/templates/email/subject/issuecommented.vm: -------------------------------------------------------------------------------- 1 | subject.vm -------------------------------------------------------------------------------- /jira/site/classes/templates/email/subject/issuecommentedited.vm: -------------------------------------------------------------------------------- 1 | subject.vm -------------------------------------------------------------------------------- /jira/site/classes/templates/email/subject/issuegenericevent.vm: -------------------------------------------------------------------------------- 1 | subject.vm -------------------------------------------------------------------------------- /jira/site/classes/templates/email/subject/issueworklogged.vm: -------------------------------------------------------------------------------- 1 | subject.vm -------------------------------------------------------------------------------- /jira/site/classes/templates/email/subject/issueworkstarted.vm: -------------------------------------------------------------------------------- 1 | subject.vm -------------------------------------------------------------------------------- /jira/site/classes/templates/email/subject/issueworkstopped.vm: -------------------------------------------------------------------------------- 1 | subject.vm -------------------------------------------------------------------------------- /jira/site/classes/templates/email/subject/issueworklogdeleted.vm: -------------------------------------------------------------------------------- 1 | subject.vm -------------------------------------------------------------------------------- /jira/site/classes/templates/email/subject/issueworklogupdated.vm: -------------------------------------------------------------------------------- 1 | subject.vm -------------------------------------------------------------------------------- /jira/site/classes/templates/email/subject/subject.vm: -------------------------------------------------------------------------------- 1 | [$issue.componentObjects.iterator().next().name] ($issue.key) $issue.summary -------------------------------------------------------------------------------- /jira/site/cron.conf: -------------------------------------------------------------------------------- 1 | # clean up temporary files 2 | 30 0 * * * find /srv/jira/base/temp/ -mtime +30 -print | xargs rm 3 | 30 1 * * * find /srv/jira/home/temp/ -mtime +30 -print | xargs rm 4 | -------------------------------------------------------------------------------- /tweak.sql: -------------------------------------------------------------------------------- 1 | -- edit JIRA DB to connect to test LDAP 2 | UPDATE cwd_directory_attribute SET attribute_value = 's3cr3t' WHERE attribute_name='ldap.password'; 3 | UPDATE cwd_directory_attribute SET attribute_value = 'ldap://ldap.jenkins-ci.org' WHERE attribute_name='ldap.url'; 4 | 5 | -- JIRA should be running at http://localhost:8080/ 6 | UPDATE propertyentry e INNER JOIN propertystring s ON e.id=s.id AND e.PROPERTY_KEY='jira.baseurl' 7 | SET s.propertyvalue='http://localhost:8080'; 8 | -------------------------------------------------------------------------------- /jira/site/bin/setenv.sh: -------------------------------------------------------------------------------- 1 | # sourced by catalina.sh upon start 2 | 3 | # read the one shipped by Atlassian first 4 | . /srv/jira/base/bin/setenv.sh 5 | 6 | # tweak JVM heap settings to our liking. Remove what JIRA set, and insert our own 7 | export JAVA_OPTS="$(echo $JAVA_OPTS | sed -e 's/-Xms[^ ]*//' -e 's/-Xmx[^ ]*//' -e 's/-XX:MaxPermSize=[^ ]*//')" 8 | export JAVA_OPTS="-XX:MaxPermSize=256m -Xms1536m -Xmx2560m -XX:ReservedCodeCacheSize=384m $JAVA_OPTS" 9 | # Version 7.4 Add Garbage collection logging on Jira Startup 10 | export JAVA_OPTS="-XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintGCCause -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=20M -Xloggc:/srv/jira/home/logs/atlassian-jira-gc-`date +%F_%H-%M-%S`.log $JAVA_OPTS" 11 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env groovy 2 | 3 | def imageName = 'jenkinsciinfra/jira' 4 | 5 | properties([ 6 | buildDiscarder(logRotator(numToKeepStr: '5', artifactNumToKeepStr: '5')), 7 | pipelineTriggers([[$class:"SCMTrigger", scmpoll_spec:"H/15 * * * *"]]), 8 | ]) 9 | 10 | node('docker&&linux') { 11 | def container 12 | stage('Build Container') { 13 | timestamps { 14 | checkout scm 15 | sh 'git rev-parse HEAD > GIT_COMMIT' 16 | shortCommit = readFile('GIT_COMMIT').take(6) 17 | def imageTag = "${env.BUILD_ID}-build${shortCommit}" 18 | echo "Creating the container ${imageName}:${imageTag}" 19 | container = docker.build("${imageName}:${imageTag}", 'jira') 20 | } 21 | } 22 | 23 | /* Assuming we're not inside of a pull request or multibranch pipeline */ 24 | if (!(env.CHANGE_ID || env.BRANCH_NAME)) { 25 | stage('Publish container') { 26 | infra.withDockerCredentials { 27 | timestamps { container.push() } 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /jira/launch.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o errexit 3 | 4 | # install cron 5 | crontab ~/site/cron.conf 6 | sudo /usr/sbin/cron -f & 7 | 8 | . /usr/local/share/atlassian/common.bash 9 | 10 | rm -f /srv/jira/home/.jira-home.lock 11 | 12 | if [ -n "$DATABASE_URL" ]; then 13 | extract_database_url "$DATABASE_URL" DB /srv/jira/base/lib 14 | DB_JDBC_URL="$(xmlstarlet esc "$DB_JDBC_URL")" 15 | SCHEMA='' 16 | if [ "$DB_TYPE" != "mysql" ]; then 17 | SCHEMA='public' 18 | fi 19 | 20 | cat < /srv/jira/home/dbconfig.xml 21 | 22 | 23 | defaultDS 24 | default 25 | $DB_TYPE 26 | $SCHEMA 27 | 28 | $DB_JDBC_URL 29 | $DB_JDBC_DRIVER 30 | $DB_USER 31 | $DB_PASSWORD 32 | 20 33 | 20 34 | 30000 35 | 20 36 | true 37 | 300 38 | 39 | 40 | END 41 | fi 42 | 43 | # replace front-end reverse proxy setting in server.xml 44 | cat /srv/jira/site/conf/server.xml | sed -e "s,@@PROXY_NAME@@,$PROXY_NAME," -e "s,@@PROXY_PORT@@,$PROXY_PORT," -e "s,@@PROXY_SCHEME@@,$PROXY_SCHEME," > /tmp/server.xml 45 | cp /tmp/server.xml /srv/jira/site/conf/server.xml 46 | 47 | export CATALINA_BASE=/srv/jira/site 48 | export JAVA_OPTS="-Datlassian.plugins.enable.wait=300" 49 | exec /srv/jira/base/bin/start-jira.sh -fg 50 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: build tag 2 | IMAGENAME=jenkinsciinfra/jira 3 | TAG=$(shell date '+%Y%m%d_%H%M%S') 4 | 5 | build: build/jira.docker 6 | 7 | tag: build 8 | docker tag ${IMAGENAME} ${IMAGENAME}:${TAG} 9 | 10 | clean: 11 | rm -rf build 12 | 13 | startdb: 14 | # start a database instance 15 | docker run --name mariadb -d -p 3306:3306 \ 16 | -e MYSQL_ROOT_PASSWORD=s3cr3t \ 17 | -e MYSQL_USER=jira \ 18 | -e MYSQL_PASSWORD=raji \ 19 | -e MYSQL_DATABASE=jiradb \ 20 | mysql:5.5 --max_allowed_packet 256mb --collation-server=utf8_bin --character-set-server=utf8 21 | #echo "Waiting for MariaDB to come up" 22 | sleep 15 23 | echo "SET GLOBAL binlog_format = 'ROW';" | docker exec -i mariadb mysql --user=root --password=s3cr3t jiradb 24 | 25 | restoredb: 26 | # restore dump from DB 27 | gunzip -c backup.db.gz | docker exec -i mariadb mysql --user=jira --password=raji jiradb 28 | # tweak database for test 29 | cat tweak.sql | docker exec -i mariadb mysql --user=jira --password=raji jiradb 30 | 31 | restorefs: 32 | [ ! -d data ] || sudo rm -rf data 33 | mkdir data 34 | cd data; tar xvzf ../backup.fs.gz 35 | sudo chown -R 2001:2001 data 36 | 37 | startldap: 38 | @docker rm ldap || true 39 | docker run -d --name ldap \ 40 | -p 9389:389 jenkinsciinfra/mock-ldap 41 | 42 | run: build/jira.docker 43 | # start JIRA 44 | @docker rm jira > /dev/null 2>&1 || true 45 | docker run -t -i --name jira \ 46 | --link mariadb:db \ 47 | --link ldap:ldap.jenkins-ci.org \ 48 | -e PROXY_NAME=localhost \ 49 | -e PROXY_PORT=8080 \ 50 | -e PROXY_SCHEME=http \ 51 | -e JAVA_OPTS="-Xmx2048m -Xms2048m" \ 52 | -v `pwd`/data/home:/srv/jira/home \ 53 | -p 8080:8080 -e DATABASE_URL=mysql://jira:raji@db/jiradb ${IMAGENAME} 54 | 55 | 56 | build/jira.docker: jira/Dockerfile jira/launch.bash $(shell find jira/site/ -type f) 57 | @mkdir build || true 58 | docker build -t ${IMAGENAME} jira 59 | 60 | data: 61 | # extract dataset 62 | mkdir data 63 | cd data && tar xvzf ../backup.fs.gz 64 | -------------------------------------------------------------------------------- /jira/Dockerfile: -------------------------------------------------------------------------------- 1 | # Basics 2 | # 3 | FROM adoptopenjdk:8-jre-hotspot 4 | LABEL \ 5 | maintainer="Jenkins Infra team " 6 | 7 | # 8 | # When using a different version of JIRA, also be sure to tweak server.xml. 9 | # To do a proper merge, 10 | # 1. switch to the 'import' branch 11 | # 2. overwrite jira/server.xml by the prestine master from JIRA distribution 12 | # 3. commit the change to the 'import' branch 13 | # 4. switch to the 'master' branch and merge the 'import' branch, while resolving the conflict if any. 14 | # 15 | ENV JIRA_VERSION 7.13.12 16 | 17 | RUN \ 18 | apt-get update -y && \ 19 | apt-get install -y \ 20 | software-properties-common \ 21 | curl \ 22 | xmlstarlet \ 23 | fontconfig \ 24 | sudo && \ 25 | rm -rf /var/lib/apt/lists/* 26 | 27 | RUN \ 28 | /usr/sbin/groupadd --gid 1000 atlassian;\ 29 | /usr/sbin/groupadd --gid 2001 jira;\ 30 | /usr/sbin/useradd \ 31 | --create-home \ 32 | --home-dir /srv/jira \ 33 | --groups atlassian \ 34 | --uid 2001 \ 35 | --gid jira \ 36 | --shell /bin/bash \ 37 | jira 38 | 39 | RUN \ 40 | mkdir -p /srv/jira/base /srv/jira/site /srv/jira/home \ 41 | mkdir -p /usr/local/share/atlassian 42 | 43 | RUN \ 44 | curl -Lks https://www.atlassian.com/software/jira/downloads/binary/atlassian-jira-software-${JIRA_VERSION}.tar.gz -o /root/jira.tar.gz; \ 45 | tar zxf /root/jira.tar.gz \ 46 | --strip=1 \ 47 | -C /srv/jira/base; \ 48 | rm /root/jira.tar.gz 49 | 50 | RUN echo "jira.home = /srv/jira/home" > /srv/jira/base/atlassian-jira/WEB-INF/classes/jira-application.properties 51 | 52 | # Allow the user to start cron 53 | RUN echo "jira ALL=(ALL) NOPASSWD: /usr/sbin/cron" >> /etc/sudoers 54 | 55 | ADD launch.bash /launch 56 | ADD site /srv/jira/site 57 | COPY common.bash /usr/local/share/atlassian/common.bash 58 | 59 | RUN \ 60 | chown -R jira:jira /srv/jira && \ 61 | chown root:atlassian /usr/local/share/atlassian/common.bash 62 | 63 | # The compartmentalized URL that JIRA is going to be referenced as. 64 | ENV PROXY_SCHEME https 65 | ENV PROXY_NAME issues.jenkins-ci.org 66 | ENV PROXY_PORT 443 67 | 68 | WORKDIR /srv/jira 69 | VOLUME ["/srv/jira/home"] 70 | EXPOSE 8080 71 | USER jira 72 | CMD ["/launch"] 73 | -------------------------------------------------------------------------------- /UPGRADE.md: -------------------------------------------------------------------------------- 1 | # Upgrade Notes 2 | 3 | ## From 5.0.6 to 6.4.2 4 | ### InnoDB backend for cwd_membership & cwd_user_attributes 5 | During upgrade, index creation failed on these tables with an error like the following: 6 | ``` 7 | SQL Exception while executing the following: 8 | CREATE INDEX idx_mem_dir_parent_child ON cwd_membership (lower_parent_name, lower_child_name, membership_type, directory_id) 9 | Error was: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is 1000 bytes 10 | 2015-04-26 16:01:24,928 localhost-startStop-1 ERROR [core.entity.jdbc.DatabaseUtil] Could not create missing indices for entity "UserAttribute" 11 | ``` 12 | This problem is described in [JRA-24124](https://jira.atlassian.com/browse/JRA-24124), which recommend changing storage engine to InnoDB. Thus the following maintenance commands are necessary: 13 | ``` 14 | ALTER TABLE cwd_membership ENGINE=InnoDB; 15 | ALTER TABLE cwd_user_attributes ENGINE=InnoDB; 16 | ``` 17 | 18 | ### Long processing on UpgradeTask_Build6040 19 | It takes a long time during this process, which shows the following output in the log: 20 | ``` 21 | Performing Upgrade Task: Map existing usernames to userkeys for rename user. 22 | ``` 23 | This process can be monitored via `SELECT coount(*) FROM app_user;` on the server. The size of this table has to go up to 38000+ before this finishes. 24 | 25 | ### freedom sponsor plugin fails 26 | Page rendering fails with the following NPE: 27 | ``` 28 | Caused by: java.lang.NullPointerException 29 | at org.freedomsponsors.plugins.jira.SponsorThis.getContextMap(SponsorThis.java:27) 30 | at com.atlassian.jira.plugin.webfragment.contextproviders.AbstractJiraContextProvider.getContextMap(AbstractJiraContextProvider.java:32) 31 | at com.atlassian.plugin.web.model.AbstractWebItem.getContextMap(AbstractWebItem.java:30) 32 | at com.atlassian.plugin.web.model.DefaultWebLabel.getDisplayableLabel(DefaultWebLabel.java:55) 33 | at com.atlassian.plugin.web.DefaultWebInterfaceManager$WebItemConverter.apply(DefaultWebInterfaceManager.java:306) 34 | at com.atlassian.plugin.web.DefaultWebInterfaceManager$WebItemConverter.apply(DefaultWebInterfaceManager.java:290) 35 | ``` 36 | To correct this problem, I removed the freedom sponsor plugins from `$JIRA_HOME/plugins/installed-plugins`. 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JIRA Container for jenkins-ci.org 2 | 3 | [Repository Archived] If you want this repository to be updated, please contact us with the instructions at https://www.jenkins.io/chat/#jenkins-infra. 4 | 5 | This container defines JIRA behind issues.jenkins-ci.org. 6 | The container consists of three main pieces: 7 | 8 | * `/srv/jira/base`: Upstream JIRA image. Ideally we don't want to touch this at all, unless we absolutely have to. 9 | * `/srv/jira/site`: Container local customizations to JIRA image. This also acts as `$CATALINA_BASE` 10 | * `/srv/jira/home`: Persisted portion of the JIRA data, such as attachments 11 | 12 | The `site` portion includes our site-local customizations to JIRA, such as: 13 | 14 | * Adjustment to JVM memory size 15 | * Different templates for email notifications 16 | * Customized Tomcat configurations 17 | 18 | ## How to develop this container 19 | You can start this container with mock LDAP and DB. 20 | 21 | At the beginning of the development session, you do the following: 22 | 23 | * `make startldap` to start a mock LDAP container in the background 24 | * `make startdb` to start local mariadb container in the background. 25 | 26 | At this point, if you have access to the backup of JIRA database and home, do the following optional steps. 27 | Note that the backup database contains sensitive information, such as the password to access production LDAP, 28 | security vulnerabilities, and so on. So it shouldn't be passed around casually: 29 | 30 | * retrieve database dump as `backup.db.gz` 31 | * `make restoredb` to fill DB with a copy of production data 32 | * retrieve JIRA_HOME dump as `backup.fs.gz` 33 | * `make restorefs` to fill ./data with a copy of production data 34 | 35 | If you omit the above steps, the JIRA container will start empty. 36 | 37 | Finally, run `make run` to build and start JIRA container in the foreground. 38 | 39 | When its initialization sequence is all done, point the browser to `http://localhost:8080/`. 40 | 41 | Two valid users exist in mock LDAP container. 'kohsuke' and 'alice'. 42 | 'kohsuke' is a super user, 'alice' is a regular user. Password is both 'password' 43 | 44 | To make changes to the JIRA container, press Ctrl+C to kill JIRA container, 45 | make edits, and run `make run` again. 46 | 47 | ### Getting database & JIRA Home dumps 48 | Here is the script I use to get the necessary dump out of JIRA: 49 | ``` 50 | ssh jira@issues.jenkins-ci.org "mysqldump hudson_jira | gzip" > backup.db.gz 51 | 52 | mkdir copy || true 53 | pushd copy 54 | rsync -avz --exclude=export '--exclude=*.log' --exclude=caches --exclude=index --exclude=log --exclude=tmp jira@issues.jenkins-ci.org:home/ . 55 | tar cvzf ../backup.fs.gz . 56 | popd 57 | ``` 58 | 59 | 60 | ## TODO 61 | * Javamelody integration (?) mainly in dbconfig.xml 62 | * oom_adj 63 | -------------------------------------------------------------------------------- /jira/common.bash: -------------------------------------------------------------------------------- 1 | urldecode() { 2 | local data=${1//+/ } 3 | printf '%b' "${data//%/\x}" 4 | } 5 | 6 | parse_url() { 7 | local prefix=DATABASE 8 | [ -n "$2" ] && prefix=$2 9 | # extract the protocol 10 | local proto="`echo $1 | grep '://' | sed -e's,^\(.*://\).*,\1,g'`" 11 | local scheme="`echo $proto | sed -e 's,^\(.*\)://,\1,g'`" 12 | # remove the protocol 13 | local url=`echo $1 | sed -e s,$proto,,g` 14 | 15 | # extract the user and password (if any) 16 | local userpass="`echo $url | grep @ | cut -d@ -f1`" 17 | local pass=`echo $userpass | grep : | cut -d: -f2` 18 | if [ -n "$pass" ]; then 19 | local user=`echo $userpass | grep : | cut -d: -f1` 20 | else 21 | local user=$userpass 22 | fi 23 | 24 | # extract the host -- updated 25 | local hostport=`echo $url | sed -e s,$userpass@,,g | cut -d/ -f1` 26 | local port=`echo $hostport | grep : | cut -d: -f2` 27 | if [ -n "$port" ]; then 28 | local host=`echo $hostport | grep : | cut -d: -f1` 29 | else 30 | local host=$hostport 31 | fi 32 | 33 | # extract the path (if any) 34 | local full_path="`echo $url | grep / | cut -d/ -f2-`" 35 | local path="`echo $full_path | cut -d? -f1`" 36 | local query="`echo $full_path | grep ? | cut -d? -f2`" 37 | local -i rc=0 38 | 39 | [ -n "$proto" ] && eval "export ${prefix}_SCHEME=\"$scheme\"" || rc=$? 40 | [ -n "$user" ] && eval "export ${prefix}_USER=\"`urldecode $user`\"" || rc=$? 41 | [ -n "$pass" ] && eval "export ${prefix}_PASSWORD=\"`urldecode $pass`\"" || rc=$? 42 | [ -n "$host" ] && eval "export ${prefix}_HOST=\"`urldecode $host`\"" || rc=$? 43 | [ -n "$port" ] && eval "export ${prefix}_PORT=\"`urldecode $port`\"" || rc=$? 44 | [ -n "$path" ] && eval "export ${prefix}_NAME=\"`urldecode $path`\"" || rc=$? 45 | [ -n "$query" ] && eval "export ${prefix}_QUERY=\"$query\"" || rc=$? 46 | } 47 | 48 | download_mysql_driver() { 49 | local driver="mysql-connector-java-5.1.30" 50 | if [ ! -f "$1/$driver-bin.jar" ]; then 51 | echo "Downloading MySQL JDBC Driver..." 52 | curl -L http://dev.mysql.com/get/Downloads/Connector-J/$driver.tar.gz | tar zxv -C /tmp 53 | cp /tmp/$driver/$driver-bin.jar $1/$driver-bin.jar 54 | fi 55 | } 56 | 57 | read_var() { 58 | eval "echo \$$1_$2" 59 | } 60 | 61 | extract_database_url() { 62 | local url="$1" 63 | local prefix="$2" 64 | local mysql_install="$3" 65 | 66 | eval "unset ${prefix}_PORT" 67 | parse_url "$url" $prefix 68 | case "$(read_var $prefix SCHEME)" in 69 | postgres|postgresql) 70 | if [ -z "$(read_var $prefix PORT)" ]; then 71 | eval "${prefix}_PORT=5432" 72 | fi 73 | local host_port_name="$(read_var $prefix HOST):$(read_var $prefix PORT)/$(read_var $prefix NAME)" 74 | local jdbc_driver="org.postgresql.Driver" 75 | local jdbc_url="jdbc:postgresql://$host_port_name" 76 | local hibernate_dialect="org.hibernate.dialect.PostgreSQLDialect" 77 | local database_type="postgres72" 78 | ;; 79 | mysql|mysql2) 80 | download_mysql_driver "$mysql_install" 81 | if [ -z "$(read_var $prefix PORT)" ]; then 82 | eval "${prefix}_PORT=3306" 83 | fi 84 | local host_port_name="$(read_var $prefix HOST):$(read_var $prefix PORT)/$(read_var $prefix NAME)" 85 | local jdbc_driver="com.mysql.jdbc.Driver" 86 | local jdbc_url="jdbc:mysql://$host_port_name?autoReconnect=true&characterEncoding=utf8&useUnicode=true&sessionVariables=default_storage_engine%3DInnoDB" 87 | local hibernate_dialect="org.hibernate.dialect.MySQLDialect" 88 | local database_type="mysql" 89 | ;; 90 | *) 91 | echo "Unsupported database url scheme: $(read_var $prefix SCHEME)" 92 | exit 1 93 | ;; 94 | esac 95 | 96 | eval "${prefix}_JDBC_DRIVER=\"$jdbc_driver\"" 97 | eval "${prefix}_JDBC_URL=\"$jdbc_url\"" 98 | eval "${prefix}_DIALECT=\"$hibernate_dialect\"" 99 | eval "${prefix}_TYPE=\"$database_type\"" 100 | } 101 | -------------------------------------------------------------------------------- /jira/site/conf/server.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 30 | 31 | 32 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 45 | 46 | 51 | 52 | 53 | 72 | 73 | 97 | 105 | 106 | 107 | 118 | 119 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 137 | 138 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 174 | 176 | 177 | 178 | 179 | 180 | --------------------------------------------------------------------------------