appbaseio / reactivesearch-api Goto Github PK
View Code? Open in Web Editor NEWAPI Gateway for Elasticsearch with declarative querying and out-of-the-box access controls
Home Page: https://api.reactivesearch.io
License: Apache License 2.0
API Gateway for Elasticsearch with declarative querying and out-of-the-box access controls
Home Page: https://api.reactivesearch.io
License: Apache License 2.0
ReactiveSearch API
are you using ?Lastest
When configuring a remote elasticsearch the variables found in config/docker.env (username and password) don't work, I had to put the credentials in the url. Is there a way to not have to pass the credentials through the url?
ES_CLUSTER_URL=https://my-elastic.com
USERNAME=username
PASSWORD=password
ES_CLUSTER_URL=https://username:[email protected]
I see this doesn't sit on top of the es unlike xpack or opendistro so I can not use
elasticsearch.username: and elasticsearch.password:
as mentioned in kibana docs
I tried to use basic auth by passing username and passwork in the url like http://foo:bar@arc:8000
but that didn't work.
Please let me know if it's possible to run it with Kibana ?
Test cases are missing for the following files in the users
plugin:
handlers.go
middleware.go
When using the example include docker-compose.yaml
file, it builds the API server locally and is able to boot up. When using the dockerhub image available on https://hub.docker.com/r/appbaseio/reactivesearch-api, it fails to boot asking for a valid APPBASE_ID
.
Could this be happening because of the build args not being opensource? https://github.com/appbaseio/reactivesearch-api/blob/dev/Dockerfile#L3-L18
My modified docker-compose file:
version: "3"
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.2.0
container_name: elasticsearch
networks:
- reactivesearch
environment:
- bootstrap.memory_lock=true
- discovery.type=single-node
- "ES_JAVA_OPTS=-Xms1g -Xmx1g"
ulimits:
nproc: 65536
nofile:
soft: 65536
hard: 65536
memlock:
soft: -1
hard: -1
ports:
- 9200:9200
reactivesearch:
#build: ./
image: appbaseio/reactivesearch-api:8.20.3
environment:
- ES_CLUSTER_URL=http://elasticsearch:9200
container_name: reactivesearch
env_file:
- config/docker.env
networks:
- reactivesearch
restart: on-failure
ports:
- 8000:8000
depends_on:
- elasticsearch
networks:
reactivesearch:
driver: bridge
sarah@remote-dev:~/reactivesearch-api$ docker compose up reactivesearch
[+] Running 1/1
✔ reactivesearch Pulled 0.9s
[+] Running 2/0
✔ Container elasticsearch Running 0.0s
✔ Container reactivesearch Recreated 0.1s
Attaching to reactivesearch
reactivesearch | => port used 8000
reactivesearch | [cmd] : reading env file .env . This may happen if the environments are declared directly : open .env: no such file or directory
reactivesearch | time="2024/01/09 19:08:35" level=fatal msg="APPBASE_ID env required but not present" file=" billing.go:615"
reactivesearch exited with code 0
ReactiveSearch API
are you using ?latest
Run go test ./...
at the root in feat/es7
branch
You can easily see that a lot of test cases get failed, we need to fix it and make sure that all the test cases work as expected.
We recently upgraded the elastic search version from 6.x to 7.x which has some breaking changes, probably that might be the reason for some failed test cases.
ReactiveSearch API
are you using ?8.9.0
POST /_permission
request, trying to create another permission object.A created permission.
Internal server error saying "*user.User" not found in request context.
From what I was able to find in the code as a non-Go developer, looks like the user is being read from the context right here for the only purpose to check if it's admin or not, which decides the permission's default settings. And if the user not found, the error is being thrown.
Looking at the auth middleware I can see it being assigned only when the request is authenticated on behalf of a user. When you use API Credentials to authenticate the request, the permission is being assigned to the context instead.
I haven't found anywhere in the documentation that you can only create permissions when authenticated as a user. So I think it's a bug.
Would it be possible to fix it by assuming the user is not an admin if the request is authenticated with the API Credentials?
Test cases are missing for the functions defined in the middleware.go
file.
how can I debug this program in IDE goland
do we support multi es backend?
Failed to compile manually
/opt/apps/reactivesearch-api$ make
go build --buildmode=plugin -o build/plugins/auth.so plugins/auth/main/auth.go
asm: xxhash_amd64.s:120: when dynamic linking, R15 is clobbered by a global variable access and is used here: 00092 (/home/tomburnell/go/pkg/mod/github.com/cespare/[email protected]/xxhash_amd64.s:120) ADDQ R15, AX
asm: assembly failed
asm: xxhash_amd64.s:120: when dynamic linking, R15 is clobbered by a global variable access and is used here: 00092 (/home/tomburnell/go/pkg/mod/github.com/cespare/xxhash/[email protected]/xxhash_amd64.s:120) ADDQ R15, AX
asm: assembly failed
asm: xxhash_amd64.s:120: when dynamic linking, R15 is clobbered by a global variable access and is used here: 00092 (/home/tomburnell/go/pkg/mod/github.com/klauspost/[email protected]/zstd/internal/xxhash/xxhash_amd64.s:120) ADDQ R15, AX
asm: assembly failed
make: *** [Makefile:20: plugins/auth/main/auth.so] Error 2
ReactiveSearch API
are you using ?commit hash: 8da3f17
ubuntu 20
go version
go version go1.17.7 linux/amd64
$ uname -a
Linux artcore-vb 5.4.0-100-generic #113-Ubuntu SMP Thu Feb 3 18:43:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
i$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17ubuntu120.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-HskZEa/gcc-9-9.3.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu20.04)
Thread model: posix
gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1
ReactiveSearch API
are you using ?Latest version
Started project up with docker compose, getting error
msg="[cmd] Unable to read license file open --log: no such file or directory" file=" entry.go:359"
Expected reactive search api to start up
error:
msg="[cmd] Unable to read license file open --log: no such file or directory" file=" entry.go:359"
There seems to be something missing steps in the docker setup. Where do I get my license key and where do I put it in the docker compose / env file ?
Currently, we don't have test cases for the elasticsearch
plugin, we should add test cases for the following files.
handlers.go
routes.go
middleware.go
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.