Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update configuration docs #395

Merged
merged 11 commits into from
Feb 4, 2025
3 changes: 0 additions & 3 deletions babel.config.js

This file was deleted.

3 changes: 1 addition & 2 deletions docs/eln/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,4 @@ For routine use in operations, Chemotion ELN can be installed on IT facilities o

### What's coming next?

- **Answer:** We aim to constantly improve the Chemotion ELN. To stay up-to-date about current developments,
have a look at the [project board](https://github.com/ComPlat/chemotion_ELN/projects/1).
- **Answer:** We aim to constantly improve the Chemotion ELN. To stay up-to-date about current developments, follow us on [GitHub](https://github.com/ComPlat/chemotion_ELN/).
75 changes: 75 additions & 0 deletions docs/eln/install_configure/ChemCLI.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,81 @@ This will create the first (production-grade) `instance` of Chemotion on your sy

> :warning: **chem_cli.yml**: Installation also creates a file called `chem_cli.yml`. This file is critical as it contains information regarding existing installations. Removing the file will render chemCLI clueless about existing installations and it will behave as if Chemotion was never installed. Please do not remove the file. Ideally there should be no need for you to modify it manually.

### Setting up a Reverse-Proxy

> We **strongly** recommend getting in touch with the IT services for this part of the installation. Getting it wrong can have security implications for your data/network.

The ELN runs inside a container and is therefore not available on your computer's network; other than on **one** exposed port. To make the installation available on the network, the container's port should be then linked an external network. We suggest that you setup a [reverse-proxy service](#setting-up-a-reverse-proxy). Such a service forwards a domain name (e.g. https://chemotion.dept.uni.de) to your ELN so that your users can visit the domain name to use the ELN. A rough guideline on how to do so is provided here.

We suggest to run an [nginx](https://nginx.org/en/docs/) reverse-proxy server if you don’t already have one. In case you want to use Shibboleth, please use [Apache](https://httpd.apache.org/). You can also choose to run something similar like [Traefik](https://traefik.io/traefik/) if you are familiar with the process.

The simplest way to setup nginx is as follows:

1. Include `nginx` as a service (in form of a container) in the `docker-compose.cli.yml` file that you use to run Chemotion ELN. The service's description should look like as follows:

```yaml
# This block is to be included in the `services` block.
nginx:
image: nginx
restart: always
volumes:
- ./nginx.conf:/etc/nginx/conf.d/nginx.conf:ro
- ./ssl/:/ssl/:ro
ports:
- "443:443"
networks:
- proxy
```

Here we name a new network called `proxy` which is used to bridge the ELN's network and the host's network. To use it successfully, please also include the following at the end of your file:

```yaml
networks:
proxy:
external: true
```

This declares the proxy network as external i.e. it is allowed to talk to the host's network. To link this `proxy` network with the ELN's network, include the it as a key-value pair for the `eln` service i.e. create a new YAML key called `services.eln.networks: [proxy]`.

Additionally, you also need to create such a network explicitly by running the following command in your shell:

```sh
docker network create proxy
```

2. Then, you need to create the `nginx.conf` file in the same folder as where you have the `docker-compose` file. The contents of the file should look as follows:

```nginx
server {
listen 443 ssl;
listen [::]:443 ssl;

server_name chemotion.dept.uni.de;

ssl_certificate /ssl/chemotion.dept.uni.de.crt;
ssl_certificate_key /ssl/chemotion.dept.uni.de.key;

resolver 127.0.0.11; # this bit is very important as it allows nginx and docker to cooperate

add_header Content-Security-Policy "default-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self' ws: blob: commonchemistry.cas.org dx.doi.org doi.org api.crossref.org; font-src 'self' data: ; frame-src 'self' nmrium.nmrxiv.org ; img-src 'self' data:" ;

location / {
proxy_pass http://eln:4000;
}
}
```

Here, you are accessing the files `....crt` and `....key`. These files are certificates that allow your connection to use encryption (i.e. use https). These certificate files should be provided to you by your IT department, or you can use a service like [Let's Encrypt](https://letsencrypt.org/) to generate them as long as your IT and firewall policies allow that. Please put these files in a folder called `ssh` and put this folder in the folder where you have your `docker-compose.yml` (and `docker-compose.cli.yml) file. The add_header block allows you to access external services e.g. allow commonchemistry.cas.org (for creating sample by cas-rn), as well as dx.doi.org, doi.org, and api.crossref.org (to fetch literature references by doi).

Further information on how to configure nginx, please refer to tutorials online (e.g. [here](https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/) and [here](https://www.cyberciti.biz/faq/configure-nginx-to-use-only-tls-1-2-and-1-3/)).

#### To summarize, you have to make sure that:

- Reverse proxy is setup properly (i.e. DNS resolves to the URL to your server's IP address).
- Any potential firewall/networking rules do not get in the way.
- Docker exposes and listens on the correct ports.
- The ELN is running.

### The `selected` instance

Once you install multiple instances of Chemotion, the actions of chemCLI pertain to only one of them i.e. you actively operate only one of them when you run a command in the `./chemCLI` > `instance` section. This instance is referred to as the `selected` instance and its name is stored in a local file (`chem_cli.yml`). You can do `./chemCLI instance switch` to switch to another instance if you have more than one instance.
Expand Down
35 changes: 16 additions & 19 deletions docs/eln/install_configure/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ This variable is meant to set the public URL that points to your ELN installatio

The variable deprecates the variables "HOST_URL" and "HOST_PROTOCOL" in previous versions. Those are now ignored and can be removed safely.

> The `PUBLIC_URL` variable is a setting that tells the ELN where it _can be reached_. It's not a setting that magically makes it so that the ELN is reachable at the provided URL. Please see [this section](./manual_install.mdx#setting-up-a-reverse-proxy) for more.
> The `PUBLIC_URL` variable is a setting that tells the ELN where it _can be reached_. It's not a setting that magically makes it so that the ELN is reachable at the provided URL. Please see [this section](ChemCLI#setting-up-a-reverse-proxy) for more.

#### Variable `SECRET_KEY_BASE`

Expand Down Expand Up @@ -212,11 +212,12 @@ wget https://raw.githubusercontent.com/ComPlat/chemotion_ELN/vM.m.n/config/stru

2. To setup the supported editors, unzip the editor's zip file, and then copy the sub-folders and files to the folder which the system loads the editors. If you wish to have multiple editors available, you can create a sub-folder for each editor. For example, you can create a folder called `ketcher2` in the `./shared/pullin/public/editors` folder and copy the extracted files there. Similarly, create another folder called `editor-abc` for another editor.

For example, for Ketcher2 (version 2.18.0), you can run the following commands to download and extract the source code.
For example, for Ketcher2 (version 2.24.0), you can run the following commands to download and extract the source code.

```sh
wget https://github.com/epam/ketcher/releases/download/v2.18.0/ketcher-standalone-2.18.0.zip
unzip ketcher-standalone-2.18.0.zip -d shared/pullin/public/editors/ketcher218
wget https://github.com/epam/ketcher/releases/download/v2.24.0/ketcher-standalone-2.24.0.zip
rm -rf shared/pullin/public/editors/ketcher2 # remove existing installation
unzip ketcher-standalone-2.24.0.zip -d shared/pullin/public/editors/ketcher2
```

3. Edit your `structure_editors.yml` to reflect this new location. For example, its contents would be similar to the following:
Expand All @@ -227,7 +228,7 @@ production:
:editors:
:ketcher2:
:label: "Ketcher 2"
:extSrc: "/editors/ketcher218/standalone/index.html"
:extSrc: "/editors/ketcher2/standalone/index.html"
:marvinjs:
:label: "MarvinJS"
:license: "license file" # license file of MarvinJS
Expand All @@ -239,6 +240,7 @@ The compatibility table for recommended versions of Ketcher 2 to be used with th

| ELN version | Ketcher 2 release |
| :---------: | :---------------: |
| 1.10.5 | 2.24.0 |
| 1.10.2 | 2.21.0 |
| 1.9.3 | 2.18.0 |

Expand Down Expand Up @@ -322,7 +324,7 @@ production:
:chemspectra:
:url: "http://spectra:4000"
:nmriumwrapper:
:url: "https://nmrium.nmrxiv.org/releases/v0.5.0/"
:url: "https://nmrium.nmrxiv.org/releases/v0.8.0/"
```

Here the `nmriumwrapper.url` value depends on the version of Chemotion ELN you are using. The compatibility between the ELN and the wrapper is as follows:
Expand All @@ -335,7 +337,7 @@ Here the `nmriumwrapper.url` value depends on the version of Chemotion ELN you a
| 1.8.2 | 0.5.0 |
| 1.9.3 & 1.10.5 | 0.4.0 - 0.8.0 |

So, if you are using e.g. ELN version 1.10.2, please `nmriumwrapper.url` to `https://nmrium.nmrxiv.org/releases/v0.8.0/`.
So, if you are using e.g. ELN version 1.10.5, please `nmriumwrapper.url` to `https://nmrium.nmrxiv.org/releases/v0.8.0/`.

To be able to access these URLs successfully, you must register with the hosting service. Please contact the [Helpdesk](/helpdesk) or see [here](https://github.com/NFDI4Chem/nmrium-react-wrapper#public-instance) for more details.

Expand Down Expand Up @@ -382,28 +384,23 @@ The ELN has ability to produce QR codes, Barcodes and Datamatrix codes, that can
"width": 100
}
}

```

### Main parameters

- __`code_type`__: Must be `qr_code`, `bar_code`, or `data_matrix_code`.
- __`code_image_size`__ Size ratio of the code image, between 0 and 100.
* _Note_: If `code_image_size` > 30, the `text_position` is automatically set to `below`.
- **`code_type`**: Must be `qr_code`, `bar_code`, or `data_matrix_code`.
- **`code_image_size`** Size ratio of the code image, between 0 and 100.

- _Note_: If `code_image_size` > 30, the `text_position` is automatically set to `below`.

- __`text_position`__: `below` or `right`.

- __`width`__: Page `width` in millimeters.

- __`name`__, __`short_label`__, __`external_label`__, __`molecule_name`__, __`code_log`__, __`displaySample`__: Boolean flags to include or exclude specific elements.
- **`text_position`**: `below` or `right`.
- **`width`**: Page `width` in millimeters.
- **`name`**, **`short_label`**, **`external_label`**, **`molecule_name`**, **`code_log`**, **`displaySample`**: Boolean flags to include or exclude specific elements.

> N.B. The variable `displaySample` will be renamed to `display_sample` in future releases (releases after v1.10.5).


### Validation rules

Invalid values (e.g., `code_image_size` > 100 or unsupported `code_type`) trigger warnings and are replaced with default values.

To customize the configuration, edit the following file in your Chemotion ELN installation: `./shared/pullin/public/json/printingConfig/defaultConfig.json`.

4 changes: 2 additions & 2 deletions docs/eln/install_configure/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Please use Chrome as browser for the Chemotion ELN and Repository.
- [Using ChemCLI](install_configure/ChemCLI)
- [Manual install](install_configure/manual_install)

Installing the ELN makes it available on port 4000 (default location is `0.0.0.0:4000`) of the computer on which it is installed. To make it accessible on a domain name, e.g. `https://myeln.edu` or over a network requires you to setup proxy. Detailed instructions for this are system/network dependent (and beyond the scope of this documentation). However, some hints are provided [here](manual_install.mdx#setting-up-a-reverse-proxy).
Installing the ELN makes it available on port 4000 (default location is `0.0.0.0:4000`) of the computer on which it is installed. To make it accessible on a domain name, e.g. `https://myeln.edu` or over a network requires you to setup proxy. Detailed instructions for this are system/network dependent (and beyond the scope of this documentation). However, some hints are provided [here](install_configure/ChemCLI#setting-up-a-reverse-proxy).

:::warning[Single User Installation]

Expand All @@ -41,7 +41,7 @@ If you still wish to install Chemotion ELN on your private computer (especially

## After Installation

Please follow the configuration steps (see [here](install_configure/manual_install#network-configuration) and [here](install_configure/configuration) to personalize your installation and then perform a [system check](install_configure/system_check) to make sure that all features are working as intended.
Please follow the configuration steps (see [here](install_configure/ChemCLI#setting-up-a-reverse-proxy) and [here](install_configure/configuration) to personalize your installation and then perform a [system check](install_configure/system_check) to make sure that all features are working as intended.

# When to upgrade?

Expand Down
87 changes: 0 additions & 87 deletions docs/eln/install_configure/manual_install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -92,93 +92,6 @@ We rely on docker volumes to preserve data. Your user data will be stored in the

Optional services can be disabled by removing/commenting-out their entry in the `docker-compose.yml` file.

## Network Configuration

> We **strongly** recommend getting in touch with the IT services for this part of the installation. Getting it wrong can have security implications for your data/network.

> This documentation assumes that the exposed port is port `4000`. If you change this, for example, by modifying the `docker-compose.yml` file, then please keep that in consideration.

The ELN runs inside a container and is therefore not available on your computer's network; other than on **one** exposed port, generally the port number `4000`. To access the ELN locally, you need to go to http://localhost:4000. To make the installation available to the public, the container's port should be then linked to the external network. This can be achieved in two ways.

- In case you have a fixed IP, other computers might be able to reach the ELN on `###.#.#.#:4000` where the hashes represent your IP. This generally only works within your local network or while you are using VPN.
- **Recommended**: We suggest that you setup a [reverse-proxy service](#setting-up-a-reverse-proxy). Such a service forwards a domain name (e.g. https://chemotion.dept.uni.de) to your ELN so that your users can visit the domain name to use the ELN. A rough guideline on how to do so is provided here.

### Setting up a Reverse-Proxy

We suggest to run an [nginx](https://nginx.org/en/docs/) reverse-proxy server if you don’t already have one. In case you want to use Shibboleth, please use [Apache](https://httpd.apache.org/). You can also choose to run something similar like [Traefik](https://traefik.io/traefik/) if you are familiar with the process.

The simplest way to setup nginx is as follows:

1. Include `nginx` as a service (in form of a container) in the `docker-compose.yml` file that you use to run Chemotion ELN. <u>In case you are using ChemCLI</u>, the please include the service in `docker-compose.cli.yml` file instead. The service's description should look like as follows:

```yaml
# This block is to be included in the `services` block.
nginx:
image: nginx
restart: always
volumes:
- ./nginx.conf:/etc/nginx/conf.d/nginx.conf:ro
- ./ssl/:/ssl/:ro
ports:
- "443:443"
networks:
- proxy
```

Here we name a new network called `proxy` which is used to bridge the ELN's network and the host's network. To use it successfully, please also include the following at the end of your file:

```yaml
networks:
proxy:
external: true
```

This declares the proxy network as external i.e. it is allowed to talk to the host's network. To link this `proxy` network with the ELN's network, include the it as a key-value pair for the `eln` service i.e. create a new YAML key called `services.eln.networks: [proxy]`.

Additionally, you also need to create such a network explicitly by running the following command in your shell:

```sh
docker network create proxy
```

2. Then, you need to create the `nginx.conf` file in the same folder as where you have the `docker-compose` file. The contents of the file should look as follows:

```nginx
server {
listen 443 ssl;
listen [::]:443 ssl;

server_name chemotion.dept.uni.de;

ssl_certificate /ssl/chemotion.dept.uni.de.crt;
ssl_certificate_key /ssl/chemotion.dept.uni.de.key;

resolver 127.0.0.11; # this bit is very important as it allows nginx and docker to cooperate

location / {
proxy_pass http://eln:4000;
}
}
```

Here, you are accessing the files `....crt` and `....key`. These files are certificates that allow your connection to use encryption (i.e. use https). These certificate files should be provided to you by your IT department, or you can use a service like [Let's Encrypt](https://letsencrypt.org/) to generate them as long as your IT and firewall policies allow that. Please put these files in a folder called `ssh` and put this folder in the folder where you have your `docker-compose.yml` (and `docker-compose.cli.yml) file.

Further information on how to configure nginx, please refer to tutorials online (e.g. [here](https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/) and [here](https://www.cyberciti.biz/faq/configure-nginx-to-use-only-tls-1-2-and-1-3/)).

NB: When setting the CSP headers, be sure to allow commonchemistry.cas.org (for creating sample by cas-rn) and dx.doi.org doi.org and api.crossref.org (to fetch literature references by doi). For example the directive could look like:

```nginx
add_header Content-Security-Policy "default-src 'self' 'unsafe-inline' 'unsafe-eval';connect-src 'self' ws: blob: commonchemistry.cas.org dx.doi.org doi.org api.crossref.org; font-src 'self' data: ; frame-src 'self' nmrium.chemotion.scc.kit.edu ; img-src 'self' data:" ;

```

#### To summarize, you have to make sure that:

- Reverse proxy is setup properly (i.e. DNS resolves to the URL to your server's IP address).
- Any potential firewall/networking rules do not get in the way.
- Docker exposes and listens on the correct ports.
- The ELN is running.

## Upgrades

:::info[Important]
Expand Down
1 change: 1 addition & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ module.exports = {
plugins: [
'@docusaurus/plugin-sitemap',
'@docusaurus/plugin-content-pages',
'@docusaurus/plugin-svgr',
[
'@docusaurus/plugin-content-docs',
{
Expand Down
Loading