Skip to content

Commit

Permalink
add checker
Browse files Browse the repository at this point in the history
  • Loading branch information
ignisco committed May 24, 2024
1 parent 13d5075 commit 0ef0f6a
Show file tree
Hide file tree
Showing 72 changed files with 587 additions and 15 deletions.
4 changes: 4 additions & 0 deletions checker3/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
data
__pycache__
Dockerfile
docker-compose.yaml
1 change: 1 addition & 0 deletions checker3/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
COMPOSE_PROJECT_NAME=n0t3b00k_checker
16 changes: 16 additions & 0 deletions checker3/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM python:3.9-buster
RUN apt-get update && apt-get upgrade -y

# add checker user
RUN useradd -ms /bin/bash -u 1000 checker

WORKDIR /checker

COPY requirements.txt .

USER checker
RUN python3 -m pip install -r requirements.txt

COPY ./src .

ENTRYPOINT [ "/home/checker/.local/bin/gunicorn", "-c", "gunicorn.conf.py", "checker:app" ]
5 changes: 5 additions & 0 deletions checker3/data/.mongodb/mongosh/664be2c6de279c080e99ea71_log
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{"t":{"$date":"2024-05-20T23:54:46.705Z"},"s":"I","c":"MONGOSH","id":1000000000,"ctx":"log","msg":"Starting log","attr":{"execPath":"/usr/bin/mongosh","envInfo":{"EDITOR":null,"NODE_OPTIONS":null,"TERM":null},"version":"2.2.5","distributionKind":"compiled","buildArch":"arm64","buildPlatform":"linux","buildTarget":"linux-arm64","buildTime":"2024-04-24T14:12:26.885Z","gitVersion":"3a95f1de5ce644bf6e5453c73b6ccd05a35dcfa5","nodeVersion":"v20.12.2","opensslVersion":"3.0.13+quic","sharedOpenssl":false,"runtimeArch":"arm64","runtimePlatform":"linux","runtimeGlibcVersion":"2.35","deps":{"nodeDriverVersion":"6.5.0","libmongocryptVersion":"1.9.0-20230828+git8e7f69f1c0","libmongocryptNodeBindingsVersion":"6.0.0","kerberosVersion":"2.1.0"}}}
{"t":{"$date":"2024-05-20T23:54:46.731Z"},"s":"I","c":"MONGOSH","id":1000000048,"ctx":"config","msg":"Loading global configuration file","attr":{"filename":"/etc/mongosh.conf","found":false}}
{"t":{"$date":"2024-05-20T23:54:46.773Z"},"s":"I","c":"DEVTOOLS-CONNECT","id":1000000042,"ctx":"mongosh-connect","msg":"Initiating connection attempt","attr":{"uri":"mongodb://127.0.0.1:27017/admin?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.2.5","driver":{"name":"nodejs|mongosh","version":"6.5.0|2.2.5"},"devtoolsConnectVersion":"2.6.0","host":"127.0.0.1:27017"}}
{"t":{"$date":"2024-05-20T23:54:46.782Z"},"s":"I","c":"DEVTOOLS-CONNECT","id":1000000035,"ctx":"mongosh-connect","msg":"Server heartbeat succeeded","attr":{"connectionId":"127.0.0.1:27017"}}
{"t":{"$date":"2024-05-20T23:54:46.899Z"},"s":"I","c":"DEVTOOLS-CONNECT","id":1000000037,"ctx":"mongosh-connect","msg":"Connection attempt finished"}
14 changes: 14 additions & 0 deletions checker3/data/.mongodb/mongosh/664be2c75e0882848899ea71_log
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{"t":{"$date":"2024-05-20T23:54:47.458Z"},"s":"I","c":"MONGOSH","id":1000000000,"ctx":"log","msg":"Starting log","attr":{"execPath":"/usr/bin/mongosh","envInfo":{"EDITOR":null,"NODE_OPTIONS":null,"TERM":null},"version":"2.2.5","distributionKind":"compiled","buildArch":"arm64","buildPlatform":"linux","buildTarget":"linux-arm64","buildTime":"2024-04-24T14:12:26.885Z","gitVersion":"3a95f1de5ce644bf6e5453c73b6ccd05a35dcfa5","nodeVersion":"v20.12.2","opensslVersion":"3.0.13+quic","sharedOpenssl":false,"runtimeArch":"arm64","runtimePlatform":"linux","runtimeGlibcVersion":"2.35","deps":{"nodeDriverVersion":"6.5.0","libmongocryptVersion":"1.9.0-20230828+git8e7f69f1c0","libmongocryptNodeBindingsVersion":"6.0.0","kerberosVersion":"2.1.0"}}}
{"t":{"$date":"2024-05-20T23:54:47.470Z"},"s":"I","c":"MONGOSH","id":1000000005,"ctx":"config","msg":"User updated"}
{"t":{"$date":"2024-05-20T23:54:47.471Z"},"s":"I","c":"MONGOSH","id":1000000048,"ctx":"config","msg":"Loading global configuration file","attr":{"filename":"/etc/mongosh.conf","found":false}}
{"t":{"$date":"2024-05-20T23:54:47.500Z"},"s":"I","c":"DEVTOOLS-CONNECT","id":1000000042,"ctx":"mongosh-connect","msg":"Initiating connection attempt","attr":{"uri":"mongodb://127.0.0.1:27017/admin?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.2.5","driver":{"name":"nodejs|mongosh","version":"6.5.0|2.2.5"},"devtoolsConnectVersion":"2.6.0","host":"127.0.0.1:27017"}}
{"t":{"$date":"2024-05-20T23:54:47.506Z"},"s":"I","c":"DEVTOOLS-CONNECT","id":1000000035,"ctx":"mongosh-connect","msg":"Server heartbeat succeeded","attr":{"connectionId":"127.0.0.1:27017"}}
{"t":{"$date":"2024-05-20T23:54:47.699Z"},"s":"I","c":"DEVTOOLS-CONNECT","id":1000000037,"ctx":"mongosh-connect","msg":"Connection attempt finished"}
{"t":{"$date":"2024-05-20T23:54:47.741Z"},"s":"I","c":"MONGOSH","id":1000000010,"ctx":"shell-api","msg":"Initialized context","attr":{"method":"setCtx","arguments":{}}}
{"t":{"$date":"2024-05-20T23:54:47.755Z"},"s":"I","c":"MONGOSH-SNIPPETS","id":1000000024,"ctx":"snippets","msg":"Fetching snippet index","attr":{"refreshMode":"allow-cached"}}
{"t":{"$date":"2024-05-20T23:54:47.760Z"},"s":"I","c":"MONGOSH-SNIPPETS","id":1000000019,"ctx":"snippets","msg":"Loaded snippets","attr":{"installdir":"/data/db/.mongodb/mongosh/snippets"}}
{"t":{"$date":"2024-05-20T23:54:47.846Z"},"s":"I","c":"MONGOSH-SNIPPETS","id":1000000028,"ctx":"snippets","msg":"Modifying snippets package.json failed","attr":{"error":"ENOENT: no such file or directory, open '/data/db/.mongodb/mongosh/snippets/package.json'"}}
{"t":{"$date":"2024-05-20T23:54:47.856Z"},"s":"I","c":"MONGOSH","id":1000000004,"ctx":"connect","msg":"Connecting to server","attr":{"session_id":"664be2c75e0882848899ea71","userId":null,"telemetryAnonymousId":"664be2c6de279c080e99ea70","connectionUri":"mongodb://<ip address>:27017/admin?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.2.5","is_atlas":false,"is_localhost":true,"is_do":false,"server_version":"7.0.9","node_version":"v20.12.2","mongosh_version":"2.2.5","server_os":"linux","server_arch":"aarch64","is_enterprise":false,"auth_type":null,"is_data_federation":false,"is_stream":false,"dl_version":null,"atlas_version":null,"is_genuine":true,"non_genuine_server_name":"mongodb","is_local_atlas":false,"fcv":"7.0","api_version":null,"api_strict":null,"api_deprecation_errors":null}}
{"t":{"$date":"2024-05-20T23:54:47.856Z"},"s":"I","c":"MONGOSH","id":1000000002,"ctx":"repl","msg":"Started REPL","attr":{"version":"2.2.5"}}
{"t":{"$date":"2024-05-20T23:54:48.062Z"},"s":"I","c":"MONGOSH","id":1000000011,"ctx":"shell-api","msg":"Performed API call","attr":{"method":"createUser","class":"Database","db":"admin","arguments":{}}}
{"t":{"$date":"2024-05-20T23:54:48.177Z"},"s":"I","c":"MONGOSH","id":1000000045,"ctx":"analytics","msg":"Flushed outstanding data","attr":{"flushError":"Trying to persist throttle state before userId is set","flushDuration":1}}
1 change: 1 addition & 0 deletions checker3/data/.mongodb/mongosh/config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"userId":"664be2c6de279c080e99ea70","telemetryAnonymousId":"664be2c6de279c080e99ea70","enableTelemetry":true}
Empty file.
1 change: 1 addition & 0 deletions checker3/data/.mongodb/mongosh/snippets/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
2 changes: 2 additions & 0 deletions checker3/data/WiredTiger
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
WiredTiger
WiredTiger 11.2.0: (November 10, 2022)
1 change: 1 addition & 0 deletions checker3/data/WiredTiger.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
WiredTiger lock file
6 changes: 6 additions & 0 deletions checker3/data/WiredTiger.turtle
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
WiredTiger version string
WiredTiger 11.2.0: (November 10, 2022)
WiredTiger version
major=11,minor=2,patch=0
file:WiredTiger.wt
access_pattern_hint=none,allocation_size=4KB,app_metadata=,assert=(commit_timestamp=none,durable_timestamp=none,read_timestamp=none,write_timestamp=off),block_allocation=best,block_compressor=,cache_resident=false,checksum=on,collator=,columns=,dictionary=0,encryption=(keyid=,name=),format=btree,huffman_key=,huffman_value=,id=0,ignore_in_memory_cache_size=false,internal_item_max=0,internal_key_max=0,internal_key_truncate=true,internal_page_max=4KB,key_format=S,key_gap=10,leaf_item_max=0,leaf_key_max=0,leaf_page_max=32KB,leaf_value_max=0,log=(enabled=true),memory_page_image_max=0,memory_page_max=5MB,os_cache_dirty_max=0,os_cache_max=0,prefix_compression=false,prefix_compression_min=4,readonly=false,split_deepen_min_child=0,split_deepen_per_child=0,split_pct=90,tiered_object=false,tiered_storage=(auth_token=,bucket=,bucket_prefix=,cache_directory=,local_retention=300,name=,object_target_size=0),value_format=S,verbose=[],version=(major=1,minor=1),write_timestamp_usage=none,checkpoint=(WiredTigerCheckpoint.2571=(addr="019381e49ee2ff4c9481e406e075819581e4c7fb50b5808080e3014fc0e25fc0",order=2571,time=1716563966,size=36864,newest_start_durable_ts=0,oldest_start_ts=0,newest_txn=7,newest_stop_durable_ts=0,newest_stop_ts=-1,newest_stop_txn=-11,prepare=0,write_gen=7692,run_write_gen=7681)),checkpoint_backup_info=,checkpoint_lsn=(22,6528)
Binary file added checker3/data/WiredTiger.wt
Binary file not shown.
Binary file added checker3/data/WiredTigerHS.wt
Binary file not shown.
Binary file added checker3/data/_mdb_catalog.wt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added checker3/data/diagnostic.data/metrics.interim
Binary file not shown.
Binary file added checker3/data/index-1--4979625772267755921.wt
Binary file not shown.
Binary file added checker3/data/index-3--4979625772267755921.wt
Binary file not shown.
Binary file added checker3/data/index-4-2105818246731380529.wt
Binary file not shown.
Binary file added checker3/data/index-5--4979625772267755921.wt
Binary file not shown.
Binary file added checker3/data/index-6--4979625772267755921.wt
Binary file not shown.
Binary file added checker3/data/index-8--4979625772267755921.wt
Binary file not shown.
Binary file added checker3/data/index-8-2105818246731380529.wt
Binary file not shown.
Binary file added checker3/data/index-9--4979625772267755921.wt
Binary file not shown.
Binary file added checker3/data/journal/WiredTigerLog.0000000022
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions checker3/data/mongod.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
Binary file added checker3/data/sizeStorer.wt
Binary file not shown.
Binary file added checker3/data/storage.bson
Binary file not shown.
51 changes: 51 additions & 0 deletions checker3/docker-compose-local.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
version: "2.1"

