Skip to content

Commit

Permalink
remove chdir to prevent race conditions and change name to piratesay
Browse files Browse the repository at this point in the history
  • Loading branch information
ignisco committed May 27, 2024
1 parent 6bb2754 commit d9a6642
Show file tree
Hide file tree
Showing 68 changed files with 212 additions and 156 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
# enowars8-service-pirateprattle
# enowars8-service-piratesay

### TODO

- [x] Change name of service and commands in command line. This will also somewhat help even out between beginners and advanced players, novel for both.
- [x] Fill with a lot of dummy content. Make sure it is obvious what is related and unrelated to the actual flags.

- [ ] (Should players be able to create fake entries themself?)
- [x] (Should players be able to create fake entries themself?)

- [ ] Implement protected folders from which opening files is not possible. Determine best vuln to implement here (overwrite is_admin thing vs explore race conditions requiring multiple connections vs combining elements from both approaches).
- [ ] Implement the checker
- [x] Implement the checker
- [x] Remove chdir to prevent issues with threads
- [ ] Fix setup the way the slides from the lectures wanted (documention folder, docker compose up should work automatically, .yml file for some CI/CD stuff)
- [ ] Test a whole bunch to make sure there aren't unwanted exploits. Questions so far:

- [x] How to prevent %n exploit that can change the actual password for the first exploit. This might be bad if it inferes and ruins the experience for the other groups as they can then no longer use the intended exploit.
- [x] How to prevent arbitrary code execution if the attacker can write an address to the stack and store values in it (Solution: Assuming solved since %n isn't allowed now)
- [ ] How to solve the potential is_admin problem for the checker. How would it verify itself? (random credentials each round that are cryptographically safe?)
- [ ] General removel of all warnings and mis-matching of buffer sizes etc. Just use PATH_MAX for everything basically?
- [ ] Implement locks to prevent race conditions and find out how to deal with a potential issue: User 1 is typing in password to open a file while user 2 is changing dir.
- [x] Implement locks to prevent race conditions and find out how to deal with a potential issue: User 1 is typing in password to open a file while user 2 is changing dir.
- [ ] NB: Need to test more if concurrent reads can cause issues. Just implement another mutex if that's the case!

### For fun if time

Expand Down
2 changes: 1 addition & 1 deletion checker3/.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
COMPOSE_PROJECT_NAME=n0t3b00k_checker
COMPOSE_PROJECT_NAME=piratesay_checker
Original file line number Diff line number Diff line change
@@ -1,5 +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"}
{"t":{"$date":"2024-05-27T05:12:09.297Z"},"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-27T05:12:09.308Z"},"s":"I","c":"MONGOSH","id":1000000048,"ctx":"config","msg":"Loading global configuration file","attr":{"filename":"/etc/mongosh.conf","found":false}}
{"t":{"$date":"2024-05-27T05:12:09.327Z"},"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-27T05:12:09.334Z"},"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-27T05:12:09.407Z"},"s":"I","c":"DEVTOOLS-CONNECT","id":1000000037,"ctx":"mongosh-connect","msg":"Connection attempt finished"}
Original file line number Diff line number Diff line change
@@ -1,14 +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}}
{"t":{"$date":"2024-05-27T05:12:09.741Z"},"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-27T05:12:09.748Z"},"s":"I","c":"MONGOSH","id":1000000005,"ctx":"config","msg":"User updated"}
{"t":{"$date":"2024-05-27T05:12:09.748Z"},"s":"I","c":"MONGOSH","id":1000000048,"ctx":"config","msg":"Loading global configuration file","attr":{"filename":"/etc/mongosh.conf","found":false}}
{"t":{"$date":"2024-05-27T05:12:09.788Z"},"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-27T05:12:09.796Z"},"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-27T05:12:09.829Z"},"s":"I","c":"DEVTOOLS-CONNECT","id":1000000037,"ctx":"mongosh-connect","msg":"Connection attempt finished"}
{"t":{"$date":"2024-05-27T05:12:09.847Z"},"s":"I","c":"MONGOSH","id":1000000004,"ctx":"connect","msg":"Connecting to server","attr":{"session_id":"665416295502c8791d99ea71","userId":null,"telemetryAnonymousId":"66541629364b93a25699ea70","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-27T05:12:09.850Z"},"s":"I","c":"MONGOSH","id":1000000010,"ctx":"shell-api","msg":"Initialized context","attr":{"method":"setCtx","arguments":{}}}
{"t":{"$date":"2024-05-27T05:12:09.857Z"},"s":"I","c":"MONGOSH-SNIPPETS","id":1000000024,"ctx":"snippets","msg":"Fetching snippet index","attr":{"refreshMode":"allow-cached"}}
{"t":{"$date":"2024-05-27T05:12:09.905Z"},"s":"I","c":"MONGOSH-SNIPPETS","id":1000000019,"ctx":"snippets","msg":"Loaded snippets","attr":{"installdir":"/data/db/.mongodb/mongosh/snippets"}}
{"t":{"$date":"2024-05-27T05:12:09.906Z"},"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-27T05:12:09.908Z"},"s":"I","c":"MONGOSH","id":1000000002,"ctx":"repl","msg":"Started REPL","attr":{"version":"2.2.5"}}
{"t":{"$date":"2024-05-27T05:12:10.043Z"},"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-27T05:12:10.114Z"},"s":"I","c":"MONGOSH","id":1000000045,"ctx":"analytics","msg":"Flushed outstanding data","attr":{"flushError":"Trying to persist throttle state before userId is set","flushDuration":0}}
2 changes: 1 addition & 1 deletion checker3/data/.mongodb/mongosh/config
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"userId":"664be2c6de279c080e99ea70","telemetryAnonymousId":"664be2c6de279c080e99ea70","enableTelemetry":true}
{"userId":"66541629364b93a25699ea70","telemetryAnonymousId":"66541629364b93a25699ea70","enableTelemetry":true}
2 changes: 1 addition & 1 deletion checker3/data/WiredTiger.turtle
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ 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)
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.12=(addr="018081e4e4e58bf98181e48b29d96e8281e41a19d456808080e3014fc0e25fc0",order=12,time=1716787015,size=36864,newest_start_durable_ts=0,oldest_start_ts=0,newest_txn=6,newest_stop_durable_ts=0,newest_stop_ts=-1,newest_stop_txn=-11,prepare=0,write_gen=33,run_write_gen=26)),checkpoint_backup_info=,checkpoint_lsn=(3,6528)
Binary file modified checker3/data/WiredTiger.wt
Binary file not shown.
Binary file modified 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 not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed checker3/data/diagnostic.data/metrics.interim
Binary file not shown.
Binary file not shown.
Binary file added checker3/data/index-1-3767779173863406023.wt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed checker3/data/index-5--4979625772267755921.wt
Binary file not shown.
Binary file added checker3/data/index-5--6895972916108036508.wt
Binary file not shown.
Binary file removed checker3/data/index-6--4979625772267755921.wt
Binary file not shown.
Binary file added checker3/data/index-6--6895972916108036508.wt
Binary file not shown.
Binary file not shown.
Binary file removed checker3/data/index-8-2105818246731380529.wt
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 0 additions & 1 deletion checker3/data/mongod.lock
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
1
Binary file modified checker3/data/sizeStorer.wt
Binary file not shown.
20 changes: 10 additions & 10 deletions checker3/docker-compose-local.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
version: "2.1"

