Sign inSign up

dsigmund/greenpass2json

By dsigmund

•Updated almost 5 years ago

Takes a HC1-String or a GreenPass-QR-Code and returns the decoded JSON.

Image
0

1.8K

dsigmund/greenpass2json repository overview

⁠greenpass2JSON

Takes a HC1-String or a GreenPass-QR-Code and returns the decoded JSON.

⁠Config

User Environment-Variables:

  • LOG_LOGLEVEL: Loglevel for Application (DEBUG, NOTICE, INFO, WARN, ERROR, FATAL) (Default: INFO)
  • KEEP_LASTIMAGE: Keep the last send image under /last/image (true, false) (Default: false)
  • KEEP_LASTHC1: Keep the last send hc1-string under /last/hc1 (true, false) (Default: false)
  • KEEP_LASTRESULT: Keep the last result under /last/result (true, false) (Default: false)
  • VERIFY_ACTIVE: Activate Verfification of certs. only valid certs will return the payload. (default: false)
  • VERIFY_LIST: List of certs to use to verify (default: https://raw.githubusercontent.com/bcsongor/covid-pass-verifier/35336fd3c0ff969b5b4784d7763c64ead6305615/src/data/certificates.json⁠)
  • POSTRESULT_ACTIVE: Post the payload to another service (default: false)
  • POSTRESULT_TARGET: Where to post the payload t (default: '')

Example:

docker run \
--env LOG_LOGLEVEL="INFO" \
--env KEEP_LASTIMAGE="true" \
--env VERIFY_ACTIVE="true" \
--name greenpass2json \
--restart unless-stopped \
-p 3000:3000 \
-d dsigmund/greenpass2json:latest

Additional Config from other packages:

⁠Usage

  • /_health: Receive Status 200 if Server is Online
  • /_version: Backend Version as text/plain
  • /qrcode: Post a jpg-Image of an qrcode from greenpass. returns JSON
  • /hc1: Post a hc1-string as form-data-body with the key "hc1". returns JSON
⁠JSON

see https://raw.githubusercontent.com/ehn-dcc-development/ehn-dcc-schema/release/1.3.0/DCC.combined-schema.json⁠

⁠Telemetrics

2 types of telemetrics are avaiable: logs and promethes metrics.

⁠Logs

Logs are written to STDOUT in the following Format:

YYYY-MM-DDTHH:ii:ss\tHOST\tgreenpass2json\tLEVEL\tMESSAGE

Example:

2021-09-19T19:26:34 LT-9410794 greenpass2json INFO greenpass2json is running on Port 3000

⁠Prometheus

The Metrics are reachable via REST: /_metrics and consist of the following stats:

  • version Version of this Service
  • process_cpu_user_seconds_total Total user CPU time spent in seconds.
  • process_cpu_system_seconds_total Total system CPU time spent in seconds.
  • process_cpu_seconds_total Total user and system CPU time spent in seconds.
  • process_start_time_seconds Start time of the process since unix epoch in seconds.
  • process_resident_memory_bytes Resident memory size in bytes.
  • nodejs_eventloop_lag_seconds Lag of event loop in seconds.
  • nodejs_eventloop_lag_min_seconds The minimum recorded event loop delay.
  • nodejs_eventloop_lag_max_seconds The maximum recorded event loop delay.
  • nodejs_eventloop_lag_mean_seconds The mean of the recorded event loop delays.
  • nodejs_eventloop_lag_stddev_seconds The standard deviation of the recorded event loop delays.
  • nodejs_eventloop_lag_p50_seconds The 50th percentile of the recorded event loop delays.
  • nodejs_eventloop_lag_p90_seconds The 90th percentile of the recorded event loop delays.
  • nodejs_eventloop_lag_p99_seconds The 99th percentile of the recorded event loop delays.
  • nodejs_active_handles Number of active libuv handles grouped by handle type. Every handle type is C++ class name.
  • nodejs_active_handles_total Total number of active handles.
  • nodejs_active_requests Number of active libuv requests grouped by request type. Every request type is C++ class name.
  • nodejs_active_requests_total Total number of active requests.
  • nodejs_heap_size_total_bytes Process heap size from Node.js in bytes.
  • nodejs_heap_size_used_bytes Process heap size used from Node.js in bytes.
  • nodejs_external_memory_bytes Node.js external memory size in bytes.
  • nodejs_heap_space_size_total_bytes Process heap space size total from Node.js in bytes.
  • nodejs_heap_space_size_used_bytes Process heap space size used from Node.js in bytes.
  • nodejs_heap_space_size_available_bytes Process heap space size available from Node.js in bytes.
  • nodejs_version_info Node.js version info.

⁠Testing

⁠QR-Code Image
curl -X POST \
  -F "image=@./testdata/qrcode.jpg" \
  http://localhost:3000/qrcode
⁠HC1-String
curl -X POST \
  -F "hc1=$(cat ./testdata/hc1.txt)" \
  http://localhost:3000/hc1

Tag summary

Content type

Image

Digest

Size

272.6 MB

Last updated

almost 5 years ago

docker pull dsigmund/greenpass2json