Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3312c357f3 | ||
|
|
fb6091bb83 | ||
|
|
16f88a1336 | ||
|
|
e0fcd058df | ||
|
|
9e37bd27f1 | ||
|
|
6b0b0244d1 | ||
|
|
c6ece21133 | ||
|
|
4919407228 | ||
|
|
1c3c82de18 | ||
|
|
06d73805a8 | ||
|
|
74e8482f96 | ||
|
|
79d8afc715 | ||
|
|
9a5df8487a | ||
|
|
3fb87562ed | ||
|
|
6a52fea44a | ||
|
|
e3085a44ba | ||
|
|
4ce11c039e | ||
|
|
70f62feec8 | ||
|
|
266a516076 | ||
|
|
2e8800150e | ||
|
|
8413681db0 | ||
|
|
ed8a581ff2 | ||
|
|
302aa1d85b | ||
|
|
f5f78eb32e | ||
|
|
e6df3d19fa | ||
|
|
08b1ea71e7 | ||
|
|
7fe302ed7c | ||
|
|
bcd170ab74 |
@@ -15,7 +15,7 @@ on:
|
|||||||
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GO_VERSION: "1.22"
|
GO_VERSION: "1.25"
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
@@ -28,7 +28,7 @@ jobs:
|
|||||||
timeout-minutes: 40
|
timeout-minutes: 40
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
pg_version: [9.6, 10, 11, 12, 13, 14, 15, 16, 17]
|
pg_version: [9.6, 10, 11, 12, 13, 14, 15, 16, 17, 18]
|
||||||
|
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
@@ -50,7 +50,7 @@ jobs:
|
|||||||
sudo rm -f /etc/apt/sources.list.d/pgdg.list
|
sudo rm -f /etc/apt/sources.list.d/pgdg.list
|
||||||
curl --silent https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add
|
curl --silent https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add
|
||||||
echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list
|
echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list
|
||||||
sudo apt-get update && sudo apt-get install -y postgresql-client-17
|
sudo apt-get update && sudo apt-get install -y postgresql-client-18
|
||||||
|
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
@@ -95,9 +95,9 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: golangci-lint
|
- name: golangci-lint
|
||||||
uses: golangci/golangci-lint-action@v3
|
uses: golangci/golangci-lint-action@v8
|
||||||
with:
|
with:
|
||||||
version: v1.57.1
|
version: v2.7.2
|
||||||
|
|
||||||
fmt:
|
fmt:
|
||||||
name: fmt
|
name: fmt
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ on:
|
|||||||
- main
|
- main
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GO_VERSION: "1.22"
|
GO_VERSION: "1.25"
|
||||||
CGO_ENABLED: 0
|
CGO_ENABLED: 0
|
||||||
IMAGE_REPOSITORY: sosedoff/pgweb
|
IMAGE_REPOSITORY: sosedoff/pgweb
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ on:
|
|||||||
- "v*"
|
- "v*"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GO_VERSION: "1.22"
|
GO_VERSION: "1.25"
|
||||||
CGO_ENABLED: 0
|
CGO_ENABLED: 0
|
||||||
DOCKER_REPOSITORY: sosedoff/pgweb
|
DOCKER_REPOSITORY: sosedoff/pgweb
|
||||||
GHCR_REPOSITORY: sosedoff/pgweb
|
GHCR_REPOSITORY: sosedoff/pgweb
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
version: "2"
|
||||||
|
linters:
|
||||||
|
disable:
|
||||||
|
- errcheck
|
||||||
|
settings:
|
||||||
|
staticcheck:
|
||||||
|
checks: ["all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022", "-ST1005", "-QF1004"]
|
||||||
+35
-14
@@ -1,8 +1,29 @@
|
|||||||
# 0.16.1 - 2024-09-07
|
## Changelog
|
||||||
|
|
||||||
|
Current [release](https://github.com/sosedoff/pgweb/releases) is `0.17.0`.
|
||||||
|
|
||||||
|
## 0.17.0 - 2025-11-22
|
||||||
|
|
||||||
|
- `NEW` Update Dockerfile to use Golang 1.24 image, GH-821
|
||||||
|
- `NEW` Bump go crypto package to 0.44.x, GH-820, GH-823
|
||||||
|
- `NEW` Add PostgreSQL 18 support to Github Actions, GH-816
|
||||||
|
- `NEW` Connect backend refactor, GH-801
|
||||||
|
- `NEW` Add server settings view, GH-768
|
||||||
|
- `NEW` Add exec time of empty queries, GH-763
|
||||||
|
- `FIX` Minor typos, GH-764, GH-786
|
||||||
|
- `FIX` Shorten git revision printed in the --version output, GH-770
|
||||||
|
|
||||||
|
## 0.16.2 - 2024-11-02
|
||||||
|
|
||||||
|
- `FIX` Build a new Docker image with PostgreSQL 17 support
|
||||||
|
- `FIX` Run CI against PostgreSQL 17, GH-758
|
||||||
|
- `FIX` Rename master to main branch, GH-750
|
||||||
|
|
||||||
|
## 0.16.1 - 2024-09-07
|
||||||
|
|
||||||
- `FIX` Remove linux/arm/v5 from docker release action, GH-742
|
- `FIX` Remove linux/arm/v5 from docker release action, GH-742
|
||||||
|
|
||||||
# 0.16.0 - 2024-06-04
|
## 0.16.0 - 2024-06-04
|
||||||
|
|
||||||
- `NEW` Allow database stats downloads, GH-738
|
- `NEW` Allow database stats downloads, GH-738
|
||||||
- `NEW` Add analyze table action, GH-737
|
- `NEW` Add analyze table action, GH-737
|
||||||
@@ -12,26 +33,26 @@
|
|||||||
- `FIX` Drop linux/arm/v5 from docker build, GH-728
|
- `FIX` Drop linux/arm/v5 from docker build, GH-728
|
||||||
- `FIX` Propagate CGO_ENABLED environment variable to docker build, GH-724
|
- `FIX` Propagate CGO_ENABLED environment variable to docker build, GH-724
|
||||||
|
|
||||||
# 0.15.0 - 2024-03-14
|
## 0.15.0 - 2024-03-14
|
||||||
|
|
||||||
- `NEW` Add support for a bookmarks-only mode, GH-716
|
- `NEW` Add support for a bookmarks-only mode, GH-716
|
||||||
- `FIX` Fix missing indexes by quoting schema/table name to ::regclass, GH-711
|
- `FIX` Fix missing indexes by quoting schema/table name to ::regclass, GH-711
|
||||||
- `FIX` Continue on parseJSON error, GH-708
|
- `FIX` Continue on parseJSON error, GH-708
|
||||||
|
|
||||||
# 0.14.3 - 2024-01-28
|
## 0.14.3 - 2024-01-28
|
||||||
|
|
||||||
- `NEW` Allow retrying a connection on startup, GH-695
|
- `NEW` Allow retrying a connection on startup, GH-695
|
||||||
- `NEW` Allow setting readonly mode in bookmarks, GH-707
|
- `NEW` Allow setting readonly mode in bookmarks, GH-707
|
||||||
- `FIX` Add UPDATE to list of restricted keywords in read-only mode, GH-697
|
- `FIX` Add UPDATE to list of restricted keywords in read-only mode, GH-697
|
||||||
|
|
||||||
# 0.14.2 - 2023-10-29
|
## 0.14.2 - 2023-10-29
|
||||||
|
|
||||||
- `NEW` Execute tests using PostgreSQL 16, GH-691
|
- `NEW` Execute tests using PostgreSQL 16, GH-691
|
||||||
- `FIX` Unclosed database sessions and tunnels, GH-688
|
- `FIX` Unclosed database sessions and tunnels, GH-688
|
||||||
- `FIX` Use pg_table_size for table stats query, GH-685
|
- `FIX` Use pg_table_size for table stats query, GH-685
|
||||||
- `FIX` Use `HasSuffix` to correctly determine URL prefix, GH-684
|
- `FIX` Use `HasSuffix` to correctly determine URL prefix, GH-684
|
||||||
|
|
||||||
# 0.14.1 - 2023-06-17
|
## 0.14.1 - 2023-06-17
|
||||||
|
|
||||||
- `NEW` Add process start time metric, GH-675
|
- `NEW` Add process start time metric, GH-675
|
||||||
- `NEW` Configure pgweb user for docker container, GH-674
|
- `NEW` Configure pgweb user for docker container, GH-674
|
||||||
@@ -39,7 +60,7 @@
|
|||||||
- `FIX` Fix typo in the healthy metric, GH-657
|
- `FIX` Fix typo in the healthy metric, GH-657
|
||||||
- `NEW` Use entrypoint instead of cmd in in dockerfile, GH-654
|
- `NEW` Use entrypoint instead of cmd in in dockerfile, GH-654
|
||||||
|
|
||||||
# 0.14.0 - 2023-02-21
|
## 0.14.0 - 2023-02-21
|
||||||
|
|
||||||
- `FIX` History page query loading fixup, GH-632
|
- `FIX` History page query loading fixup, GH-632
|
||||||
- `NEW` Display cell content via context menu, GH-634
|
- `NEW` Display cell content via context menu, GH-634
|
||||||
@@ -51,11 +72,11 @@
|
|||||||
- `FIX` Ensure that objects are sorted by schema and name, GH-648
|
- `FIX` Ensure that objects are sorted by schema and name, GH-648
|
||||||
- `FIX` Fetch local queries on db connect, GH-650
|
- `FIX` Fetch local queries on db connect, GH-650
|
||||||
|
|
||||||
# 0.13.1 - 2022-12-27
|
## 0.13.1 - 2022-12-27
|
||||||
|
|
||||||
- Fix connect flow when `~/.pgweb/bookmarks` directory is not available, GH-631
|
- Fix connect flow when `~/.pgweb/bookmarks` directory is not available, GH-631
|
||||||
|
|
||||||
# 0.13.0 - 2022-12-25
|
## 0.13.0 - 2022-12-25
|
||||||
|
|
||||||
- Add support for .pgpass file, GH-617
|
- Add support for .pgpass file, GH-617
|
||||||
- Request logging additions (request id, forwarded user), GH-618
|
- Request logging additions (request id, forwarded user), GH-618
|
||||||
@@ -67,7 +88,7 @@
|
|||||||
- Add duration_ms to log entries, GH-628
|
- Add duration_ms to log entries, GH-628
|
||||||
- Add query execution stats to api endpoint, GH-629
|
- Add query execution stats to api endpoint, GH-629
|
||||||
|
|
||||||
# 0.12.0 - 2022-12-13
|
## 0.12.0 - 2022-12-13
|
||||||
|
|
||||||
- Deprecate usage of Gox for binary builds, GH-571
|
- Deprecate usage of Gox for binary builds, GH-571
|
||||||
- Add netcat install in dockerfile to provide a way to healthcheck, GH-572
|
- Add netcat install in dockerfile to provide a way to healthcheck, GH-572
|
||||||
@@ -94,12 +115,12 @@
|
|||||||
- Switch windows tests from Appveyor to Github Actions, GH-611
|
- Switch windows tests from Appveyor to Github Actions, GH-611
|
||||||
- Fix activity endpoint panic when server version is not detected, GH-612
|
- Fix activity endpoint panic when server version is not detected, GH-612
|
||||||
|
|
||||||
# 0.11.12 - 2022-07-05
|
## 0.11.12 - 2022-07-05
|
||||||
|
|
||||||
- Update base docker image (alpine), update deps, GH-558
|
- Update base docker image (alpine), update deps, GH-558
|
||||||
- Refactor docker images building, include ARM, GH-568
|
- Refactor docker images building, include ARM, GH-568
|
||||||
|
|
||||||
# 0.11.11 - 2022-03-29
|
## 0.11.11 - 2022-03-29
|
||||||
|
|
||||||
- Auto-detect the query from the query source based on user selection, GH-547
|
- Auto-detect the query from the query source based on user selection, GH-547
|
||||||
- Added binary codec base58 as well as improving the help for --binary-codec flag, GH-548
|
- Added binary codec base58 as well as improving the help for --binary-codec flag, GH-548
|
||||||
@@ -364,7 +385,7 @@
|
|||||||
## 0.6.0 - 2015-05-31
|
## 0.6.0 - 2015-05-31
|
||||||
|
|
||||||
- Adds ability to execute only selected SQL query in run command view, [GH-85]
|
- Adds ability to execute only selected SQL query in run command view, [GH-85]
|
||||||
- Adds ability to delete/truncate table via context meny on sidebar view
|
- Adds ability to delete/truncate table via context many on sidebar view
|
||||||
- Adds ability to export table contents to CSV via context menu on sidebar view
|
- Adds ability to export table contents to CSV via context menu on sidebar view
|
||||||
- Changes sidebar color scheme to a lighter and better looking one
|
- Changes sidebar color scheme to a lighter and better looking one
|
||||||
|
|
||||||
@@ -378,7 +399,7 @@
|
|||||||
|
|
||||||
## 0.5.2 - 2015-04-13
|
## 0.5.2 - 2015-04-13
|
||||||
|
|
||||||
- Adds a new endpoint /activity that retuns active queries
|
- Adds a new endpoint /activity that returns active queries
|
||||||
- Adds tab to view active queries
|
- Adds tab to view active queries
|
||||||
- Adds column sorting when browsing table contents
|
- Adds column sorting when browsing table contents
|
||||||
- Fixes SQL query view when switching to table structure view
|
- Fixes SQL query view when switching to table structure view
|
||||||
|
|||||||
+1
-1
@@ -2,6 +2,6 @@
|
|||||||
- Create a new git branch
|
- Create a new git branch
|
||||||
- Make changes
|
- Make changes
|
||||||
- Run tests: `make test`
|
- Run tests: `make test`
|
||||||
- Run tests agains all supported PostreSQL versions: `make test-all` (optional)
|
- Run tests against all supported PostreSQL versions: `make test-all` (optional)
|
||||||
- If you change frontend code (js/css) make sure to rebuild assets: `make assets`
|
- If you change frontend code (js/css) make sure to rebuild assets: `make assets`
|
||||||
- Open a new pull request
|
- Open a new pull request
|
||||||
+5
-5
@@ -1,11 +1,11 @@
|
|||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Builder Stage
|
# Builder Stage
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
FROM golang:1.22-bullseye AS build
|
FROM golang:1.25-trixie AS build
|
||||||
|
|
||||||
# Set default build argument for CGO_ENABLED
|
# Set default build argument for CGO_ENABLED
|
||||||
ARG CGO_ENABLED=0
|
ARG CGO_ENABLED=0
|
||||||
ENV CGO_ENABLED ${CGO_ENABLED}
|
ENV CGO_ENABLED=${CGO_ENABLED}
|
||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ RUN make build
|
|||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Fetch signing key
|
# Fetch signing key
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
FROM debian:bullseye-slim AS keyring
|
FROM debian:trixie-slim AS keyring
|
||||||
ADD https://www.postgresql.org/media/keys/ACCC4CF8.asc keyring.asc
|
ADD https://www.postgresql.org/media/keys/ACCC4CF8.asc keyring.asc
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -qq --no-install-recommends gpg
|
apt-get install -qq --no-install-recommends gpg
|
||||||
@@ -30,14 +30,14 @@ RUN gpg -o keyring.pgp --dearmor keyring.asc
|
|||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Release Stage
|
# Release Stage
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
FROM debian:bullseye-slim
|
FROM debian:trixie-slim
|
||||||
|
|
||||||
ARG keyring=/usr/share/keyrings/postgresql-archive-keyring.pgp
|
ARG keyring=/usr/share/keyrings/postgresql-archive-keyring.pgp
|
||||||
COPY --from=keyring /keyring.pgp $keyring
|
COPY --from=keyring /keyring.pgp $keyring
|
||||||
RUN . /etc/os-release && \
|
RUN . /etc/os-release && \
|
||||||
echo "deb [signed-by=${keyring}] http://apt.postgresql.org/pub/repos/apt/ ${VERSION_CODENAME}-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \
|
echo "deb [signed-by=${keyring}] http://apt.postgresql.org/pub/repos/apt/ ${VERSION_CODENAME}-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \
|
||||||
apt-get update && \
|
apt-get update && \
|
||||||
apt-get install -qq --no-install-recommends ca-certificates openssl netcat curl postgresql-client
|
apt-get install -qq --no-install-recommends ca-certificates openssl netcat-openbsd curl postgresql-client
|
||||||
|
|
||||||
COPY --from=build /build/pgweb /usr/bin/pgweb
|
COPY --from=build /build/pgweb /usr/bin/pgweb
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
PKG = github.com/sosedoff/pgweb
|
PKG = github.com/sosedoff/pgweb
|
||||||
GIT_COMMIT ?= $(shell git rev-parse HEAD)
|
GIT_COMMIT ?= $(shell git rev-parse --short=8 HEAD)
|
||||||
BUILD_TIME ?= $(shell date -u +"%Y-%m-%dT%H:%M:%SZ" | tr -d '\n')
|
BUILD_TIME ?= $(shell date -u +"%Y-%m-%dT%H:%M:%SZ" | tr -d '\n')
|
||||||
GO_VERSION ?= $(shell go version | awk {'print $$3'})
|
GO_VERSION ?= $(shell go version | awk {'print $$3'})
|
||||||
|
|
||||||
|
|||||||
@@ -3,3 +3,4 @@ source "https://rubygems.org"
|
|||||||
gem "sinatra"
|
gem "sinatra"
|
||||||
gem "json"
|
gem "json"
|
||||||
gem "puma"
|
gem "puma"
|
||||||
|
gem "rackup"
|
||||||
|
|||||||
@@ -1,30 +1,43 @@
|
|||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
json (2.6.2)
|
base64 (0.3.0)
|
||||||
mustermann (3.0.0)
|
json (2.12.2)
|
||||||
|
logger (1.7.0)
|
||||||
|
mustermann (3.0.3)
|
||||||
ruby2_keywords (~> 0.0.1)
|
ruby2_keywords (~> 0.0.1)
|
||||||
nio4r (2.5.8)
|
nio4r (2.7.4)
|
||||||
puma (6.0.0)
|
puma (6.6.0)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
rack (2.2.6.2)
|
rack (3.1.16)
|
||||||
rack-protection (3.0.4)
|
rack-protection (4.1.1)
|
||||||
rack
|
base64 (>= 0.1.0)
|
||||||
|
logger (>= 1.6.0)
|
||||||
|
rack (>= 3.0.0, < 4)
|
||||||
|
rack-session (2.1.1)
|
||||||
|
base64 (>= 0.1.0)
|
||||||
|
rack (>= 3.0.0)
|
||||||
|
rackup (2.2.1)
|
||||||
|
rack (>= 3)
|
||||||
ruby2_keywords (0.0.5)
|
ruby2_keywords (0.0.5)
|
||||||
sinatra (3.0.4)
|
sinatra (4.1.1)
|
||||||
|
logger (>= 1.6.0)
|
||||||
mustermann (~> 3.0)
|
mustermann (~> 3.0)
|
||||||
rack (~> 2.2, >= 2.2.4)
|
rack (>= 3.0.0, < 4)
|
||||||
rack-protection (= 3.0.4)
|
rack-protection (= 4.1.1)
|
||||||
|
rack-session (>= 2.0.0, < 3)
|
||||||
tilt (~> 2.0)
|
tilt (~> 2.0)
|
||||||
tilt (2.0.11)
|
tilt (2.6.0)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
arm64-darwin-21
|
arm64-darwin-21
|
||||||
|
arm64-darwin-24
|
||||||
x86_64-linux
|
x86_64-linux
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
json
|
json
|
||||||
puma
|
puma
|
||||||
|
rackup
|
||||||
sinatra
|
sinatra
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
|
require "bundler/setup"
|
||||||
require "sinatra"
|
require "sinatra"
|
||||||
|
|
||||||
# Authentication token
|
# Authentication token
|
||||||
$token = "test"
|
$token = "test"
|
||||||
|
|
||||||
# List of all availble resources
|
# List of all available resources
|
||||||
$resources = {
|
$resources = {
|
||||||
"id1" => "postgres://localhost:5432/db1?sslmode=disable",
|
"id1" => "postgres://localhost:5432/db1?sslmode=disable",
|
||||||
"id2" => "postgres://localhost:5432/db2?sslmode=disable",
|
"id2" => "postgres://localhost:5432/db2?sslmode=disable",
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
host = "localhost"
|
||||||
|
port = 5432
|
||||||
|
user = "postgres"
|
||||||
|
database = "mydatabase"
|
||||||
|
ssl = "disable"
|
||||||
|
|
||||||
|
[SSH]
|
||||||
|
host = "ssh-host"
|
||||||
|
user = "ssh-user"
|
||||||
|
password = "ssh-password"
|
||||||
|
key = "/path/to/key-file"
|
||||||
|
keypassword = "key-file-password"
|
||||||
+10
-2
@@ -1,6 +1,4 @@
|
|||||||
---
|
---
|
||||||
version: "3.9"
|
|
||||||
|
|
||||||
x-base: &base
|
x-base: &base
|
||||||
environment: &env
|
environment: &env
|
||||||
POSTGRES_DB: pgweb
|
POSTGRES_DB: pgweb
|
||||||
@@ -11,6 +9,16 @@ x-base: &base
|
|||||||
interval: 5s
|
interval: 5s
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
postgres18:
|
||||||
|
<<: *base
|
||||||
|
image: postgres:18
|
||||||
|
ports:
|
||||||
|
- 5433:5432
|
||||||
|
postgres17:
|
||||||
|
<<: *base
|
||||||
|
image: postgres:17
|
||||||
|
ports:
|
||||||
|
- 5433:5432
|
||||||
postgres16:
|
postgres16:
|
||||||
<<: *base
|
<<: *base
|
||||||
image: postgres:16
|
image: postgres:16
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
---
|
---
|
||||||
version: "3.9"
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
container_name: pgweb-postgres
|
container_name: pgweb-postgres
|
||||||
|
|||||||
@@ -1,57 +1,64 @@
|
|||||||
module github.com/sosedoff/pgweb
|
module github.com/sosedoff/pgweb
|
||||||
|
|
||||||
go 1.22
|
go 1.25
|
||||||
|
|
||||||
|
toolchain go1.25.4
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/BurntSushi/toml v1.1.0
|
github.com/BurntSushi/toml v1.1.0
|
||||||
github.com/ScaleFT/sshkeys v0.0.0-20200327173127-6142f742bca5
|
github.com/ScaleFT/sshkeys v0.0.0-20200327173127-6142f742bca5
|
||||||
github.com/gin-gonic/gin v1.9.1
|
github.com/gin-gonic/gin v1.11.0
|
||||||
github.com/jackc/pgpassfile v1.0.0
|
github.com/jackc/pgpassfile v1.0.0
|
||||||
github.com/jessevdk/go-flags v1.5.0
|
github.com/jessevdk/go-flags v1.5.0
|
||||||
github.com/jmoiron/sqlx v1.3.5
|
github.com/jmoiron/sqlx v1.3.5
|
||||||
github.com/lib/pq v1.10.5
|
github.com/lib/pq v1.10.5
|
||||||
github.com/mitchellh/go-homedir v1.1.0
|
github.com/mitchellh/go-homedir v1.1.0
|
||||||
github.com/mr-tron/base58 v1.2.0
|
github.com/mr-tron/base58 v1.2.0
|
||||||
github.com/prometheus/client_golang v1.14.0
|
github.com/prometheus/client_golang v1.19.1
|
||||||
github.com/sirupsen/logrus v1.9.0
|
github.com/sirupsen/logrus v1.9.1
|
||||||
github.com/stretchr/testify v1.8.3
|
github.com/stretchr/testify v1.11.1
|
||||||
github.com/tuvistavie/securerandom v0.0.0-20140719024926-15512123a948
|
github.com/tuvistavie/securerandom v0.0.0-20140719024926-15512123a948
|
||||||
golang.org/x/crypto v0.9.0
|
go.balki.me/anyhttp v0.5.0
|
||||||
|
golang.org/x/crypto v0.46.0
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/beorn7/perks v1.0.1 // indirect
|
github.com/beorn7/perks v1.0.1 // indirect
|
||||||
github.com/bytedance/sonic v1.9.1 // indirect
|
github.com/bytedance/gopkg v0.1.3 // indirect
|
||||||
|
github.com/bytedance/sonic v1.14.2 // indirect
|
||||||
|
github.com/bytedance/sonic/loader v0.4.0 // indirect
|
||||||
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
||||||
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
|
github.com/cloudwego/base64x v0.1.6 // indirect
|
||||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||||
github.com/dchest/bcrypt_pbkdf v0.0.0-20150205184540-83f37f9c154a // indirect
|
github.com/dchest/bcrypt_pbkdf v0.0.0-20150205184540-83f37f9c154a // indirect
|
||||||
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
|
github.com/gabriel-vasile/mimetype v1.4.12 // indirect
|
||||||
github.com/gin-contrib/sse v0.1.0 // indirect
|
github.com/gin-contrib/sse v1.1.0 // indirect
|
||||||
github.com/go-playground/locales v0.14.1 // indirect
|
github.com/go-playground/locales v0.14.1 // indirect
|
||||||
github.com/go-playground/universal-translator v0.18.1 // indirect
|
github.com/go-playground/universal-translator v0.18.1 // indirect
|
||||||
github.com/go-playground/validator/v10 v10.14.0 // indirect
|
github.com/go-playground/validator/v10 v10.30.1 // indirect
|
||||||
github.com/goccy/go-json v0.10.2 // indirect
|
github.com/goccy/go-json v0.10.5 // indirect
|
||||||
github.com/golang/protobuf v1.5.2 // indirect
|
github.com/goccy/go-yaml v1.19.1 // indirect
|
||||||
github.com/json-iterator/go v1.1.12 // indirect
|
github.com/json-iterator/go v1.1.12 // indirect
|
||||||
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
|
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
|
||||||
github.com/kr/pretty v0.3.1 // indirect
|
github.com/kr/text v0.2.0 // indirect
|
||||||
github.com/leodido/go-urn v1.2.4 // indirect
|
github.com/leodido/go-urn v1.4.0 // indirect
|
||||||
github.com/mattn/go-isatty v0.0.19 // indirect
|
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||||
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
|
|
||||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||||
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
|
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
|
||||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||||
github.com/prometheus/client_model v0.3.0 // indirect
|
github.com/prometheus/client_model v0.5.0 // indirect
|
||||||
github.com/prometheus/common v0.39.0 // indirect
|
github.com/prometheus/common v0.48.0 // indirect
|
||||||
github.com/prometheus/procfs v0.8.0 // indirect
|
github.com/prometheus/procfs v0.12.0 // indirect
|
||||||
|
github.com/quic-go/qpack v0.6.0 // indirect
|
||||||
|
github.com/quic-go/quic-go v0.58.0 // indirect
|
||||||
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
|
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
|
||||||
github.com/ugorji/go/codec v1.2.11 // indirect
|
github.com/ugorji/go/codec v1.3.1 // indirect
|
||||||
golang.org/x/arch v0.3.0 // indirect
|
go.uber.org/mock v0.6.0 // indirect
|
||||||
golang.org/x/net v0.10.0 // indirect
|
golang.org/x/arch v0.23.0 // indirect
|
||||||
golang.org/x/sys v0.8.0 // indirect
|
golang.org/x/net v0.48.0 // indirect
|
||||||
golang.org/x/text v0.9.0 // indirect
|
golang.org/x/sys v0.39.0 // indirect
|
||||||
google.golang.org/protobuf v1.30.0 // indirect
|
golang.org/x/text v0.32.0 // indirect
|
||||||
|
google.golang.org/protobuf v1.36.11 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -4,44 +4,44 @@ github.com/ScaleFT/sshkeys v0.0.0-20200327173127-6142f742bca5 h1:VauE2GcJNZFun2O
|
|||||||
github.com/ScaleFT/sshkeys v0.0.0-20200327173127-6142f742bca5/go.mod h1:gxOHeajFfvGQh/fxlC8oOKBe23xnnJTif00IFFbiT+o=
|
github.com/ScaleFT/sshkeys v0.0.0-20200327173127-6142f742bca5/go.mod h1:gxOHeajFfvGQh/fxlC8oOKBe23xnnJTif00IFFbiT+o=
|
||||||
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||||
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
|
github.com/bytedance/gopkg v0.1.3 h1:TPBSwH8RsouGCBcMBktLt1AymVo2TVsBVCY4b6TnZ/M=
|
||||||
github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s=
|
github.com/bytedance/gopkg v0.1.3/go.mod h1:576VvJ+eJgyCzdjS+c4+77QF3p7ubbtiKARP3TxducM=
|
||||||
github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U=
|
github.com/bytedance/sonic v1.14.2 h1:k1twIoe97C1DtYUo+fZQy865IuHia4PR5RPiuGPPIIE=
|
||||||
|
github.com/bytedance/sonic v1.14.2/go.mod h1:T80iDELeHiHKSc0C9tubFygiuXoGzrkjKzX2quAx980=
|
||||||
|
github.com/bytedance/sonic/loader v0.4.0 h1:olZ7lEqcxtZygCK9EKYKADnpQoYkRQxaeY2NYzevs+o=
|
||||||
|
github.com/bytedance/sonic/loader v0.4.0/go.mod h1:AR4NYCk5DdzZizZ5djGqQ92eEhCCcdf5x77udYiSJRo=
|
||||||
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
|
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
|
||||||
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||||
github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY=
|
github.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=
|
||||||
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams=
|
github.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=
|
||||||
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk=
|
|
||||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/dchest/bcrypt_pbkdf v0.0.0-20150205184540-83f37f9c154a h1:saTgr5tMLFnmy/yg3qDTft4rE5DY2uJ/cCxCe3q0XTU=
|
github.com/dchest/bcrypt_pbkdf v0.0.0-20150205184540-83f37f9c154a h1:saTgr5tMLFnmy/yg3qDTft4rE5DY2uJ/cCxCe3q0XTU=
|
||||||
github.com/dchest/bcrypt_pbkdf v0.0.0-20150205184540-83f37f9c154a/go.mod h1:Bw9BbhOJVNR+t0jCqx2GC6zv0TGBsShs56Y3gfSCvl0=
|
github.com/dchest/bcrypt_pbkdf v0.0.0-20150205184540-83f37f9c154a/go.mod h1:Bw9BbhOJVNR+t0jCqx2GC6zv0TGBsShs56Y3gfSCvl0=
|
||||||
github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU=
|
github.com/gabriel-vasile/mimetype v1.4.12 h1:e9hWvmLYvtp846tLHam2o++qitpguFiYCKbn0w9jyqw=
|
||||||
github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA=
|
github.com/gabriel-vasile/mimetype v1.4.12/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=
|
||||||
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
|
github.com/gin-contrib/sse v1.1.0 h1:n0w2GMuUpWDVp7qSpvze6fAu9iRxJY4Hmj6AmBOU05w=
|
||||||
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
|
github.com/gin-contrib/sse v1.1.0/go.mod h1:hxRZ5gVpWMT7Z0B0gSNYqqsSCNIJMjzvm6fqCz9vjwM=
|
||||||
github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg=
|
github.com/gin-gonic/gin v1.11.0 h1:OW/6PLjyusp2PPXtyxKHU0RbX6I/l28FTdDlae5ueWk=
|
||||||
github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU=
|
github.com/gin-gonic/gin v1.11.0/go.mod h1:+iq/FyxlGzII0KHiBGjuNn4UNENUlKbGlNmc+W50Dls=
|
||||||
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
|
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
|
||||||
|
github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
|
||||||
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
|
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
|
||||||
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
|
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
|
||||||
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
|
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
|
||||||
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
|
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
|
||||||
github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js=
|
github.com/go-playground/validator/v10 v10.30.1 h1:f3zDSN/zOma+w6+1Wswgd9fLkdwy06ntQJp0BBvFG0w=
|
||||||
github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU=
|
github.com/go-playground/validator/v10 v10.30.1/go.mod h1:oSuBIQzuJxL//3MelwSLD5hc2Tu889bF0Idm9Dg26cM=
|
||||||
github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
|
github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
|
||||||
github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
|
github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
|
||||||
github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
|
github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4=
|
||||||
github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
|
github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
|
||||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
github.com/goccy/go-yaml v1.19.1 h1:3rG3+v8pkhRqoQ/88NYNMHYVGYztCOCIZ7UQhu7H+NE=
|
||||||
github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
|
github.com/goccy/go-yaml v1.19.1/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
|
||||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||||
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
|
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||||
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
|
||||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
|
||||||
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
|
|
||||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||||
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
|
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
|
||||||
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
|
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
|
||||||
@@ -51,24 +51,21 @@ github.com/jmoiron/sqlx v1.3.5 h1:vFFPA71p1o5gAeqtEAwLU4dnX2napprKtHr7PYIcN3g=
|
|||||||
github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ=
|
github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ=
|
||||||
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
||||||
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
||||||
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
|
github.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=
|
||||||
github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk=
|
github.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
|
||||||
github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY=
|
|
||||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||||
github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q=
|
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
|
||||||
github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4=
|
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
|
||||||
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||||
github.com/lib/pq v1.10.5 h1:J+gdV2cUmX7ZqL2B0lFcW0m+egaHC2V3lpO8nWxyYiQ=
|
github.com/lib/pq v1.10.5 h1:J+gdV2cUmX7ZqL2B0lFcW0m+egaHC2V3lpO8nWxyYiQ=
|
||||||
github.com/lib/pq v1.10.5/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
github.com/lib/pq v1.10.5/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||||
github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
|
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||||
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||||
github.com/mattn/go-sqlite3 v1.14.6 h1:dNPt6NO46WmLVt2DLNpwczCmdV5boIZ6g/tlDrlRUbg=
|
github.com/mattn/go-sqlite3 v1.14.6 h1:dNPt6NO46WmLVt2DLNpwczCmdV5boIZ6g/tlDrlRUbg=
|
||||||
github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
|
github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
|
||||||
github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
|
|
||||||
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
|
|
||||||
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
|
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
|
||||||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||||
@@ -78,74 +75,77 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
|
|||||||
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||||
github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o=
|
github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o=
|
||||||
github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
|
github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
|
||||||
github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ=
|
github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=
|
||||||
github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4=
|
github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
|
||||||
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
|
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw=
|
github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE=
|
||||||
github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y=
|
github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho=
|
||||||
github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4=
|
github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw=
|
||||||
github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w=
|
github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
|
||||||
github.com/prometheus/common v0.39.0 h1:oOyhkDq05hPZKItWVBkJ6g6AtGxi+fy7F4JvUV8uhsI=
|
github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE=
|
||||||
github.com/prometheus/common v0.39.0/go.mod h1:6XBZ7lYdLCbkAVhwRsWTZn+IN5AB9F/NXd5w0BbEX0Y=
|
github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc=
|
||||||
github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo=
|
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
|
||||||
github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4=
|
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
|
||||||
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
|
github.com/quic-go/qpack v0.6.0 h1:g7W+BMYynC1LbYLSqRt8PBg5Tgwxn214ZZR34VIOjz8=
|
||||||
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
github.com/quic-go/qpack v0.6.0/go.mod h1:lUpLKChi8njB4ty2bFLX2x4gzDqXwUpaO1DP9qMDZII=
|
||||||
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
|
github.com/quic-go/quic-go v0.58.0 h1:ggY2pvZaVdB9EyojxL1p+5mptkuHyX5MOSv4dgWF4Ug=
|
||||||
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
|
github.com/quic-go/quic-go v0.58.0/go.mod h1:upnsH4Ju1YkqpLXC305eW3yDZ4NfnNbmQRCMWS58IKU=
|
||||||
|
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
|
||||||
|
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
|
||||||
|
github.com/sirupsen/logrus v1.9.1 h1:Ou41VVR3nMWWmTiEUnj0OlsgOSCUFgsPAOl6jRIcVtQ=
|
||||||
|
github.com/sirupsen/logrus v1.9.1/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||||
|
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
|
||||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||||
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||||
github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
|
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
||||||
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
|
||||||
github.com/tuvistavie/securerandom v0.0.0-20140719024926-15512123a948 h1:yL0l/u242MzDP6D0B5vGC+wxm5WRY+alQZy+dJk3bFI=
|
github.com/tuvistavie/securerandom v0.0.0-20140719024926-15512123a948 h1:yL0l/u242MzDP6D0B5vGC+wxm5WRY+alQZy+dJk3bFI=
|
||||||
github.com/tuvistavie/securerandom v0.0.0-20140719024926-15512123a948/go.mod h1:a06d/M1pxWi51qiSrfGMHaEydtuXT06nha8N2aNQuXk=
|
github.com/tuvistavie/securerandom v0.0.0-20140719024926-15512123a948/go.mod h1:a06d/M1pxWi51qiSrfGMHaEydtuXT06nha8N2aNQuXk=
|
||||||
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
|
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
|
||||||
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
|
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
|
||||||
github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
|
github.com/ugorji/go/codec v1.3.1 h1:waO7eEiFDwidsBN6agj1vJQ4AG7lh2yqXyOXqhgQuyY=
|
||||||
github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
|
github.com/ugorji/go/codec v1.3.1/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=
|
||||||
golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
|
go.balki.me/anyhttp v0.5.0 h1:uys0oRciBpZfwtxXAevScKy6amIQBXyDrcV0EtGF5zo=
|
||||||
golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k=
|
go.balki.me/anyhttp v0.5.0/go.mod h1:JhfekOIjgVODoVqUCficjpIgmB3wwlB7jhN0eN2EZ/s=
|
||||||
golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
|
go.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y=
|
||||||
|
go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU=
|
||||||
|
golang.org/x/arch v0.23.0 h1:lKF64A2jF6Zd8L0knGltUnegD62JMFBiCPBmQpToHhg=
|
||||||
|
golang.org/x/arch v0.23.0/go.mod h1:dNHoOeKiyja7GTvF9NJS1l3Z2yntpQNzgrjh1cU103A=
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||||
golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g=
|
golang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=
|
||||||
golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0=
|
golang.org/x/crypto v0.46.0/go.mod h1:Evb/oLKmMraqjZ2iQTwDwvCtJkczlDuTmdJXoZVzqU0=
|
||||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M=
|
golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=
|
||||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY=
|
||||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
||||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
||||||
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
|
golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=
|
||||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||||
golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols=
|
golang.org/x/term v0.38.0 h1:PQ5pkm/rLO6HnxFR7N2lJHOZX6Kez5Y1gDSJla6jo7Q=
|
||||||
|
golang.org/x/term v0.38.0/go.mod h1:bSEAKrOT1W+VSu9TSCMtoGEOUcKxOKgl3LE5QEF/xVg=
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
|
golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=
|
||||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY=
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
|
||||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
|
||||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
|
||||||
google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
|
|
||||||
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||||
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
|
|
||||||
|
|||||||
+13
-6
@@ -15,6 +15,7 @@ import (
|
|||||||
"github.com/sosedoff/pgweb/pkg/bookmarks"
|
"github.com/sosedoff/pgweb/pkg/bookmarks"
|
||||||
"github.com/sosedoff/pgweb/pkg/client"
|
"github.com/sosedoff/pgweb/pkg/client"
|
||||||
"github.com/sosedoff/pgweb/pkg/command"
|
"github.com/sosedoff/pgweb/pkg/command"
|
||||||
|
"github.com/sosedoff/pgweb/pkg/connect"
|
||||||
"github.com/sosedoff/pgweb/pkg/connection"
|
"github.com/sosedoff/pgweb/pkg/connection"
|
||||||
"github.com/sosedoff/pgweb/pkg/metrics"
|
"github.com/sosedoff/pgweb/pkg/metrics"
|
||||||
"github.com/sosedoff/pgweb/pkg/queries"
|
"github.com/sosedoff/pgweb/pkg/queries"
|
||||||
@@ -92,18 +93,18 @@ func GetSessions(c *gin.Context) {
|
|||||||
|
|
||||||
// ConnectWithBackend creates a new connection based on backend resource
|
// ConnectWithBackend creates a new connection based on backend resource
|
||||||
func ConnectWithBackend(c *gin.Context) {
|
func ConnectWithBackend(c *gin.Context) {
|
||||||
// Setup a new backend client
|
backend := connect.NewBackend(command.Opts.ConnectBackend, command.Opts.ConnectToken)
|
||||||
backend := Backend{
|
backend.SetLogger(logger)
|
||||||
Endpoint: command.Opts.ConnectBackend,
|
|
||||||
Token: command.Opts.ConnectToken,
|
if command.Opts.ConnectHeaders != "" {
|
||||||
PassHeaders: strings.Split(command.Opts.ConnectHeaders, ","),
|
backend.SetPassHeaders(strings.Split(command.Opts.ConnectHeaders, ","))
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
|
ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
// Fetch connection credentials
|
// Fetch connection credentials
|
||||||
cred, err := backend.FetchCredential(ctx, c.Param("resource"), c)
|
cred, err := backend.FetchCredential(ctx, c.Param("resource"), c.Request.Header)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
badRequest(c, err)
|
badRequest(c, err)
|
||||||
return
|
return
|
||||||
@@ -486,6 +487,12 @@ func GetConnectionInfo(c *gin.Context) {
|
|||||||
successResponse(c, info)
|
successResponse(c, info)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetServerSettings renders a list of all server settings
|
||||||
|
func GetServerSettings(c *gin.Context) {
|
||||||
|
res, err := DB(c).ServerSettings()
|
||||||
|
serveResult(c, res, err)
|
||||||
|
}
|
||||||
|
|
||||||
// GetActivity renders a list of running queries
|
// GetActivity renders a list of running queries
|
||||||
func GetActivity(c *gin.Context) {
|
func GetActivity(c *gin.Context) {
|
||||||
res, err := DB(c).Activity()
|
res, err := DB(c).Activity()
|
||||||
|
|||||||
@@ -1,87 +0,0 @@
|
|||||||
package api
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bytes"
|
|
||||||
"context"
|
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
|
||||||
"net/http"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Backend represents a third party configuration source
|
|
||||||
type Backend struct {
|
|
||||||
Endpoint string
|
|
||||||
Token string
|
|
||||||
PassHeaders []string
|
|
||||||
}
|
|
||||||
|
|
||||||
// BackendRequest represents a payload sent to the third-party source
|
|
||||||
type BackendRequest struct {
|
|
||||||
Resource string `json:"resource"`
|
|
||||||
Token string `json:"token"`
|
|
||||||
Headers map[string]string `json:"headers"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// BackendCredential represents the third-party response
|
|
||||||
type BackendCredential struct {
|
|
||||||
DatabaseURL string `json:"database_url"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// FetchCredential sends an authentication request to a third-party service
|
|
||||||
func (be Backend) FetchCredential(ctx context.Context, resource string, c *gin.Context) (*BackendCredential, error) {
|
|
||||||
logger.WithField("resource", resource).Debug("fetching database credential")
|
|
||||||
|
|
||||||
request := BackendRequest{
|
|
||||||
Resource: resource,
|
|
||||||
Token: be.Token,
|
|
||||||
Headers: map[string]string{},
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pass white-listed client headers to the backend request
|
|
||||||
for _, name := range be.PassHeaders {
|
|
||||||
request.Headers[strings.ToLower(name)] = c.Request.Header.Get(name)
|
|
||||||
}
|
|
||||||
|
|
||||||
body, err := json.Marshal(request)
|
|
||||||
if err != nil {
|
|
||||||
logger.WithField("resource", resource).Error("backend request serialization error:", err)
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
req, err := http.NewRequestWithContext(ctx, http.MethodPost, be.Endpoint, bytes.NewReader(body))
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
req.Header.Set("content-type", "application/json")
|
|
||||||
|
|
||||||
resp, err := http.DefaultClient.Do(req)
|
|
||||||
if err != nil {
|
|
||||||
logger.WithField("resource", resource).Error("backend credential fetch failed:", err)
|
|
||||||
return nil, errBackendConnectError
|
|
||||||
}
|
|
||||||
defer resp.Body.Close()
|
|
||||||
|
|
||||||
if resp.StatusCode != 200 {
|
|
||||||
err = fmt.Errorf("backend credential fetch received HTTP status code %v", resp.StatusCode)
|
|
||||||
|
|
||||||
logger.
|
|
||||||
WithField("resource", resource).
|
|
||||||
WithField("status", resp.StatusCode).
|
|
||||||
Error(err)
|
|
||||||
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
cred := &BackendCredential{}
|
|
||||||
if err := json.NewDecoder(resp.Body).Decode(cred); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if cred.DatabaseURL == "" {
|
|
||||||
return nil, errConnStringRequired
|
|
||||||
}
|
|
||||||
|
|
||||||
return cred, nil
|
|
||||||
}
|
|
||||||
@@ -7,12 +7,10 @@ import (
|
|||||||
var (
|
var (
|
||||||
errNotConnected = errors.New("Not connected")
|
errNotConnected = errors.New("Not connected")
|
||||||
errNotPermitted = errors.New("Not permitted")
|
errNotPermitted = errors.New("Not permitted")
|
||||||
errConnStringRequired = errors.New("Connection string is required")
|
|
||||||
errInvalidConnString = errors.New("Invalid connection string")
|
errInvalidConnString = errors.New("Invalid connection string")
|
||||||
errSessionRequired = errors.New("Session ID is required")
|
errSessionRequired = errors.New("Session ID is required")
|
||||||
errSessionLocked = errors.New("Session is locked")
|
errSessionLocked = errors.New("Session is locked")
|
||||||
errURLRequired = errors.New("URL parameter is required")
|
errURLRequired = errors.New("URL parameter is required")
|
||||||
errQueryRequired = errors.New("Query parameter is required")
|
errQueryRequired = errors.New("Query parameter is required")
|
||||||
errDatabaseNameRequired = errors.New("Database name is required")
|
errDatabaseNameRequired = errors.New("Database name is required")
|
||||||
errBackendConnectError = errors.New("Unable to connect to the auth backend")
|
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ func SetupRoutes(router *gin.Engine) {
|
|||||||
api.POST("/switchdb", SwitchDb)
|
api.POST("/switchdb", SwitchDb)
|
||||||
api.GET("/databases", GetDatabases)
|
api.GET("/databases", GetDatabases)
|
||||||
api.GET("/connection", GetConnectionInfo)
|
api.GET("/connection", GetConnectionInfo)
|
||||||
|
api.GET("/server_settings", GetServerSettings)
|
||||||
api.GET("/activity", GetActivity)
|
api.GET("/activity", GetActivity)
|
||||||
api.GET("/schemas", GetSchemas)
|
api.GET("/schemas", GetSchemas)
|
||||||
api.GET("/objects", GetObjects)
|
api.GET("/objects", GetObjects)
|
||||||
|
|||||||
@@ -43,18 +43,21 @@ func (m *SessionManager) IDs() []string {
|
|||||||
|
|
||||||
func (m *SessionManager) Sessions() map[string]*client.Client {
|
func (m *SessionManager) Sessions() map[string]*client.Client {
|
||||||
m.mu.Lock()
|
m.mu.Lock()
|
||||||
sessions := m.sessions
|
defer m.mu.Unlock()
|
||||||
m.mu.Unlock()
|
|
||||||
|
sessions := make(map[string]*client.Client, len(m.sessions))
|
||||||
|
for k, v := range m.sessions {
|
||||||
|
sessions[k] = v
|
||||||
|
}
|
||||||
|
|
||||||
return sessions
|
return sessions
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *SessionManager) Get(id string) *client.Client {
|
func (m *SessionManager) Get(id string) *client.Client {
|
||||||
m.mu.Lock()
|
m.mu.Lock()
|
||||||
c := m.sessions[id]
|
defer m.mu.Unlock()
|
||||||
m.mu.Unlock()
|
|
||||||
|
|
||||||
return c
|
return m.sessions[id]
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *SessionManager) Add(id string, conn *client.Client) {
|
func (m *SessionManager) Add(id string, conn *client.Client) {
|
||||||
@@ -81,10 +84,9 @@ func (m *SessionManager) Remove(id string) bool {
|
|||||||
|
|
||||||
func (m *SessionManager) Len() int {
|
func (m *SessionManager) Len() int {
|
||||||
m.mu.Lock()
|
m.mu.Lock()
|
||||||
sz := len(m.sessions)
|
defer m.mu.Unlock()
|
||||||
m.mu.Unlock()
|
|
||||||
|
|
||||||
return sz
|
return len(m.sessions)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *SessionManager) Cleanup() int {
|
func (m *SessionManager) Cleanup() int {
|
||||||
@@ -118,7 +120,7 @@ func (m *SessionManager) RunPeriodicCleanup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *SessionManager) staleSessions() []string {
|
func (m *SessionManager) staleSessions() []string {
|
||||||
m.mu.TryLock()
|
m.mu.Lock()
|
||||||
defer m.mu.Unlock()
|
defer m.mu.Unlock()
|
||||||
|
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ func TestManagerList(t *testing.T) {
|
|||||||
num int
|
num int
|
||||||
err string
|
err string
|
||||||
}{
|
}{
|
||||||
{"../../data", 3, ""},
|
{"../../data", 4, ""},
|
||||||
{"../../data/bookmark.toml", 0, "is not a directory"},
|
{"../../data/bookmark.toml", 0, "is not a directory"},
|
||||||
{"../../data2", 0, ""},
|
{"../../data2", 0, ""},
|
||||||
{"", 0, ""},
|
{"", 0, ""},
|
||||||
@@ -32,7 +32,12 @@ func TestManagerList(t *testing.T) {
|
|||||||
func TestManagerListIDs(t *testing.T) {
|
func TestManagerListIDs(t *testing.T) {
|
||||||
ids, err := NewManager("../../data").ListIDs()
|
ids, err := NewManager("../../data").ListIDs()
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.Equal(t, []string{"bookmark", "bookmark_invalid_ssl", "bookmark_url"}, ids)
|
assert.Equal(t, []string{
|
||||||
|
"bookmark",
|
||||||
|
"bookmark_invalid_ssl",
|
||||||
|
"bookmark_url",
|
||||||
|
"bookmark_with_ssh",
|
||||||
|
}, ids)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestManagerGet(t *testing.T) {
|
func TestManagerGet(t *testing.T) {
|
||||||
@@ -80,6 +85,19 @@ func Test_readBookmark(t *testing.T) {
|
|||||||
assert.Equal(t, "", b.Password)
|
assert.Equal(t, "", b.Password)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
t.Run("with ssh options", func(t *testing.T) {
|
||||||
|
b, err := readBookmark("../../data/bookmark_with_ssh.toml")
|
||||||
|
assert.NoError(t, err)
|
||||||
|
assert.NotNil(t, b.SSH)
|
||||||
|
|
||||||
|
sshc := b.SSH
|
||||||
|
assert.Equal(t, "ssh-host", sshc.Host)
|
||||||
|
assert.Equal(t, "ssh-user", sshc.User)
|
||||||
|
assert.Equal(t, "ssh-password", sshc.Password)
|
||||||
|
assert.Equal(t, "/path/to/key-file", sshc.Key)
|
||||||
|
assert.Equal(t, "key-file-password", sshc.KeyPassword)
|
||||||
|
})
|
||||||
|
|
||||||
t.Run("invalid ssl", func(t *testing.T) {
|
t.Run("invalid ssl", func(t *testing.T) {
|
||||||
b, err := readBookmark("../../data/bookmark_invalid_ssl.toml")
|
b, err := readBookmark("../../data/bookmark_invalid_ssl.toml")
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|||||||
+29
-19
@@ -1,6 +1,7 @@
|
|||||||
package cli
|
package cli
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
@@ -22,6 +23,7 @@ import (
|
|||||||
"github.com/sosedoff/pgweb/pkg/metrics"
|
"github.com/sosedoff/pgweb/pkg/metrics"
|
||||||
"github.com/sosedoff/pgweb/pkg/queries"
|
"github.com/sosedoff/pgweb/pkg/queries"
|
||||||
"github.com/sosedoff/pgweb/pkg/util"
|
"github.com/sosedoff/pgweb/pkg/util"
|
||||||
|
"go.balki.me/anyhttp"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -194,7 +196,7 @@ func printVersion() {
|
|||||||
fmt.Println(command.VersionString())
|
fmt.Println(command.VersionString())
|
||||||
}
|
}
|
||||||
|
|
||||||
func startServer() {
|
func startServer() *anyhttp.ServerCtx {
|
||||||
router := gin.New()
|
router := gin.New()
|
||||||
router.Use(api.RequestLogger(logger))
|
router.Use(api.RequestLogger(logger))
|
||||||
router.Use(gin.Recovery())
|
router.Use(gin.Recovery())
|
||||||
@@ -210,18 +212,22 @@ func startServer() {
|
|||||||
api.SetupMetrics(router)
|
api.SetupMetrics(router)
|
||||||
|
|
||||||
fmt.Println("Starting server...")
|
fmt.Println("Starting server...")
|
||||||
go func() {
|
address := fmt.Sprintf("%v:%v", options.HTTPHost, options.HTTPPort)
|
||||||
metrics.SetHealthy(true)
|
if options.HTTPAddr != "" {
|
||||||
|
address = options.HTTPAddr
|
||||||
|
}
|
||||||
|
|
||||||
err := router.Run(fmt.Sprintf("%v:%v", options.HTTPHost, options.HTTPPort))
|
metrics.SetHealthy(true)
|
||||||
if err != nil {
|
|
||||||
fmt.Println("Cant start server:", err)
|
ctx, err := anyhttp.Serve(address, router.Handler())
|
||||||
if strings.Contains(err.Error(), "address already in use") {
|
if err != nil {
|
||||||
openPage()
|
fmt.Println("Can't start server:", err)
|
||||||
}
|
if strings.Contains(err.Error(), "address already in use") {
|
||||||
os.Exit(1)
|
openPage()
|
||||||
}
|
}
|
||||||
}()
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
return ctx
|
||||||
}
|
}
|
||||||
|
|
||||||
func startMetricsServer() {
|
func startMetricsServer() {
|
||||||
@@ -236,12 +242,6 @@ func startMetricsServer() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func handleSignals() {
|
|
||||||
c := make(chan os.Signal, 1)
|
|
||||||
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
|
|
||||||
<-c
|
|
||||||
}
|
|
||||||
|
|
||||||
func openPage() {
|
func openPage() {
|
||||||
url := fmt.Sprintf("http://%v:%v/%s", options.HTTPHost, options.HTTPPort, options.Prefix)
|
url := fmt.Sprintf("http://%v:%v/%s", options.HTTPHost, options.HTTPPort, options.Prefix)
|
||||||
fmt.Println("To view database open", url, "in browser")
|
fmt.Println("To view database open", url, "in browser")
|
||||||
@@ -327,7 +327,17 @@ func Run() {
|
|||||||
go startMetricsServer()
|
go startMetricsServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
startServer()
|
serverCtx := startServer()
|
||||||
|
|
||||||
openPage()
|
openPage()
|
||||||
handleSignals()
|
|
||||||
|
c := make(chan os.Signal, 1)
|
||||||
|
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
|
||||||
|
select {
|
||||||
|
case doneErr := <-serverCtx.Done:
|
||||||
|
logger.Infoln("idle server. shutting down error: ", doneErr)
|
||||||
|
case <-c:
|
||||||
|
logger.Infoln("received signal. shutting down")
|
||||||
|
serverCtx.Shutdown(context.TODO())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -386,6 +386,10 @@ func (client *Client) TablesStats() (*Result, error) {
|
|||||||
return client.query(statements.TablesStats)
|
return client.query(statements.TablesStats)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (client *Client) ServerSettings() (*Result, error) {
|
||||||
|
return client.query(statements.Settings)
|
||||||
|
}
|
||||||
|
|
||||||
// Returns all active queriers on the server
|
// Returns all active queriers on the server
|
||||||
func (client *Client) Activity() (*Result, error) {
|
func (client *Client) Activity() (*Result, error) {
|
||||||
if client.serverType == cockroachType {
|
if client.serverType == cockroachType {
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/sosedoff/pgweb/pkg/command"
|
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
|
"github.com/sosedoff/pgweb/pkg/command"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -57,7 +57,9 @@ func assertMatches(t *testing.T, expected, src []string) {
|
|||||||
|
|
||||||
func pgVersion() (int, int) {
|
func pgVersion() (int, int) {
|
||||||
var major, minor int
|
var major, minor int
|
||||||
fmt.Sscanf(os.Getenv("PGVERSION"), "%d.%d", &major, &minor)
|
if _, err := fmt.Sscanf(os.Getenv("PGVERSION"), "%d.%d", &major, &minor); err != nil {
|
||||||
|
log.Println("[warn] unable to read value of PGVERSION env var")
|
||||||
|
}
|
||||||
return major, minor
|
return major, minor
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -717,6 +719,32 @@ func testConnContext(t *testing.T) {
|
|||||||
assert.Equal(t, "default", result.Mode)
|
assert.Equal(t, "default", result.Mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func testServerSettings(t *testing.T) {
|
||||||
|
expectedColumns := []string{
|
||||||
|
"name",
|
||||||
|
"setting",
|
||||||
|
"unit",
|
||||||
|
"category",
|
||||||
|
"short_desc",
|
||||||
|
"extra_desc",
|
||||||
|
"context",
|
||||||
|
"vartype",
|
||||||
|
"source",
|
||||||
|
"min_val",
|
||||||
|
"max_val",
|
||||||
|
"enumvals",
|
||||||
|
"boot_val",
|
||||||
|
"reset_val",
|
||||||
|
"sourcefile",
|
||||||
|
"sourceline",
|
||||||
|
"pending_restart",
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := testClient.ServerSettings()
|
||||||
|
assert.NoError(t, err)
|
||||||
|
assert.Equal(t, expectedColumns, result.Columns)
|
||||||
|
}
|
||||||
|
|
||||||
func TestAll(t *testing.T) {
|
func TestAll(t *testing.T) {
|
||||||
if onWindows() {
|
if onWindows() {
|
||||||
t.Log("Unit testing on Windows platform is not supported.")
|
t.Log("Unit testing on Windows platform is not supported.")
|
||||||
@@ -756,6 +784,7 @@ func TestAll(t *testing.T) {
|
|||||||
testDumpExport(t)
|
testDumpExport(t)
|
||||||
testTablesStats(t)
|
testTablesStats(t)
|
||||||
testConnContext(t)
|
testConnContext(t)
|
||||||
|
testServerSettings(t)
|
||||||
|
|
||||||
teardownClient()
|
teardownClient()
|
||||||
teardown(t, true)
|
teardown(t, true)
|
||||||
|
|||||||
+2
-2
@@ -28,9 +28,9 @@ var (
|
|||||||
// Example: 10.2.3.1 -> 10.2
|
// Example: 10.2.3.1 -> 10.2
|
||||||
func getMajorMinorVersion(str string) (major int, minor int) {
|
func getMajorMinorVersion(str string) (major int, minor int) {
|
||||||
chunks := strings.Split(str, ".")
|
chunks := strings.Split(str, ".")
|
||||||
fmt.Sscanf(chunks[0], "%d", &major)
|
fmt.Sscanf(chunks[0], "%d", &major) //nolint
|
||||||
if len(chunks) > 1 {
|
if len(chunks) > 1 {
|
||||||
fmt.Sscanf(chunks[1], "%d", &minor)
|
fmt.Sscanf(chunks[1], "%d", &minor) //nolint
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ type Options struct {
|
|||||||
OpenTimeout int `long:"open-timeout" description:"Maximum wait time for connection, in seconds" default:"30"`
|
OpenTimeout int `long:"open-timeout" description:"Maximum wait time for connection, in seconds" default:"30"`
|
||||||
RetryDelay uint `long:"open-retry-delay" description:"Number of seconds to wait before retrying the connection" default:"3"`
|
RetryDelay uint `long:"open-retry-delay" description:"Number of seconds to wait before retrying the connection" default:"3"`
|
||||||
RetryCount uint `long:"open-retry" description:"Number of times to retry establishing connection" default:"0"`
|
RetryCount uint `long:"open-retry" description:"Number of times to retry establishing connection" default:"0"`
|
||||||
|
HTTPAddr string `long:"address" description:"anyhttp address. See https://pkg.go.dev/go.balki.me/anyhttp#readme-address-syntax" default:""`
|
||||||
HTTPHost string `long:"bind" description:"HTTP server host" default:"localhost"`
|
HTTPHost string `long:"bind" description:"HTTP server host" default:"localhost"`
|
||||||
HTTPPort uint `long:"listen" description:"HTTP server listen port" default:"8081"`
|
HTTPPort uint `long:"listen" description:"HTTP server listen port" default:"8081"`
|
||||||
AuthUser string `long:"auth-user" description:"HTTP basic auth user"`
|
AuthUser string `long:"auth-user" description:"HTTP basic auth user"`
|
||||||
@@ -181,7 +182,7 @@ func ParseOptions(args []string) (Options, error) {
|
|||||||
|
|
||||||
homePath, err := homedir.Dir()
|
homePath, err := homedir.Dir()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "[WARN] cant detect home dir: %v", err)
|
fmt.Fprintf(os.Stderr, "[WARN] can't detect home dir: %v", err)
|
||||||
homePath = os.Getenv("HOME")
|
homePath = os.Getenv("HOME")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -237,7 +238,7 @@ func AvailableEnvVars() string {
|
|||||||
return strings.Join([]string{
|
return strings.Join([]string{
|
||||||
" " + envVarPrefix + "DATABASE_URL Database connection string",
|
" " + envVarPrefix + "DATABASE_URL Database connection string",
|
||||||
" " + envVarPrefix + "URL_PREFIX HTTP server path prefix",
|
" " + envVarPrefix + "URL_PREFIX HTTP server path prefix",
|
||||||
" " + envVarPrefix + "SESSIONS: Enable multiple database sessions",
|
" " + envVarPrefix + "SESSIONS Enable multiple database sessions",
|
||||||
" " + envVarPrefix + "LOCK_SESSION Lock session to a single database connection",
|
" " + envVarPrefix + "LOCK_SESSION Lock session to a single database connection",
|
||||||
" " + envVarPrefix + "AUTH_USER HTTP basic auth username",
|
" " + envVarPrefix + "AUTH_USER HTTP basic auth username",
|
||||||
" " + envVarPrefix + "AUTH_PASS HTTP basic auth password",
|
" " + envVarPrefix + "AUTH_PASS HTTP basic auth password",
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
// Version is the current Pgweb application version
|
// Version is the current Pgweb application version
|
||||||
Version = "0.16.2"
|
Version = "0.17.0"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
@@ -0,0 +1,92 @@
|
|||||||
|
package connect
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Backend struct {
|
||||||
|
Endpoint string
|
||||||
|
Token string
|
||||||
|
PassHeaders []string
|
||||||
|
|
||||||
|
logger *logrus.Logger
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewBackend(endpoint string, token string) Backend {
|
||||||
|
return Backend{
|
||||||
|
Endpoint: endpoint,
|
||||||
|
Token: token,
|
||||||
|
logger: logrus.StandardLogger(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (be *Backend) SetLogger(logger *logrus.Logger) {
|
||||||
|
be.logger = logger
|
||||||
|
}
|
||||||
|
|
||||||
|
func (be *Backend) SetPassHeaders(headers []string) {
|
||||||
|
be.PassHeaders = headers
|
||||||
|
}
|
||||||
|
|
||||||
|
func (be *Backend) FetchCredential(ctx context.Context, resource string, headers http.Header) (*Credential, error) {
|
||||||
|
be.logger.WithField("resource", resource).Debug("fetching database credential")
|
||||||
|
|
||||||
|
request := Request{
|
||||||
|
Resource: resource,
|
||||||
|
Token: be.Token,
|
||||||
|
Headers: map[string]string{},
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pass allow-listed client headers to the backend request
|
||||||
|
for _, name := range be.PassHeaders {
|
||||||
|
request.Headers[strings.ToLower(name)] = headers.Get(name)
|
||||||
|
}
|
||||||
|
|
||||||
|
body, err := json.Marshal(request)
|
||||||
|
if err != nil {
|
||||||
|
be.logger.WithField("resource", resource).Error("backend request serialization error:", err)
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
req, err := http.NewRequestWithContext(ctx, http.MethodPost, be.Endpoint, bytes.NewReader(body))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
req.Header.Set("content-type", "application/json")
|
||||||
|
|
||||||
|
resp, err := http.DefaultClient.Do(req)
|
||||||
|
if err != nil {
|
||||||
|
be.logger.WithField("resource", resource).Error("backend credential fetch failed:", err)
|
||||||
|
return nil, errBackendConnectError
|
||||||
|
}
|
||||||
|
defer resp.Body.Close()
|
||||||
|
|
||||||
|
if resp.StatusCode != 200 {
|
||||||
|
err = fmt.Errorf("backend credential fetch received HTTP status code %v", resp.StatusCode)
|
||||||
|
|
||||||
|
be.logger.
|
||||||
|
WithField("resource", request.Resource).
|
||||||
|
WithField("status", resp.StatusCode).
|
||||||
|
Error(err)
|
||||||
|
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
cred := &Credential{}
|
||||||
|
if err := json.NewDecoder(resp.Body).Decode(cred); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if cred.DatabaseURL == "" {
|
||||||
|
return nil, errConnStringRequired
|
||||||
|
}
|
||||||
|
|
||||||
|
return cred, nil
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package api
|
package connect
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
@@ -9,6 +9,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -17,8 +18,8 @@ func TestBackendFetchCredential(t *testing.T) {
|
|||||||
name string
|
name string
|
||||||
backend Backend
|
backend Backend
|
||||||
resourceName string
|
resourceName string
|
||||||
cred *BackendCredential
|
cred *Credential
|
||||||
reqCtx *gin.Context
|
headers http.Header
|
||||||
ctx func() (context.Context, context.CancelFunc)
|
ctx func() (context.Context, context.CancelFunc)
|
||||||
err error
|
err error
|
||||||
}{
|
}{
|
||||||
@@ -33,12 +34,12 @@ func TestBackendFetchCredential(t *testing.T) {
|
|||||||
ctx: func() (context.Context, context.CancelFunc) {
|
ctx: func() (context.Context, context.CancelFunc) {
|
||||||
return context.WithTimeout(context.Background(), time.Millisecond*100)
|
return context.WithTimeout(context.Background(), time.Millisecond*100)
|
||||||
},
|
},
|
||||||
err: errors.New("Unable to connect to the auth backend"),
|
err: errors.New("unable to connect to the auth backend"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Empty response",
|
name: "Empty response",
|
||||||
backend: Backend{Endpoint: "http://localhost:5555/empty-response"},
|
backend: Backend{Endpoint: "http://localhost:5555/empty-response"},
|
||||||
err: errors.New("Connection string is required"),
|
err: errors.New("connection string is required"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Missing header",
|
name: "Missing header",
|
||||||
@@ -51,19 +52,15 @@ func TestBackendFetchCredential(t *testing.T) {
|
|||||||
Endpoint: "http://localhost:5555/pass-header",
|
Endpoint: "http://localhost:5555/pass-header",
|
||||||
PassHeaders: []string{"x-foo"},
|
PassHeaders: []string{"x-foo"},
|
||||||
},
|
},
|
||||||
reqCtx: &gin.Context{
|
headers: http.Header{
|
||||||
Request: &http.Request{
|
"X-Foo": []string{"bar"},
|
||||||
Header: http.Header{
|
|
||||||
"X-Foo": []string{"bar"},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
cred: &BackendCredential{DatabaseURL: "postgres://hostname/bar"},
|
cred: &Credential{DatabaseURL: "postgres://hostname/bar"},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Success",
|
name: "Success",
|
||||||
backend: Backend{Endpoint: "http://localhost:5555/success"},
|
backend: Backend{Endpoint: "http://localhost:5555/success"},
|
||||||
cred: &BackendCredential{DatabaseURL: "postgres://hostname/dbname"},
|
cred: &Credential{DatabaseURL: "postgres://hostname/dbname"},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,6 +70,8 @@ func TestBackendFetchCredential(t *testing.T) {
|
|||||||
startTestBackend(srvCtx, "localhost:5555")
|
startTestBackend(srvCtx, "localhost:5555")
|
||||||
|
|
||||||
for _, ex := range examples {
|
for _, ex := range examples {
|
||||||
|
ex.backend.logger = logrus.StandardLogger()
|
||||||
|
|
||||||
t.Run(ex.name, func(t *testing.T) {
|
t.Run(ex.name, func(t *testing.T) {
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
if ex.ctx != nil {
|
if ex.ctx != nil {
|
||||||
@@ -80,14 +79,7 @@ func TestBackendFetchCredential(t *testing.T) {
|
|||||||
}
|
}
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
reqCtx := ex.reqCtx
|
cred, err := ex.backend.FetchCredential(ctx, ex.resourceName, ex.headers)
|
||||||
if reqCtx == nil {
|
|
||||||
reqCtx = &gin.Context{
|
|
||||||
Request: &http.Request{},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cred, err := ex.backend.FetchCredential(ctx, ex.resourceName, reqCtx)
|
|
||||||
assert.Equal(t, ex.err, err)
|
assert.Equal(t, ex.err, err)
|
||||||
assert.Equal(t, ex.cred, cred)
|
assert.Equal(t, ex.cred, cred)
|
||||||
})
|
})
|
||||||
@@ -117,7 +109,7 @@ func startTestBackend(ctx context.Context, listenAddr string) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
router.POST("/pass-header", func(c *gin.Context) {
|
router.POST("/pass-header", func(c *gin.Context) {
|
||||||
req := BackendRequest{}
|
req := Request{}
|
||||||
if err := c.BindJSON(&req); err != nil {
|
if err := c.BindJSON(&req); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package connect
|
||||||
|
|
||||||
|
import "errors"
|
||||||
|
|
||||||
|
var (
|
||||||
|
errBackendConnectError = errors.New("unable to connect to the auth backend")
|
||||||
|
errConnStringRequired = errors.New("connection string is required")
|
||||||
|
)
|
||||||
|
|
||||||
|
// Request holds the resource request details
|
||||||
|
type Request struct {
|
||||||
|
Resource string `json:"resource"`
|
||||||
|
Token string `json:"token"`
|
||||||
|
Headers map[string]string `json:"headers,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Credential holds the database connection string
|
||||||
|
type Credential struct {
|
||||||
|
DatabaseURL string `json:"database_url"`
|
||||||
|
}
|
||||||
@@ -178,7 +178,7 @@ func lookupPassword(opts command.Options, url *neturl.URL) string {
|
|||||||
|
|
||||||
if url != nil {
|
if url != nil {
|
||||||
var dbName string
|
var dbName string
|
||||||
fmt.Sscanf(url.Path, "/%s", &dbName)
|
fmt.Sscanf(url.Path, "/%s", &dbName) //nolint
|
||||||
|
|
||||||
return passfile.FindPassword(
|
return passfile.FindPassword(
|
||||||
url.Hostname(),
|
url.Hostname(),
|
||||||
|
|||||||
@@ -47,6 +47,9 @@ var (
|
|||||||
//go:embed sql/function.sql
|
//go:embed sql/function.sql
|
||||||
Function string
|
Function string
|
||||||
|
|
||||||
|
//go:embed sql/settings.sql
|
||||||
|
Settings string
|
||||||
|
|
||||||
// Activity queries for specific PG versions
|
// Activity queries for specific PG versions
|
||||||
Activity = map[string]string{
|
Activity = map[string]string{
|
||||||
"default": "SELECT * FROM pg_stat_activity WHERE datname = current_database()",
|
"default": "SELECT * FROM pg_stat_activity WHERE datname = current_database()",
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
SELECT * FROM pg_settings
|
||||||
@@ -10,5 +10,6 @@ JOIN
|
|||||||
WHERE
|
WHERE
|
||||||
n.nspname = $1
|
n.nspname = $1
|
||||||
AND relname = $2
|
AND relname = $2
|
||||||
|
AND contype != 'n'
|
||||||
ORDER BY
|
ORDER BY
|
||||||
contype DESC
|
contype DESC
|
||||||
|
|||||||
@@ -327,6 +327,8 @@
|
|||||||
<li><a href="#" data-action="show_db_stats">Show Database Stats</a></li>
|
<li><a href="#" data-action="show_db_stats">Show Database Stats</a></li>
|
||||||
<li><a href="#" data-action="download_db_stats">Download Database Stats</a></li>
|
<li><a href="#" data-action="download_db_stats">Download Database Stats</a></li>
|
||||||
<li class="divider"></li>
|
<li class="divider"></li>
|
||||||
|
<li><a href="#" data-action="server_settings">Show Server Settings</a></li>
|
||||||
|
<li class="divider"></li>
|
||||||
<li><a href="#" data-action="export">Export SQL dump</a></li>
|
<li><a href="#" data-action="export">Export SQL dump</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+22
-4
@@ -99,6 +99,7 @@ function apiCall(method, path, params, cb) {
|
|||||||
|
|
||||||
function getInfo(cb) { apiCall("get", "/info", {}, cb); }
|
function getInfo(cb) { apiCall("get", "/info", {}, cb); }
|
||||||
function getConnection(cb) { apiCall("get", "/connection", {}, cb); }
|
function getConnection(cb) { apiCall("get", "/connection", {}, cb); }
|
||||||
|
function getServerSettings(cb) { apiCall("get", "/server_settings", {}, cb); }
|
||||||
function getSchemas(cb) { apiCall("get", "/schemas", {}, cb); }
|
function getSchemas(cb) { apiCall("get", "/schemas", {}, cb); }
|
||||||
function getObjects(cb) { apiCall("get", "/objects", {}, cb); }
|
function getObjects(cb) { apiCall("get", "/objects", {}, cb); }
|
||||||
function getTables(cb) { apiCall("get", "/tables", {}, cb); }
|
function getTables(cb) { apiCall("get", "/tables", {}, cb); }
|
||||||
@@ -430,7 +431,11 @@ function buildTable(results, sortColumn, sortOrder, options) {
|
|||||||
if (results.rows.length == 0) {
|
if (results.rows.length == 0) {
|
||||||
$("#results_header").html("");
|
$("#results_header").html("");
|
||||||
$("#results_body").html("<tr><td>No records found</td></tr>");
|
$("#results_body").html("<tr><td>No records found</td></tr>");
|
||||||
$("#result-rows-count").html("");
|
if (results.stats) {
|
||||||
|
$("#result-rows-count").html(results.stats.query_duration_ms + " ms");
|
||||||
|
} else {
|
||||||
|
$("#result-rows-count").html("");
|
||||||
|
}
|
||||||
$("#results").addClass("empty");
|
$("#results").addClass("empty");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -440,9 +445,8 @@ function buildTable(results, sortColumn, sortOrder, options) {
|
|||||||
|
|
||||||
results.columns.forEach(function(col) {
|
results.columns.forEach(function(col) {
|
||||||
if (col === sortColumn) {
|
if (col === sortColumn) {
|
||||||
cols += "<th class='table-header-col active' data-name='" + col + "'" + "data-order=" + sortOrder + ">" + col + " " + sortArrow(sortOrder) + "</th>";
|
cols += "<th class='table-header-col active' data-name='" + col + "' data-order=" + sortOrder + ">" + col + " " + sortArrow(sortOrder) + "</th>";
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
cols += "<th class='table-header-col' data-name='" + col + "'>" + col + "</th>";
|
cols += "<th class='table-header-col' data-name='" + col + "'>" + col + "</th>";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -675,6 +679,17 @@ function downloadDatabaseStats() {
|
|||||||
openInNewWindow("api/tables_stats", { format: "csv", export: "true" });
|
openInNewWindow("api/tables_stats", { format: "csv", export: "true" });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showServerSettings() {
|
||||||
|
getServerSettings(function(data) {
|
||||||
|
buildTable(data);
|
||||||
|
|
||||||
|
setCurrentTab("table_content");
|
||||||
|
$("#input").hide();
|
||||||
|
$("#body").prop("class", "full");
|
||||||
|
$("#results").addClass("no-crop");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function showTableStructure() {
|
function showTableStructure() {
|
||||||
var name = getCurrentObject().name;
|
var name = getCurrentObject().name;
|
||||||
|
|
||||||
@@ -1277,6 +1292,9 @@ function bindCurrentDatabaseMenu() {
|
|||||||
case "download_db_stats":
|
case "download_db_stats":
|
||||||
downloadDatabaseStats();
|
downloadDatabaseStats();
|
||||||
break;
|
break;
|
||||||
|
case "server_settings":
|
||||||
|
showServerSettings();
|
||||||
|
break;
|
||||||
case "export":
|
case "export":
|
||||||
openInNewWindow("api/export");
|
openInNewWindow("api/export");
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user