unzip it, set it as your working directory, and follow the instructions below.
<!-- Note: This file is primarily defined to be used in the IXP documentation. However, it is also provided in the docker-deployment repository for reference. If you accessed this file from the docker-deployment repository, please be aware that the links used in this file may not work as expected. -->
## HTTPS Deployment
For HTTPS deployment, you need to generate HTTPS certificates. In this configuration, the
certificates are generated via [Certbot](https://certbot.eff.org/) using Lets Encrypt.
<!-- TODO: update package file for Dux -->
This can be done via the `./cert_script.sh` script, which automatically generates the certificate in
the current directory. Invoke the script like so, substituting the placeholders for their respective
values:
For deployment of the IXP with SSL certificates generated via
[Certbot](https://certbot.eff.org/) by Let's Encrypt, download the latest
set it as your working directory, and follow the instructions below.
<!-- Note: This file is primarily defined to be used in the IXP documentation. However, it is also provided in the docker-deployment repository for reference. If you accessed this file from the docker-deployment repository, please be aware that the links used in this file may not work as expected. -->
## HTTPS Deployment with your own certificates (advanced)
## HTTPS Deployment with your own certificates
For HTTPS deployment with your own certificates, add `fullchain.pem` and `privkey.pem` into the
`./certificates` directory. If the format of the keys or selection of keys does not suffice, modify
the `nginx.conf.template` file and change the related configuration on line `:32-33`.
<!-- TODO: update package file for Dux -->
Docker compose mounts the `./certificates` folder as `/etc/nginx/certificates/` in the Nginx
container.
For deployment of the IXP with your own SSL certificates, download the latest
<!-- Note: This file is primarily defined to be used in the IXP documentation. However, it is also provided in the docker-deployment repository for reference. If you accessed this file from the docker-deployment repository, please be aware that the links used in this file may not work as expected. -->
# Installation
The INJECT Exercise Platform (IXP) comprises two main components: the frontend and the backend. This
separation allows for modular development, easier maintenance, and scalability of the platform.
Below, we'll walk you through the unified process of installation for frontend as well as for
backend.
The INJECT Exercise Platform (IXP) comprises two main components: the frontend
and the backend. This separation allows for modular development, easier
maintenance, and scalability of the platform. Below, we'll walk you through the
unified installation process for the frontend and backend.
For a deeper understanding of the overall architecture of the IXP, you can refer to the
[architecture overview](../architecture/overview.md) in the documentation.
For a deeper understanding of the overall architecture of the IXP, you can refer
to the [architecture overview](../architecture/overview.md) in the
documentation.
## Prerequisites
@@ -14,16 +17,19 @@ For a deeper understanding of the overall architecture of the IXP, you can refer
Before you begin, ensure that you have the following:
- A server with at least 2 core CPU and 8 GB RAM
- A 64-bit x86 architecture
- Root or sudo access to the server
- At least 4 GB of disk space, although more is necessary for long-term storage of exercise data
- a server with at least a 2-core CPU and 8 GB RAM,
- a 64-bit x86 architecture,
- root or sudo access to the server,
- and at least 4 GB of disk space, although more is necessary for long-term
storage of exercise data.
These requirements ensure that the backend server can handle data processing efficiently while
serving the frontend interface smoothly for the most basic needs.
These requirements ensure that the backend server can handle data processing
efficiently while serving the frontend interface smoothly for the most basic
needs.
The performance mainly depends on one factor, which is _the number of teams in all currently running
exercises_. Please refer to the table below for our recommended hardware setups based on this value.
The performance mainly depends on one factor, which is _the number of teams in
all currently running exercises_. Please refer to the table below for our
recommended hardware setups based on this value.
| Number of teams | CPU Cores (Worker Count) | RAM |
-[Docker Compose](https://docs.docker.com/compose/install/linux/) with
recommended version v2.27.0
Make sure to install Docker and Docker Compose before proceeding with the installation.
Make sure to install Docker and Docker Compose before proceeding with the
installation.
## Installation
@@ -61,26 +60,29 @@ Make sure to install Docker and Docker Compose before proceeding with the instal
### 2. Download the source code of the frontend and the backend:
The frontend and backend releases follow a modified version of
[Semantic Versioning](https://semver.org/). Each release is tagged with a version number in the
format `vX.Y.Z`, where:
[Semantic Versioning](https://semver.org/). Each release is tagged with a
version number in the format `vX.Y.Z`, where:
-`X` is the major version,
-`Y` is the minor version,
-`Z` is the patch version.
The major version is incremented for significant changes to the whole platform. Such releases are
deployed together with a new version of the documentation and exercise definitions.
The major version is incremented for significant changes to the whole platform.
Such releases are deployed together with a new version of the documentation and
exercise definitions.
The minor version is incremented for changes to the API. Because of this, **only the frontend and
backend with the same major and minor version are compatible with each other**. For example,
`v3.0.0` of the frontend is compatible with `v3.0.0` of the backend but not with `v2.0.0` of the
backend. Similarly, `v3.1.0` of the frontend is compatible with `v3.1.0` of the backend, but not
The minor version is incremented for changes to the API. Because of this, **only
the frontend and backend with the same major and minor version are compatible
with each other**. For example, `v3.0.0` of the frontend is compatible with
`v3.0.0` of the backend but not with `v2.0.0` of the backend. Similarly,
`v3.1.0` of the frontend is compatible with `v3.1.0` of the backend, but not
with `v3.0.0` of the backend.
The patch version is incremented for bug fixes and minor improvements. Such releases are created for
the frontend and backend separately. **The patch version of the frontend and backend does not have
to match.** For example, `v3.0.1` of the frontend is compatible with `v3.0.0` of the backend, but
not with `v2.0.0` of the backend.
The patch version is incremented for bug fixes and minor improvements. Such
releases are created for the frontend and backend separately. **The patch
versions of the frontend and backend do not have to match.** For example,
`v3.0.1` of the frontend is compatible with `v3.0.0` of the backend, but not
with `v2.0.0` of the backend.
The releases can be downloaded from the following links:
@@ -89,43 +91,67 @@ The releases can be downloaded from the following links:
### 3. Unzip the downloaded archives, move them inside the compose preset folder (`https` or `https-owncert`, depending on which one you chose for generating TLS certificates), and rename the unzipped folders to `frontend` and `backend` respectively.
Having the source code available in folders named `frontend` and`backend` is crucial for the
deployment script to work.
The deployment script expects the source code in folders named `frontend` and
`backend`.
### 4. Set up the `.env` file in the root directory (`https` or `https-owncert`).
Follow the setup guide [here](./setup.md#environment-variables). Especially make sure that:
Follow the setup guide [here](./setup.md#environment-variables). Especially make
sure that:
-`INJECT_DOMAIN` is set to your desired hostname (the same one you generated the certificate for),
- and `INJECT_SECRET_KEY` is changed to a truly random string of characters of at least 50
characters.
-`INJECT_DOMAIN` is set to your desired hostname (the same one you generated
the certificate for)
- and `INJECT_SECRET_KEY` is changed to a truly random string of characters of
at least 50 characters.
### 5. Make sure the prepared scripts are executable.
The following scripts are used to set up the environment. Make sure they are executable:
The following scripts are used to set up the environment. Make sure they are
executable:
-`./01-substitute-env.sh`: you can grant the executable permission via
`chmod +x 01-substitute-env.sh`.
-`./frontend/frontend/substituteEnv.sh`: you can grant the executable permission via
`chmod +x frontend/frontend/substituteEnv.sh`.
`chmod +x 01-substitute-env.sh`,
-`./frontend/frontend/substituteEnv.sh`: you can grant the executable
permission via `chmod +x frontend/frontend/substituteEnv.sh`.
### 6. Run `docker compose up`, or `docker compose up -d` to run the containers in the background.
If any errors occur, please refer to the [troubleshooting guides](./troubleshooting.md).
If any errors occur, please refer to the
[troubleshooting guides](./troubleshooting.md).
!!! Disclaimer
### 7. Add an admin (superuser) account by following [these instructions](./users.md).
If you are upgrading an existing installation, please note that all stored data
will be lost during the upgrade process, as we cannot guarantee compatibility
between different versions of the platform.
To avoid problems during the upgrade process, please stop the running containers
and remove the volumes by executing `docker compose down -v`. Also, make sure to
rebuild the containers by executing `docker compose up --build` when starting
them again.
### 7. Add an admin account by following [these instructions](./users.md).
## Conclusion
By following the installation guide, you'll be able to successfully set up and deploy the IXP. After
completing the installation, you may download this
By following the installation guide, you'll be able to set up and deploy the
IXP. After completing the installation, you may download the
<!-- Note: This file is primarily defined to be used in the IXP documentation. However, it is also provided in the docker-deployment repository for reference. If you accessed this file from the docker-deployment repository, please be aware that the links used in this file may not work as expected. -->
## Troubleshooting
If you encounter issues during deployment, consider the following steps:
-**Executable Permissions**: Ensure that the deployment scripts have executable permissions. Run
the following command to set the appropriate permissions:
-**Executable Permissions**: Ensure that the deployment scripts have executable
permissions. Run the following command to set the appropriate permissions:
```
chmod +x deploy.sh 01-substitute-env.sh
chmod +x deploy-with-https.sh generate-cert.sh # If using HTTPS deployment
```
-**INJECT_DOMAIN Setting**: Verify that the INJECT_DOMAIN environment variable is set to a domain
name and not a static IP address. The platform requires a domain name to function correctly. For
local test deployments please use reserved TLD `.localhost` (example: `inject.localhost`)
-**Backend is not returning any valid response**: Verify that the `INJECT_DOMAIN` and
`INJECT_HOST_ADDRESSES` is setup correctly. The platform requires that the addresses are setup
to hostnames where the platform is expected to be accessed from.
-**Frontend's error log in Developer Console is reporting mixed-origin connection issues**: Verify
that connection settings in the environment varibles are setup correctely. If using HTTP
deployment, that they use `http://` and `ws://` protocol, and when using HTTPS, then `https://`
and `wss://`.
-**Application is connecting to an incorrect backend instance**: Clean up your cookies and session
storage to enforce rebinding of the Frontend client.
-**INJECT_DOMAIN Setting**: Verify that the INJECT_DOMAIN environment variable
is set to a domain name and not a static IP address. The platform requires a
domain name to function correctly. For local test deployments please use