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

Configurable docroot via MicroProfile Config #9819

Merged
merged 23 commits into from
Oct 13, 2023

Commits on Jun 21, 2023

  1. fix(ct): enable sane default for upload storage location in containers

    The default from microprofile-config.properties does NOT work,
    as the location must already be resolvable while the servlet is
    being initialized - the app shipped defaults file is not yet read
    at this point.
    
    This is similar to the database options, which must be set using one
    of the other Payara included config sources. (Non-easily resolvable
    timing issue). The solution for containers is to add an env var to
    the docker file, which can be overriden by any env var from compose
    or K8s etc. (Problem is the high ordinal of the env source though)
    poikilotherm committed Jun 21, 2023
    Configuration menu
    Copy the full SHA
    98e5b3f View commit details
    Browse the repository at this point in the history
  2. fix(ct,conf): switch to different approach to default upload location

    Instead of trying to provide a default using STORAGE_DIR env var from
    microprofile-config.properties as before, using this env var reference
    in glassfish-web.xml directly now. By defaulting to "." if not present
    (as in classic installations), it is fully equivalent to the former
    hardcoded default value.
    
    Providing a synced variant of it in microprofile-config.properties
    and leaving a hint about the pitfalls, we can reuse the setting for
    other purposes within the codebase as well (and expect the same
    behaviour because same defaults).
    poikilotherm committed Jun 21, 2023
    Configuration menu
    Copy the full SHA
    d71cdf2 View commit details
    Browse the repository at this point in the history
  3. feat(conf): introduce ConfigCheckService to validate config on startup

    …IQSS#9572
    
    Starting with important local storage locations for the Dataverse application,
    this service uses EJB startup mechanisms to verify configuration bits on startup.
    
    Checks for the temp storage location and JSF upload location as crucial parts
    of the app, which, if not exist or write protected, while only cause errors and
    failures on the first data upload attempt. This is not desirable as it might cause
    users to be blocked.
    poikilotherm committed Jun 21, 2023
    Configuration menu
    Copy the full SHA
    a4ec3a6 View commit details
    Browse the repository at this point in the history
  4. feat(conf): make docroot location configurable IQSS#9662

    Add JVM Setting and add to config checker on startup to ensure target location is in good shape.
    poikilotherm committed Jun 21, 2023
    Configuration menu
    Copy the full SHA
    6999093 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    0e29e3e View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    4aac8f1 View commit details
    Browse the repository at this point in the history
  7. refactor(conf): make docroot and uploads locations more precise and d…

    …ocument more of the behaviour
    poikilotherm committed Jun 21, 2023
    Configuration menu
    Copy the full SHA
    1c256e9 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    2913a52 View commit details
    Browse the repository at this point in the history

Commits on Aug 22, 2023

  1. Configuration menu
    Copy the full SHA
    554d7ce View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1db0042 View commit details
    Browse the repository at this point in the history
  3. refactor(collection): make logo location non-static IQSS#9662

    By introducing a new static method ThemeWidgetFragment.getLogoDir
    all other places (api.Access, api.Dataverse, UpdateDataverseThemeCommand,
    DataverseServiceBean) can use a lookup function from one central place
    instead of building the path on their own.
    
    Reducing code duplication also means we can more easily get the location
    from a setting, enabling relocation of the data. That is especially
    important for container usage.
    
    Also, we can now use ConfigCheckService to detect if the folders we configured
    are read/write accessible to us.
    poikilotherm committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    72722e7 View commit details
    Browse the repository at this point in the history
  4. fix(webapp): revert to hardcoded default for dirs in glassfish-web.xml

    …IQSS#9662
    
    Payara does not support looking up variables in default values of a lookup.
    As a consequence, we must return to the hardcoded "./docroot" and "./uploads"
    and instead supply default values using two environment variables in the
    applications' Dockerfile. This way they stay configurable from cmdline or
    other sources of env vars.
    poikilotherm committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    431afed View commit details
    Browse the repository at this point in the history
  5. fix(settings): make ConfigCheckService use Files.exist IQSS#9662

    With Files.notExist if some folder does not have the "execute"
    attribute, it cannot detect a folder does not exist.
    Inverting the Files.exists call solves the problem.
    
    Also adding tests for the business logic.
    poikilotherm committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    ec131f8 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    848f564 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    c49ee0a View commit details
    Browse the repository at this point in the history

Commits on Aug 23, 2023

  1. fix(test,settings): make SiteMapUtilTest use test.filesDir property

    This is also used in ConfigCheckServiceTest to verify the checks are
    working. This property is picked up when sitemap util looks up the
    storage location via MPCONFIG, parsing the default values during
    testing from src/test/resources/META-INF/microprofile-config.properties
    poikilotherm committed Aug 23, 2023
    Configuration menu
    Copy the full SHA
    28ddccc View commit details
    Browse the repository at this point in the history
  2. fix(test,settings): provide default for test.filesDir

    By providing a sane default unter /tmp, we enable a few tests that
    do not use a custom testclass scoped directory to run
    poikilotherm committed Aug 23, 2023
    Configuration menu
    Copy the full SHA
    ba8e6d2 View commit details
    Browse the repository at this point in the history
  3. style(settings): unify default dataverse.files dir options

    - No more profile to work around Payaras bug with overriding profiled
      values
    - Group together because every item using $STORAGE_DIR and a default
      to match classic installs now
    poikilotherm committed Aug 23, 2023
    Configuration menu
    Copy the full SHA
    396ffff View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d37eedf View commit details
    Browse the repository at this point in the history

Commits on Sep 15, 2023

  1. Configuration menu
    Copy the full SHA
    880b34c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    efaf5d5 View commit details
    Browse the repository at this point in the history

Commits on Oct 2, 2023

  1. Configuration menu
    Copy the full SHA
    034a972 View commit details
    Browse the repository at this point in the history

Commits on Oct 5, 2023

  1. Configuration menu
    Copy the full SHA
    fce664f View commit details
    Browse the repository at this point in the history