-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* build(docker): add a docker compose file to test connection through ssh tunnel * feat(command): add ssh related fields to the options struct * feat(connection): add support for mysql connection via ssh * feat(sshdb): add sshdb pkg to handle the ssh tunnel connection * feat(pkg): add support for new drivers for connections via the ssh tunnel * feat: integrate the sshdb pkg to the app and the root command * build(docker): add more services and commands to the docker compose environment to play with * build(git): add the known_host file generated by the tests * feat(config): add support for the ssh tunnel to the config file * docs(readme): add details to the documentation on how to setup a ssh tunnel connection * docs(CONTRIBUTING): add more info on how to run the ssh server for testing
- Loading branch information
1 parent
a0a6fdc
commit 9386c11
Showing
22 changed files
with
953 additions
and
28 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 |
---|---|---|
|
@@ -30,3 +30,6 @@ dblab | |
assets/.DS_Store | ||
|
||
.DS_Store | ||
|
||
# sshdb pkg testing | ||
pkg/sshdb/testdata/known_hosts |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
services: | ||
ssh: | ||
image: rastasheep/ubuntu-sshd:latest | ||
container_name: test-ssh | ||
ports: | ||
- "2222:22" | ||
environment: | ||
- ROOT_PASSWORD=root | ||
networks: | ||
- private-network | ||
- public-network | ||
|
||
postgres: | ||
image: postgres:15 | ||
container_name: test-postgres | ||
environment: | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=password | ||
- POSTGRES_DB=users | ||
networks: | ||
- private-network | ||
|
||
mysql: | ||
image: mysql:8.0 | ||
environment: | ||
MYSQL_USER: myuser | ||
MYSQL_PASSWORD: 5@klkbN#ABC | ||
MYSQL_ROOT_PASSWORD: myuser | ||
MYSQL_DATABASE: mydb | ||
networks: | ||
- private-network | ||
|
||
dblab: | ||
build: | ||
context: . | ||
target: builder | ||
volumes: | ||
- ./:/src/app:z | ||
depends_on: | ||
- postgres | ||
environment: | ||
- DB_HOST=postgres | ||
- DB_USER=postgres | ||
- DB_PASSWORD=password | ||
- DB_NAME=users | ||
- DB_PORT=5432 | ||
- DB_DRIVER=postgres | ||
- DB_SCHEMA=public | ||
entrypoint: ["/bin/bash", "./scripts/entrypoint.dev.sh"] | ||
networks: | ||
- private-network | ||
|
||
dblab-mysql: | ||
build: | ||
context: . | ||
target: builder | ||
volumes: | ||
- ./:/src/app:z | ||
depends_on: | ||
- mysql | ||
environment: | ||
- DB_HOST=mysql | ||
- DB_USER=myuser | ||
- DB_PASSWORD=5@klkbN#ABC | ||
- DB_NAME=mydb | ||
- DB_PORT=3306 | ||
- DB_DRIVER=mysql | ||
entrypoint: ["/bin/bash", "./scripts/entrypoint-mysql.dev.sh"] | ||
networks: | ||
- private-network | ||
|
||
networks: | ||
private-network: | ||
internal: true # Makes this network inaccessible from outside Docker | ||
public-network: |
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
version: "3.8" | ||
|
||
services: | ||
postgres: | ||
image: postgres:12.1-alpine | ||
|
Oops, something went wrong.