mirror of
https://github.com/hanzoai/datastore.git
synced 2026-09-26 13:55:07 +00:00
All HTTP interface headers are now X-Datastore-* (Query-Id, Summary, Progress, Format, Exception-Code, Server-Display-Name, Timezone, Quota, Database, User, Key, Compress, SSL-Certificate-Auth, Exception-Tag). 326 refs across 100 files (server, tests, docs kept consistent). String-literal rename — compile-safe; it deliberately changes the on-the-wire protocol identity (clients/drivers must read X-Datastore-*). The native-protocol handshake name already follows VERSION_NAME (=Datastore). Needs build/integration verification on the build host.
48 lines
1.7 KiB
Plaintext
48 lines
1.7 KiB
Plaintext
# Hanzo Datastore — HTTP header translation proxy
|
|
# Translates X-Datastore-* headers to the wire protocol headers the engine expects.
|
|
# Listens on 8123 (public), proxies to 8124 (engine).
|
|
|
|
server {
|
|
listen 8123;
|
|
listen [::]:8123;
|
|
|
|
client_max_body_size 0;
|
|
proxy_buffering off;
|
|
proxy_request_buffering off;
|
|
|
|
location / {
|
|
proxy_pass http://127.0.0.1:8124;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Connection "";
|
|
|
|
# Translate Hanzo Datastore headers → wire protocol
|
|
proxy_set_header X-Datastore-User $http_x_datastore_user;
|
|
proxy_set_header X-Datastore-Key $http_x_datastore_key;
|
|
proxy_set_header X-Datastore-Database $http_x_datastore_database;
|
|
proxy_set_header X-Datastore-Format $http_x_datastore_format;
|
|
|
|
# Pass all other headers through
|
|
proxy_pass_request_headers on;
|
|
|
|
# Map response header: x-clickhouse-query-id → x-datastore-query-id
|
|
proxy_hide_header x-clickhouse-query-id;
|
|
add_header x-datastore-query-id $upstream_http_x_clickhouse_query_id always;
|
|
|
|
proxy_hide_header x-clickhouse-format;
|
|
add_header x-datastore-format $upstream_http_x_clickhouse_format always;
|
|
|
|
proxy_hide_header x-clickhouse-timezone;
|
|
add_header x-datastore-timezone $upstream_http_x_clickhouse_timezone always;
|
|
|
|
proxy_hide_header x-clickhouse-server-display-name;
|
|
add_header x-datastore-server-display-name $upstream_http_x_clickhouse_server_display_name always;
|
|
|
|
proxy_hide_header x-clickhouse-summary;
|
|
add_header x-datastore-summary $upstream_http_x_clickhouse_summary always;
|
|
}
|
|
|
|
location = /ping {
|
|
proxy_pass http://127.0.0.1:8124/ping;
|
|
}
|
|
}
|