Skip to content

Commit ca2ec5d

Browse files
committed
chore: short clean up & optimise env description & adjust the README file according to custom HTML content and data privacy
1 parent 79be4d7 commit ca2ec5d

File tree

5 files changed

+40
-26
lines changed

5 files changed

+40
-26
lines changed

README.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,6 @@ To stop the system use:
7474

7575
### Advanced Settings
7676

77-
#### Google Search Console
78-
79-
This optional feature enables the verification of your MassBank instance by Google search console.
80-
81-
If the _.env_ file contains a non-empty _GOOGLE_SEARCH_CONSOLE_KEY_ property then this key will be used as meta-tag in every HTML document of the web interface.
82-
8377
#### Distributor's Information
8478

8579
The _DISTRIBUTOR_TEXT_ property is a free text field to insert any description of the distributor of a running MassBank instance.
@@ -102,6 +96,26 @@ Both _MB3_FRONTEND_HOMEPAGE_NEWS_SECTION_TEXT_ and _MB3_FRONTEND_HOMEPAGE_FUNDIN
10296

10397
To enable a custom section with free text content set the variable _MB3_FRONTEND_HOMEPAGE_ADDITIONAL_SECTION_NAME_ and _MB3_FRONTEND_HOMEPAGE_ADDITIONAL_SECTION_TEXT_. As the names indicate, the first stands for the section name while the latter is the text to fill that section.
10498

99+
#### Extended HTML Head and Body
100+
101+
##### Head File
102+
103+
This optional feature enables to import of custom content in every webpage's HTML head of MassBank. This can be useful for the verification of your MassBank instance by Google search console or Bing, for example, or if the import of external libraries is needed when executing custom HTML body file content (see below).
104+
105+
If the _.env_ file contains a non-empty _HTML_HEAD_FILE_ property then its file content will be included in the head section of every HTML document of the web interface.
106+
107+
##### Body File
108+
109+
This optional feature enables the import of custom content in every webpage's HTML body of MassBank. This feature can be useful to implement a customised data privacy management, e.g. tracking. To display a data privacy section in every webpage's footer, the root element needs to have the id "_data-privacy-container_".
110+
111+
If the _.env_ file contains a non-empty _HTML_BODY_FILE_ property then its file content will be included in the body section of every HTML document of the web interface to enable the data privacy management button. The HTML file content is responsible for what is shown in the graphical interface and for the executed code. The MassBank implementation does not influence or control that.
112+
113+
##### Mount Local Directory
114+
115+
In order to mount the HTML files, the variable _HTML_LOCAL_DIR_ needs to be set to a local directory. For example in the root of the project.
116+
117+
Additionally, the volume needs to be mounted. Therefore, firstly, the directory (_HTML_LOCAL_DIR_) needs to be created and contain the head or both HTML files. Secondly, the _volumes_ tag in the frontend section in the docker-compose file has to be re-activated.
118+
105119
### Troubleshooting
106120

107121
In case your system is different from linux/amd64 then a warning might appear after starting docker compose:

compose/docker-compose.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ services:
5252
similarity-service:
5353
# platform: linux/amd64
5454
image: quay.io/massbank/massbank3-similarity-service:latest
55-
restart: always
56-
# ports:
57-
# - "${SIMILARITY_SERVICE_PORT}:8080"
55+
restart: always
5856
environment:
5957
- MSP
6058
- VERBOSE=${SIMILARITY_SERVICE_VERBOSE}
@@ -110,8 +108,8 @@ services:
110108
restart: always
111109
ports:
112110
- "${MB3_FRONTEND_PORT}:3000"
113-
volumes:
114-
- "${HTML_LOCAL_DIR}:/app/analytics-html"
111+
# volumes:
112+
# - "${HTML_LOCAL_DIR}:/app/analytics-html"
115113

116114
mb3tool:
117115
build:

compose/env.dist

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,11 @@ HTML_HEAD_FILE=""
159159
# External libraries used in this HTML body file, like jquery, need to be included in the HTML head file.
160160
HTML_BODY_FILE=""
161161

162-
# The volume path to the HTML files to mount
163-
HTML_LOCAL_DIR=./../analytics-html/
162+
# In order to mount the HTML files, the path needs to be set to a local directory.
163+
# The volume path to the HTML files to mount, e.g. "/analytics-html" in the root of the project.
164+
# Additionally, the volume need to be mounted in the docker-compose.yml file. Therefore, the
165+
# directory needs to be created and the volumes tag for the frontend in the docker-compose file re-activated.
166+
HTML_LOCAL_DIR=""
164167

165168

166169
# ---------------------------

web-frontend/Dockerfile-frontend

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ COPY --from=build /app/src ./src/
1818
COPY --from=build /app/public ./public/
1919
COPY --from=build /app/package.json /app/package-lock.json /app/server.ts /app/entrypoint.sh ./
2020

