Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP][#3446] Remove nginx default.conf SP 0.93.0 -> 0.95.0 migration code #3455

Merged
merged 2 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions ui/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ FROM nginx:mainline-alpine3.18

COPY dist/streampipes/ui/browser/ /usr/share/nginx/html/

#Store a copy to have a version if the other is hidden in the volume. Required for migration from 0.93.0 to 0.95.0. Could be removed after the release of 0.95.0.
RUN mkdir -p /etc/opt/nginx/
RUN chown -R nginx:nginx /etc/opt/nginx/
COPY nginx_config/default.conf.template /etc/opt/nginx/default.conf.template
RUN chown -R nginx:nginx /etc/opt/nginx/default.conf.template



RUN chown -R nginx:nginx /usr/share/nginx/html && chmod -R 755 /usr/share/nginx/html && \
chown -R nginx:nginx /var/cache/nginx && \
chown -R nginx:nginx /var/log/nginx && \
Expand Down
17 changes: 1 addition & 16 deletions ui/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,8 @@ if [ ! -z "$NGINX_SSL" ] && [ "$NGINX_SSL" = "true" ]; then
rm /etc/nginx/conf.d/default.conf
ln -s /app/nginx-confs/ssl.conf /etc/nginx/conf.d/default.conf
elif [ ! -z "$SP_HTTP_SERVER_ADAPTER_ENDPOINT" ]; then

if [ ! -f /etc/nginx/conf.d/default.conf ]
then
DEFAULT_CONF_BACKUP="/etc/nginx/conf.d/default.conf_$(date +%s).bak"
echo "Create backup of old configuration $DEFAULT_CONF_BACKUP"
cp /etc/nginx/conf.d/default.conf $DEFAULT_CONF_BACKUP
fi

# Required for migration from 0.93.0 to 0.95.0. Could be removed after the release of 0.95.0.
if [ ! -f /etc/nginx/conf.d/default.conf.template ]
then
echo "Migrate to new nginx template"
cp /etc/opt/nginx/default.conf.template /etc/nginx/conf.d/default.conf.template
fi

rm -f /etc/nginx/conf.d/default.conf
envsubst '\$SP_HTTP_SERVER_ADAPTER_ENDPOINT' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf
fi

exec "$@"
exec "$@"
Loading