Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,92 @@
# what we do ?
* Get cluster from ckman by url
* Get user from ranger by url
* add monitor(ck user) to heartbeart and kill/cancel query
* add default quota if range not set
* support basic and params to auth

#### new Example of configuration:
```yml
# Whether to print debug logs.
#
# By default debug logs are disabled.
log_debug: true

# Whether to ignore security checks during config parsing.
#
# By default security checks are enabled.
hack_me_please: true

# Optional network lists, might be used as values for `allowed_networks`.
network_groups:
- name: "office"
# Each item may contain either IP or IP subnet mask.
networks: ["127.0.0.0/24", "10.0.0.1/24"]

- name: "reporting-apps"
networks: ["10.10.10.0/24"]


# Settings for `chproxy` input interfaces.
server:
# Configs for input http interface.
# The interface works only if this section is present.
http:
# TCP address to listen to for http.
# May be in the form IP:port . IP part is optional.
listen_addr: ":9090"

# List of allowed networks or network_groups.
# Each item may contain IP address, IP subnet mask or a name
# from `network_groups`.
# By default requests are accepted from all the IPs.
# allowed_networks: ["office", "reporting-apps", "1.2.3.4"]

# ReadTimeout is the maximum duration for proxy to reading the entire
# request, including the body.
# Default value is 1m
read_timeout: 5m

# WriteTimeout is the maximum duration for proxy before timing out writes of the response.
# Default is largest MaxExecutionTime + MaxQueueTime value from Users or Clusters
write_timeout: 10m

# IdleTimeout is the maximum amount of time for proxy to wait for the next request.
# Default is 10m
idle_timeout: 20m

# Metrics in prometheus format are exposed on the `/metrics` path.
# Access to `/metrics` endpoint may be restricted in this section.
# By default access to `/metrics` is unrestricted.
metrics:
allowed_networks: ["office"]

call:
interval: 10m
user_url: "http://centos01:16080/service/plugins/policies/download"
cluster_url: "http://10.0.0.14:8808/api/v1/k8s/chproxy/cluster"

monitor:
name: "monitor"
password: "monitor2345"

default_quota:
max_concurrent_queries: 10
# second
max_execution_time: 120
requests_per_minute: 30

```
#### test
```
// 1
echo "select * from system.clusters" | curl --data-binary @- "centos03:9090?user=z2&password=123&cluster=ch01"
// 2
// user: cluster_name.ck_user_name
echo "select * from system.clusters" | curl -u ch01.z2:123 --data-binary @- "centos03:9090"
```
--------------

[![Go Report Card](https://goreportcard.com/badge/github.com/Vertamedia/chproxy)](https://goreportcard.com/report/github.com/Vertamedia/chproxy)
[![Build Status](https://travis-ci.org/Vertamedia/chproxy.svg?branch=master)](https://travis-ci.org/Vertamedia/chproxy?branch=master)
[![Coverage](https://img.shields.io/badge/gocover.io-75.7%25-green.svg)](http://gocover.io/github.com/Vertamedia/chproxy?version=1.9)
Expand Down
Loading