@scalio-cloud/ui 0.44.0 → 0.44.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -83,7 +83,8 @@ server {
83
83
 
84
84
  Both lists empty: no limit (both files stay empty). An address passes if it is in the IP list or its country is
85
85
  allowed. An invalid entry closes the instance for everyone except the machine paths and names the entry in the log
86
- (fail closed). Countries set but no database: only the IP list counts, the log says so. For countries the image needs
86
+ (fail closed). Countries set but no database or the geoip2 module not loaded (`load_module` in `nginx.conf` or
87
+ `modules/*.conf`): only the IP list counts, nginx still starts and the log says why. For countries the image needs
87
88
  `ngx_http_geoip2_module` and the free DB-IP «IP to Country Lite» database (CC BY 4.0: show «IP Geolocation by DB-IP»
88
89
  on the about page). Tests (`test/access.test.js`) run with real nginx when it is installed.
89
90
 
@@ -4,7 +4,8 @@
4
4
  # official nginx image runs it before nginx starts) and machine-paths.txt next to it.
5
5
  #
6
6
  # ALLOWED_CLIENT_IPS CIDR list, comma separated ("203.0.113.0/24, 2001:db8::/48"); empty = no limit
7
- # ALLOWED_COUNTRIES ISO country codes, comma separated ("CH,DE,AT"); needs the geoip2 module and SCALIO_GEOIP_DB
7
+ # ALLOWED_COUNTRIES ISO country codes, comma separated ("CH,DE,AT"); needs SCALIO_GEOIP_DB and the geoip2 module
8
+ # loaded in nginx.conf (load_module, or modules/*.conf as in the Alpine package)
8
9
  # TRUSTED_PROXIES CIDR list of the proxy in front (Caddy network, Azure ingress); its X-Forwarded-For counts
9
10
  # SCALIO_APP nexus, citadel, … : picks the app's machine paths (machine-paths.txt)
10
11
  # SCALIO_GEOIP_DB country database (DB-IP «IP to Country Lite», mmdb); default /etc/nginx/geoip/dbip-country.mmdb
@@ -12,7 +13,8 @@
12
13
  # Allowed is who is in the IP list OR in an allowed country; machine paths stay open. Everyone else gets 403 with a
13
14
  # short page that names the address (and the country), so the customer can add it in Scalio Compass.
14
15
  # Both variables empty: the two files are written empty and nothing changes.
15
- # A wrong entry or countries without database: fail closed (only machine paths open) and say why in the log.
16
+ # A wrong entry: fail closed (only machine paths open) and say why in the log. Countries without database or
17
+ # without the geoip2 module: only the IP list counts (nginx still starts) and the log says why.
16
18
  set -eu
17
19
 
18
20
  DIR="${SCALIO_ACCESS_DIR:-/etc/nginx}"
@@ -21,6 +23,7 @@ SERVER_CONF="${SCALIO_ACCESS_SERVER:-$DIR/snippets/scalio-access.conf}"
21
23
  PATHS_FILE="${SCALIO_MACHINE_PATHS_FILE:-$(dirname "$0")/machine-paths.txt}"
22
24
  [ -f "$PATHS_FILE" ] || PATHS_FILE="$DIR/snippets/machine-paths.txt"
23
25
  GEOIP_DB="${SCALIO_GEOIP_DB:-$DIR/geoip/dbip-country.mmdb}"
26
+ NGINX_CONF="${SCALIO_NGINX_CONF:-$DIR/nginx.conf}"
24
27
  APP="${SCALIO_APP:-}"
25
28
 
26
29
  log() { echo "scalio-access: $*" >&2; }
@@ -66,6 +69,11 @@ geo_ok=1
66
69
  if [ -n "$COUNTRIES" ] && [ ! -r "$GEOIP_DB" ]; then
67
70
  geo_ok=0
68
71
  log "ALLOWED_COUNTRIES set, but no country database at $GEOIP_DB: only the IP list counts"
72
+ elif [ -n "$COUNTRIES" ] && ! cat "$NGINX_CONF" "$DIR"/modules/*.conf "$DIR"/modules-enabled/*.conf 2>/dev/null \
73
+ | grep -v '^[[:space:]]*#' | grep -q 'ngx_http_geoip2_module'; then
74
+ # Without load_module nginx would refuse the geoip2 block and not start at all.
75
+ geo_ok=0
76
+ log "ALLOWED_COUNTRIES set, but the geoip2 module is not loaded ($NGINX_CONF): only the IP list counts"
69
77
  fi
70
78
  if [ -n "$broken" ]; then
71
79
  log "invalid entries:$broken -> access closed for everyone except the machine paths"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalio-cloud/ui",
3
- "version": "0.44.0",
3
+ "version": "0.44.1",
4
4
  "description": "Scalio Control Room design tokens, Tailwind preset, self-hosted fonts, the shared app header, sign-in layout, sidebar and page blocks",
5
5
  "license": "SEE LICENSE IN README.md",
6
6
  "private": false,