-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
webui: prepare containers with NextJS
- Loading branch information
Showing
4 changed files
with
64 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,31 @@ | ||
[rucio_endpoint] | ||
REACT_APP_RUCIO_HOST = {{ RUCIO_HOST | default('https://rucio-host-not-defined') }} | ||
|
||
[login_page_org_images] | ||
{% if WEBUI_LOGIN_PAGE_IMAGE_PRIMARY is defined %} | ||
REACT_APP_login_page_image_primary = {{ WEBUI_LOGIN_PAGE_IMAGE_PRIMARY }} | ||
{% endif %} | ||
{% if WEBUI_LOGIN_PAGE_IMAGE_SECONDARY is defined %} | ||
REACT_APP_login_page_image_secondary = {{ WEBUI_LOGIN_PAGE_IMAGE_SECONDARY }} | ||
{% endif %} | ||
[public] | ||
NEXT_PUBLIC_WEBUI_HOST = {{ RUCIO_HOST | default('https://rucio-host-not-defined') }} | ||
|
||
[meta] | ||
PROJECT_NAME = {{PROJECT_NAME | default('https://atlas.cern/')}} | ||
|
||
[session] | ||
SESSION_PASSWORD = {{SESSION_PASSWORD | default('2gyZ3GDw3LHZQKDhPmPDL3sjREVRXPr8')}} | ||
SESSION_COOKIE_NAME = {{SESSION_COOKIE_NAME | default('rucio-webui-session')}} | ||
NODE_TLS_REJECT_UNAUTHORIZED = {{NODE_TLS_REJECT_UNAUTHORIZED | default('0')}} | ||
|
||
[gateway] | ||
RUCIO_AUTH_HOST = {{ RUCIO_AUTH_HOST | default('https://rucio-auth-host-not-defined') }} | ||
RUCIO_HOST = {{ RUCIO_HOST | default('https://rucio-host-not-defined') }} | ||
|
||
[oidc] | ||
OIDC_ENABLED = {{ OIDC_ENABLED | default('false') }} | ||
OIDC_PROVIDERS = {{ OIDC_PROVIDERS | default('') }} | ||
|
||
|
||
{% if OIDC_PROVIDERS %} | ||
{% set providers_list = OIDC_PROVIDERS.split(',') %} | ||
{% for provider in providers_list %} | ||
{% set provider_var_name = 'OIDC_PROVIDER_' + provider + '_CLIENT_ID' %} | ||
{% set provider_value = '' %} | ||
{% if provider_var_name in context %} | ||
{% set provider_value = context[provider_var_name] %} | ||
{% endif %} | ||
OIDC_PROVIDER_{{ provider }}_CLIENT_ID={{ provider_value }} | ||
{% endfor %} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,35 +6,38 @@ | |
# | ||
# Authors: | ||
# - Mayank Sharma, <[email protected]>, 2022 | ||
# - Eraldo Junior <[email protected]>, 2023 | ||
|
||
FROM almalinux:9 | ||
|
||
FROM quay.io/centos/centos:stream8 as production | ||
ARG TAG | ||
|
||
LABEL stage=production | ||
RUN dnf -y update && \ | ||
dnf -y module reset nodejs && \ | ||
dnf -y module enable nodejs:16 && \ | ||
dnf -y module install nodejs:16/common && \ | ||
dnf -y install httpd mod_ssl python39 git procps && \ | ||
dnf clean all | ||
|
||
RUN python3 -m pip install --no-cache-dir --upgrade pip | ||
dnf -y module enable nodejs:18 && \ | ||
dnf -y module install nodejs:18/common && \ | ||
dnf -y install httpd mod_ssl python39 python-pip git procps && \ | ||
dnf clean all && \ | ||
rm -rf /var/cache/dnf | ||
|
||
RUN python3 -m pip install --no-cache-dir --upgrade pip && \ | ||
python3 -m pip install --no-cache-dir --upgrade setuptools | ||
RUN python3 -m pip install --no-cache-dir j2cli | ||
|
||
WORKDIR /opt/rucio/webui | ||
|
||
ENV RUCIO_WEBUI_PATH=$(WORKDIR) | ||
|
||
RUN curl https://raw.githubusercontent.com/rucio/rucio/master/tools/merge_rucio_configs.py --output /opt/rucio/merge_rucio_configs.py | ||
RUN git clone --depth 1 -b ${TAG} -- https://github.com/rucio/webui.git /opt/rucio/webui | ||
RUN npm ci --legacy-peer-deps | ||
|
||
COPY robots.txt /var/www/html | ||
COPY httpd.conf.j2 /tmp/ | ||
COPY rucio.conf.j2 /tmp | ||
RUN npm install | ||
RUN npm run build | ||
|
||
COPY docker-entrypoint.sh / | ||
COPY .env.default.j2 /tmp/ | ||
|
||
RUN rm /etc/httpd/conf.d/welcome.conf /etc/httpd/conf.d/userdir.conf /etc/httpd/conf.d/ssl.conf | ||
|
||
VOLUME /var/log/httpd | ||
|
||
EXPOSE 443 | ||
EXPOSE 80 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,25 @@ | ||
#!/bin/bash -e | ||
|
||
j2 /tmp/httpd.conf.j2 | sed '/^\s*$/d' > /etc/httpd/conf/httpd.conf | ||
|
||
echo "=================== /etc/httpd/conf/httpd.conf ========================" | ||
cat /etc/httpd/conf/httpd.conf | ||
echo "" | ||
|
||
|
||
j2 /tmp/rucio.conf.j2 | sed '/^\s*$/d' > /etc/httpd/conf.d/rucio.conf | ||
|
||
echo "=================== /etc/httpd/conf.d/rucio.conf ========================" | ||
cat /etc/httpd/conf.d/rucio.conf | ||
echo "" | ||
|
||
j2 /tmp/.env.default.j2 | sed '/^\s*$/d' > /opt/rucio/webui/.env.default | ||
|
||
if [ -f /opt/rucio/webui/.env ]; then | ||
echo "/opt/rucio/webui/.env already mounted." | ||
else | ||
echo "/opt/rucio/webui/.env not found. will generate one." | ||
python3 /opt/rucio/merge_rucio_configs.py \ | ||
-s /opt/rucio/webui/.env.default $RUCIO_OVERRIDE_CONFIGS \ | ||
--use-env \ | ||
-d /opt/rucio/webui/.env | ||
echo "/opt/rucio/webui/.env not found. will generate one." | ||
j2 /tmp/.env.default.j2 | sed '/^\s*$/d' > /opt/rucio/webui/.env | ||
fi | ||
|
||
echo "=================== /opt/rucio/webui/.env ========================" | ||
cat /opt/rucio/webui/.env | ||
echo "" | ||
|
||
npm run build | ||
cp -rfn /opt/rucio/webui/build/* /var/www/html/ | ||
exec httpd -D FOREGROUND | ||
if [ -d "/patch" ] | ||
then | ||
echo "Patches found. Trying to apply them" | ||
for patchfile in /patch/* | ||
do | ||
echo "Apply patch ${patchfile}" | ||
patch -p3 -d "$RUCIO_WEBUI_PATH" < $patchfile | ||
done | ||
fi | ||
|
||
echo "=================== Starting RUCIO WEBUI ========================" | ||
npm run start |