embulk-executor-remoteserver 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -9
- data/classpath/{embulk-executor-remoteserver-0.3.1.jar → embulk-executor-remoteserver-0.3.2.jar} +0 -0
- data/gradle.properties +1 -1
- data/src/main/java/org/embulk/executor/remoteserver/Launcher.java +6 -6
- data/src/main/java/org/embulk/executor/remoteserver/RemoteServerExecutor.java +19 -19
- data/src/test/resources/config/exec_tls.yml +3 -3
- data/test/docker-compose.yml +6 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f28395ebbd29d2028501114573e227c225fd8b6c
|
4
|
+
data.tar.gz: ab865e0e32d2c4d4b56057497278ab61ee1d64be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7de676f12a5aab6ff29d4b43c191b06637f40901037e21bf05a9c98432bff45766e67626d6d6d7cb097d7f065a92e3fe4924b2abaa22fc497d7b530f60a43112
|
7
|
+
data.tar.gz: 7dc8342789e19402d7a1d61f25bb7525aaed2525496eb93d482f42b078e25ba2ce387c78e35785788c0a89898c3ce99d074692fa99fd5f000f04372a3d10dc3f
|
data/README.md
CHANGED
@@ -14,11 +14,11 @@ Embulk executor plugin to run Embulk tasks on remote servers.
|
|
14
14
|
|
15
15
|
- **hosts**: List of remote servers (`hostname` or `hostname:port`, default port is `30001`). If not specified, the executor runs as the local mode, which starts an Embulk server on its own process (array of string)
|
16
16
|
- **timeout_seconds**: Timeout seconds of the whole execution (integer, default: `3600`)
|
17
|
-
- **
|
18
|
-
- **
|
17
|
+
- **use_tls**: Enable to connect server over TLS (boolean, default: `false`)
|
18
|
+
- **cert_p12_file**: Information of a P12 file used as your client certificate. It would be needed when client authentication is enabled on Embulk server.
|
19
19
|
- **path**: Path of the file (string, required)
|
20
20
|
- **password**: Password of the file (string, required)
|
21
|
-
- **
|
21
|
+
- **ca_p12_file**: Information of a P12 file used as CA certificate. It would be needed when Embulk server uses a certificate in which unknown CA signed.
|
22
22
|
- **path**: Path of the file (string, required)
|
23
23
|
- **password**: Password of the file (string, required)
|
24
24
|
|
@@ -49,12 +49,10 @@ There are some environment variables to configure the server
|
|
49
49
|
|
50
50
|
- `BIND_ADDRESS`: Bind address of the server (default: `0.0.0.0`)
|
51
51
|
- `PORT`: Port number to listen (default: `30001`)
|
52
|
-
- `
|
53
|
-
- `
|
54
|
-
- `
|
55
|
-
- `
|
56
|
-
- `TRUST_P12_PATH`: Path of the P12 file used as a TrustManager
|
57
|
-
- `TRUST_P12_PASSWORD`: Password of the Trust P12 file
|
52
|
+
- `USE_TLS`: Try to connect to client via TLS if `true` (default: `false`)
|
53
|
+
- `REQUIRE_TLS_CLIENT_AUTH`: Require client authentication if `true` (default: `false`)
|
54
|
+
- `CERT_P12_PATH`, `CERT_P12_PASSWORD`: Path and password of the P12 file for server certificate. Ignored unless both is set.
|
55
|
+
- `CA_P12_PATH`, `CA_P12_PASSWORD`: Path and password of the P12 file for CA certificate. Ignored unless both is set.
|
58
56
|
|
59
57
|
## Build
|
60
58
|
|
data/classpath/{embulk-executor-remoteserver-0.3.1.jar → embulk-executor-remoteserver-0.3.2.jar}
RENAMED
Binary file
|
data/gradle.properties
CHANGED
@@ -1 +1 @@
|
|
1
|
-
version=0.3.
|
1
|
+
version=0.3.2
|
@@ -20,24 +20,24 @@ public class Launcher {
|
|
20
20
|
}
|
21
21
|
|
22
22
|
private static TLSConfig createTLSConfig(Map<String, String> envVars) {
|
23
|
-
if (!"true".equals(envVars.get("
|
23
|
+
if (!"true".equals(envVars.get("USE_TLS"))) {
|
24
24
|
return null;
|
25
25
|
}
|
26
26
|
|
27
27
|
TLSConfig tlsConfig = new TLSConfig();
|
28
|
-
String keyP12Path = envVars.get("
|
29
|
-
String keyP12Password = envVars.get("
|
28
|
+
String keyP12Path = envVars.get("CERT_P12_PATH");
|
29
|
+
String keyP12Password = envVars.get("CERT_P12_PASSWORD");
|
30
30
|
if (keyP12Path != null && keyP12Password != null) {
|
31
31
|
tlsConfig.keyStore(new P12File(keyP12Path, keyP12Password));
|
32
32
|
}
|
33
33
|
|
34
|
-
String trustP12Path = envVars.get("
|
35
|
-
String trustP12Password = envVars.get("
|
34
|
+
String trustP12Path = envVars.get("CA_P12_PATH");
|
35
|
+
String trustP12Password = envVars.get("CA_P12_PASSWORD");
|
36
36
|
if (trustP12Path != null && trustP12Password != null) {
|
37
37
|
tlsConfig.trustStore(new P12File(trustP12Path, trustP12Password));
|
38
38
|
}
|
39
39
|
|
40
|
-
if ("true".equals(envVars.get("
|
40
|
+
if ("true".equals(envVars.get("REQUIRE_TLS_CLIENT_AUTH"))) {
|
41
41
|
tlsConfig.enableClientAuth(true);
|
42
42
|
}
|
43
43
|
return tlsConfig;
|
@@ -43,33 +43,33 @@ public class RemoteServerExecutor implements ExecutorPlugin {
|
|
43
43
|
@ConfigDefault("3600")
|
44
44
|
int getTimeoutSeconds();
|
45
45
|
|
46
|
-
@Config("
|
46
|
+
@Config("use_tls")
|
47
47
|
@ConfigDefault("false")
|
48
|
-
boolean
|
48
|
+
boolean getUseTls();
|
49
49
|
|
50
|
-
@Config("
|
50
|
+
@Config("cert_p12_file")
|
51
51
|
@ConfigDefault("null")
|
52
|
-
Optional<P12File>
|
52
|
+
Optional<P12File> getCertP12File();
|
53
53
|
|
54
|
-
@Config("
|
54
|
+
@Config("ca_p12_file")
|
55
55
|
@ConfigDefault("null")
|
56
|
-
Optional<P12File>
|
56
|
+
Optional<P12File> getCaP12File();
|
57
57
|
|
58
58
|
@ConfigInject
|
59
59
|
ModelManager getModelManager();
|
60
60
|
|
61
61
|
// Used for the local mode (mainly for testing)
|
62
|
-
@Config("
|
62
|
+
@Config("__server_cert_p12_file")
|
63
63
|
@ConfigDefault("null")
|
64
|
-
Optional<P12File>
|
64
|
+
Optional<P12File> getServerCertP12File();
|
65
65
|
|
66
|
-
@Config("
|
66
|
+
@Config("__server_ca_p12_file")
|
67
67
|
@ConfigDefault("null")
|
68
|
-
Optional<P12File>
|
68
|
+
Optional<P12File> getServerCaP12File();
|
69
69
|
|
70
|
-
@Config("
|
70
|
+
@Config("__server_require_tls_client_auth")
|
71
71
|
@ConfigDefault("false")
|
72
|
-
boolean
|
72
|
+
boolean getServerRequireTlsClientAuth();
|
73
73
|
}
|
74
74
|
|
75
75
|
@Inject
|
@@ -131,10 +131,10 @@ public class RemoteServerExecutor implements ExecutorPlugin {
|
|
131
131
|
systemConfigJson, pluginTaskJson, processTaskJson, gemSpecs, pluginArchiveBytes, state, inputTaskCount, modelManager);
|
132
132
|
|
133
133
|
TLSConfig tlsConfig = null;
|
134
|
-
if (pluginTask.
|
134
|
+
if (pluginTask.getUseTls()) {
|
135
135
|
tlsConfig = new TLSConfig();
|
136
|
-
pluginTask.
|
137
|
-
pluginTask.
|
136
|
+
pluginTask.getCertP12File().ifPresent(tlsConfig::keyStore);
|
137
|
+
pluginTask.getCaP12File().ifPresent(tlsConfig::trustStore);
|
138
138
|
}
|
139
139
|
|
140
140
|
try (EmbulkClient client = EmbulkClient.open(session, hosts, tlsConfig)) {
|
@@ -169,11 +169,11 @@ public class RemoteServerExecutor implements ExecutorPlugin {
|
|
169
169
|
|
170
170
|
private EmbulkServer startEmbulkServer(PluginTask task) throws IOException {
|
171
171
|
TLSConfig tlsConfig = null;
|
172
|
-
if (task.
|
172
|
+
if (task.getUseTls()) {
|
173
173
|
tlsConfig = new TLSConfig();
|
174
|
-
task.
|
175
|
-
task.
|
176
|
-
if (task.
|
174
|
+
task.getServerCertP12File().ifPresent(tlsConfig::keyStore);
|
175
|
+
task.getServerCaP12File().ifPresent(tlsConfig::trustStore);
|
176
|
+
if (task.getServerRequireTlsClientAuth()) {
|
177
177
|
tlsConfig.enableClientAuth(true);
|
178
178
|
}
|
179
179
|
}
|
@@ -3,11 +3,11 @@ timeout_seconds: 5
|
|
3
3
|
hosts:
|
4
4
|
- localhost:30003
|
5
5
|
- localhost:30004
|
6
|
-
|
7
|
-
|
6
|
+
use_tls: true
|
7
|
+
cert_p12_file:
|
8
8
|
path: tmp/certs/client.p12
|
9
9
|
password: fghij
|
10
|
-
|
10
|
+
ca_p12_file:
|
11
11
|
path: tmp/certs/ca-chain.p12
|
12
12
|
password: p@ssw0rd
|
13
13
|
|
data/test/docker-compose.yml
CHANGED
@@ -20,12 +20,12 @@ services:
|
|
20
20
|
<<: *server
|
21
21
|
environment:
|
22
22
|
LOG_LEVEL: debug
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
23
|
+
USE_TLS: "true"
|
24
|
+
REQUIRE_TLS_CLIENT_AUTH: "true"
|
25
|
+
CERT_P12_PATH: /certs/embulk-server.local.p12
|
26
|
+
CERT_P12_PASSWORD: abcde
|
27
|
+
CA_P12_PATH: /certs/ca-chain.p12
|
28
|
+
CA_P12_PASSWORD: p@ssw0rd
|
29
29
|
ports:
|
30
30
|
- "30003:30001"
|
31
31
|
volumes:
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-executor-remoteserver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shinichi Ishimura
|
@@ -51,7 +51,7 @@ files:
|
|
51
51
|
- LICENSE
|
52
52
|
- README.md
|
53
53
|
- build.gradle
|
54
|
-
- classpath/embulk-executor-remoteserver-0.3.
|
54
|
+
- classpath/embulk-executor-remoteserver-0.3.2.jar
|
55
55
|
- classpath/msgpack-core-0.8.16.jar
|
56
56
|
- classpath/nsocket-0.3.4.jar
|
57
57
|
- classpath/slf4j-api-1.7.26.jar
|