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

[docker config] new header's config is improperly configured for non-java services (datahub, datafeeder) #425

Open
jeanpommier opened this issue Sep 27, 2024 · 3 comments
Labels

Comments

@jeanpommier
Copy link
Member

Configuration for the header is done in defaults.properties. You can for instance change the logo. And add a complementary stylesheet. But some apps won't read that config, resulting in an incoherent header whenever there is some custom config. For instance when changing the logo, it won't apply on datafeeder and datahub as can be seen on the following scripts:

@jeanpommier jeanpommier changed the title new header's config is improperly configured for non-java services (datahub, datafeeder) [docker config] new header's config is improperly configured for non-java services (datahub, datafeeder) Sep 27, 2024
@jeanpommier
Copy link
Member Author

I believe we should be able to read the .properties file if necessary, somthing like (ex. for the datahub)

#!/bin/sh

# To be properl executed by datahub initialization need the +x flag 
# so you need to add it with chmod and commit/push it

# Parse default.properties file
file="../../default.properties"
function prop {
    grep "^${1}" ${file} | cut -d'=' -f2
}

DATAHUB_DIR=${1:-/usr/share/nginx/html/datahub}
SNIPPET="<script src=\"$(prop 'headerScript')\"></script><geor-header active-app='datahub' style=\"height:$(prop 'headerHeight')px\" logo-url=\"$(prop 'logoUrl')\" stylesheet=\"$(prop 'georchestraStylesheet')\"></geor-header>"

if grep -q "<geor-header" "${DATAHUB_DIR}/index.html"; then
  echo "[INFO] geOrchestra: header already present."
  exit 0
fi

echo "[INFO] geOrchestra: adding header in the main page..."
sed -i "s#<body>#<body>${SNIPPET}#" ${DATAHUB_DIR}/index.html

@jeanpommier
Copy link
Member Author

I noticed that the login page also doesn't take the logo config into account. Which app is serving this page ? Is this a gateway feature ?

@f-necas
Copy link
Contributor

f-necas commented Oct 3, 2024

From the default docker comp it's in resources/static/index.html and I think it's served by traefik or gw (don't remember it).

For the default.properties I've tried to create a georchestra version of DF and DH in order to avoid to fork them. But didn't succeed by now.

But the for the conf I ended up with a more elegant way to use it : https://github.com/f-necas/geor-gnui2/blob/main/header.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants