embulk-input-remote 0.3.3 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ae62e6b2f381fbc643b9f8c5e9cc9bdd4246d944
4
- data.tar.gz: 8b8b3e6a6f61a69a6aa1660dd78eb210d6a13dbc
3
+ metadata.gz: 24bb3008bbdbe51c44da96c8b15ff08cbeac29ff
4
+ data.tar.gz: 3295982e957968931d6c5803377ad41b0db4349e
5
5
  SHA512:
6
- metadata.gz: 46e848501723870c0e8e0043c2014a1451815145c5c6bee4e3f4d0dc1f7f272c832caa27ed1172b058006bb72160d101b6f92510c3b116ba005c3913cb5ded59
7
- data.tar.gz: b6448a41ec225d167ddc73ba0b4bd040b883a10a8c832b7a265ee283396e5bcde95da86f6bee1d72f570be9caa39b4df5fa3a327793bcd11846b9a01cc0c6bed
6
+ metadata.gz: 09f523ee72f8ff8a827741439390320aab48f948d68bd8a1aae5e45404335b060d172c5d6859143621439748c61e5d2e70b3e370d00a0fe391e53ce922444efa
7
+ data.tar.gz: 8edb2b6b79faac14ab323b9038388c55a222d9fa6e7ef7d7a21b88a3129e30c41861e10e963fb02a8389ed849833f4176f354dc9971843b8cf70988fa538eb13
data/.circleci/config.yml CHANGED
@@ -7,18 +7,32 @@ jobs:
7
7
  steps:
8
8
  - checkout
9
9
 
10
- - run: ssh-keygen -t ecdsa -f id_rsa_test -N ''
11
10
  - run: docker-compose up -d
12
11
  - run: docker-compose ps
13
-
12
+ - run: |
13
+ docker cp $(docker inspect --format="{{.Id}}" embulk-input-remote_host1):/home/ubuntu/.ssh/id_rsa_test . && \
14
+ chmod 400 id_rsa_test
14
15
  - restore_cache:
15
- key: embulk-input-remote-{{ checksum "build.gradle" }}
16
+ key: v1-gradle-{{ checksum "build.gradle" }}
17
+ key: v1-gradle-
16
18
  - run: ./gradlew checkstyle
17
- - run: ./gradlew check --full-stacktrace
19
+ - run: ./gradlew check --info
20
+ - run:
21
+ name: Save test results
22
+ command: |
23
+ mkdir -p ~/junit/
24
+ find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/junit/ \;
25
+ when: always
26
+ - store_test_results:
27
+ path: ~/junit
28
+ - store_artifacts:
29
+ path: ~/junit
30
+
18
31
  - save_cache:
19
32
  paths:
20
33
  - "~/.gradle"
21
- key: embulk-input-remote-{{ checksum "build.gradle" }}
34
+ - "~/.m2"
35
+ key: v1-gradle-{{ checksum "build.gradle" }}
22
36
 
23
37
  - deploy:
24
38
  name: Push Gem to RubyGems.org and bump up
data/.gitignore CHANGED
@@ -11,4 +11,3 @@ build/
11
11
  .classpath
12
12
  .project
13
13
  id_rsa_test
