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

Implement custom scripts #7

Merged
merged 3 commits into from
Dec 1, 2023
Merged

Conversation

f-necas
Copy link

@f-necas f-necas commented Dec 1, 2023

Custom scripts

This PR adds the capability to run scripts at startup of the container.

It's a part of the georchestra PR :

Soving issue :

Changes

Startup script

A custom-startup.sh script is implemented in order to avoid overriding Nginx default script.

How-to

Set CUSTOM_SCRIPTS_DIRECTORY environment variable to point to a valid volume.
Set a volume with scripts to execute.

Example :

 import:
    ...
    volumes:
      - georchestra_datadir:/etc/georchestra
    environment:
      - CUSTOM_SCRIPTS_DIRECTORY=/etc/georchestra/import/scripts

@f-necas f-necas mentioned this pull request Dec 1, 2023
@f-necas f-necas requested a review from edevosc2c December 1, 2023 13:27
@edevosc2c edevosc2c merged commit ad416e4 into georchestra-datafeeder Dec 1, 2023
@edevosc2c edevosc2c deleted the custom-scripts branch December 1, 2023 16:41
@edevosc2c
Copy link
Member

To be backported in ???? (23?)

f-necas added a commit that referenced this pull request Jun 26, 2024
relying on nx cache for building docker image

disable nx-cloud

feat: include georchestra header

df: support ENV for settings

df: set base href to ./

chore: build docker image

datafeeder - Adding a gh action to build / publish a docker image

gh-action - fixing georchestra version (docker tag)

chore: lint

chore: add thesaurus url to settings

base-ref=/impot/'

nginx - redirect onto the index.html when a UUID is present in the URL

Used the following in order to write the rule:

https://github.com/georchestra/geonetwork-ui/blob/georchestra/apps/datafeeder/src/app/app-routing.module.ts

Note:

* Not completely tested at runtime, compilation / docker image OK,
  the rewrite rule has been tested in a running docker image though.
* There is still probably some code missing JS-side to manage these
  query string after the '#' char, as reloading the page after having
  uploaded a dataset does not reload the app at the exact same place.

Concerns: This might break the usage of the docker image outside of the
official georchestra docker composition, as the redirection needs the
X-forwarded-* headers in order to work properly.

github-actions - deactivate gh-pages related actions

nginx - no redirect, just serve the index.html

npm run format:fix

fixing serving virtual routes for the JS app

somehow nginx will return a document with an "application/octet-stream"
content-type, because it probably can't figure out the type by itself.

Forcing "text/html" to be returned, so that the page is not "downloaded"
by the browser, but interpreted as a web page.

Tests: hacking the nginx configuration using the georchestra docker
composition. I was able to reload the page at the expected step once a
dataset has been uploaded.

chore: set proxy config for DF in georchestra

chore: use node 14 in docker image

change branch name in gh action

change branch name from datafeeder to georchestra-datafeeder

build(fix): fix dockerignore for datafeeder build

build(fix): raise build job timeout and formating

fixing lang calculation

some browsers seem to use the "xy-ZT" format for locates, which
obviously won't work as lookup key, as a two-char code is expected.

tests: runtime tested

implement & fix gh action to produce a docker image for the df frontend

See georchestra/georchestra#3659

Also fixes the existing action, as the branch has been renamed.

fix(nx): change defaultBase to georchestra-datafeeder branch

chore: add more to docker ignore

feat(docker): run postinstall scripts manually

This is required for Nx to build its dependency graph, and then to resolve
the result of `createGlobPatternsForDependencies` in the tailwind config

feat(header): make df header iframe configurable moving it from index.html to app.component

fix: formatting

Implement custom scripts (#7)

* feat: implement custom script

* change entrypoint name + fix entrypoint command

* let execution logic in upstream /docker-entrypoint.sh

---------

Co-authored-by: Emilien Devos <[email protected]>
georchestra: re-add icons

removal github actions workflow

see georchestra/georchestra#4105

Merge pull request #8 from georchestra/new-header
f-necas added a commit that referenced this pull request Jul 16, 2024
relying on nx cache for building docker image

disable nx-cloud

feat: include georchestra header

df: support ENV for settings

df: set base href to ./

chore: build docker image

datafeeder - Adding a gh action to build / publish a docker image

gh-action - fixing georchestra version (docker tag)

chore: lint

chore: add thesaurus url to settings

base-ref=/impot/'

nginx - redirect onto the index.html when a UUID is present in the URL

Used the following in order to write the rule:

https://github.com/georchestra/geonetwork-ui/blob/georchestra/apps/datafeeder/src/app/app-routing.module.ts

Note:

* Not completely tested at runtime, compilation / docker image OK,
  the rewrite rule has been tested in a running docker image though.
* There is still probably some code missing JS-side to manage these
  query string after the '#' char, as reloading the page after having
  uploaded a dataset does not reload the app at the exact same place.

Concerns: This might break the usage of the docker image outside of the
official georchestra docker composition, as the redirection needs the
X-forwarded-* headers in order to work properly.

github-actions - deactivate gh-pages related actions

nginx - no redirect, just serve the index.html

npm run format:fix

fixing serving virtual routes for the JS app

somehow nginx will return a document with an "application/octet-stream"
content-type, because it probably can't figure out the type by itself.

Forcing "text/html" to be returned, so that the page is not "downloaded"
by the browser, but interpreted as a web page.

Tests: hacking the nginx configuration using the georchestra docker
composition. I was able to reload the page at the expected step once a
dataset has been uploaded.

chore: set proxy config for DF in georchestra

chore: use node 14 in docker image

change branch name in gh action

change branch name from datafeeder to georchestra-datafeeder

build(fix): fix dockerignore for datafeeder build

build(fix): raise build job timeout and formating

fixing lang calculation

some browsers seem to use the "xy-ZT" format for locates, which
obviously won't work as lookup key, as a two-char code is expected.

tests: runtime tested

implement & fix gh action to produce a docker image for the df frontend

See georchestra/georchestra#3659

Also fixes the existing action, as the branch has been renamed.

fix(nx): change defaultBase to georchestra-datafeeder branch

chore: add more to docker ignore

feat(docker): run postinstall scripts manually

This is required for Nx to build its dependency graph, and then to resolve
the result of `createGlobPatternsForDependencies` in the tailwind config

feat(header): make df header iframe configurable moving it from index.html to app.component

fix: formatting

Implement custom scripts (#7)

* feat: implement custom script

* change entrypoint name + fix entrypoint command

* let execution logic in upstream /docker-entrypoint.sh

---------

Co-authored-by: Emilien Devos <[email protected]>
georchestra: re-add icons

removal github actions workflow

see georchestra/georchestra#4105

Merge pull request #8 from georchestra/new-header
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants