Skip to content

Commit

Permalink
feature/DBC22-1655: Remove auth from beta site
Browse files Browse the repository at this point in the history
  • Loading branch information
wmuldergov authored and fatbird committed Feb 14, 2024
1 parent ce71c05 commit fda76a6
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 20 deletions.
7 changes: 0 additions & 7 deletions compose/frontend/StaticBuild
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,6 @@ COPY ./compose/frontend/default.conf /etc/nginx/conf.d
COPY --from=buildnode /app/build /usr/share/nginx/html
RUN chmod -R 777 /run /var/log/nginx /var/cache/nginx /usr/share/nginx/html/static/js

#FOUR LINES BELOW ARE TEMPORARY FOR THE PRIVATE BETA
RUN mkdir -p /etc/apache2
RUN touch /etc/apache2/.htpasswd
RUN chmod -R 777 /etc/apache2/.htpasswd
RUN chmod -R 777 /etc/nginx/conf.d


ARG DEBUG_BUILD=false

# Add debugging tools into builds if enabled
Expand Down
2 changes: 0 additions & 2 deletions compose/frontend/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ server {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
auth_basic "Beta Site";
auth_basic_user_file /etc/apache2/.htpasswd;
}

proxy_cache cache;
Expand Down
12 changes: 1 addition & 11 deletions compose/frontend/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,4 @@ echo -e "window.ROUTE_PLANNER_KEY='${REACT_APP_ROUTE_PLANNER_KEY}';" >> $MAIN
echo -e "window.REPLAY_THE_DAY='${REACT_APP_REPLAY_THE_DAY}';" >> $MAIN

# Set the environment to be used for caching django content
sed -i "s~{ENVIRONMENT}~$ENVIRONMENT~g" /etc/nginx/conf.d/default.conf

#FOLLOWING SECTION IS TEMPORARY FOR THE PRIVATE BETA
# Check if $ENVIRONMENT is not set to "prod". If it is prod we want to keep these lines
if [ "$ENVIRONMENT" != "prod" ]; then
# Remove the specified lines from default.conf
sed -i '/auth_basic "Beta Site";/d' /etc/nginx/conf.d/default.conf
sed -i '/auth_basic_user_file \/etc\/apache2\/.htpasswd;/d' /etc/nginx/conf.d/default.conf
fi
#Copy the content of the secret into the .htpasswd file.
echo "$TEMP_AUTH_SECRET" >> /etc/apache2/.htpasswd
sed -i "s~{ENVIRONMENT}~$ENVIRONMENT~g" /etc/nginx/conf.d/default.conf

0 comments on commit fda76a6

Please sign in to comment.