diff --git a/.classpath b/.classpath index d531303bd..d23c6b9fc 100644 --- a/.classpath +++ b/.classpath @@ -1,131 +1,104 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.project b/.project index f2e777550..90c747bcb 100644 --- a/.project +++ b/.project @@ -15,14 +15,8 @@ - - org.eclipse.m2e.core.maven2Builder - - - - org.eclipse.m2e.core.maven2Nature org.eclipse.jdt.core.javanature net.sf.eclipsecs.core.CheckstyleNature diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..a98b76035 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,2 @@ +language: java + diff --git a/build.moxie b/build.moxie index 65ad9535e..0d07194ef 100644 --- a/build.moxie +++ b/build.moxie @@ -10,7 +10,7 @@ name: Gitblit description: pure Java Git solution groupId: com.gitblit artifactId: gitblit -version: 1.8.1-SNAPSHOT +version: 1.9.0-SNAPSHOT inceptionYear: 2011 # Current stable release @@ -66,14 +66,15 @@ sourceDirectories: resourceDirectories: - compile 'src/main/resources' +- test 'src/test/resources' - site 'src/site/resources' -# compile for Java 8 class format +# compile for Java 7 class format tasks: { 'mx:javac' : { - source: 1.8 - target: 1.8 - compiler: javac1.8 + source: 1.7 + target: 1.7 + compiler: javac1.7 encoding: UTF-8 # stop complaints about bootstrap classpath when compiling with Java 8 compilerArgs: '-Xlint:-options' @@ -104,8 +105,8 @@ repositories: central, eclipse-snapshots, eclipse, gitblit properties: { jetty.version : 9.2.13.v20150730 slf4j.version : 1.7.12 - wicket.version : 8.0.0-M2 - lucene.version : 4.10.4 + wicket.version : 7.8.0 + lucene.version : 5.5.2 jgit.version : 4.1.1.201511131810-r groovy.version : 2.4.4 bouncycastle.version : 1.52 @@ -145,9 +146,9 @@ dependencies: - compile 'org.apache.wicket:wicket-extensions:${wicket.version}' :war !org.mockito - compile 'org.apache.lucene:lucene-core:${lucene.version}' :war :fedclient - compile 'org.apache.lucene:lucene-analyzers-common:${lucene.version}' :war :fedclient -- compile 'org.apache.lucene:lucene-highlighter:${lucene.version}' :war :fedclient +- compile 'org.apache.lucene:lucene-highlighter:${lucene.version}' :war :fedclient !org.apache.lucene:lucene-join - compile 'org.apache.lucene:lucene-memory:${lucene.version}' :war :fedclient -- compile 'org.apache.lucene:lucene-queryparser:${lucene.version}' :war :fedclient +- compile 'org.apache.lucene:lucene-queryparser:${lucene.version}' :war :fedclient !org.apache.lucene:lucene-spatial - compile 'org.pegdown:pegdown:1.5.0' :war - compile 'org.fusesource.wikitext:wikitext-core:${wikitext.version}' :war - compile 'org.fusesource.wikitext:twiki-core:${wikitext.version}' :war @@ -180,7 +181,7 @@ dependencies: - compile 'ro.fortsoft.pf4j:pf4j:0.9.0' :war - compile 'org.apache.tika:tika-core:1.5' :war - compile 'org.jsoup:jsoup:1.7.3' :war -- test 'junit' +- test 'junit:junit:4.12' # Dependencies for Selenium web page testing - test 'org.seleniumhq.selenium:selenium-java:${selenium.version}' @jar - test 'org.seleniumhq.selenium:selenium-support:${selenium.version}' @jar @@ -188,4 +189,4 @@ dependencies: - test 'org.mockito:mockito-core:1.10.19' # Dependencies with the "build" scope are retrieved # and injected into the Ant runtime classpath -- build 'jacoco' +- build 'org.jacoco:org.jacoco.ant:0.7.8' diff --git a/circle.yml b/circle.yml new file mode 100644 index 000000000..fcf878675 --- /dev/null +++ b/circle.yml @@ -0,0 +1,22 @@ +machine: + java: + version: openjdk7 + +compile: + pre: + - java -version + - javac -version + override: + - ant + +test: + override: + - ant test + post: + - mkdir -p $CIRCLE_TEST_REPORTS/junit/ + - cp -a build/tests/TEST-*.xml $CIRCLE_TEST_REPORTS/junit/ + +general: + artifacts: + - "build/target/reports" + diff --git a/gitblit.iml b/gitblit.iml index ec6dc5e16..2c7254951 100644 --- a/gitblit.iml +++ b/gitblit.iml @@ -11,6 +11,7 @@ + @@ -146,13 +147,13 @@ - + - + - + @@ -168,24 +169,24 @@ - + - + - + - + - + - + @@ -222,6 +223,17 @@ + + + + + + + + + + + @@ -245,101 +257,101 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -900,17 +912,6 @@ - - - - - - - - - - - diff --git a/src/main/distrib/data/certs/instructions.tmpl_zh_TW b/src/main/distrib/data/certs/instructions.tmpl_zh_TW new file mode 100644 index 000000000..72b99e0da --- /dev/null +++ b/src/main/distrib/data/certs/instructions.tmpl_zh_TW @@ -0,0 +1,111 @@ +******************************************************************************** + Gitblit 伺服器 $serverHostname 所需之 SSL 用戶端憑證 +******************************************************************************** + + $userDisplayname 您好, + + 伺服器 $serverHostname 所需要的私鑰,公鑰以及Gitblit簽證檔案(CA)存放於 $username.p12, PKCS#12 certificate store[1] 以及 $username.pem. + + 兩種證書皆受密碼保護. + 密碼提示: $storePasswordHint + + +Git 憑證匯入步驟 +============================================= + + 附件之 PEM 檔案可以直接匯入至您的git程式裡. + + git config [--global] http.sslCert path/to/$username.pem + + PEM檔案受密碼保護,因此匯入過程會提示多次. 如果您偏好不使用密碼,您需要另外匯出無密碼之私鑰後,再匯入git程式裡. + + openssl rsa -in path/to/$username.pem -out path/to/$username.key + git config [--global] http.sslKey path/to/$username.key + + 此外,您應該妥善保管已經解除密碼保護之私鑰. + + 註: + 如果沒有匯出私鑰, 有些早期git版本將會發生匯入失敗問題,例如:Ubuntu 12.04 with git 1.7.9.5. + + +Firefox 憑證匯入步驟 +============================================= + + Firefox 有自己的證書管理介面. + + 1. 點選 "選項->進階->憑證" + 2. 點選 "檢視憑證清單" + 3. 切換至 "您的憑證" + 4. 點選 "匯入(M)" + 5. 選擇電腦中的憑證檔案 $username.p12 + 6. 輸入憑證檔案所需的密碼 + 7. 切換至"憑證機構" + 8. 找到 "Gitblit Certificate Authority" 憑證 + 9. 點選"編輯信任(E)" + 10.選擇信任網站. + + +Chrome/IE (Windows) 憑證匯入步驟 +============================================= + + 在Windows作業系統下, Chrome 與 IE 共用相同的憑證設定. + + IE + ------------------------------------ + 1. 選擇 "網際網路選項->內容" + 2. 點選"憑證" + + Chrome + ------------------------------------ + 1. 選擇 "設定->顯示進階設定->HTTP/SSL" + 2. 點選"管理憑證" + + 共同步驟 (Windows) + ------------------------------------ + 3. 切換至 "個人" + 4. 點選"匯入(I)" + 5. 依照指示匯入. + 請切換匯入檔案類型為p12並且找到 $username.p12 這個憑證檔案 + 6. 輸入憑證檔案保護密碼 + 7. 由於主要發放憑證單位(CA)與個人憑證檔案皆儲存於 $username.p12, 因此匯入時候,必須選擇 "自動根據憑證類型來選擇憑證存放區". + 如果選擇預設值匯入, 將不會安裝主要發放憑證單位(CA) + + +Chrome (Linux) Installation Instructions +============================================= + + On Linux, Chrome maintains it's own certificate store. + + 1. Navigate to Settings->Show Advanced Settings->HTTP/SSL + 2. Click the "Manage Certificates..." button + 3. Navigate your filesystem and select $username.p12 + 4. At the password prompt enter the certificate store password + You have now imported your private key, public certificate, and the CA certificate + but now we must manually set the trust settings of the CA certificate. + 5. Switch to the "Authorities" tab + 6. Scroll down and find "Gitblit-> Gitblit Certificate Authority" + 7. Select it and click "Edit Trust..." + 8. Check "This certificate can identify websites" and click OK. + + +Chrome/Safari (Mac OS X) Installation Instructions +============================================= + +On Mac OS X, Chrome and Safari both use Keychain Access to store certificates +so configuring one will automatically apply for both. + + 1. Double-click $username.pem + 2. At the password prompt enter the certificate store password + You have now imported your private key, public certificate, and the CA certificate + but now we must manually set the trust settings of the CA certificate. + 3. Find the Gitblit Certificate Authority certificate, it should have a red + indicator meaning untrusted, and double-click it. + 4. Open the "Trust" disclosure triangle and change "When using this certificate" + to "Always Trust". + 5. Close the certificate view and enter your system password to save the changes + to your keychain. + + +[1] PKCS#12 is one of the standard container formats for sharing private keys and + public certificates. +[2] http://www.openssl.org diff --git a/src/main/distrib/data/certs/mail.tmpl_zh_TW b/src/main/distrib/data/certs/mail.tmpl_zh_TW new file mode 100644 index 000000000..20eb5183c --- /dev/null +++ b/src/main/distrib/data/certs/mail.tmpl_zh_TW @@ -0,0 +1,5 @@ +$userDisplayname 您好 + + 伺服器 $serverHostname 所需要的私鑰,公鑰以及Gitblit簽證檔案(CA)已經全部打包並且以zip壓縮檔方式寄給您. + + 此外,檔案還附上各瀏覽器設定步驟供您參考. \ No newline at end of file diff --git a/src/main/distrib/data/defaults.properties b/src/main/distrib/data/defaults.properties index 04166342c..51fa1253a 100644 --- a/src/main/distrib/data/defaults.properties +++ b/src/main/distrib/data/defaults.properties @@ -138,10 +138,25 @@ git.sshKeysManager = com.gitblit.transport.ssh.FileKeyManager # SINCE 1.5.0 git.sshKeysFolder= ${baseFolder}/ssh -# Use Kerberos5 (GSS) authentication + +# Authentication methods offered by the SSH server. +# Space separated list of authentication method names that the +# server shall offer. The default is "publickey password". # -# SINCE 1.7.0 -git.sshWithKrb5 = false +# Valid authentication method names are: +# publickey - authenticate with SSH public key +# password - authenticate with username, password +# keyboard-interactive - currently synonym to 'password' +# gssapi-with-mic - GSS API Kerberos 5 authentication +# +# This setting obsoletes the "git.sshWithKrb5" setting. To enable +# Kerberos5 (GSS) authentication, add 'gssapi-with-mic' to the list. +# +# SINCE 1.9.0 +# RESTART REQUIRED +# SPACE-DELIMITED +git.sshAuthenticationMethods = publickey password + # The path to a Kerberos 5 keytab. # @@ -301,7 +316,7 @@ git.defaultIncrementalPushTagPrefix = r # the repository should be created with 'git init --shared' to make sure that # it can be accessed e.g. via ssh (user git) and http (user www-data). # -# Valid values are the values available for the '--shared' option. The the manual +# Valid values are the values available for the '--shared' option. See the manual # page for 'git init' for more information on shared repositories. # # SINCE 1.4.0 @@ -1950,6 +1965,22 @@ realm.ldap.email = email # SINCE 1.0.0 realm.ldap.uid = uid +# Attribute on the USER record that indicates their public SSH key. +# Leave blank when public SSH keys shall not be retrieved from LDAP. +# +# This setting is only relevant when a public key manager is used that +# retrieves SSH keys from LDAP (e.g. com.gitblit.transport.ssh.LdapKeyManager). +# +# The accepted format of the value is dependent on the public key manager used. +# Examples: +# sshPublicKey - Use the attribute 'sshPublicKey' on the user record. +# altSecurityIdentities:SshKey - Use the attribute 'altSecurityIdentities' +# on the user record, for which the record value +# starts with 'SshKey:', followed by the SSH key entry. +# +# SINCE 1.9.0 +realm.ldap.sshPublicKey = + # Defines whether to synchronize all LDAP users and teams into the user service # This requires either anonymous LDAP access or that a specific account is set # in realm.ldap.username and realm.ldap.password, that has permission to read diff --git a/src/main/java/WEB-INF/web.xml b/src/main/java/WEB-INF/web.xml index db7721539..c648dcdef 100644 --- a/src/main/java/WEB-INF/web.xml +++ b/src/main/java/WEB-INF/web.xml @@ -1,7 +1,7 @@ - +