Skip to content

Commit

Permalink
Merge pull request #179 from alexjoybc/feature/sftp-demo-app
Browse files Browse the repository at this point in the history
Added config for sftp
  • Loading branch information
TayGov authored Apr 15, 2020
2 parents cd0cb85 + 7950c8f commit f5c589c
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 12 deletions.
2 changes: 1 addition & 1 deletion jrcc-access-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>ca.bc.gov.open</groupId>
<artifactId>jrcc-document-api</artifactId>
<version>1.1.0</version>
<version>1.2.0-SNAPSHOT</version>

<parent>
<groupId>org.springframework.boot</groupId>
Expand Down
6 changes: 3 additions & 3 deletions jrcc-access-spring-boot-autoconfigure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</parent>
<groupId>ca.bc.gov.open</groupId>
<artifactId>jrcc-access-spring-boot-autoconfigure</artifactId>
<version>1.1.0</version>
<version>1.2.0-SNAPSHOT</version>
<name>jrcc-access-spring-boot-autoconfigure</name>
<description>Demo project for Spring Boot</description>

Expand Down Expand Up @@ -98,12 +98,12 @@
<dependency>
<groupId>ca.bc.gov.open</groupId>
<artifactId>jrcc-document-access-libs</artifactId>
<version>1.1.0</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>ca.bc.gov.open</groupId>
<artifactId>jrcc-document-api</artifactId>
<version>1.1.0</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
Expand Down
22 changes: 22 additions & 0 deletions jrcc-access-spring-boot-sample-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Sample application

## SFTP Config

run

```bash
docker-compose up
```

run

```bash
ssh-keyscan -H localhost -p 22 >> ~/.ssh/known_hosts
```

configure the following environment variables on your environment:

| Name | Value |
| --- | --- |
| KNOWN_HOSTS | ~/.ssh/known_hosts |
| spring_active_profiles | sftp |
36 changes: 36 additions & 0 deletions jrcc-access-spring-boot-sample-app/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: '3.7'
services:

#############################################################################################
### SFTP SERVER ###
#############################################################################################
dps-sftp:
image: atmoz/sftp
ports:
- "22:22"
command: admin:admin:::upload
networks:
- doc-access


#############################################################################################
### REDIS SERVER ###
#############################################################################################
dps-redis:
container_name: redis
image: redis
command: redis-server --requirepass admin
ports:
- "6379:6379"
volumes:
- data-redis:/data
restart: always
networks:
- doc-access

volumes:
data-redis:

networks:
doc-access:
driver: "bridge"
4 changes: 2 additions & 2 deletions jrcc-access-spring-boot-sample-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</parent>
<groupId>ca.bc.gov.open</groupId>
<artifactId>jrcc-access-spring-boot-sample-app</artifactId>
<version>1.1.0</version>
<version>1.2.0-SNAPSHOT</version>
<name>jrcc-access-spring-boot-sample-app</name>
<description>Demo project for Spring Boot</description>

Expand All @@ -37,7 +37,7 @@
<dependency>
<groupId>ca.bc.gov.open</groupId>
<artifactId>jrcc-access-spring-boot-starter</artifactId>
<version>1.1.0</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>

</dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
main:
web-application-type: none
logging:
level:
ca:
gov:
bc: DEBUG
pattern:
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} %X{transaction.filename} %X{transaction.id} - %msg%n"
file: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} %X{transaction.filename} - %msg%n"
spring:
redis:
host: localhost
port: 6379
password: admin
bcgov:
access:
input:
sender: bcgov
document-type: test-doc
plugin: sftp
sftp:
port: 22
username: admin
password: admin
remoteDirectory: upload
filterPattern: .*.xml
cron: '*/5 * * * * ?'
maxMessagePerPoll: 1
allowUnknownKeys: true
knownHostFile: ${KNOWN_HOSTS}
output:
document-type: test-doc
plugin: console
6 changes: 3 additions & 3 deletions jrcc-access-spring-boot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</parent>
<groupId>ca.bc.gov.open</groupId>
<artifactId>jrcc-access-spring-boot-starter</artifactId>
<version>1.1.0</version>
<version>1.2.0-SNAPSHOT</version>
<name>jrcc-access-spring-boot-starter</name>
<description>Demo project for Spring Boot</description>

Expand All @@ -37,12 +37,12 @@
<dependency>
<groupId>ca.bc.gov.open</groupId>
<artifactId>jrcc-access-spring-boot-autoconfigure</artifactId>
<version>1.1.0</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>ca.bc.gov.open</groupId>
<artifactId>jrcc-document-access-libs</artifactId>
<version>1.1.0</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
</dependencies>

Expand Down
4 changes: 2 additions & 2 deletions jrcc-document-access-libs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<parent>
<groupId>ca.bc.gov.open</groupId>
<artifactId>document-access</artifactId>
<version>1.1.0</version>
<version>1.2.0-SNAPSHOT</version>
</parent>


<groupId>ca.bc.gov.open</groupId>
<artifactId>jrcc-document-access-libs</artifactId>
<version>1.1.0</version>
<version>1.2.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>jrcc-document-access-libs</name>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>ca.bc.gov.open</groupId>
<artifactId>document-access</artifactId>
<version>1.1.0</version>
<version>1.2.0-SNAPSHOT</version>

<name>document-access</name>
<packaging>pom</packaging>
Expand Down

0 comments on commit f5c589c

Please sign in to comment.