14
- id_rsa_test.pub
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Build Status](https://travis-ci.org/kamatama41/embulk-input-remote.svg?branch=master)](https://travis-ci.org/kamatama41/embulk-input-remote)
1
+ [![CircleCI](https://circleci.com/gh/kamatama41/embulk-input-remote.svg?style=svg)](https://circleci.com/gh/kamatama41/embulk-input-remote)
2
2
 
3
3
  # Remote file input plugin for [Embulk](https://github.com/embulk/embulk)
4
4
 
@@ -12,21 +12,21 @@ This plugin load data from Remote hosts by SCP
12
12
 
13
13
  ## Configuration
14
14
 
15
- - **hosts**: Target hosts, format should be `host` or `host:port` (overrides `default_port`) (list, default: [])
16
- - **hosts_command**: Command for getting hosts(Windows not supported). If given the option, "hosts" is overwritten. (string, default: null)
17
- - **hosts_separator**: Separator for "hosts_command" result (string, default: " ")
18
- - **default_port**: Default port number for SSH (integer, default: 22)
19
- - **path**: Path of remote host (File or Directory) (string, default: "")
20
- - **path_command**: Command for getting path (Windows not supported). If given the option "path" is overwritten. (string, default: null)
21
- - **ignore_not_found_hosts**: If the option is true, Hosts which meet the following conditions are skipped. (Means they are not included into resume target.) (boolean, default: false)
22
- - Target file (or directory) isn't found
23
- - Occurred SSH error
15
+ - **hosts**: Target hosts, its format should be `hostname` or `hostname:port` (its `port` overrides `default_port`) (list, default: [])
16
+ - **hosts_command**: Command to get `hosts` (Windows not supported). If given the option, `hosts` is overwritten. (string, default: null)
17
+ - **hosts_separator**: Separator for `hosts_command` result (string, default: " ")
18
+ - **default_port**: Port number for SSH (integer, default: 22)
19
+ - **path**: File or directory path of remote host (string, default: "")
20
+ - **path_command**: Command to get `path` (Windows not supported). If given the option, `path` is overwritten. (string, default: null)
21
+ - **ignore_not_found_hosts**: If true, hosts that meet the following conditions are skipped, which means they are not included into the the target of resuming.) (boolean, default: false)
22
+ - Target file (or directory) is not found
23
+ - An error that is related to SSH connectivity occurred
24
24
  - **auth**: SSH authentication setting (hash, default: {})
25
- - **user**: SSH username (string, default: execute user)
26
- - **type**: public_key or password (string, default: public_key)
27
- - **key_path**: Path of secret key (If you choose type "public_key") (string, default: "~/.ssh/id_rsa or id_dsa")
28
- - **password**: SSH password (If you choose type "password") (string)
29
- - **skip_host_key_verification**: If the option is true, HostKey verification will be skipped (boolean, default: false)
25
+ - **user**: SSH username (string, default: current user)
26
+ - **type**: `public_key` or `password` (string, default: public_key)
27
+ - **key_path**: Path of your secret key (required when you choose `public_key` type) (string, default: `~/.ssh/id_rsa` or `id_dsa`")
28
+ - **password**: Password of the `user` (required when you choose `password` type) (string)
29
+ - **skip_host_key_verification**: If true, verification of host key will be skipped (boolean, default: false)
30
30
 
31
31
  ## Example
32
32
 
@@ -50,8 +50,8 @@ in:
50
50
  ```
51
51
 
52
52
  ## Note
53
- When this plugin run on Linux, a task might be blocked.
54
- The cause is java.security.SecureRandom. Please try one of the followings.
53
+ When running Embulk with this plugin on Linux, it might be blocked due to SecureRandom. Please try one of followings to resolve it.
54
+ (Note: it makes SecureRandom more insecure than default)
55
55
 
56
56
  ### set JVM_OPTION "-Djava.security.egd"
57
57
 
@@ -60,10 +60,9 @@ $ export JAVA_TOOL_OPTIONS="-Djava.security.egd=file:/dev/./urandom"
60
60
  $ embulk run config.yml
61
61
  ```
62
62
 
63
- ### rewrite ${JAVA_HOME}/jre/lib/security/java.security
64
-
63
+ ### Update "securerandom.source" in ${JAVA_HOME}/jre/lib/security/java.security
65
64
  ```
66
- # securerandom.source=file:/dev/random # before
65
+ # securerandom.source=file:/dev/random # before
67
66
  securerandom.source=file:/dev/./urandom # after
68
67
  ```
69
68
 
@@ -72,15 +71,19 @@ securerandom.source=file:/dev/./urandom # after
72
71
  http://stackoverflow.com/questions/137212/how-to-solve-performance-problem-with-java-securerandom
73
72
 
74
73
  ## Development on local machine
75
- - Install Docker and then we can create SSH-able containers
74
+ Install Docker and Docker compose so that you can start SSH-able containers and run tests.
75
+
76
76
  ```sh
77
- $ ssh-keygen -t ecdsa -f ./id_rsa_test -N ''
78
77
  $ docker-compose up -d
79
78
  $ docker-compose ps
80
- Name Command State Ports
79
+ Name Command State Ports
81
80
  --------------------------------------------------------------------------
82
- embulkinputremote_host1_1 /entrypoint.sh Up 0.0.0.0:10022->22/tcp
83
- embulkinputremote_host2_1 /entrypoint.sh Up 0.0.0.0:10023->22/tcp
81
+ embulk-input-remote_host1 /entrypoint.sh Up 0.0.0.0:10022->22/tcp
82
+ embulk-input-remote_host2 /entrypoint.sh Up 0.0.0.0:10023->22/tcp
83
+
84
+ $ docker cp $(docker inspect --format="{{.Id}}" embulk-input-remote_host1):/home/ubuntu/.ssh/id_rsa_test .
85
+ $ chmod 400 id_rsa_test
86
+ $ ./gradlew test
84
87
  ```
85
88
 
86
89
  ## Build
data/build.gradle CHANGED
@@ -1,18 +1,17 @@
1
1
  buildscript {
2
- ext.kotlinVersion = '1.1.1'
3
2
  repositories {
4
- mavenCentral()
5
3
  jcenter()
6
4
  maven { url 'http://kamatama41.github.com/maven-repository/repository' }
7
5
  }
8
6
  dependencies {
9
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
10
7
  classpath "com.github.kamatama41:gradle-embulk-plugin:0.1.4"
11
8
  classpath "net.researchgate:gradle-release:2.5.0"
12
9
  }
13
10
  }
14
11
 
15
- apply plugin: "kotlin"
12
+ plugins {
13
+ id "org.jetbrains.kotlin.jvm" version "1.2.31"
14
+ }
16
15
  apply plugin: "com.github.kamatama41.embulk"
17
16
  apply plugin: "net.researchgate.release"
18
17
 
@@ -25,19 +24,19 @@ repositories {
25
24
  maven { url 'http://kamatama41.github.com/maven-repository/repository' }
26
25
  }
27
26
 
28
- sourceCompatibility = 1.7
29
- targetCompatibility = 1.7
27
+ sourceCompatibility = 1.8
28
+ targetCompatibility = 1.8
30
29
 
31
30
  dependencies {
32
- compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
33
- compile "com.hierynomus:sshj:0.19.1"
31
+ compile "org.jetbrains.kotlin:kotlin-stdlib"
32
+ compile "com.hierynomus:sshj:0.24.0"
34
33
  compile "com.jcraft:jzlib:1.1.3"
35
- testCompile "com.github.kamatama41:embulk-test-helpers:0.3.2"
34
+ testCompile "com.github.kamatama41:embulk-test-helpers:0.4.0"
36
35
  testCompile "com.github.docker-java:docker-java:3.0.7"
37
36
  }
38
37
 
39
38
  embulk {
40
- version = "0.8.18"
39
+ version = "0.9.7"
41
40
  category = "file-input"
42
41
  name = "remote"
43
42
  authors = ["Shinichi Ishimura"]
@@ -47,6 +46,10 @@ embulk {
47
46
  homepage = "https://github.com/kamatama41/embulk-input-remote"
48
47
  }
49
48
 
49
+ test {
50
+ jvmArgs '-Djava.security.egd=file:/dev/./urandom'
51
+ }
52
+
50
53
  release {
51
54
  git { requireBranch = 'master' }
52
55
  }
Binary file
Binary file
Binary file
Binary file
Binary file
data/docker-compose.yml CHANGED
@@ -1,16 +1,16 @@
1
- version: '2'
1
+ version: '3'
2
2
  services:
3
3
  host1:
4
- image: "sickp/alpine-sshd:7.2"
4
+ container_name: embulk-input-remote_host1
5
+ image: "kamatama41/ubuntu-sshd"
5
6
  ports:
6
7
  - "10022:22"
7
8
  volumes:
8
9
  - ./src/test/resources/input/host1/:/mount
9
- - ./id_rsa_test.pub:/root/.ssh/authorized_keys
10
10
  host2:
11
- image: "sickp/alpine-sshd:7.2"
11
+ container_name: embulk-input-remote_host2
12
+ image: "kamatama41/ubuntu-sshd"
12
13
  ports:
13
14
  - "10023:22"
14
15
  volumes:
15
16
  - ./src/test/resources/input/host2/:/mount
16
- - ./id_rsa_test.pub:/root/.ssh/authorized_keys
Binary file
@@ -1,6 +1,5 @@
1
- #Thu Feb 02 08:54:57 JST 2017
2
1
  distributionBase=GRADLE_USER_HOME
3
2
  distributionPath=wrapper/dists
4
3
  zipStoreBase=GRADLE_USER_HOME
5
4
  zipStorePath=wrapper/dists
6
- distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
5
+ distributionUrl=https\://services.gradle.org/distributions/gradle-4.5.1-all.zip
data/gradle.properties CHANGED
@@ -1 +1 @@
1
- version=0.3.3
1
+ version=0.4.0
data/gradlew CHANGED
@@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
33
33
  # Use the maximum available, or set MAX_FD != -1 to use that value.
34
34
  MAX_FD="maximum"
35
35
 
36
- warn ( ) {
36
+ warn () {
37
37
  echo "$*"
38
38
  }
39
39
 
40
- die ( ) {
40
+ die () {
41
41
  echo
42
42
  echo "$*"
43
43
  echo
@@ -155,7 +155,7 @@ if $cygwin ; then
155
155
  fi
156
156
 
157
157
  # Escape application args
158
- save ( ) {
158
+ save () {
159
159
  for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160
160
  echo " "
161
161
  }
@@ -37,7 +37,6 @@ class TestRemoteFileInputPlugin : EmbulkPluginTest() {
37
37
  assertRecords(record(1, "user1"))
38
38
  }
39
39
 
40
- @Ignore("Cannot pass on TravisCI, although pass on Local Mac OS...")
41
40
  @Test fun loadFromRemoteViaPublicKey() {
42
41
  val keyPath = System.getenv("KEY_PATH") ?: "./id_rsa_test"
43
42
 
@@ -159,8 +158,8 @@ class TestRemoteFileInputPlugin : EmbulkPluginTest() {
159
158
  }
160
159
 
161
160
  companion object DockerUtils {
162
- private val CONTAINER_ID_HOST1 = "embulkinputremote_host1_1"
163
- private val CONTAINER_ID_HOST2 = "embulkinputremote_host2_1"
161
+ private const val CONTAINER_ID_HOST1 = "embulk-input-remote_host1"
162
+ private const val CONTAINER_ID_HOST2 = "embulk-input-remote_host2"
164
163
  private val dockerClient = DockerClientBuilder.getInstance().build()
165
164
 
166
165
  private fun stopContainer(containerId: String) {
@@ -3,9 +3,9 @@ hosts:
3
3
  - localhost:10022
4
4
  path: /mount/test.csv
5
5
  auth:
6
- user: root
6
+ user: ubuntu
7
7
  type: password
8
- password: root
8
+ password: passw0rd
9
9
  skip_host_key_verification: true
10
10
  parser:
11
11
  type: csv
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-input-remote
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shinichi Ishimura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-20 00:00:00.000000000 Z
11
+ date: 2018-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -47,7 +47,6 @@ extra_rdoc_files: []
47
47
  files:
48
48
  - .circleci/config.yml
49
49
  - .gitignore
50
- - Dockerfile
51
50
  - LICENSE.txt
52
51
  - README.md
53
52
  - build.gradle
@@ -70,14 +69,14 @@ files:
70
69
  - src/test/resources/input/host2/test_command.csv
71
70
  - src/test/resources/script/hosts.sh
72
71
  - src/test/resources/yaml/base.yml
73
- - classpath/sshj-0.19.1.jar
74
- - classpath/bcprov-jdk15on-1.51.jar
72
+ - classpath/bcpkix-jdk15on-1.57.jar
73
+ - classpath/kotlin-stdlib-1.2.31.jar
74
+ - classpath/sshj-0.24.0.jar
75
75
  - classpath/jzlib-1.1.3.jar
76
- - classpath/embulk-input-remote-0.3.3.jar
76
+ - classpath/eddsa-0.2.0.jar
77
+ - classpath/embulk-input-remote-0.4.0.jar
77
78
  - classpath/annotations-13.0.jar
78
- - classpath/bcpkix-jdk15on-1.51.jar
79
- - classpath/eddsa-0.1.0.jar
80
- - classpath/kotlin-stdlib-1.1.1.jar
79
+ - classpath/bcprov-jdk15on-1.57.jar
81
80
  homepage: https://github.com/kamatama41/embulk-input-remote
82
81
  licenses:
83
82
  - MIT
data/Dockerfile DELETED
@@ -1,17 +0,0 @@
1
- # Deprecated
2
- ## ref: https://docs.docker.com/engine/examples/running_ssh_service/
3
- #FROM ubuntu:16.04
4
- #
5
- #RUN apt-get update && apt-get install -y openssh-server
6
- #RUN mkdir /var/run/sshd
7
- #RUN echo 'root:screencast' | chpasswd
8
- #RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
9
- #
10
- ## SSH login fix. Otherwise user is kicked off after login
11
- #RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
12
- #
13
- #ENV NOTVISIBLE "in users profile"
14
- #RUN echo "export VISIBLE=now" >> /etc/profile
15
- #
16
- #EXPOSE 22
17
- #CMD ["/usr/sbin/sshd", "-D"]
Binary file
Binary file
Binary file
Binary file
Binary file