Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hivemind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
hivemind
Commits
d64fccd4
Commit
d64fccd4
authored
2 months ago
by
Michał Kudela
Committed by
Andrzej Such
1 month ago
Browse files
Options
Downloads
Patches
Plain Diff
Document Nginx rewriter setup in README
parent
8a11b044
No related branches found
No related tags found
1 merge request
!823
Removing not used queries and python server
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+42
-0
42 additions, 0 deletions
README.md
with
42 additions
and
0 deletions
README.md
+
42
−
0
View file @
d64fccd4
...
...
@@ -195,6 +195,48 @@ If you updated some sql files and want to reload sql queries etc:
../hivemind/scripts/run_instance.sh registry.gitlab.syncad.com/hive/hivemind/instance:local-hivemind-develop install_app --upgrade-schema --database-admin-url="postgresql://haf_admin@172.17.0.2/haf_block_log"
```
## Rewriter
Nginx acts as a rewriter, redirecting all JSON-RPC 2.0 calls to the `
/rpc/home
` endpoint to maintain compatibility with
the previous system version. The recently introduced PostgREST supports REST API, while legacy JSON-RPC calls must still
be handled. Nginx ensures that incoming JSON-RPC requests are rewritten as parameters to the REST `
/rpc/home/
` endpoint.
There are plans to introduce a proper REST API for Hivemind in the future.
Using the rule:
```log
rewrite ^/(.*)$ /rpc/home break;
```
All URLs are rewritten to `
/rpc/home
`, where further request processing takes place, including the conversion from
JSON-RPC to SQL queries.
This section describes how to build and run the Nginx container, which serves as a URL rewriter for JSON-RPC calls.
1. Build the Docker image
```bash
docker build -t hivemind-nginx-rewriter .
````
2. Run the container
```bash
docker run -d --name hivemind-nginx-rewriter -p 80:80 hivemind-nginx
```
3. Configuration Files
The container uses the following configuration files:
```log
nginx.conf.template – the main Nginx configuration.
rewrite_rules.conf – contains the rewrite rules.
rewriter_entrypoint.sh – the entrypoint script executed when the container starts.
```
These files are copied into the container at build time.
4. Stopping the container
```bash
docker stop hivemind-nginx
```
## Tests
To run api tests:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment