-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add https support * Use 'sudo' in update-hosts.sh * Delete certs and generate them during the workflow run --------- Co-authored-by: a.stamov <a.stamov@rt-solar.ru>
- Loading branch information
1 parent
38ebb79
commit afac00b
Showing
12 changed files
with
165 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
version: '3' | ||
services: | ||
clickhouse: | ||
# https://docs.docker.com/compose/compose-file/#variable-substitution | ||
image: "clickhouse/clickhouse-server:${CLICKHOUSE_VERSION:-22.3}" | ||
volumes: | ||
- ./entrypoint.sh:/custom-entrypoint.sh | ||
- ./server-config.xml:/etc/clickhouse-server/config.d/server-config.xml | ||
- ./certs/server.crt:/tmp/certs/server.crt | ||
- ./certs/server.key:/tmp/certs/server.key | ||
- ./certs/ca.crt:/tmp/certs/ca.crt | ||
expose: | ||
- "8123" | ||
- "8447" | ||
ports: | ||
- "8123:8123" | ||
- "8447:8447" | ||
- "9000:9000" | ||
entrypoint: | ||
- /custom-entrypoint.sh | ||
hostname: clickhouseserver.test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
CERTS_DIR=/etc/clickhouse-server/certs/ | ||
mkdir -p $CERTS_DIR | ||
# Copy cert files to $CERTS_DIR and apply required rights so as not to affect the original files | ||
cp /tmp/certs/* $CERTS_DIR | ||
chown clickhouse:clickhouse $CERTS_DIR* | ||
chmod 644 $CERTS_DIR* | ||
/entrypoint.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
# Script is used to (re)generate self-signed certificates needed to run the tests | ||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
CERTS_DIR=$SCRIPT_DIR/certs | ||
rm -rf $CERTS_DIR | ||
mkdir -p $CERTS_DIR | ||
cd $CERTS_DIR | ||
openssl genrsa -out ca.key 2048 | ||
openssl req -x509 -subj "/CN=clickhouseserver.test CA" -nodes -key ca.key -days 3650 -out ca.crt | ||
openssl req -newkey rsa:2048 -nodes -subj "/CN=clickhouseserver.test" -keyout server.key -out server.csr | ||
openssl x509 -req -in server.csr -out server.crt -CA ca.crt -CAkey ca.key -days 3650 -copy_extensions copy | ||
openssl req -newkey rsa:2048 -nodes -subj "/CN=clickhouseserver.test" -keyout client.key -out client.csr | ||
openssl x509 -req -in client.csr -out client.crt -CA ca.crt -CAkey ca.key -days 3650 -copy_extensions copy | ||
|
||
openssl pkcs12 -export -in client.crt -inkey client.key -out keystore.p12 -name client -CAfile ca.crt -caname 'clickhouseserver.test CA' -password pass:password | ||
|
||
keytool -importkeystore -deststorepass password -destkeypass password -destkeystore keystore.jks -deststoretype JKS -srckeystore keystore.p12 -srcstoretype PKCS12 -srcstorepass password -alias client -noprompt | ||
|
||
keytool -importcert -alias ca -file ca.crt -keystore keystore.jks -storepass password -noprompt | ||
rm ca.key client.key client.csr client.crt server.csr keystore.p12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?xml version="1.0"?> | ||
<!-- | ||
NOTE: User and query level settings are set up in "users.xml" file. | ||
If you have accidentally specified user-level settings here, server won't start. | ||
You can either move the settings to the right place inside "users.xml" file | ||
or add <skip_check_for_incorrect_settings>1</skip_check_for_incorrect_settings> here. | ||
--> | ||
<yandex> | ||
|
||
<!-- HTTP API with TLS (HTTPS). | ||
You have to configure certificate to enable this interface. | ||
See the openSSL section below. | ||
--> | ||
<https_port>8447</https_port> | ||
|
||
<!-- Used with https_port and tcp_port_secure. Full ssl options list: https://github.com/ClickHouse-Extras/poco/blob/master/NetSSL_OpenSSL/include/Poco/Net/SSLManager.h#L71 --> | ||
<openSSL> | ||
<server> <!-- Used for https server AND secure tcp port --> | ||
<!-- openssl req -subj "/CN=localhost" -new -newkey rsa:2048 -days 365 -nodes -x509 -keyout /etc/clickhouse-server/server.key -out /etc/clickhouse-server/server.crt --> | ||
<certificateFile>/etc/clickhouse-server/certs/server.crt</certificateFile> | ||
<privateKeyFile>/etc/clickhouse-server/certs/server.key</privateKeyFile> | ||
<caConfig>/etc/clickhouse-server/certs/ca.crt</caConfig> | ||
<!-- dhparams are optional. You can delete the <dhParamsFile> element. | ||
To generate dhparams, use the following command: | ||
openssl dhparam -out /etc/clickhouse-server/dhparam.pem 4096 | ||
Only file format with BEGIN DH PARAMETERS is supported. | ||
--> | ||
<dhParamsFile remove="remove">/etc/clickhouse-server/dhparam.pem</dhParamsFile> | ||
<verificationMode>relaxed</verificationMode> | ||
<cacheSessions>true</cacheSessions> | ||
<preferServerCiphers>true</preferServerCiphers> | ||
<loadDefaultCAFile>false</loadDefaultCAFile> | ||
</server> | ||
</openSSL> | ||
</yandex> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
# Add 'clickhouseserver.test' to '/etc/hosts' file if it is not already there | ||
if ! grep -q '127.0.0.1[[:space:]]*clickhouseserver.test' /etc/hosts; then | ||
echo '127.0.0.1 clickhouseserver.test' | sudo tee -a /etc/hosts | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.