-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Audit logs #5646
Audit logs #5646
Changes from 72 commits
69fc71d
085d111
a683ecc
b48011e
5d303a6
a6bdde7
de61804
7c39b96
e3900aa
6996263
201c867
76464b0
069b3b6
1d439e2
ecbe706
e766e02
fb57f44
5733bbf
9240bf5
227fb48
ec12b71
5522b04
ec5e62d
f34a622
a16795f
bc72b22
c133070
15e5fd7
66ba85f
b718845
4427bbe
e619f78
aa555b2
04d4b00
92cf339
625b318
6b8b737
7798ace
397a861
1c6e554
f137741
1a8a69f
a8b7e16
0a5d1df
56327c1
ff473bd
da42cca
865922c
177e876
7987e5e
4850aac
372f8dc
3793b53
ffdf143
cebdc39
9eb3111
b7cf15d
118173a
8e0c956
647b2e5
51e9459
e1a2027
21c4f61
8c3ce8e
3174af1
d41bfd5
ba1cdd8
0fc276d
a103778
1b017b0
e324432
8a86d17
346fb49
f014890
0ca4195
6a07b98
6ddfbf2
97f1971
28485c8
30aee83
5f24fe3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/bash | ||
|
||
CLICKHOUSE_DB="${CLICKHOUSE_DB:-cvat}"; | ||
CLICKHOUSE_USER="${CLICKHOUSE_USER:-user}"; | ||
CLICKHOUSE_PASSWORD="${CLICKHOUSE_PASSWORD:-password}"; | ||
|
||
cat <<EOT > /etc/clickhouse-server/users.d/user.xml | ||
<yandex> | ||
<!-- Docs: <https://clickhouse.tech/docs/en/operations/settings/settings_users/> --> | ||
<users> | ||
<${CLICKHOUSE_USER}> | ||
<profile>default</profile> | ||
<networks> | ||
<ip>::/0</ip> | ||
</networks> | ||
<password>${CLICKHOUSE_PASSWORD}</password> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, do we need to check the value? What if contains |
||
<quota>default</quota> | ||
</${CLICKHOUSE_USER}> | ||
</users> | ||
</yandex> | ||
EOT | ||
|
||
clickhouse-client --query "CREATE DATABASE IF NOT EXISTS ${CLICKHOUSE_DB}"; | ||
|
||
echo " | ||
CREATE TABLE IF NOT EXISTS ${CLICKHOUSE_DB}.events | ||
( | ||
\`scope\` String NOT NULL, | ||
\`obj_name\` String NULL, | ||
\`obj_id\` UInt64 NULL, | ||
\`obj_val\` String NULL, | ||
\`source\` String NOT NULL, | ||
\`timestamp\` DateTime64(3, 'Etc/UTC') NOT NULL, | ||
\`count\` UInt16 NULL, | ||
\`duration\` UInt32 DEFAULT toUInt32(0), | ||
\`project_id\` UInt64 NULL, | ||
\`task_id\` UInt64 NULL, | ||
\`job_id\` UInt64 NULL, | ||
\`user_id\` UInt64 NULL, | ||
\`org_id\` UInt64 NULL, | ||
\`payload\` String NULL | ||
) | ||
ENGINE = MergeTree | ||
PARTITION BY toYYYYMM(timestamp) | ||
ORDER BY (timestamp) | ||
SETTINGS index_granularity = 8192 | ||
;" | clickhouse-client |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: cvat | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will vote to remove analytics based on ELK in the next version. Let's have these files as a guide. I don't think we need to keep them in the repo. Probably we can discuss that tomorrow on our team meeting. |
||
|
||
services: | ||
elasticsearch: | ||
container_name: cvat_elasticsearch | ||
image: cvat_elasticsearch | ||
build: | ||
context: ./elasticsearch | ||
args: | ||
ELK_VERSION: 6.8.23 | ||
volumes: | ||
- cvat_events:/usr/share/elasticsearch/data | ||
restart: always | ||
|
||
kibana: | ||
container_name: cvat_kibana | ||
image: cvat_kibana | ||
build: | ||
context: ./kibana | ||
args: | ||
ELK_VERSION: 6.8.23 | ||
depends_on: ['elasticsearch'] | ||
environment: | ||
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200 | ||
restart: always | ||
ports: | ||
- '5601:5601' | ||
|
||
cvat_kibana_setup: | ||
container_name: cvat_kibana_setup | ||
image: cvat/server:${CVAT_VERSION:-dev} | ||
volumes: ['./components/analytics/deprecated/kibana:/home/django/kibana:ro'] | ||
working_dir: '/home/django' | ||
entrypoint: | ||
[ | ||
'bash', | ||
'wait-for-it.sh', | ||
'elasticsearch:9200', | ||
'-t', | ||
'0', | ||
'--', | ||
'/bin/bash', | ||
'wait-for-it.sh', | ||
'kibana:5601', | ||
'-t', | ||
'0', | ||
'--', | ||
'python3', | ||
'kibana/setup.py', | ||
'kibana/export.json', | ||
] | ||
environment: | ||
no_proxy: elasticsearch,kibana,${no_proxy:-} | ||
|
||
volumes: | ||
cvat_events: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
server.host: 0.0.0.0 | ||
elasticsearch.requestHeadersWhitelist: ['cookie', 'authorization', 'x-forwarded-user'] | ||
kibana.defaultAppId: 'discover' | ||
server.basePath: /analytics |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably it is necessary to check that CLICKHOUSE_USER value without spaces and special symbols.