Latest
This commit is contained in:
parent
6b857207a0
commit
86042c0fe9
2 changed files with 20 additions and 1 deletions
|
@ -13,12 +13,30 @@
|
||||||
|
|
||||||
if command -v nginx > /dev/null; then
|
if command -v nginx > /dev/null; then
|
||||||
if [ -d Applications ] && [ -d /System ]; then
|
if [ -d Applications ] && [ -d /System ]; then
|
||||||
|
### macOS
|
||||||
logg info 'Skipping installation of NGINX Amplify because macOS is not supported'
|
logg info 'Skipping installation of NGINX Amplify because macOS is not supported'
|
||||||
|
NGINX_CONFIG_DIR=/usr/local/etc/nginx
|
||||||
else
|
else
|
||||||
|
### Linux
|
||||||
|
NGINX_CONFIG_DIR=/etc/nginx
|
||||||
logg info 'Downloading the NGINX Amplify installer script'
|
logg info 'Downloading the NGINX Amplify installer script'
|
||||||
TMP="$(mktemp)"
|
TMP="$(mktemp)"
|
||||||
curl -sSL https://github.com/nginxinc/nginx-amplify-agent/raw/master/packages/install.sh > "$TMP"
|
curl -sSL https://github.com/nginxinc/nginx-amplify-agent/raw/master/packages/install.sh > "$TMP"
|
||||||
logg info 'Running the NGINX Amplify setup script'
|
logg info 'Running the NGINX Amplify setup script'
|
||||||
API_KEY="{{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "NGINX_AMPLIFY_API_KEY")) }}{{- includeTemplate "secrets/NGINX_AMPLIFY_API_KEY" | decrypt | trim -}}{{ else }}{{- env "NGINX_AMPLIFY_API_KEY" -}}{{ end }}" sh "$TMP"
|
API_KEY="{{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "NGINX_AMPLIFY_API_KEY")) }}{{- includeTemplate "secrets/NGINX_AMPLIFY_API_KEY" | decrypt | trim -}}{{ else }}{{- env "NGINX_AMPLIFY_API_KEY" -}}{{ end }}" sh "$TMP"
|
||||||
fi
|
fi
|
||||||
|
logg info "Ensuring $NGINX_CONFIG_DIR is present" && sudo mkdir -p "$NGINX_CONFIG_DIR"
|
||||||
|
logg info "Copying configuration files from $HOME/.local/etc/nginx to $NGINX_CONFIG_DIR"
|
||||||
|
sudo rsync -av "$HOME/.local/etc/nginx" "$NGINX_CONFIG_DIR"
|
||||||
|
if [ -d /Applications ] && [ -d /System ]; then
|
||||||
|
### macOS
|
||||||
|
if [ -d "${HOMEBREW_PREFIX:-/opt/homebrew}/etc/nginx" ] && [ ! -L "${HOMEBREW_PREFIX:-/opt/homebrew}/etc/nginx" ]; then
|
||||||
|
logg info "Removing directory at ${HOMEBREW_PREFIX:-/opt/homebrew}/etc/nginx"
|
||||||
|
sudo rm -rf "{HOMEBREW_PREFIX:-/opt/homebrew}/etc/nginx"
|
||||||
|
logg info "Symlinking /usr/local/etc/nginx to ${HOMEBREW_PREFIX:-/opt/homebrew}/etc/nginx"
|
||||||
|
ln -s /usr/local/etc/nginx "${HOMEBREW_PREFIX:-/opt/homebrew}/etc/nginx"
|
||||||
|
else
|
||||||
|
logg info "Skipping symlinking of /usr/local/etc/nginx to ${HOMEBREW_PREFIX:-/opt/homebrew}/etc/nginx because directory symlink already appears to be there"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -7259,6 +7259,8 @@ softwarePackages:
|
||||||
_desc: It also generates sites-enabled proxies using YML configurations. Easter eggs included. [Nginx](https://www.nginx.com/), stylized as NGINX, nginx or NginX, is a web server that can also be used as a reverse proxy, load balancer, mail proxy and HTTP cache. The software was created by Igor Sysoev and publicly released in 2004. Nginx is free and open-source software, released under the terms of the 2-clause BSD license.
|
_desc: It also generates sites-enabled proxies using YML configurations. Easter eggs included. [Nginx](https://www.nginx.com/), stylized as NGINX, nginx or NginX, is a web server that can also be used as a reverse proxy, load balancer, mail proxy and HTTP cache. The software was created by Igor Sysoev and publicly released in 2004. Nginx is free and open-source software, released under the terms of the 2-clause BSD license.
|
||||||
_docs: https://nginx.org/en/docs/
|
_docs: https://nginx.org/en/docs/
|
||||||
_github: https://github.com/nginx/nginx
|
_github: https://github.com/nginx/nginx
|
||||||
|
_groups:
|
||||||
|
- www-data
|
||||||
_home: https://nginx.org/
|
_home: https://nginx.org/
|
||||||
_name: NGINX
|
_name: NGINX
|
||||||
_ports:
|
_ports:
|
||||||
|
@ -7269,7 +7271,6 @@ softwarePackages:
|
||||||
_service: nginx
|
_service: nginx
|
||||||
_serviceEnabled: true
|
_serviceEnabled: true
|
||||||
_short: "nginx is a popular open-source web server known for its high performance, stability, and scalability. "
|
_short: "nginx is a popular open-source web server known for its high performance, stability, and scalability. "
|
||||||
_todo: Check out /opt/homebrew/etc/nginx/nginx.conf / nginx/servers
|
|
||||||
ansible: professormanhattan.nginx
|
ansible: professormanhattan.nginx
|
||||||
apt: nginx
|
apt: nginx
|
||||||
brew: nginx
|
brew: nginx
|
||||||
|
|
Loading…
Reference in a new issue