Giter VIP home page Giter VIP logo

Comments (7)

uhurusurfa avatar uhurusurfa commented on July 26, 2024

I think you are using someones fork of the official OpenAS2 code base because the sample docker-compose.yml for this repo does not specify any volumes:
https://github.com/OpenAS2/OpenAs2App/blob/master/docker-compose.yml

from openas2app.

sonykphilip avatar sonykphilip commented on July 26, 2024

I'm sorry that I wasn't clear enough. I modified the provided compose file from the repo and added the volumes.

But the question was about why the partnerships file would get overwritten on a recreate, IAC.

from openas2app.

uhurusurfa avatar uhurusurfa commented on July 26, 2024

When you say it gets overwritten with the defaults, what defaults are these and where is the file containing the defaults stored?
The code has no concept of a default set of partnerships so the only possibility I can think of is that there must be a second file somewhere that contains the defaults and somehow docker is copying it into the volume.

from openas2app.

sonykphilip avatar sonykphilip commented on July 26, 2024

The contents of this file is what I see after it recreates the container
https://github.com/OpenAS2/OpenAs2App/blob/master/Server/src/config/partnerships.xml

This seems to be happening during the server startup process. Docker is not doing anything here other than mapping the hostfs file inside the container to that specific location.

What I have done now is to copy all the files+dirs from the 'openas2/config' dir inside the container onto the hostfs and changed the the line to:

volumes:
  - /opt/openas2/config:/opt/openas2/config

This seems to work.

I wanted to only change the files which I really needed to change and leave the rest as is. But now I have the contents of the whole config directory on the hostfs.

This is my current openas2-server section in the compose file

services:
  openas2:
    container_name: openas2
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - 4080:10080
      - 4099:10099
      - 4081:10081
      - 4443:10443
      - 4444:10444
    environment:
      - OPENAS2_PROPERTIES_FILE=/opt/openas2/config/openas2.properties
      - EXTRA_PARMS="-Xmx512m"
    volumes:
      #- /opt/openas2/config/personal.p12:/opt/openas2/config/personal.p12
      #- /opt/openas/config/personal.jks:/opt/openas2/config/personal.jks
      #- /opt/openas2/config/openas2.properties:/opt/openas2/config/openas2.properties
      #- /opt/openas2/config/partnerships.xml:/opt/openas2/config/partnerships.xml
      #- /opt/openas2/config/DB:/opt/openas2/config/DB
      - /opt/openas2/config:/opt/openas2/config
      - /opt/openas2/data:/opt/openas2/data
      - /opt/openas2/logs:/opt/openas2/logs
    tty: true
    stdin_open: true
    restart: always

from openas2app.

uhurusurfa avatar uhurusurfa commented on July 26, 2024

You can put the partnerships XML file and openas2.properties file somewhere like:
/opt/MyAS2Config
In the openas2.properties file make sure you have:
partnership_file=/opt/MyAS2Config/partnerships.xml
Then in the docker file set OPENAS2_PROPERTIES_FILE to /opt/MyAS2Config/openas2.properties
And set the volume so that /opt/MyAS2Config is accessible from the container.

from openas2app.

sonykphilip avatar sonykphilip commented on July 26, 2024

Yes, this is exactly what I did and raised this issue about the properties file getting overwritten with this method.

`The partnerships.xml is a volume mount in the docker-compose.yaml:

volumes:

  • /opt/openas2/config/openas2.properties:/opt/openas2/config/openas2.properties
  • /opt/openas2/config/partnerships.xml:/opt/openas2/config/partnerships.xml

In the /opt/openas2/config/openas2.properties:
partnership_file=/opt/openas2/config/partnerships.xml

environment:
- OPENAS2_PROPERTIES_FILE=/opt/openas2/config/openas2.properties
- EXTRA_PARMS="-Xmx512m"`

If you see my latest config, everything that mounts a specific file has now been commented out and Ive added the 'config' directory as a mount instead:
- /opt/openas2/config:/opt/openas2/config

from openas2app.

ThorTL67 avatar ThorTL67 commented on July 26, 2024

I'm testing with 3.7 and have this as my volume:

    volumes:
      - ./Server/src/config:/opt/openas2/config

The config files including partnerships are persisting.

I ran into the same issue regarding #332 but found that the partnership export from the WEBUI was producing a weird partnerships xml, I don't think it's related to this

from openas2app.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.