services:
n0t3b00k-checker:
build: .
# The checker runs a HTTP interfaces, so we need to map port 3031 to the outside (port 8000).
ports:
- 5008:8000
environment:
- MONGO_ENABLED=1
- MONGO_HOST=n0t3b00k-mongo
- MONGO_PORT=27017
- MONGO_USER=n0t3b00k
- MONGO_PASSWORD=n0t3b00k
mem_limit: 1G
memswap_limit: 2G
ulimits:
core:
soft: 0
hard: 0
nproc:
soft: 4000
hard: 4000
networks:
- pirateprattle_service_default
# The python checkerlib requires a mongo db!
n0t3b00k-mongo:
image: mongo
#ports:
# - 27017:27017
volumes:
- ./data:/data/db
environment:
MONGO_INITDB_ROOT_USERNAME: n0t3b00k
MONGO_INITDB_ROOT_PASSWORD: n0t3b00k
mem_limit: 1G
memswap_limit: 2G
ulimits:
core:
soft: 0
hard: 0
nproc:
soft: 4000
hard: 4000

networks:
- pirateprattle_service_default

networks:
pirateprattle_service_default:
external: true
42 changes: 42 additions & 0 deletions checker3/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
version: '2.1'

services:
n0t3b00k-checker:
build: .
# The checker runs a HTTP interfaces, so we need to map port 3031 to the outside (port 8000).
ports:
- 5008:8000
environment:
- MONGO_ENABLED=1
- MONGO_HOST=n0t3b00k-mongo
- MONGO_PORT=27017
- MONGO_USER=n0t3b00k
- MONGO_PASSWORD=n0t3b00k
mem_limit: 1G
memswap_limit: 2G
ulimits:
core:
soft: 0
hard: 0
nproc:
soft: 4000
hard: 4000
# The python checkerlib requires a mongo db!
n0t3b00k-mongo:
image: mongo
#ports:
# - 27017:27017
volumes:
- ./data:/data/db
environment:
MONGO_INITDB_ROOT_USERNAME: n0t3b00k
MONGO_INITDB_ROOT_PASSWORD: n0t3b00k
mem_limit: 1G
memswap_limit: 2G
ulimits:
core:
soft: 0
hard: 0
nproc:
soft: 4000
hard: 4000
4 changes: 4 additions & 0 deletions checker3/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
enochecker3==0.8.1
uvicorn
gunicorn
faker
Loading

0 comments on commit 0ef0f6a

Please sign in to comment.