annotate host/nginx_common.sh @ 2137:67b504ba388c nginx_decoupled

don't assume the user's primary group name is the same as their username
author Violet7
date Mon, 19 Jan 2026 20:20:03 -0800
parents 3ca8f933209d
children 5cf7c6b1dec9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2136
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
1 #!/bin/bash
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
2 set -e
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
3
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
4 export NGINX_ROOT_CONFIG_DIR="$HOME/.nginx-luan"
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
5 export NGINX_ROOT_CONFIG_FILE="$NGINX_ROOT_CONFIG_DIR/nginx.conf"
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
6 export NGINX_SITE_CONFIGS_DIR="$NGINX_ROOT_CONFIG_DIR/sites"
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
7 export NGINX_LOG_DIR="$NGINX_ROOT_CONFIG_DIR/log"
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
8 export NGINX_PID_DIR="$NGINX_ROOT_CONFIG_DIR"
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
9 export NGINX_USER="$(whoami)"
2137
67b504ba388c don't assume the user's primary group name is the same as their username
Violet7
parents: 2136
diff changeset
10 export NGINX_GROUP"$(id -gn)"
2136
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
11
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
12 # -p makes this succeed if the path exists on macos
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
13 # on linux, mkdir always suceeds if path exists
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
14 mkdir -p $NGINX_ROOT_CONFIG_DIR
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
15 mkdir -p $NGINX_SITE_CONFIGS_DIR
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
16 mkdir -p $NGINX_LOG_DIR
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
17 mkdir -p $NGINX_PID_DIR