21-
ENTRYPOINT sh entrypoint.sh "${MB3_API_URL}" "${MB3_FRONTEND_URL}" "${MB3_FRONTEND_BASE_URL}" "${MB3_FRONTEND_VERSION}" "${EXPORT_SERVICE_URL}" "${HTML_HEAD_FILE}" "${MB3_API_URL_INTERNAL}" "${EXPORT_SERVICE_URL_INTERNAL}" "${DISTRIBUTOR_TEXT}" "${DISTRIBUTOR_URL}" "${MB3_FRONTEND_BROWSER_TAB_TITLE}" "${MB3_FRONTEND_HOMEPAGE_INTRO_TEXT}" "${MB3_FRONTEND_HOMEPAGE_NEWS_SECTION_TEXT}" "${MB3_FRONTEND_HOMEPAGE_FUNDING_SECTION_TEXT}" "${MB3_FRONTEND_HOMEPAGE_ADDITIONAL_SECTION_NAME}" "${MB3_FRONTEND_HOMEPAGE_ADDITIONAL_SECTION_TEXT}" "${HTML_HEAD_FILE}" "${HTML_BODY_FILE}"
21+
ENTRYPOINT sh entrypoint.sh "${MB3_API_URL}" "${MB3_FRONTEND_URL}" "${MB3_FRONTEND_BASE_URL}" "${MB3_FRONTEND_VERSION}" "${EXPORT_SERVICE_URL}" "${MB3_API_URL_INTERNAL}" "${EXPORT_SERVICE_URL_INTERNAL}" "${DISTRIBUTOR_TEXT}" "${DISTRIBUTOR_URL}" "${MB3_FRONTEND_BROWSER_TAB_TITLE}" "${MB3_FRONTEND_HOMEPAGE_INTRO_TEXT}" "${MB3_FRONTEND_HOMEPAGE_NEWS_SECTION_TEXT}" "${MB3_FRONTEND_HOMEPAGE_FUNDING_SECTION_TEXT}" "${MB3_FRONTEND_HOMEPAGE_ADDITIONAL_SECTION_NAME}" "${MB3_FRONTEND_HOMEPAGE_ADDITIONAL_SECTION_TEXT}" "${HTML_HEAD_FILE}" "${HTML_BODY_FILE}"
2222
EXPOSE 3000

web-frontend/entrypoint.sh

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,17 @@ echo "MB3_FRONTEND_URL=$2" >> .env
55
echo "MB3_FRONTEND_BASE_URL=$3" >> .env
66
echo "MB3_VERSION=${4:-"3.0.0"}" >> .env
77
echo "EXPORT_SERVICE_URL=$5" >> .env
8-
echo "GOOGLE_SEARCH_CONSOLE_KEY=${6:-""}" >> .env
9-
echo "MB3_API_URL_INTERNAL=$7" >> .env
10-
echo "EXPORT_SERVICE_URL_INTERNAL=$8" >> .env
11-
echo "DISTRIBUTOR_TEXT=${9:-"This website is hosted and distributed by ..."}" >> .env
12-
echo "DISTRIBUTOR_URL=${10:-""}" >> .env
13-
echo "MB3_FRONTEND_BROWSER_TAB_TITLE=${11:-"Massbank3"}" >> .env
14-
echo "MB3_FRONTEND_HOMEPAGE_INTRO_TEXT=${12:-"Welcome to MassBank, an open-source mass spectral library for the identification of small chemical molecules of metabolomics, exposomics and environmental relevance."}" >> .env
15-
echo "MB3_FRONTEND_HOMEPAGE_NEWS_SECTION_TEXT=${13:-""}" >> .env
16-
echo "MB3_FRONTEND_HOMEPAGE_FUNDING_SECTION_TEXT=${14:-""}" >> .env
17-
echo "MB3_FRONTEND_HOMEPAGE_ADDITIONAL_SECTION_NAME=${15:-""}" >> .env
18-
echo "HTML_HEAD_FILE=${16:-""}" >> .env
19-
echo "HTML_BODY_FILE=${17:-""}" >> .env
8+
echo "MB3_API_URL_INTERNAL=$6" >> .env
9+
echo "EXPORT_SERVICE_URL_INTERNAL=$7" >> .env
10+
echo "DISTRIBUTOR_TEXT=${8:-"This website is hosted and distributed by ..."}" >> .env
11+
echo "DISTRIBUTOR_URL=${9:-""}" >> .env
12+
echo "MB3_FRONTEND_BROWSER_TAB_TITLE=${10:-"Massbank3"}" >> .env
13+
echo "MB3_FRONTEND_HOMEPAGE_INTRO_TEXT=${11:-"Welcome to MassBank, an open-source mass spectral library for the identification of small chemical molecules of metabolomics, exposomics and environmental relevance."}" >> .env
14+
echo "MB3_FRONTEND_HOMEPAGE_NEWS_SECTION_TEXT=${12:-""}" >> .env
15+
echo "MB3_FRONTEND_HOMEPAGE_FUNDING_SECTION_TEXT=${13:-""}" >> .env
16+
echo "MB3_FRONTEND_HOMEPAGE_ADDITIONAL_SECTION_NAME=${14:-""}" >> .env
17+
echo "HTML_HEAD_FILE=${15:-""}" >> .env
18+
echo "HTML_BODY_FILE=${16:-""}" >> .env
2019

2120

2221
npm run start

0 commit comments

Comments
 (0)