Skip to content

Commit

Permalink
revert change on docker-compose file
Browse files Browse the repository at this point in the history
  • Loading branch information
raftmsohani committed Oct 17, 2023
1 parent 0b8f794 commit adcd482
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 8 deletions.
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions scripts/deploy-backend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,21 @@ set_cf_envs()
"REDIS_URI"
)



echo "Setting environment variables for $CGAPPNAME_BACKEND"

for var_name in ${var_list[@]}; do
# Intentionally unsetting variable if empty
if [[ -z "${!var_name}" ]]; then
echo "WARNING: Empty value for $var_name. It will now be unset."
cf_cmd="cf unset-env $CGAPPNAME_BACKEND $var_name ${!var_name}"
$cf_cmd
#cf_cmd="cf unset-env $CGAPPNAME_BACKEND $var_name ${!var_name}"

#$cf_cmd
continue
fi

cf_cmd="cf set-env $CGAPPNAME_BACKEND $var_name ${!var_name}"
#cf_cmd="cf set-env $CGAPPNAME_BACKEND $var_name ${!var_name}"
echo "Setting var : $var_name"
$cf_cmd
done
Expand All @@ -86,7 +89,7 @@ update_backend()
cd tdrs-backend || exit
if [ "$1" = "rolling" ] ; then
set_cf_envs

cf set-env "$CGAPPNAME_BACKEND" DJANGO_SU_NAME "[email protected]"
# Do a zero downtime deploy. This requires enough memory for
# two apps to exist in the org/space at one time.
cf push "$CGAPPNAME_BACKEND" --no-route -f manifest.buildpack.yml -t 180 --strategy rolling || exit 1
Expand Down
10 changes: 9 additions & 1 deletion tdrs-backend/tdpservice/settings/cloudgov.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,14 @@ class Development(CloudGov):

# https://docs.djangoproject.com/en/2.0/ref/settings/#allowed-hosts
ALLOWED_HOSTS = ['.app.cloud.gov']

CORS_ORIGIN_ALLOW_ALL = False
CORS_ALLOWED_ORIGINS = ['https://*.app.cloud.gov']
CORS_ALLOW_CREDENTIALS = True
CORS_ALLOW_METHODS = (
"GET",
"PATCH",
"POST",
)

class Staging(CloudGov):
"""Settings for applications deployed in the Cloud.gov staging space."""
Expand Down Expand Up @@ -186,3 +193,4 @@ class Production(CloudGov):

# CORS allowed origins
CORS_ALLOWED_ORIGINS = ['https://tanfdata.acf.hhs.gov']
CORS_ORIGIN_ALLOW_ALL = False
24 changes: 24 additions & 0 deletions tdrs-frontend/.env.development
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,27 @@ REACT_APP_EVENT_THROTTLE_TIME=60000
# @import '../../theme/_global.scss';
# Without the variable, only the relative import is possible
SASS_PATH=node_modules:src
REACT_APP_BACKEND_URL=https://tdp-frontend-raft.app.cloud.gov/v1
REACT_APP_FRONTEND_URL=https://tdp-frontend-raft.app.cloud.gov
REACT_APP_BACKEND_HOST=https://tdp-frontend-raft.app.cloud.gov
REACT_APP_CF_SPACE=tanf-dev
REACT_APP_BACKEND_URL=https://tdp-frontend-raft.app.cloud.gov/v1
REACT_APP_FRONTEND_URL=https://tdp-frontend-raft.app.cloud.gov
REACT_APP_BACKEND_HOST=https://tdp-frontend-raft.app.cloud.gov
REACT_APP_CF_SPACE=tanf-dev
REACT_APP_BACKEND_URL=https://tdp-frontend-raft.app.cloud.gov/v1
REACT_APP_FRONTEND_URL=https://tdp-frontend-raft.app.cloud.gov
REACT_APP_BACKEND_HOST=https://tdp-frontend-raft.app.cloud.gov
REACT_APP_CF_SPACE=tanf-dev
REACT_APP_BACKEND_URL=https://tdp-frontend-raft.app.cloud.gov/v1
REACT_APP_FRONTEND_URL=https://tdp-frontend-raft.app.cloud.gov
REACT_APP_BACKEND_HOST=https://tdp-frontend-raft.app.cloud.gov
REACT_APP_CF_SPACE=tanf-dev
REACT_APP_BACKEND_URL=https://tdp-frontend-raft.app.cloud.gov/v1
REACT_APP_FRONTEND_URL=https://tdp-frontend-raft.app.cloud.gov
REACT_APP_BACKEND_HOST=https://tdp-frontend-raft.app.cloud.gov
REACT_APP_CF_SPACE=tanf-dev
REACT_APP_BACKEND_URL=https://tdp-frontend-raft.app.cloud.gov/v1
REACT_APP_FRONTEND_URL=https://tdp-frontend-raft.app.cloud.gov
REACT_APP_BACKEND_HOST=https://tdp-frontend-raft.app.cloud.gov
REACT_APP_CF_SPACE=tanf-dev
3 changes: 1 addition & 2 deletions tdrs-frontend/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ services:
zaproxy:
image: owasp/zap2docker-stable:2.13.0
container_name: zap-scan
command: sleep 13600
command: sleep 3600
ports:
- 8090:8090
networks:
- local
volumes:
- ../scripts:/zap/scripts/:rw
- ./reports:/zap/wrk/:rw
- ../scripts/zap-hook.py:/zap/scripts/zap-hook.py:ro
tdp-frontend:
Expand Down
5 changes: 4 additions & 1 deletion tdrs-frontend/nginx/cloud.gov/locations.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ location ~ ^/(v1|admin|static/admin|swagger|redocs) {
proxy_buffer_size 4k;
proxy_temp_file_write_size 64k;

limit_except GET HEAD POST { deny all;
}

add_header Access-Control-Allow-Origin 's3-us-gov-west-1.amazonaws.com';
}

if ($request_method ~ ^(PATCH|TRACE)$) {
if ($request_method ~ ^(PATCH|TRACE|OPTION)$) {
return 405;
}

Expand Down

0 comments on commit adcd482

Please sign in to comment.