From 4421be142f171f44b25341c5e2b16506ab1f5d9f Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Wed, 22 Jul 2020 16:06:35 +0200 Subject: [PATCH 1/2] replace wrong comment with documentation link in server-config.xml --- scm-packaging/deb/pom.xml | 28 +++++- .../deb/src/main/fs/etc/scm/server-config.xml | 92 ++----------------- scm-packaging/docker/pom.xml | 10 ++ .../src/main/fs/etc/scm/server-config.xml | 92 ++----------------- scm-packaging/pom.xml | 18 ++++ scm-packaging/rpm/pom.xml | 28 +++++- .../rpm/src/main/fs/etc/scm/server-config.xml | 92 ++----------------- scm-packaging/unix/pom.xml | 3 +- .../unix/src/main/assembly/scm-server-app.xml | 14 +++ .../unix/src/main/fs/conf/server-config.xml | 92 ++----------------- .../src/main/assembly/scm-server-app.xml | 16 +++- .../src/main/fs/conf/server-config.xml | 92 ++----------------- 12 files changed, 150 insertions(+), 427 deletions(-) diff --git a/scm-packaging/deb/pom.xml b/scm-packaging/deb/pom.xml index 2f1c850838..eaac444cb7 100644 --- a/scm-packaging/deb/pom.xml +++ b/scm-packaging/deb/pom.xml @@ -54,6 +54,30 @@ + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + copy-resources + prepare-package + + copy-resources + + + ${project.build.directory}/deb/etc/scm + + + src/main/fs/etc/scm + true + + + + + + + org.apache.maven.plugins maven-dependency-plugin @@ -135,7 +159,7 @@ file - src/main/fs/etc/scm/logging.xml + ${project.build.directory}/deb/etc/scm/logging.xml /etc/scm/logging.xml true @@ -148,7 +172,7 @@ file - src/main/fs/etc/scm/server-config.xml + ${project.build.directory}/deb/etc/scm/server-config.xml /etc/scm/server-config.xml true diff --git a/scm-packaging/deb/src/main/fs/etc/scm/server-config.xml b/scm-packaging/deb/src/main/fs/etc/scm/server-config.xml index 89f9d56ca4..217e1ae052 100644 --- a/scm-packaging/deb/src/main/fs/etc/scm/server-config.xml +++ b/scm-packaging/deb/src/main/fs/etc/scm/server-config.xml @@ -27,6 +27,14 @@ + + 16384 @@ -110,88 +118,4 @@ - - - - - - - - - - - - - - - - diff --git a/scm-packaging/docker/pom.xml b/scm-packaging/docker/pom.xml index ad3b3abab1..dafb65412d 100644 --- a/scm-packaging/docker/pom.xml +++ b/scm-packaging/docker/pom.xml @@ -113,6 +113,16 @@ src/main/fs false + + **/scm/* + + + + src/main/fs + true + + **/scm/* + diff --git a/scm-packaging/docker/src/main/fs/etc/scm/server-config.xml b/scm-packaging/docker/src/main/fs/etc/scm/server-config.xml index 89f9d56ca4..217e1ae052 100644 --- a/scm-packaging/docker/src/main/fs/etc/scm/server-config.xml +++ b/scm-packaging/docker/src/main/fs/etc/scm/server-config.xml @@ -27,6 +27,14 @@ + + 16384 @@ -110,88 +118,4 @@ - - - - - - - - - - - - - - - - diff --git a/scm-packaging/pom.xml b/scm-packaging/pom.xml index 85ec7e86ac..3b3bc562df 100644 --- a/scm-packaging/pom.xml +++ b/scm-packaging/pom.xml @@ -44,6 +44,24 @@ https://packages.scm-manager.org + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.2.0 + + + parse-version + + parse-version + + + + + + + packaging diff --git a/scm-packaging/rpm/pom.xml b/scm-packaging/rpm/pom.xml index bcfe3533eb..1a32923cbf 100644 --- a/scm-packaging/rpm/pom.xml +++ b/scm-packaging/rpm/pom.xml @@ -60,6 +60,30 @@ + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + copy-resources + prepare-package + + copy-resources + + + ${project.build.directory}/rpm/etc/scm + + + src/main/fs/etc/scm + true + + + + + + + org.apache.maven.plugins maven-dependency-plugin @@ -172,7 +196,7 @@ /etc/scm/logging.xml - src/main/fs/etc/scm/logging.xml + ${project.build.directory}/rpm/etc/scm/logging.xml root scm 0640 @@ -181,7 +205,7 @@ /etc/scm/server-config.xml - src/main/fs/etc/scm/server-config.xml + ${project.build.directory}/rpm/etc/scm/server-config.xml root scm 0640 diff --git a/scm-packaging/rpm/src/main/fs/etc/scm/server-config.xml b/scm-packaging/rpm/src/main/fs/etc/scm/server-config.xml index 89f9d56ca4..bd3b75b72a 100644 --- a/scm-packaging/rpm/src/main/fs/etc/scm/server-config.xml +++ b/scm-packaging/rpm/src/main/fs/etc/scm/server-config.xml @@ -27,6 +27,14 @@ + + 16384 @@ -109,89 +117,5 @@ - - - - - - - - - - - - - - - - diff --git a/scm-packaging/unix/pom.xml b/scm-packaging/unix/pom.xml index 4d77592d35..81dfbe75c1 100644 --- a/scm-packaging/unix/pom.xml +++ b/scm-packaging/unix/pom.xml @@ -24,8 +24,7 @@ SOFTWARE. --> - + 4.0.0 diff --git a/scm-packaging/unix/src/main/assembly/scm-server-app.xml b/scm-packaging/unix/src/main/assembly/scm-server-app.xml index 1b8728fbc9..0521e69681 100644 --- a/scm-packaging/unix/src/main/assembly/scm-server-app.xml +++ b/scm-packaging/unix/src/main/assembly/scm-server-app.xml @@ -39,9 +39,23 @@ + + + + src/main/fs/conf + true + conf + + src/main/fs false + + conf/** + diff --git a/scm-packaging/unix/src/main/fs/conf/server-config.xml b/scm-packaging/unix/src/main/fs/conf/server-config.xml index 08814ccf68..8e01822c91 100644 --- a/scm-packaging/unix/src/main/fs/conf/server-config.xml +++ b/scm-packaging/unix/src/main/fs/conf/server-config.xml @@ -27,6 +27,14 @@ + + 16384 @@ -113,89 +121,5 @@ - - - - - - - - - - - - - - - - diff --git a/scm-packaging/windows/src/main/assembly/scm-server-app.xml b/scm-packaging/windows/src/main/assembly/scm-server-app.xml index b83ab7b431..2062e53f68 100644 --- a/scm-packaging/windows/src/main/assembly/scm-server-app.xml +++ b/scm-packaging/windows/src/main/assembly/scm-server-app.xml @@ -39,12 +39,26 @@ + + + + src/main/fs/conf + true + conf + + src/main/fs false + + conf/** + - + target/windows false diff --git a/scm-packaging/windows/src/main/fs/conf/server-config.xml b/scm-packaging/windows/src/main/fs/conf/server-config.xml index 8aa4333bdc..bbcc515670 100644 --- a/scm-packaging/windows/src/main/fs/conf/server-config.xml +++ b/scm-packaging/windows/src/main/fs/conf/server-config.xml @@ -27,6 +27,14 @@ + + 16384 @@ -114,89 +122,5 @@ - - - - - - - - - - - - - - - - From 946ede1e8819244aa8a78312f474f1c16d70e5c6 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Thu, 23 Jul 2020 09:28:11 +0200 Subject: [PATCH 2/2] updates scm-server with https documentation --- docs/en/administration/scm-server-ssl.md | 117 --------------- docs/en/administration/scm-server.md | 183 +++++++++++++++++++++++ docs/en/navigation.yml | 2 +- 3 files changed, 184 insertions(+), 118 deletions(-) delete mode 100644 docs/en/administration/scm-server-ssl.md create mode 100644 docs/en/administration/scm-server.md diff --git a/docs/en/administration/scm-server-ssl.md b/docs/en/administration/scm-server-ssl.md deleted file mode 100644 index 71debe72c6..0000000000 --- a/docs/en/administration/scm-server-ssl.md +++ /dev/null @@ -1,117 +0,0 @@ ---- -title: SCM-Server SSL ---- - - - -**Note**: This document describes a ssl configuration with a - self-signed certificate - -1\. Open a shell and go to the conf directory of the scm-server - -2\. Create a certificate request. Replace all variables (\*varname\*) - -```bash -$ keytool -genkey -alias scm -keyalg RSA -keystore keystore.jks - -Enter keystore password: your password -Re-enter new password: your password -What is your first and last name? - [Unknown]: *your servername* -What is the name of your organizational unit? - [Unknown]: *organisation unit* -What is the name of your organization? - [Unknown]: *organisation* -What is the name of your City or Locality? - [Unknown]: *city* -What is the name of your State or Province? - [Unknown]: *state* -What is the two-letter country code for this unit? - [Unknown]: *country code* -Is CN=your servername, OU=your organisation unit, O=your organisation, L=your city, ST=your state, C=cc correct? - [no]: yes - -Enter key password for - (RETURN if same as keystore password): *password* -Re-enter new password: *password* -``` - -**Note**: You have to enter the full qualified hostname of your - server for the cn (cn = What is your first and last name?) - -3\. Edit the server-config.xml, uncomment the SSL-Connector and set your -password. For example: - -```xml - - - - - - - - - SSLv2Hello - SSLv3 - - - - - 8181 - 30000 - /conf/keystore.jks - *password* - *password* - /conf/keystore.jks - *password* - - - -``` - -4\. Start or restart the scm-server - -**Note**: It looks like there is a error in some version of - OpenJDK (issues \#84 and \#151). If you have such a problem, - please try to use the Oracle JDK. - -### Configure Git - -1\. Export the certificate from keystore: - -```bash -$ keytool -exportcert -keystore keystore.jks -alias scm -rfc -file cert.pem -``` - -2\. Copy the certificate to your client and add it to your git config: - -```bash -$ git config http.sslCAInfo /complete/path/to/cert.pem -``` - -### Configure Mercurial - -1\. Export the certificate from keystore: - -```bash -$ keytool -exportcert -keystore keystore.jks -alias scm -rfc -file cert.pem -``` - -2\. Copy the certificate to your client and add it to your .hgrc config -file: - -```bash -[web] -cacerts = /complete/path/to/cert.pem -``` - -### Sources - -- [Keytool](http://download.oracle.com/javase/1.4.2/docs/tooldocs/windows/keytool.html) -- [Jetty SSL-Connectors](http://wiki.eclipse.org/Jetty/Reference/SSL_Connectors) diff --git a/docs/en/administration/scm-server.md b/docs/en/administration/scm-server.md new file mode 100644 index 0000000000..fb382e03f2 --- /dev/null +++ b/docs/en/administration/scm-server.md @@ -0,0 +1,183 @@ +--- +title: SCM-Server Configuration +subtitle: Various configuration options for the SCM-Server +displayToc: true +--- + +## Https + +In order to use https with scm-server, you need a keystore with a certificate and the corresponding secret key. +In the following we will use `openssl` to create a self signed certificate for demonstration purposes. + +### Create self signed certificate + +**Warning**: Do not use self signed certificates in production, this is only for demonstration purposes. + +```bash +openssl req -new -x509 -newkey rsa:2048 -sha256 -keyout tls.key -out tls.crt +``` + +This command will ask a few questions about metadata for generated certificate: + +* PEM pass phrase: This is a password to protect the scret key +* Country Name (2 letter code) +* State or Province Name (full name) +* Locality Name (eg, city) +* Organization Name (eg, company) +* Organizational Unit Name (eg, section) +* Common Name (eg, fully qualified host name) +* Email Address + +Make sure that the common name matches the fqdn, which you are using to access SCM-Manager. + +#### Browsers + +In order to use a self signed certificate the certificate must be imported into you browser. + +#### Configure Git + +To use git with a self signed certificate, we have to add the certificate path to the configuration. + +```bash +git config http.sslCAInfo /complete/path/to/tls.crt +``` + +#### Configure Mercurial + +To use mercurial with a self signed certificate, we have to add the certificate path to the configuration. + +```ini +[web] +cacerts = /complete/path/to/cert.pem +``` + +### Create keystore + +Create a keystore in pkcs12 format. +This command can be used with the self signed certificate from above or with a valid certificate from an authority. + +```bash +openssl pkcs12 -inkey tls.key -in tls.crt -export -out keystore.pkcs12 +``` + +If your secret key is protected with a pass phrase, you have to enter it first. +Than you have to enter an export password to protect your keystore. + +### Server configuration + +Add the following snippet at the end of your `server-config.xml`, be sure it is inside the `Configure` tag: + +```xml + + + + + + /conf/keystore.pkcs12 + + + PKCS12 + + secret + + + + + + + TLSv1.2 + TLSv1.3 + + + + + + TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 + TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 + TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 + TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 + TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 + TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 + TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 + TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + http/1.1 + + + + + + + + + + + + + + + + + + + + + + + + + + + +``` + +The snipped above assumes your keystore is in the pkcs12 format and is stored at `conf/keystore.pkcs12` with the password `secret`. +You have to tweek this settings to match your setup. +After modifying your `server-config.xml`, you have to **restart** your SCM-Manager instance. +Now SCM-Manager should open a second port with **https** (in the example above **8443**). diff --git a/docs/en/navigation.yml b/docs/en/navigation.yml index 55d9971267..e696c98bc6 100644 --- a/docs/en/navigation.yml +++ b/docs/en/navigation.yml @@ -16,7 +16,7 @@ entries: - /administration/basedirectory/ - /administration/logging/ - - /administration/scm-server-ssl/ + - /administration/scm-server/ - /administration/reverse-proxies/ - section: Development