services:
n0t3b00k-checker:
piratesay-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_HOST=piratesay-mongo
- MONGO_PORT=27017
- MONGO_USER=n0t3b00k
- MONGO_PASSWORD=n0t3b00k
- MONGO_USER=piratesay
- MONGO_PASSWORD=piratesay
mem_limit: 1G
memswap_limit: 2G
ulimits:
Expand All @@ -22,17 +22,17 @@ services:
soft: 4000
hard: 4000
networks:
- pirateprattle_service_default
- piratesay_service_default
# The python checkerlib requires a mongo db!
n0t3b00k-mongo:
piratesay-mongo:
image: mongo
#ports:
# - 27017:27017
volumes:
- ./data:/data/db
environment:
MONGO_INITDB_ROOT_USERNAME: n0t3b00k
MONGO_INITDB_ROOT_PASSWORD: n0t3b00k
MONGO_INITDB_ROOT_USERNAME: piratesay
MONGO_INITDB_ROOT_PASSWORD: piratesay
mem_limit: 1G
memswap_limit: 2G
ulimits:
Expand All @@ -44,8 +44,8 @@ services:
hard: 4000

networks:
- pirateprattle_service_default
- piratesay_service_default

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

services:
n0t3b00k-checker:
piratesay-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_HOST=piratesay-mongo
- MONGO_PORT=27017
- MONGO_USER=n0t3b00k
- MONGO_PASSWORD=n0t3b00k
- MONGO_USER=piratesay
- MONGO_PASSWORD=piratesay
mem_limit: 1G
memswap_limit: 2G
ulimits:
Expand All @@ -22,15 +22,15 @@ services:
soft: 4000
hard: 4000
# The python checkerlib requires a mongo db!
n0t3b00k-mongo:
piratesay-mongo:
image: mongo
#ports:
# - 27017:27017
volumes:
- ./data:/data/db
environment:
MONGO_INITDB_ROOT_USERNAME: n0t3b00k
MONGO_INITDB_ROOT_PASSWORD: n0t3b00k
MONGO_INITDB_ROOT_USERNAME: piratesay
MONGO_INITDB_ROOT_PASSWORD: piratesay
mem_limit: 1G
memswap_limit: 2G
ulimits:
Expand Down
Loading

0 comments on commit d9a6642

Please sign in to comment.