diff --git a/bitnami/appsmith/1/debian-11/Dockerfile b/bitnami/appsmith/1/debian-11/Dockerfile index fe392012d32d..2391cbc7533d 100644 --- a/bitnami/appsmith/1/debian-11/Dockerfile +++ b/bitnami/appsmith/1/debian-11/Dockerfile @@ -5,7 +5,7 @@ ARG TARGETARCH LABEL org.opencontainers.image.authors="https://bitnami.com/contact" \ org.opencontainers.image.description="Application packaged by Bitnami" \ org.opencontainers.image.licenses="Apache-2.0" \ - org.opencontainers.image.ref.name="1.9.4-debian-11-r0" \ + org.opencontainers.image.ref.name="1.9.4-debian-11-r1" \ org.opencontainers.image.source="https://github.com/bitnami/containers/tree/main/bitnami/appsmith" \ org.opencontainers.image.title="appsmith" \ org.opencontainers.image.vendor="VMware, Inc." \ diff --git a/bitnami/appsmith/1/debian-11/rootfs/opt/bitnami/scripts/appsmith/postunpack.sh b/bitnami/appsmith/1/debian-11/rootfs/opt/bitnami/scripts/appsmith/postunpack.sh index 6c93a81d6b85..1e93aea42a7c 100755 --- a/bitnami/appsmith/1/debian-11/rootfs/opt/bitnami/scripts/appsmith/postunpack.sh +++ b/bitnami/appsmith/1/debian-11/rootfs/opt/bitnami/scripts/appsmith/postunpack.sh @@ -32,70 +32,6 @@ done bash "${APPSMITH_BASE_DIR}/templates/docker.env.sh" "" "" "" "" "" >"${APPSMITH_CONF_FILE}" chmod -R g+rwX "${APPSMITH_CONF_FILE}" -# Nginx configuration, based on upstream nginx configuration but removing hardcoded references to localhost -# https://github.com/appsmithorg/appsmith/blob/release/deploy/docker/templates/nginx/nginx-app-http.conf.template.sh#L102 -ensure_web_server_app_configuration_exists "appsmith" \ - --document-root /opt/bitnami/appsmith/editor \ - --http-port "$APPSMITH_UI_HTTP_PORT" \ - --https-port "$APPSMITH_UI_HTTPS_PORT" \ - --nginx-external-configuration $' -map $http_x_forwarded_proto $origin_scheme { - default $http_x_forwarded_proto; - \'\' $scheme; -} - -map $http_x_forwarded_host $origin_host { - default $http_x_forwarded_host; - \'\' $host; -} -' \ - --nginx-additional-configuration " -client_max_body_size 100m; - -gzip on; -gzip_types *; - -server_tokens off; -index index.html index.htm; -error_page 404 /; - -# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors -add_header Content-Security-Policy \"frame-ancestors 'self' *\"; - -proxy_set_header X-Forwarded-Proto \$origin_scheme; -proxy_set_header X-Forwarded-Host \$origin_host; - -location / { - try_files \$uri /index.html =404; -} - -location /api { - proxy_set_header X-Forwarded-Proto \$scheme; - proxy_set_header X-Forwarded-Host \$host; - proxy_pass http://${APPSMITH_API_HOST}:${APPSMITH_API_PORT}; -} - -location /oauth2 { - proxy_set_header X-Forwarded-Proto \$scheme; - proxy_set_header X-Forwarded-Host \$host; - proxy_pass http://${APPSMITH_API_HOST}:${APPSMITH_API_PORT}; -} - -location /login { - proxy_set_header X-Forwarded-Proto \$scheme; - proxy_set_header X-Forwarded-Host \$host; - proxy_pass http://${APPSMITH_API_HOST}:${APPSMITH_API_PORT}; -} - -location /rts { - proxy_pass http://${APPSMITH_RTS_HOST}:${APPSMITH_RTS_PORT}; - proxy_http_version 1.1; - proxy_set_header Host \$host; - proxy_set_header Connection 'upgrade'; - proxy_set_header Upgrade \$http_upgrade; -} -" - # Add symlinks to the default paths to make a similar UX as the upstream Appsmith container # https://github.com/appsmithorg/appsmith/blob/release/Dockerfile#L6 ln -s "${APPSMITH_BASE_DIR}" "/opt/appsmith" diff --git a/bitnami/appsmith/1/debian-11/rootfs/opt/bitnami/scripts/appsmith/setup.sh b/bitnami/appsmith/1/debian-11/rootfs/opt/bitnami/scripts/appsmith/setup.sh index 6c8b1eff544c..32979720d6a0 100755 --- a/bitnami/appsmith/1/debian-11/rootfs/opt/bitnami/scripts/appsmith/setup.sh +++ b/bitnami/appsmith/1/debian-11/rootfs/opt/bitnami/scripts/appsmith/setup.sh @@ -25,4 +25,68 @@ trap "appsmith_backend_stop" EXIT # Ensure 'appsmith' user exists when running as 'root' am_i_root && ensure_user_exists "$APPSMITH_DAEMON_USER" --group "$APPSMITH_DAEMON_GROUP" +# Nginx configuration, based on upstream nginx configuration but removing hardcoded references to localhost +# https://github.com/appsmithorg/appsmith/blob/release/deploy/docker/templates/nginx/nginx-app-http.conf.template.sh#L102 +ensure_web_server_app_configuration_exists "appsmith" \ + --document-root /opt/bitnami/appsmith/editor \ + --http-port "$APPSMITH_UI_HTTP_PORT" \ + --https-port "$APPSMITH_UI_HTTPS_PORT" \ + --nginx-external-configuration $' +map $http_x_forwarded_proto $origin_scheme { + default $http_x_forwarded_proto; + \'\' $scheme; +} + +map $http_x_forwarded_host $origin_host { + default $http_x_forwarded_host; + \'\' $host; +} +' \ + --nginx-additional-configuration " +client_max_body_size 100m; + +gzip on; +gzip_types *; + +server_tokens off; +index index.html index.htm; +error_page 404 /; + +# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors +add_header Content-Security-Policy \"frame-ancestors 'self' *\"; + +proxy_set_header X-Forwarded-Proto \$origin_scheme; +proxy_set_header X-Forwarded-Host \$origin_host; + +location / { + try_files \$uri /index.html =404; +} + +location /api { + proxy_set_header X-Forwarded-Proto \$scheme; + proxy_set_header X-Forwarded-Host \$host; + proxy_pass http://${APPSMITH_API_HOST}:${APPSMITH_API_PORT}; +} + +location /oauth2 { + proxy_set_header X-Forwarded-Proto \$scheme; + proxy_set_header X-Forwarded-Host \$host; + proxy_pass http://${APPSMITH_API_HOST}:${APPSMITH_API_PORT}; +} + +location /login { + proxy_set_header X-Forwarded-Proto \$scheme; + proxy_set_header X-Forwarded-Host \$host; + proxy_pass http://${APPSMITH_API_HOST}:${APPSMITH_API_PORT}; +} + +location /rts { + proxy_pass http://${APPSMITH_RTS_HOST}:${APPSMITH_RTS_PORT}; + proxy_http_version 1.1; + proxy_set_header Host \$host; + proxy_set_header Connection 'upgrade'; + proxy_set_header Upgrade \$http_upgrade; +} +" + appsmith_initialize