Skip to content

Commit b70111c

Browse files
committed
chore: setup docker compose
chore: passwordless access to clickhouse fix: passwordless clickhouse login
1 parent 6ff15b4 commit b70111c

9 files changed

+1865
-2
lines changed

.dockerignore

+3
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,6 @@ out/
3535

3636
# Tauri
3737
src-tauri/
38+
39+
#Clickhouse
40+
conf/

Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ RUN npm install
77
ENV NODE_ENV=production
88
ENV PLATFORM=WEB
99

10+
ARG CLICKHOUSE_URL
11+
1012
RUN npm run build
1113
RUN ls /app/build
1214

README.md

+23
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,29 @@
1919

2020
## Getting Started
2121

22+
### → Live
23+
24+
https://agx.app
25+
26+
### → Local
27+
28+
1. Clone the repository:
29+
30+
```bash
31+
git clone https://github.com/agnosticeng/agx
32+
cd agx
33+
```
34+
35+
2. Run with docker compose:
36+
37+
```bash
38+
docker compose up
39+
```
40+
41+
3. Access the application via https://localhost:8080
42+
43+
### → Native
44+
2245
1. Clone the repository:
2346

2447
```bash

conf/config.xml

+1,794
Large diffs are not rendered by default.

conf/users.xml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<clickhouse>
2+
<users>
3+
<default>
4+
<networks>
5+
<ip>::/0</ip>
6+
</networks>
7+
<password></password>
8+
</default>
9+
</users>
10+
</clickhouse>

docker-compose.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
version: '3'
2+
services:
3+
agx_app:
4+
build:
5+
context: .
6+
dockerfile: Dockerfile
7+
args:
8+
- CLICKHOUSE_URL=http://localhost:8123?default_format=JSON
9+
ports:
10+
- '8080:80'
11+
depends_on:
12+
clickhouse:
13+
condition: service_healthy
14+
clickhouse:
15+
image: clickhouse/clickhouse-server:latest
16+
ports:
17+
- '8123:8123'
18+
- '9000:9000'
19+
volumes:
20+
- clickhouse_data:/var/lib/clickhouse
21+
- ./conf/config.xml:/etc/clickhouse-server/config.d/config.xml
22+
- ./conf/users.xml:/etc/clickhouse-server/users.d/users.xml
23+
healthcheck:
24+
test: wget --no-verbose --tries=1 --spider http://localhost:8123/ping || exit 1
25+
interval: 3s
26+
timeout: 5s
27+
retries: 5
28+
volumes:
29+
clickhouse_data:

src/lib/olap-engine/engine-remote.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ export class RemoteEngine extends InternalEventEmitter<Events> implements OLAPEn
99

1010
async exec(query: string, _emit = true) {
1111
try {
12-
const proxy =
13-
new URLSearchParams(window.location.search).get('proxy') ?? 'https://proxy.agx.app/query';
12+
const proxy = new URLSearchParams(window.location.search).get('proxy') ?? CLICKHOUSE_URL;
1413
const response = await fetch(proxy, { method: 'POST', body: query });
1514

1615
const r = await response.text();

src/vite-env.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
declare const PLATFORM: 'NATIVE' | 'WEB';
22
declare const BUILD: string;
3+
declare const CLICKHOUSE_URL: string;
4+
35
type MaybePromise<T> = T | Promise<T>;

vite.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export default defineConfig(async () => ({
2222
exclude: ['@sqlite.org/sqlite-wasm']
2323
},
2424
define: {
25+
CLICKHOUSE_URL: JSON.stringify(process.env.CLICKHOUSE_URL || 'https://proxy.agx.app/query'),
2526
PLATFORM: JSON.stringify(process.env.PLATFORM || 'NATIVE'),
2627
BUILD: JSON.stringify(
2728
(process.env.CF_PAGES_COMMIT_SHA || process.env.COMMIT_SHA || 'dev').slice(0, 7)

0 commit comments

Comments
 (0)