diff --git a/jrcc-access-spring-boot-sample-app/README.md b/jrcc-access-spring-boot-sample-app/README.md new file mode 100644 index 00000000..dda5aa88 --- /dev/null +++ b/jrcc-access-spring-boot-sample-app/README.md @@ -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 | diff --git a/jrcc-access-spring-boot-sample-app/docker-compose.yml b/jrcc-access-spring-boot-sample-app/docker-compose.yml new file mode 100644 index 00000000..b276191e --- /dev/null +++ b/jrcc-access-spring-boot-sample-app/docker-compose.yml @@ -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" diff --git a/jrcc-access-spring-boot-sample-app/src/main/resources/application-sftp.yml b/jrcc-access-spring-boot-sample-app/src/main/resources/application-sftp.yml new file mode 100644 index 00000000..01bf260f --- /dev/null +++ b/jrcc-access-spring-boot-sample-app/src/main/resources/application-sftp.yml @@ -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 \ No newline at end of file