Run container as keeper user, add basic auth to prometheus

This commit is contained in:
2024-01-16 15:33:56 +01:00
parent 7499b69a98
commit 1aec892a02
7 changed files with 35 additions and 21 deletions

View File

@@ -34,7 +34,7 @@ runcmd:
- git clone https://github.com/0x1d/drift-keeper /app/bot
- mv /app/.env /app/bot/.env
- mv /app/config.yaml /app/bot/config.yaml
- cd /app/bot && docker-compose up -d
- cd /app/bot && sudo -u keeper -g bot -- docker-compose up -d
write_files:
- path: /app/.env

View File

@@ -20,8 +20,9 @@ services:
container_name: prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
#ports:
# - 9090:9090
- '--web.config.file=/etc/prometheus/web.yml'
ports:
- 9090:9090
restart: unless-stopped
volumes:
- ./prometheus:/etc/prometheus

View File

@@ -9,10 +9,26 @@ GRAFANA_ADMIN_PASSWORD=grafana
# Drift Config
ENV=mainnet-beta
ENDPOINT=https://solana-mainnet.rpc.extrnode.com/your-api-key
WS_ENDPOINT=wss://solana-mainnet.rpc.extrnode.com/your-api-key
KEEPER_PRIVATE_KEY="[123,345,...]"
# Hetzner DE
ENDPOINT=http://178.63.126.77:8899
# OVH FR
#ENDPOINT=http://141.95.126.29:8899
# Cloudvider GB
#ENDPOINT=http://194.127.173.58:8899
#CherryServers LT
#ENDPOINT=http://84.32.189.122:8099
# Teraswitch US
#ENDPOINT=http://74.118.139.251:8899
# Teraswitch2 US
#ENDPOINT=http://74.118.139.68:8899
# ExtrNode
#ENDPOINT=https://solana-mainnet.rpc.extrnode.com/your-api-key
#WS_ENDPOINT=wss://solana-mainnet.rpc.extrnode.com/your-api-key
# Jito Config
# Required if useJito: true is set in config.yaml
JITO_BLOCK_ENGINE_URL=frankfurt.mainnet.block-engine.jito.wtf

View File

@@ -149,7 +149,7 @@
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
"diff"
],
"fields": "",
"values": false
@@ -166,7 +166,7 @@
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "delta(total_collateral[24h])",
"expr": "total_collateral",
"fullMetaSearch": false,
"includeNullMetadata": true,
"instant": false,
@@ -176,7 +176,7 @@
"useBackend": false
}
],
"title": "Profit 24h",
"title": "PNL",
"type": "stat"
},
{
@@ -299,7 +299,7 @@
"mode": "scheme",
"reverse": false,
"scale": "exponential",
"scheme": "Turbo",
"scheme": "Viridis",
"steps": 64
},
"exemplars": {
@@ -436,7 +436,7 @@
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
"showLegend": false
},
"tooltip": {
"mode": "single",
@@ -538,7 +538,7 @@
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
"showLegend": false
},
"tooltip": {
"mode": "single",
@@ -957,6 +957,6 @@
"timezone": "",
"title": "Drift Keeper",
"uid": "f4c3a630-ffd0-41c8-a36a-52e0771b77fb",
"version": 7,
"version": 6,
"weekStart": ""
}

View File

@@ -7,3 +7,7 @@ datasources:
isDefault: true
access: proxy
editable: true
basicAuth: true
basicAuthUser: prom
secureJsonData:
basicAuthPassword: prompass

View File

@@ -10,15 +10,6 @@ alerting:
timeout: 10s
api_version: v1
scrape_configs:
- job_name: prometheus
honor_timestamps: true
scrape_interval: 15s
scrape_timeout: 10s
metrics_path: /metrics
scheme: http
static_configs:
- targets:
- localhost:9090
- job_name: keeper
honor_timestamps: true
scrape_interval: 15s

2
prometheus/web.yml Normal file
View File

@@ -0,0 +1,2 @@
basic_auth_users:
prom: $2y$10$oWtHm79bh0D1CnNC4brGiOU7y6MbYa6cgklF/g6ek9YZYkgXfeOIu