Skip to content

qwc-services/qwc-ext-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker

QWC external link service

API documentation:

http://localhost:5023/api/

Setup

Declare the resource type in the config database:

INSERT INTO qwc_config.resource_types(name, description, list_order) values ('external_links', 'External link name', <list_order>);

Pick <list_order> according to the desired ordering position in the resource selection menu in the QWC Admin GUI.

Configuration

The static config files are stored as JSON files in $CONFIG_PATH with subdirectories for each tenant, e.g. $CONFIG_PATH/default/*.json. The default tenant name is default.

JSON config

  • JSON schema
  • File location: $CONFIG_PATH/<tenant>/extConfig.json

Example:

{
  "$schema": "https://raw.githubusercontent.com/qwc-services/qwc-ext-service/master/schemas/qwc-ext-service.json",
  "service": "ext",
  "config": {
    "program_map": {
      "prog1": "http://my.secret.site/path/?tenant=$tenant$&user=$username$",
    }
  },
  "resources": {
    "external_program_names": [
      "prog1"
    ]
  }
}

Development

Create a virtual environment:

python3 -m venv .venv

Activate virtual environment:

source .venv/bin/activate

Install requirements:

pip install -r requirements.txt

Set the CONFIG_PATH environment variable to the path containing the service config and permission files when starting this service (default: config).

export CONFIG_PATH=../qwc-docker/volumes/config

Configure environment:

echo FLASK_ENV=development >.flaskenv

Start local service:

python src/server.py