From df3624bcf58b70885a90303910103d1c83ee89a7 Mon Sep 17 00:00:00 2001 From: SaneiSaya Date: Thu, 27 Jul 2023 10:42:35 -0600 Subject: [PATCH 1/9] Create Dockerfile --- Dockerfile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f552a00 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +# Set the base image +FROM python:3.9 + +# Set environment variables +ENV FLASK_APP=app.py +ENV UNSEAL_VAULT_KEY1=key1 +ENV UNSEAL_VAULT_KEY2=key2 +# Add more environment variables if needed... + +# Create and set work directory +WORKDIR /eNMS + +# Download the latest release of eNMS +RUN wget https://github.com/afourmy/eNMS/archive/refs/tags/v5.1.1.tar.gz && \ + tar -xzf v5.1.1.tar.gz --strip-components=1 && \ + rm v5.1.1.tar.gz + +# Install required packages +RUN apt-get update && apt-get install -y wget supervisor + +# Copy requirements.txt and supervisord.conf +COPY requirements.txt supervisord.conf /eNMS/ + +# Install Python requirements +RUN pip install -r requirements.txt + +# Set the command to run when the container starts +CMD ["supervisord", "-c", "/eNMS/supervisord.conf"] From 845be54f1c03509cd83822df143d3617274b4c0e Mon Sep 17 00:00:00 2001 From: SaneiSaya Date: Thu, 27 Jul 2023 11:22:23 -0600 Subject: [PATCH 2/9] Update README.md added example intructions --- README.md | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 490105c..e202a1a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,67 @@ -# docker-enms -just testing +# eNMS Deployment with Docker Compose and Traefik + +This repository includes Docker configurations for running eNMS in a production environment, utilizing Docker Compose for container orchestration and Traefik for reverse proxy and automatic HTTPS. + +## Prerequisites + +These instructions assume you are deploying on a Linux machine and have Docker, Docker Compose and Git installed. + +## Deployment Steps + +### Step 1: Clone the Repository + +You need to clone the repository where you've stored the Dockerfile and docker-compose.yml: + +```sh +git clone +cd +``` + +Step 2: Create a .env File +``` +In the root of the project, create a .env file using the example to store your environment variables: + +``` +Copy code +touch .env +``` +Populate the .env file with your environment variables or refer to the examples: + +``` +Copy code +echo "ENMS_PASSWORD=" >> .env +echo "UNSEAL_VAULT_KEY1=" >> .env +echo "UNSEAL_VAULT_KEY2=" >> .env +echo "UNSEAL_VAULT_KEY3=" >> .env +``` +Replace , , , with your actual values. + +Step 3: Create the Directories for Volumes +Create the directories that will be used by Docker as volumes, such as /data/docker: + +``` +Copy code +mkdir -p /data/docker/eNMS/{files,logs,db} +``` +Step 4: Create settings.json and scheduler.json Files +Create two files: settings.json and scheduler.json inside the files directory: + +``` +Copy code +touch /data/docker/eNMS/files/settings.json +touch /data/docker/eNMS/files/scheduler.json +``` +Populate settings.json and scheduler.json with your preferred configuration values. + +Step 5: Start the Docker Containers +Run the following command in the same directory as your docker-compose.yml file to start your containers: + +``` +Copy code +docker-compose up -d +``` +Your custom eNMS application should now be up and running and accessible via your configured domain through Traefik. Please adjust these instructions according to your specific environment and configuration needs. + + + +Again, don't forget to replace ``, ``, ``, `` with your actual values. From 2daa9034d9d32331bafc93f4068a357337911f03 Mon Sep 17 00:00:00 2001 From: SaneiSaya Date: Thu, 27 Jul 2023 11:24:29 -0600 Subject: [PATCH 3/9] Create .env This will automatically unseal your vault --- .env | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 0000000..8df018e --- /dev/null +++ b/.env @@ -0,0 +1,5 @@ +VAULT_TOKEN= +UNSEAL_VAULT_KEY1= +UNSEAL_VAULT_KEY2= +UNSEAL_VAULT_KEY3= +SECRET_KEY= From 73299378a15329605d89175afcfd0f50d1782225 Mon Sep 17 00:00:00 2001 From: SaneiSaya Date: Thu, 27 Jul 2023 11:27:00 -0600 Subject: [PATCH 4/9] Update README.md cleaned up formatting --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e202a1a..f749568 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ git clone cd ``` -Step 2: Create a .env File +### Step 2: Create a .env File ``` In the root of the project, create a .env file using the example to store your environment variables: @@ -36,14 +36,14 @@ echo "UNSEAL_VAULT_KEY3=" >> .env ``` Replace , , , with your actual values. -Step 3: Create the Directories for Volumes +### Step 3: Create the Directories for Volumes Create the directories that will be used by Docker as volumes, such as /data/docker: ``` Copy code mkdir -p /data/docker/eNMS/{files,logs,db} ``` -Step 4: Create settings.json and scheduler.json Files +### Step 4: Create settings.json and scheduler.json Files Create two files: settings.json and scheduler.json inside the files directory: ``` @@ -53,7 +53,7 @@ touch /data/docker/eNMS/files/scheduler.json ``` Populate settings.json and scheduler.json with your preferred configuration values. -Step 5: Start the Docker Containers +### Step 5: Start the Docker Containers Run the following command in the same directory as your docker-compose.yml file to start your containers: ``` From 143e58b02234c484ca864d0517a3acc6ea6b8ed2 Mon Sep 17 00:00:00 2001 From: SaneiSaya Date: Thu, 27 Jul 2023 11:28:12 -0600 Subject: [PATCH 5/9] Update README.md syntax --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f749568..884bb1a 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ cd ``` ### Step 2: Create a .env File -``` + In the root of the project, create a .env file using the example to store your environment variables: ``` From 0ccb084801d712bf51e289aa897d9582633f8a49 Mon Sep 17 00:00:00 2001 From: SaneiSaya Date: Thu, 27 Jul 2023 11:34:55 -0600 Subject: [PATCH 6/9] Update README.md Acknowledgments --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 884bb1a..be0848f 100644 --- a/README.md +++ b/README.md @@ -65,3 +65,12 @@ Your custom eNMS application should now be up and running and accessible via you Again, don't forget to replace ``, ``, ``, `` with your actual values. + +## Acknowledgments + +This project uses the following open-source packages: + +- [eNMS](https://github.com/afourmy/eNMS): Enterprise Network Management System + +We would like to express our gratitude to the developers and maintainers of these projects. + From 8be1fa0f549251922aae2ebe6ff44b8000bb85f9 Mon Sep 17 00:00:00 2001 From: SaneiSaya Date: Thu, 27 Jul 2023 11:38:02 -0600 Subject: [PATCH 7/9] Update README.md directory info update --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index be0848f..792df1c 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,8 @@ These instructions assume you are deploying on a Linux machine and have Docker, You need to clone the repository where you've stored the Dockerfile and docker-compose.yml: ```sh -git clone -cd +git clone [](https://github.com/SaneiSaya/docker-enms) +cd docker-enms ``` ### Step 2: Create a .env File From 21208ee87b3a95db8fcc2a1e464538a8b452069f Mon Sep 17 00:00:00 2001 From: SaneiSaya Date: Thu, 27 Jul 2023 12:31:13 -0600 Subject: [PATCH 8/9] Update README.md fixed git syntax --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 792df1c..ce6b55e 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ These instructions assume you are deploying on a Linux machine and have Docker, You need to clone the repository where you've stored the Dockerfile and docker-compose.yml: ```sh -git clone [](https://github.com/SaneiSaya/docker-enms) +git clone https://github.com/SaneiSaya/docker-enms cd docker-enms ``` From a7ab7709725da63f446f26f30c0c3cfe8d09bc71 Mon Sep 17 00:00:00 2001 From: SaneiSaya Date: Thu, 27 Jul 2023 12:37:27 -0600 Subject: [PATCH 9/9] Create settings.json database settings, ldap auth, and slack integration --- settings.json | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 settings.json diff --git a/settings.json b/settings.json new file mode 100644 index 0000000..533cbde --- /dev/null +++ b/settings.json @@ -0,0 +1,17 @@ +{ + "database_type": "mysql+pymysql", + "database_user": "root", + "database_password": "root_password", + "database_address": "db", + "database_name": "enms", + "authentication": { + "method": "database", + "openldap": { + "address": "ldap://ldap.example.com", + "base_dn": "dc=example,dc=com" + } + }, + "slack": { + "token": "your_slack_token_here" + } +}