1.0.1 • Published 9 months ago

forward-pg-tunnel v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
9 months ago

Forward-PG-Tunnel

English

Deіcription

Package for creating an ssh tunnel and sending additional messages to the PostgreSQL database

Getting started

To start, you need to fill in the default configuration file located in the config folder.

Configuration file

SectionKeyTypeExampleDescription
sshConfighoststring"20.95.0.236"SSH route host
sshConfigport503numberSSH port to the route
sshConfigusernamestring"root"SSH route login
sshConfigpasswordstring""SSH route password. If not used leave blank
sshConfigprivateKeystring"~/.ssh/id_rsa_dell_r620"The path to the connection key
tunnelOptionsautoClosebooleantrueAuto close tunnel
serverOptionshoststring"localhost"Local address where the TCP server will be started
serverOptionsportnumber5432Local port where the TCP server will be running
forwardOptionssrcPortnumber5432Port on the remote host that will be sent to the local host
forwardOptionsdstAddrstring"192.168.0.105"Database address on the remote host
forwardOptionsdstPortnumber5432Database port on a remote host
pgClientuserstring"postgre"Database user
pgClienthoststring"localhost"Database host
pgClientdatabasestring"postgre"Database name
pgClientpasswordstring"password"DB password
pgClientportnumber5432DB port
visibleshowbooleantrueReflection of alkalis during Operation

Usage examples

Create an instance and call the methods

import PostgreTunnelConnector from 'forward-pg-tunnel';

const dbConnector = new PostgreTunnelConnector();
dbConnector.runQuery("SELECT * FROM regions limit 5");

Українська

Опис

Пакет для створення ssh тунелю та пробросу досупів до бази данних PostgreSQL

Початок роботи

Для пзапуску необхідно заповнити конфігураційний файл default котрий знаходиться в папці config.

Конфігуційний файл

РозділКлючТипПрикладОпис
sshConfighoststring"5.59.105.0"Хост ssh маршруту
sshConfigport503numberПорт ssh маршруту
sshConfigusernamestring"root"Логін ssh маршруту
sshConfigpasswordstring""Пароль ssh маршруту. Якщо не використовуєтья залишити порожнім
sshConfigprivateKeystring"~/.ssh/id_rsa_dell_r620"Шлях до ключа підключення
tunnelOptionsautoClosebooleantrueАвтозачинення тунелю
serverOptionshoststring"localhost"Локальна адреса, на якій буде запущений TCP сервер
serverOptionsportnumber5432Локальний порт, на якому буде запущений TCP сервер
forwardOptionssrcPortnumber5432Порт на віддаленому хості, який буде проброшен на локальний хост
forwardOptionsdstAddrstring"192.168.0.105"Адреса бази даних на віддаленому хості
forwardOptionsdstPortnumber5432Порт бази даних на віддаленому хості
pgClientuserstring"postgre"Користувач БД
pgClienthoststring"localhost"Хост БД
pgClientdatabasestring"postgre"Назва БД
pgClientpasswordstring"password"Пароль БД
pgClientportnumber5432Порт БД
visibleshowbooleantrueВідображення логів у процессі роботи

Приклади використання

Створіть екземпляр і викликайте методи

import PostgreTunnelConnector from 'forward-pg-tunnel'

const dbConnector = new PostgreTunnelConnector();
dbConnector.runQuery("SELECT * FROM regions limit 5");
1.0.1

9 months ago

1.0.0

9 months ago