summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjc0b <j@jc0b.computer>2020-06-30 18:02:16 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2020-08-24 19:44:37 +0200
commitb97d1977d08760b237c645a275be1972a32451b7 (patch)
tree55cfdd69a8237411558a3045c9342a014de607f1
parent6a4703517e7e1ca5ee2c8d8e0a4c49f32d17c662 (diff)
parentabb91a93c40ef3577aa953cf6e8c252593e082d4 (diff)
Merge branch 'feature/mongodb-migration' of github.com:atlarge-research/opendc-dev into feature/mongodb-migration
-rw-r--r--.dockerignore0
-rw-r--r--.gitignore9
-rw-r--r--CONTRIBUTING.md2
-rw-r--r--Dockerfile35
-rwxr-xr-xbuild/configure.sh23
-rw-r--r--docker-compose.yml101
-rw-r--r--frontend/CONTRIBUTING.md28
-rw-r--r--frontend/LICENSE.md21
-rw-r--r--frontend/README.md5
-rw-r--r--mongodb/Dockerfile4
-rwxr-xr-xmongodb/configure.sh23
-rw-r--r--mongodb/docker-compose.yml1
-rw-r--r--mongodb/mongo-init-opendc-db.sh3
-rw-r--r--simulator/CONTRIBUTING.md0
-rw-r--r--simulator/LICENSE.txt21
-rw-r--r--simulator/README.md9
-rw-r--r--web-server/LICENSE.md21
-rw-r--r--web-server/OpenDC.postman_collection.json61
-rw-r--r--web-server/main.py9
-rw-r--r--web-server/opendc/util/database.py2
20 files changed, 105 insertions, 273 deletions
diff --git a/.dockerignore b/.dockerignore
deleted file mode 100644
index e69de29b..00000000
--- a/.dockerignore
+++ /dev/null
diff --git a/.gitignore b/.gitignore
index e31adcb6..fc1cd81f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,12 +1,15 @@
# JetBrains platform
.idea/
-# Credential setup file
-keys.json
-
# pyenv version files
.python-version
mongodb/opendc_testing/*
# macOS-specific files
.DS_Store
+
+# Environment files
+.env
+
+# Old credential setup file
+keys.json
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index a90c1fb5..1f29e2fb 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,4 +1,4 @@
-# Contributing to the OpenDC Frontend
+# Contributing to OpenDC
First of all, thanks for wanting to contribute! 🎉
diff --git a/Dockerfile b/Dockerfile
index f7f36d87..fe64736e 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,35 +1,26 @@
-FROM node:14.2.0
-MAINTAINER Sacheendra Talluri <sacheendra.t@gmail.com>
+FROM nikolaik/python-nodejs:python3.8-nodejs14
+MAINTAINER OpenDC Maintainers <opendc@atlarge-research.com>
-# Adding the mongodb repo and installing the client
-RUN wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | apt-key add - \
- && echo "deb http://repo.mongodb.org/apt/debian stretch/mongodb-org/4.2 main" | tee /etc/apt/sources.list.d/mongodb-org-4.2.list \
- && apt-get update \
- && apt-get install -y mongodb-org
+## Dockerfile for the frontend/server part of the deployment
-# Installing python and web-server dependencies
-RUN echo "deb http://ftp.debian.org/debian stretch main" >> /etc/apt/sources.list \
- && apt-get update \
- && apt-get install -y python3 python3-pip yarn git sed mysql-client pymongo \
- && pip3 install oauth2client eventlet flask-socketio flask-compress mysql-connector-python-rf \
- && pip3 install --upgrade pyasn1-modules \
- && rm -rf /var/lib/apt/lists/*
+# Installing packages
+RUN apt-get update \
+ && apt-get install -y yarn git sed
# Copy OpenDC directory
COPY ./ /opendc
-# Setting up simulator
-RUN pip install -e /opendc/opendc-web-server \
- && python /opendc/opendc-web-server/setup.py install \
- && chmod 555 /opendc/build/configure.sh \
- && cd /opendc/opendc-frontend \
+# Fetch web server dependencies
+RUN pip install -r /opendc/web-server/requirements.txt
+
+# Build frontend
+RUN cd /opendc/frontend \
&& rm -rf ./build \
- && rm -rf ./node_modules \
&& yarn \
- && export REACT_APP_OAUTH_CLIENT_ID=$(cat ../keys.json | python -c "import sys, json; print json.load(sys.stdin)['OAUTH_CLIENT_ID']") \
+ && export REACT_APP_OAUTH_CLIENT_ID=$OPENDC_OAUTH_CLIENT_ID \
&& yarn build
# Set working directory
WORKDIR /opendc
-CMD ["sh", "-c", "./build/configure.sh && python3 opendc-web-server/main.py keys.json"]
+CMD ["sh", "-c", "python web-server/main.py"]
diff --git a/build/configure.sh b/build/configure.sh
deleted file mode 100755
index 7dda7773..00000000
--- a/build/configure.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-if [ -z "$MONGO_DB" ]; then
- echo "MONGO_DB environment variable not specified"
- exit 1
-fi
-
-if [ -z "$MONGO_DB_USER" ]; then
- echo "MONGO_DB_USER environment variable not specified"
- exit 1
-fi
-
-if [ -z "$MONGO_DB_PASSWORD" ]; then
- echo "MONGO_DB_PASSWORD environment variable not specified"
- exit 1
-fi
-
-MONGO_COMMAND="mongo $MONGO_DB -h $MONGO_DB_HOST --port $MONGO_DB_PORT -u $MONGO_DB_USERNAME -p $MONGO_DB_PASSWORD --authenticationDatabase $MONGO_DB"
-
-until eval $MONGO_COMMAND --eval 'db.getCollectionNames();' ; do
- echo "MongoDB is unavailable - sleeping"
- sleep 1
-done
-
-echo "MongoDB available"
diff --git a/docker-compose.yml b/docker-compose.yml
index 3f4ad20a..bc2b2e25 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -7,78 +7,73 @@ services:
ports:
- "8081:8081"
links:
- - mariadb
+ - mongo
depends_on:
- - mariadb
+ - mongo
environment:
- - MYSQL_DATABASE=opendc
- - MYSQL_USER=opendc
- - MYSQL_PASSWORD=opendcpassword
- - MONGO_DB=opendc
- - MONGO_DB_USERNAME=opendc
- - MONGO_DB_PASSWORD=opendcpassword
- - MONGO_DB_HOST=mongo
- - MONGO_DB_PORT=27017
+ - MONGO_INITDB_ROOT_USERNAME
+ - MONGO_INITDB_ROOT_PASSWORD
+ - MONGO_INITDB_DATABASE
+ - OPENDC_DB
+ - OPENDC_DB_USERNAME
+ - OPENDC_DB_PASSWORD
+ - OPENDC_FLASK_SECRET
+ - OPENDC_OAUTH_CLIENT_ID
+ - OPENDC_ROOT_DIR
+ - OPENDC_SERVER_BASE_URL
+
+# TODO: Implement new database interaction on the simulator side
+# simulator:
+# build:
+# context: ./opendc-simulator
+# dockerfile: opendc-model-odc/setup/Dockerfile
+# image: simulator
+# restart: on-failure
+# links:
+# - mongo
+# depends_on:
+# - mongo
+# environment:
+# - PERSISTENCE_URL=jdbc:mysql://mariadb:3306/opendc
+# - PERSISTENCE_USER=opendc
+# - PERSISTENCE_PASSWORD=opendcpassword
+# - COLLECT_MACHINE_STATES=ON
+# - COLLECT_TASK_STATES=ON
+# - COLLECT_STAGE_MEASUREMENTS=OFF
+# - COLLECT_TASK_METRICS=OFF
+# - COLLECT_JOB_METRICS=OFF
- simulator:
- build:
- context: ./opendc-simulator
- dockerfile: opendc-model-odc/setup/Dockerfile
- image: simulator
- restart: on-failure
- links:
- - mariadb
- depends_on:
- - mariadb
- environment:
- - PERSISTENCE_URL=jdbc:mysql://mariadb:3306/opendc
- - PERSISTENCE_USER=opendc
- - PERSISTENCE_PASSWORD=opendcpassword
- - COLLECT_MACHINE_STATES=ON
- - COLLECT_TASK_STATES=ON
- - COLLECT_STAGE_MEASUREMENTS=OFF
- - COLLECT_TASK_METRICS=OFF
- - COLLECT_JOB_METRICS=OFF
- mariadb:
- build:
- context: ./database
- image: database
- restart: on-failure
- ports:
- - "3306:3306" # comment this line out in production
- environment:
- - MYSQL_DATABASE=opendc
- - MYSQL_USER=opendc
- - MYSQL_PASSWORD=opendcpassword
- - MYSQL_RANDOM_ROOT_PASSWORD=yes
- # uncomment in production
- # volumes:
- # - "/data/mariadb:/var/lib/mysql"
mongo:
build:
context: ./mongodb
restart: on-failure
environment:
- - MONGO_INITDB_ROOT_USERNAME=root
- - MONGO_INITDB_ROOT_PASSWORD=rootpassword
- - MONGO_INITDB_DATABASE=admin
- - OPENDC_DB=opendc
- - OPENDC_DB_USERNAME=opendc
- - OPENDC_DB_PASSWORD=opendcpassword
+ - MONGO_INITDB_ROOT_USERNAME
+ - MONGO_INITDB_ROOT_PASSWORD
+ - MONGO_INITDB_DATABASE
+ - OPENDC_DB
+ - OPENDC_DB_USERNAME
+ - OPENDC_DB_PASSWORD
+ # Comment out for public deployment
ports:
- 27017:27017
+ # Uncomment for persistent deployment
#volumes:
# - mongo-volume:/data/db
mongo-express:
image: mongo-express
restart: on-failure
+ links:
+ - mongo
+ depends_on:
+ - mongo
ports:
- 8082:8081
environment:
- ME_CONFIG_MONGODB_ADMINUSERNAME: root
- ME_CONFIG_MONGODB_ADMINPASSWORD: rootpassword
+ ME_CONFIG_MONGODB_ADMINUSERNAME: "${MONGO_INITDB_ROOT_USERNAME}"
+ ME_CONFIG_MONGODB_ADMINPASSWORD: "${MONGO_INITDB_ROOT_PASSWORD}"
volumes:
mongo-volume:
- external: false \ No newline at end of file
+ external: false
diff --git a/frontend/CONTRIBUTING.md b/frontend/CONTRIBUTING.md
deleted file mode 100644
index 152ab5aa..00000000
--- a/frontend/CONTRIBUTING.md
+++ /dev/null
@@ -1,28 +0,0 @@
-# Contributing to the OpenDC Frontend
-
-First of all, thanks for wanting to contribute! 🎉
-
-
-## 💬 Have a question or general feedback relating to the OpenDC Frontend?
-
-Contact us at 📧[opendc@atlarge-research.com](mailto:opendc@atlarge-research.com)!
-
-
-## 🐞 Want to report a bug or suggest a feature?
-
-Encountered what you deem to be undesirable behavior? Have an idea for a feature that could be added? Please go to our [GitHub issues page](https://github.com/atlarge-research/opendc-frontend/issues) and have a look if there already is an issue addressing your concern.
-
-If there already is an issue, feel free to comment on the issue to show your support for it, or to add additional information that might be helpful. You can also just react with a thumbs-up 👍 to the issue or feature, to indicate that you'd be interested in its resolution. This can help us prioritize what we spend our development time on.
-
-If you can't find an issue that fits your problem or feature request, [open a new one](https://github.com/atlarge-research/opendc-frontend/issues/new). Describe actual and expected behavior, and be as detailed as you can. We'll get back to you asap.
-
-
-## 💻 Want to contribute code?
-
-Great! [Fork this repo](https://github.com/atlarge-research/opendc-frontend/new/master) and submit a PR here when you're ready! Be sure to describe *what* you changed and *why* you changed it, to help us understand what your contribution is about.
-
-* A couple of notes on the code itself:
- * Before you make changes to the codebase, have a look at the rest of the codebase (especially parts that are similar to what you want to achieve). Do you understand what they do? If not, feel free to [contact us](mailto:opendc@atlarge-research.com).
- * Try to write clean, concise, self-documenting code.
- * Don't worry too much about the formatting of your code: our `prettier` pre-commit hook takes care of formatting your code for you, automatically.
-* A quick note on commit messages: Please follow common Git standards when writing commit messages, see [this post](https://chris.beams.io/posts/git-commit/) for details.
diff --git a/frontend/LICENSE.md b/frontend/LICENSE.md
deleted file mode 100644
index 57288ae2..00000000
--- a/frontend/LICENSE.md
+++ /dev/null
@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2017 atlarge-research
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/frontend/README.md b/frontend/README.md
index 527abd28..0ed1f44a 100644
--- a/frontend/README.md
+++ b/frontend/README.md
@@ -95,8 +95,3 @@ The following command runs all tests in the codebase. On top of this, it also wa
```bash
yarn test
```
-
-
-## License
-
-The code is released under the MIT license. See `LICENSE.md`.
diff --git a/mongodb/Dockerfile b/mongodb/Dockerfile
index b4eb9dd1..12803f8e 100644
--- a/mongodb/Dockerfile
+++ b/mongodb/Dockerfile
@@ -1,5 +1,5 @@
-FROM mongo:4.2.5
+FROM mongo:4.2.8
MAINTAINER Jacob Burley <j.burley@vu.nl>
# Import init script
-ADD mongo-init-opendc-db.sh /docker-entrypoint-initdb.d \ No newline at end of file
+ADD mongo-init-opendc-db.sh /docker-entrypoint-initdb.d
diff --git a/mongodb/configure.sh b/mongodb/configure.sh
new file mode 100755
index 00000000..78f28ac8
--- /dev/null
+++ b/mongodb/configure.sh
@@ -0,0 +1,23 @@
+if [ -z "$OPENDC_DB" ]; then
+ echo "OPENDC_DB environment variable not specified"
+ exit 1
+fi
+
+if [ -z "$OPENDC_DB_USERNAME" ]; then
+ echo "OPENDC_DB_USERNAME environment variable not specified"
+ exit 1
+fi
+
+if [ -z "$OPENDC_DB_PASSWORD" ]; then
+ echo "OPENDC_DB_PASSWORD environment variable not specified"
+ exit 1
+fi
+
+MONGO_COMMAND="mongo $OPENDC_DB -u $OPENDC_DB_USERNAME -p $OPENDC_DB_PASSWORD --authenticationDatabase $OPENDC_DB"
+
+until eval $MONGO_COMMAND --eval 'db.getCollectionNames();' ; do
+ echo "MongoDB is unavailable - sleeping"
+ sleep 1
+done
+
+echo "MongoDB available"
diff --git a/mongodb/docker-compose.yml b/mongodb/docker-compose.yml
index aa54a74c..87af4d6f 100644
--- a/mongodb/docker-compose.yml
+++ b/mongodb/docker-compose.yml
@@ -13,6 +13,7 @@ services:
OPENDC_DB_PASSWORD: opendcpassword
ports:
- 27017:27017
+ # Uncomment for persistent deployment
#volumes:
# - mongo-volume:/data/db
diff --git a/mongodb/mongo-init-opendc-db.sh b/mongodb/mongo-init-opendc-db.sh
index e7a787fe..5ff62f8b 100644
--- a/mongodb/mongo-init-opendc-db.sh
+++ b/mongodb/mongo-init-opendc-db.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-echo 'Creating opendc user and db'
+echo 'Creating OpenDC user and database'
mongo opendc --host localhost \
--port 27017 \
@@ -17,6 +17,7 @@ $MONGO_CMD --eval 'db.createCollection("users");'
$MONGO_CMD --eval 'db.createCollection("simulations");'
$MONGO_CMD --eval 'db.createCollection("topologies");'
$MONGO_CMD --eval 'db.createCollection("experiments");'
+$MONGO_CMD --eval 'db.createCollection("traces");'
$MONGO_CMD --eval 'db.createCollection("prefabs");'
echo 'Loading test data'
diff --git a/simulator/CONTRIBUTING.md b/simulator/CONTRIBUTING.md
deleted file mode 100644
index e69de29b..00000000
--- a/simulator/CONTRIBUTING.md
+++ /dev/null
diff --git a/simulator/LICENSE.txt b/simulator/LICENSE.txt
deleted file mode 100644
index 57288ae2..00000000
--- a/simulator/LICENSE.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2017 atlarge-research
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/simulator/README.md b/simulator/README.md
index 84b40a54..0e9a1671 100644
--- a/simulator/README.md
+++ b/simulator/README.md
@@ -35,12 +35,3 @@ The documentation is located in the [docs/](docs) directory and is divided as fo
## Getting Started
TODO
-
-## Contributing
-### Contributing Guide
-Read our [contributing guide](CONTRIBUTING.md) to learn about our
-development process, how to propose bug fixes and improvements, and how
-to build and test your changes to the project.
-
-### License
-The OpenDC simulator is available under the [MIT license](https://github.com/atlarge-research/opendc-simulator/blob/master/LICENSE.txt).
diff --git a/web-server/LICENSE.md b/web-server/LICENSE.md
deleted file mode 100644
index 57288ae2..00000000
--- a/web-server/LICENSE.md
+++ /dev/null
@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2017 atlarge-research
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/web-server/OpenDC.postman_collection.json b/web-server/OpenDC.postman_collection.json
deleted file mode 100644
index c34dc310..00000000
--- a/web-server/OpenDC.postman_collection.json
+++ /dev/null
@@ -1,61 +0,0 @@
-{
- "variables": [],
- "info": {
- "name": "OpenDC",
- "_postman_id": "e8b68f59-29cb-71d0-6237-b22932c40f9c",
- "description": "Sample requests for developing the OpenDC API",
- "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
- },
- "item": [
- {
- "name": "Create New Simulation",
- "request": {
- "url": "localhost:8081/api/v1/simulations",
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json",
- "description": ""
- },
- {
- "key": "auth-token",
- "value": "PUT YOUR AUTH TOKEN HERE",
- "description": ""
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"simulation\": {\r\n \"name\": \"Simulation Name\"\r\n }\r\n}"
- },
- "description": ""
- },
- "response": []
- },
- {
- "name": "Create New User",
- "request": {
- "url": "localhost:8081/api/v1/users",
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json",
- "description": ""
- },
- {
- "key": "auth-token",
- "value": "PUT YOUR AUTH TOKEN HERE",
- "description": ""
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"user\": {\r\n \"email\": \"email@example.com\"\r\n }\r\n}"
- },
- "description": ""
- },
- "response": []
- }
- ]
-} \ No newline at end of file
diff --git a/web-server/main.py b/web-server/main.py
index 6d2f8747..94696e8d 100644
--- a/web-server/main.py
+++ b/web-server/main.py
@@ -15,17 +15,24 @@ from opendc.util.exceptions import AuthorizationTokenError, RequestInitializatio
TEST_MODE = "OPENDC_FLASK_TESTING" in os.environ
+# Specify the directory of static assets
if TEST_MODE:
STATIC_ROOT = os.curdir
else:
+ STATIC_ROOT = os.path.join(os.environ['OPENDC_ROOT_DIR'], 'frontend', 'build')
+
+# Set up database if not testing
+if not TEST_MODE:
database.DB.initialize_database(user=os.environ['OPENDC_DB_USERNAME'],
password=os.environ['OPENDC_DB_PASSWORD'],
database=os.environ['OPENDC_DB'],
host='localhost')
- STATIC_ROOT = os.path.join(os.environ['OPENDC_ROOT_DIR'], 'opendc-frontend', 'build')
+# Set up the core app
FLASK_CORE_APP = Flask(__name__, static_url_path='', static_folder=STATIC_ROOT)
FLASK_CORE_APP.config['SECRET_KEY'] = os.environ['OPENDC_FLASK_SECRET']
+
+# Set up CORS support for local setups
if 'localhost' in os.environ['OPENDC_SERVER_BASE_URL']:
CORS(FLASK_CORE_APP)
diff --git a/web-server/opendc/util/database.py b/web-server/opendc/util/database.py
index 12d6afc9..0402c2e1 100644
--- a/web-server/opendc/util/database.py
+++ b/web-server/opendc/util/database.py
@@ -14,7 +14,7 @@ class Database:
def __init__(self):
self.opendc_db = None
- def init_database(self, user, password, database, host):
+ def initialize_database(self, user, password, database, host):
"""Initializes the database connection."""
user = urllib.parse.quote_plus(user)