Skip to content

Latest commit

 

History

History

webserver

ezmaster-webserver

Docker Pulls

Web Server for ezmaster

Prerequisites

ezmaster3.8.0

Usage

Crontab feature

To sync with git repo, just change the config :

{
 "environnement": {
        "NODE_ENV": "production",
        "CRON_VERBOSE": true,
        "GIT_REPOSITORY": "https://github.com/Inist-CNRS/lodex-extented",
        "GIT_BRANCH": "v3"
    },
 "tasks": [
        {
            "when": "30 * * * *",
            "execute": "/app/gitsync $GIT_REPOSITORY $GIT_BRANCH"
        }
    ]
}

To sync with a directory within a monorepo, use:

{
 "environnement": {
        "NODE_ENV": "production",
        "CRON_VERBOSE": true,
        "GIT_REPOSITORY": "https://gitbucket.inist.fr/git/tdm/web-services.git",
        "GIT_BRANCH": "master",
        "GIT_DIRECTORY": "www-home"
    },
    "tasks": [{
      "when": "30 8-19 * * 1-5",
      "execute": "/app/gitsyncdir $GIT_REPOSITORY $GIT_BRANCH $GIT_DIRECTORY "
    }]
}

Tip: use https://crontab.guru/ to check the when of your tasks.

Authentication feature

To enable autentication, just edit this line with the wanted login/password in the config:

{
    "options": {
        "authUser": "admin",
        "authPass": "secret"
    }
}

Redirect feature

Re-route path using regex, just add rules with from/to key in the config:

{
    "options" : {
        "rewrite": [
          {
            "from": "/(.*)",
            "to": "https://user-doc.lodex.inist.fr/$1"
          }
        ]
    }
}

Advanced Configuration

{
    "options": {
        "logFormat": "combined"
    }
}

Developer

To run stuff locally, just type:

make build
make run-debug

Then open your browser at http://localhost:8000