diff --git a/Dockerfile b/Dockerfile index 046c7dffe..7430b896e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,5 +16,5 @@ RUN pip install --no-cache-dir -r requirements.txt COPY . /app/backend EXPOSE 8000 -#RUN python manage.py migrate -#RUN python manage.py makemigrations +# RUN python manage.py migrate +# RUN python manage.py makemigrations diff --git a/data/mongodb/.mongodb/mongosh/67a9e746372a239bce544ca6_log b/data/mongodb/.mongodb/mongosh/67a9e746372a239bce544ca6_log new file mode 100644 index 000000000..14d701048 --- /dev/null +++ b/data/mongodb/.mongodb/mongosh/67a9e746372a239bce544ca6_log @@ -0,0 +1,6 @@ +{"t":{"$date":"2025-02-10T11:47:18.691Z"},"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.3.8","distributionKind":"compiled","buildArch":"x64","buildPlatform":"linux","buildTarget":"linux-x64","buildTime":"2024-12-30T22:43:03.083Z","gitVersion":"0f0681f5ed67530071c9b3811cf5e18a222b9ae4","nodeVersion":"v20.18.1","opensslVersion":"3.0.15+quic","sharedOpenssl":false,"runtimeArch":"x64","runtimePlatform":"linux","runtimeGlibcVersion":"2.39","deps":{"nodeDriverVersion":"6.12.0","libmongocryptVersion":"1.11.0","libmongocryptNodeBindingsVersion":"6.1.0","kerberosVersion":"2.1.0"}}} +{"t":{"$date":"2025-02-10T11:47:18.791Z"},"s":"I","c":"MONGOSH","id":1000000048,"ctx":"config","msg":"Loading global configuration file","attr":{"filename":"/etc/mongosh.conf","found":false}} +{"t":{"$date":"2025-02-10T11:47:19.098Z"},"s":"I","c":"DEVTOOLS-CONNECT","id":1000000049,"ctx":"mongosh-connect","msg":"Loaded system CA list","attr":{"caCount":293,"asyncFallbackError":null,"systemCertsError":null,"messages":[]}} +{"t":{"$date":"2025-02-10T11:47:19.121Z"},"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.3.8","driver":{"name":"nodejs|mongosh","version":"6.12.0|2.3.8"},"devtoolsConnectVersion":"3.3.4","host":"127.0.0.1:27017"}} +{"t":{"$date":"2025-02-10T11:47:19.151Z"},"s":"I","c":"DEVTOOLS-CONNECT","id":1000000035,"ctx":"mongosh-connect","msg":"Server heartbeat succeeded","attr":{"connectionId":"127.0.0.1:27017"}} +{"t":{"$date":"2025-02-10T11:47:19.248Z"},"s":"I","c":"DEVTOOLS-CONNECT","id":1000000037,"ctx":"mongosh-connect","msg":"Connection attempt finished"} diff --git a/data/mongodb/.mongodb/mongosh/67a9e7477dc39f8029544ca6_log b/data/mongodb/.mongodb/mongosh/67a9e7477dc39f8029544ca6_log new file mode 100644 index 000000000..a617a2cff --- /dev/null +++ b/data/mongodb/.mongodb/mongosh/67a9e7477dc39f8029544ca6_log @@ -0,0 +1,15 @@ +{"t":{"$date":"2025-02-10T11:47:19.614Z"},"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.3.8","distributionKind":"compiled","buildArch":"x64","buildPlatform":"linux","buildTarget":"linux-x64","buildTime":"2024-12-30T22:43:03.083Z","gitVersion":"0f0681f5ed67530071c9b3811cf5e18a222b9ae4","nodeVersion":"v20.18.1","opensslVersion":"3.0.15+quic","sharedOpenssl":false,"runtimeArch":"x64","runtimePlatform":"linux","runtimeGlibcVersion":"2.39","deps":{"nodeDriverVersion":"6.12.0","libmongocryptVersion":"1.11.0","libmongocryptNodeBindingsVersion":"6.1.0","kerberosVersion":"2.1.0"}}} +{"t":{"$date":"2025-02-10T11:47:19.662Z"},"s":"I","c":"MONGOSH","id":1000000005,"ctx":"config","msg":"User updated"} +{"t":{"$date":"2025-02-10T11:47:19.665Z"},"s":"I","c":"MONGOSH","id":1000000048,"ctx":"config","msg":"Loading global configuration file","attr":{"filename":"/etc/mongosh.conf","found":false}} +{"t":{"$date":"2025-02-10T11:47:19.742Z"},"s":"I","c":"DEVTOOLS-CONNECT","id":1000000049,"ctx":"mongosh-connect","msg":"Loaded system CA list","attr":{"caCount":293,"asyncFallbackError":null,"systemCertsError":null,"messages":[]}} +{"t":{"$date":"2025-02-10T11:47:19.763Z"},"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.3.8","driver":{"name":"nodejs|mongosh","version":"6.12.0|2.3.8"},"devtoolsConnectVersion":"3.3.4","host":"127.0.0.1:27017"}} +{"t":{"$date":"2025-02-10T11:47:19.772Z"},"s":"I","c":"DEVTOOLS-CONNECT","id":1000000035,"ctx":"mongosh-connect","msg":"Server heartbeat succeeded","attr":{"connectionId":"127.0.0.1:27017"}} +{"t":{"$date":"2025-02-10T11:47:19.826Z"},"s":"I","c":"DEVTOOLS-CONNECT","id":1000000037,"ctx":"mongosh-connect","msg":"Connection attempt finished"} +{"t":{"$date":"2025-02-10T11:47:19.846Z"},"s":"I","c":"MONGOSH","id":1000000010,"ctx":"shell-api","msg":"Initialized context","attr":{"method":"setCtx","arguments":{}}} +{"t":{"$date":"2025-02-10T11:47:19.848Z"},"s":"I","c":"MONGOSH-SNIPPETS","id":1000000024,"ctx":"snippets","msg":"Fetching snippet index","attr":{"refreshMode":"allow-cached"}} +{"t":{"$date":"2025-02-10T11:47:19.850Z"},"s":"I","c":"MONGOSH-SNIPPETS","id":1000000019,"ctx":"snippets","msg":"Loaded snippets","attr":{"installdir":"/data/db/.mongodb/mongosh/snippets"}} +{"t":{"$date":"2025-02-10T11:47:19.969Z"},"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":"2025-02-10T11:47:19.970Z"},"s":"I","c":"MONGOSH","id":1000000002,"ctx":"repl","msg":"Started REPL","attr":{"version":"2.3.8"}} +{"t":{"$date":"2025-02-10T11:47:19.985Z"},"s":"I","c":"MONGOSH","id":1000000004,"ctx":"connect","msg":"Connecting to server","attr":{"userId":null,"telemetryAnonymousId":"67a9e746372a239bce544ca5","connectionUri":"mongodb://:27017/admin?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.3.8","mongosh_version":"2.3.8","session_id":"67a9e7477dc39f8029544ca6","is_localhost":true,"is_do_url":false,"is_atlas_url":false,"is_atlas":false,"server_version":"8.0.4","node_version":"v20.18.1","server_os":"linux","server_arch":"x86_64","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":"8.0","api_version":null,"api_strict":null,"api_deprecation_errors":null,"atlas_hostname":null}} +{"t":{"$date":"2025-02-10T11:47:20.220Z"},"s":"I","c":"MONGOSH","id":1000000011,"ctx":"shell-api","msg":"Performed API call","attr":{"method":"createUser","class":"Database","db":"admin","arguments":{}}} +{"t":{"$date":"2025-02-10T11:47:20.452Z"},"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}} diff --git a/data/mongodb/.mongodb/mongosh/67a9e74f3a45b9f77a544ca6_log b/data/mongodb/.mongodb/mongosh/67a9e74f3a45b9f77a544ca6_log new file mode 100644 index 000000000..4584d0ded --- /dev/null +++ b/data/mongodb/.mongodb/mongosh/67a9e74f3a45b9f77a544ca6_log @@ -0,0 +1,11 @@ +{"t":{"$date":"2025-02-10T11:47:27.550Z"},"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.3.8","distributionKind":"compiled","buildArch":"x64","buildPlatform":"linux","buildTarget":"linux-x64","buildTime":"2024-12-30T22:43:03.083Z","gitVersion":"0f0681f5ed67530071c9b3811cf5e18a222b9ae4","nodeVersion":"v20.18.1","opensslVersion":"3.0.15+quic","sharedOpenssl":false,"runtimeArch":"x64","runtimePlatform":"linux","runtimeGlibcVersion":"2.39","deps":{"nodeDriverVersion":"6.12.0","libmongocryptVersion":"1.11.0","libmongocryptNodeBindingsVersion":"6.1.0","kerberosVersion":"2.1.0"}}} +{"t":{"$date":"2025-02-10T11:47:27.599Z"},"s":"I","c":"MONGOSH","id":1000000005,"ctx":"config","msg":"User updated"} +{"t":{"$date":"2025-02-10T11:47:27.600Z"},"s":"I","c":"MONGOSH","id":1000000048,"ctx":"config","msg":"Loading global configuration file","attr":{"filename":"/etc/mongosh.conf","found":false}} +{"t":{"$date":"2025-02-10T11:47:27.683Z"},"s":"I","c":"DEVTOOLS-CONNECT","id":1000000049,"ctx":"mongosh-connect","msg":"Loaded system CA list","attr":{"caCount":293,"asyncFallbackError":null,"systemCertsError":null,"messages":[]}} +{"t":{"$date":"2025-02-10T11:47:27.707Z"},"s":"I","c":"DEVTOOLS-CONNECT","id":1000000042,"ctx":"mongosh-connect","msg":"Initiating connection attempt","attr":{"uri":"mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.3.8","driver":{"name":"nodejs|mongosh","version":"6.12.0|2.3.8"},"devtoolsConnectVersion":"3.3.4","host":"127.0.0.1:27017"}} +{"t":{"$date":"2025-02-10T11:47:27.718Z"},"s":"I","c":"DEVTOOLS-CONNECT","id":1000000035,"ctx":"mongosh-connect","msg":"Server heartbeat succeeded","attr":{"connectionId":"127.0.0.1:27017"}} +{"t":{"$date":"2025-02-10T11:47:27.805Z"},"s":"I","c":"DEVTOOLS-CONNECT","id":1000000037,"ctx":"mongosh-connect","msg":"Connection attempt finished"} +{"t":{"$date":"2025-02-10T11:47:27.808Z"},"s":"I","c":"MONGOSH","id":1000000010,"ctx":"shell-api","msg":"Initialized context","attr":{"method":"setCtx","arguments":{}}} +{"t":{"$date":"2025-02-10T11:47:27.814Z"},"s":"I","c":"MONGOSH-SNIPPETS","id":1000000019,"ctx":"snippets","msg":"Loaded snippets","attr":{"installdir":"/data/db/.mongodb/mongosh/snippets"}} +{"t":{"$date":"2025-02-10T11:47:27.819Z"},"s":"I","c":"MONGOSH","id":1000000003,"ctx":"repl","msg":"Start loading CLI scripts"} +{"t":{"$date":"2025-02-10T11:47:27.824Z"},"s":"I","c":"MONGOSH","id":1000000013,"ctx":"repl","msg":"Evaluating script passed on the command line"} diff --git a/data/mongodb/.mongodb/mongosh/config b/data/mongodb/.mongodb/mongosh/config new file mode 100644 index 000000000..411a729d5 --- /dev/null +++ b/data/mongodb/.mongodb/mongosh/config @@ -0,0 +1 @@ +{"userId":"67a9e746372a239bce544ca5","telemetryAnonymousId":"67a9e746372a239bce544ca5","enableTelemetry":true} \ No newline at end of file diff --git a/data/mongodb/.mongodb/mongosh/mongosh_repl_history b/data/mongodb/.mongodb/mongosh/mongosh_repl_history new file mode 100644 index 000000000..e69de29bb diff --git a/data/mongodb/.mongodb/mongosh/snippets/package.json b/data/mongodb/.mongodb/mongosh/snippets/package.json new file mode 100644 index 000000000..9e26dfeeb --- /dev/null +++ b/data/mongodb/.mongodb/mongosh/snippets/package.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/data/mongodb/WiredTiger b/data/mongodb/WiredTiger new file mode 100644 index 000000000..1d6d8f773 --- /dev/null +++ b/data/mongodb/WiredTiger @@ -0,0 +1,2 @@ +WiredTiger +WiredTiger 11.3.0: (November 16, 2023) diff --git a/data/mongodb/WiredTiger.lock b/data/mongodb/WiredTiger.lock new file mode 100644 index 000000000..3d842068e --- /dev/null +++ b/data/mongodb/WiredTiger.lock @@ -0,0 +1 @@ +WiredTiger lock file diff --git a/data/mongodb/WiredTiger.turtle b/data/mongodb/WiredTiger.turtle new file mode 100644 index 000000000..0f5ac8af9 --- /dev/null +++ b/data/mongodb/WiredTiger.turtle @@ -0,0 +1,6 @@ +WiredTiger version string +WiredTiger 11.3.0: (November 16, 2023) +WiredTiger version +major=11,minor=3,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.4=(addr="018381e4c3a51c7e8481e45cf562698581e4d9340356808080e3014fc0e23fc0",order=4,time=1739188043,size=28672,newest_start_durable_ts=0,oldest_start_ts=0,newest_txn=1,newest_stop_durable_ts=0,newest_stop_ts=-1,newest_stop_txn=-11,prepare=0,write_gen=11,run_write_gen=9)),checkpoint_backup_info=,checkpoint_lsn=(2,384) diff --git a/data/mongodb/WiredTiger.wt b/data/mongodb/WiredTiger.wt new file mode 100644 index 000000000..9ee17bc31 Binary files /dev/null and b/data/mongodb/WiredTiger.wt differ diff --git a/data/mongodb/WiredTigerHS.wt b/data/mongodb/WiredTigerHS.wt new file mode 100644 index 000000000..3f019cba9 Binary files /dev/null and b/data/mongodb/WiredTigerHS.wt differ diff --git a/data/mongodb/_mdb_catalog.wt b/data/mongodb/_mdb_catalog.wt new file mode 100644 index 000000000..cfa856685 Binary files /dev/null and b/data/mongodb/_mdb_catalog.wt differ diff --git a/data/mongodb/collection-0-3545043312376694256.wt b/data/mongodb/collection-0-3545043312376694256.wt new file mode 100644 index 000000000..0553b34b8 Binary files /dev/null and b/data/mongodb/collection-0-3545043312376694256.wt differ diff --git a/data/mongodb/collection-2-3545043312376694256.wt b/data/mongodb/collection-2-3545043312376694256.wt new file mode 100644 index 000000000..2d31c4612 Binary files /dev/null and b/data/mongodb/collection-2-3545043312376694256.wt differ diff --git a/data/mongodb/collection-4-3545043312376694256.wt b/data/mongodb/collection-4-3545043312376694256.wt new file mode 100644 index 000000000..3f019cba9 Binary files /dev/null and b/data/mongodb/collection-4-3545043312376694256.wt differ diff --git a/data/mongodb/collection-7-3545043312376694256.wt b/data/mongodb/collection-7-3545043312376694256.wt new file mode 100644 index 000000000..02afe9bcb Binary files /dev/null and b/data/mongodb/collection-7-3545043312376694256.wt differ diff --git a/data/mongodb/diagnostic.data/metrics.2025-02-10T11-41-46Z-00000 b/data/mongodb/diagnostic.data/metrics.2025-02-10T11-41-46Z-00000 new file mode 100644 index 000000000..ce81fdc88 Binary files /dev/null and b/data/mongodb/diagnostic.data/metrics.2025-02-10T11-41-46Z-00000 differ diff --git a/data/mongodb/diagnostic.data/metrics.2025-02-10T11-47-24Z-00000 b/data/mongodb/diagnostic.data/metrics.2025-02-10T11-47-24Z-00000 new file mode 100644 index 000000000..81dfaecd2 Binary files /dev/null and b/data/mongodb/diagnostic.data/metrics.2025-02-10T11-47-24Z-00000 differ diff --git a/data/mongodb/index-1-3545043312376694256.wt b/data/mongodb/index-1-3545043312376694256.wt new file mode 100644 index 000000000..d718b343b Binary files /dev/null and b/data/mongodb/index-1-3545043312376694256.wt differ diff --git a/data/mongodb/index-3-3545043312376694256.wt b/data/mongodb/index-3-3545043312376694256.wt new file mode 100644 index 000000000..39f438da6 Binary files /dev/null and b/data/mongodb/index-3-3545043312376694256.wt differ diff --git a/data/mongodb/index-5-3545043312376694256.wt b/data/mongodb/index-5-3545043312376694256.wt new file mode 100644 index 000000000..3f019cba9 Binary files /dev/null and b/data/mongodb/index-5-3545043312376694256.wt differ diff --git a/data/mongodb/index-6-3545043312376694256.wt b/data/mongodb/index-6-3545043312376694256.wt new file mode 100644 index 000000000..3f019cba9 Binary files /dev/null and b/data/mongodb/index-6-3545043312376694256.wt differ diff --git a/data/mongodb/index-8-3545043312376694256.wt b/data/mongodb/index-8-3545043312376694256.wt new file mode 100644 index 000000000..8c22607d0 Binary files /dev/null and b/data/mongodb/index-8-3545043312376694256.wt differ diff --git a/data/mongodb/index-9-3545043312376694256.wt b/data/mongodb/index-9-3545043312376694256.wt new file mode 100644 index 000000000..26aef0dc6 Binary files /dev/null and b/data/mongodb/index-9-3545043312376694256.wt differ diff --git a/data/mongodb/journal/WiredTigerLog.0000000002 b/data/mongodb/journal/WiredTigerLog.0000000002 new file mode 100644 index 000000000..da34a08f1 Binary files /dev/null and b/data/mongodb/journal/WiredTigerLog.0000000002 differ diff --git a/data/mongodb/journal/WiredTigerPreplog.0000000001 b/data/mongodb/journal/WiredTigerPreplog.0000000001 new file mode 100644 index 000000000..aa52a216f Binary files /dev/null and b/data/mongodb/journal/WiredTigerPreplog.0000000001 differ diff --git a/data/mongodb/mongod.lock b/data/mongodb/mongod.lock new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/data/mongodb/mongod.lock @@ -0,0 +1 @@ +1 diff --git a/data/mongodb/sizeStorer.wt b/data/mongodb/sizeStorer.wt new file mode 100644 index 000000000..e51c58dca Binary files /dev/null and b/data/mongodb/sizeStorer.wt differ diff --git a/data/mongodb/storage.bson b/data/mongodb/storage.bson new file mode 100644 index 000000000..276b69451 Binary files /dev/null and b/data/mongodb/storage.bson differ diff --git a/docker-compose.yml b/docker-compose.yml index 83c261914..6d7772d82 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,7 +24,7 @@ services: env_file: - ".env" depends_on: - - db + - mongodb restart: always healthcheck: test: ["CMD-SHELL", "curl -f http://localhost:8000/admin || exit 1"] @@ -35,16 +35,17 @@ services: networks: - notes-app-nw - db: - image: mysql - container_name: "db_cont" + mongodb: + image: mongo + container_name: "mongodb_cont" environment: - - MYSQL_ROOT_PASSWORD=root - - MYSQL_DATABASE=test_db + - MONGO_INITDB_ROOT_USERNAME=root + - MONGO_INITDB_ROOT_PASSWORD=root + - MONGO_INITDB_DATABASE=test_db volumes: - - ./data/mysql/db:/var/lib/mysql + - ./data/mongodb:/data/db healthcheck: - test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot", "-proot"] + test: ["CMD", "mongosh", "--eval", "db.runCommand('ping').ok"] interval: 10s timeout: 5s retries: 5 diff --git a/docker-compose.yml_donot b/docker-compose.yml_donot new file mode 100644 index 000000000..f9ae03a37 --- /dev/null +++ b/docker-compose.yml_donot @@ -0,0 +1,56 @@ +version: "3.8" + +services: + nginx: + build: ./nginx + image: nginx + container_name: "nginx_cont" + ports: + - "80:80" + restart: always + depends_on: + - django_app + networks: + - notes-app-nw + + django_app: + build: + context: . + image: django_app + container_name: "django_cont" + ports: + - "8000:8000" + command: sh -c "python manage.py migrate --noinput && gunicorn notesapp.wsgi --bind 0.0.0.0:8000" + env_file: + - ".env" + depends_on: + - db + restart: always + healthcheck: + test: ["CMD-SHELL", "curl -f http://localhost:8000/admin || exit 1"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 30s + networks: + - notes-app-nw + + db: + image: mysql + container_name: "db_cont" + environment: + - MYSQL_ROOT_PASSWORD=root + - MYSQL_DATABASE=test_db + volumes: + - db_data:/var/lib/mysql + healthcheck: + test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot", "-proot"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 60s + networks: + - notes-app-nw + +networks: + notes-app-nw: