diff --git a/haini.sh b/haini.sh index 6e832b5..f5ee36c 100755 --- a/haini.sh +++ b/haini.sh @@ -2,6 +2,8 @@ # Fallar ante cualquier error set -e +DIR="$(realpath "$0" | xargs -r dirname)" + # Por ahora sólo soportamos x86_64 uname -m | grep -q x86_64 || exit 1 @@ -30,7 +32,6 @@ correr() { bwrap \ --unshare-user-try \ --unshare-ipc \ - --unshare-pid \ --unshare-uts \ --unshare-cgroup-try \ --bind "$ENTORNO" / \ @@ -75,11 +76,19 @@ crear_entorno() { tzdata bash ffmpeg vips file git make \ ruby ruby-bundler ruby-json ruby-bigdecimal ruby-irb ruby-rake \ nodejs yarn \ - gnutls-utils nghttp2 \ + gnutls-utils nginx \ less" # Habilitar la instalación de gemas binarias sed -re "s/#(@platforms = )/\1/" -i "$ENTORNO/usr/lib/ruby/2.7.0/rubygems.rb" + + # Deshabilitar el usuario de nginx + sed -re "/user nginx/d" -i "$ENTORNO/etc/nginx/nginx.conf" + + # Crear el directorio del PID + install -dm 755 "$ENTORNO/run/nginx" + # Instalar la configuración + install -m 640 "$DIR/nginx.conf" "$ENTORNO/etc/nginx/http.d/default.conf" } crear_entorno diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..8d2082f --- /dev/null +++ b/nginx.conf @@ -0,0 +1,21 @@ +server { + server_name ~(?.+).sutty.local; + listen 4000 ssl http2 default_server; + + ssl_certificate /Sutty/sutty.local/domain/sutty.local.crt; + ssl_certificate_key /Sutty/sutty.local/domain/sutty.local.key; + + root /Sutty/$domain-jekyll-theme/_site; + + add_header Cache-Control "no-store; max-age=0"; + + location /assets/js/ { + proxy_pass http://127.0.0.1:65001; + } + + location /sockjs-node/ { + proxy_set_header Connection "upgrade"; + proxy_set_header Upgrade $http_upgrade; + proxy_pass http://127.0.0.1:65001; + } +}