Skip to content

Commit 35b2d51

Browse files
authored
Fix Rust widget renderer modal button initialization (#1924)
* Production release: Fix CX Collections export CSV error (#1911) * Add Cargo caching and library linkage verification to CircleCI - Add restore/save cache for Cargo target and registry directories - Use Cargo.lock checksum for cache key to ensure proper invalidation - Verify Rust library linkage with ldd before deploy - Fail fast if library has unresolved dependencies - Should significantly speed up Rust builds on subsequent runs * Fix cx_collections export_csv 500 error - Handle nil organization in User#cx_collections to prevent NoMethodError - Add eager loading for service_provider.organization and cx_collection_details - Add missing database indexes on cx_collections, cx_collection_details, cx_responses Fixes the 'We're sorry, but something went wrong' error at: /admin/cx_collections/export_csv * Update schema.rb with new indexes for CircleCI * Update schema version to include new migration * Add tests for User#cx_collections method * fix: use git URL for rust buildpack in production manifest * fix: correct redis service name in production manifest * Release: WidgetRenderer load fix (#1914) * Add Cargo caching and library linkage verification to CircleCI - Add restore/save cache for Cargo target and registry directories - Use Cargo.lock checksum for cache key to ensure proper invalidation - Verify Rust library linkage with ldd before deploy - Fail fast if library has unresolved dependencies - Should significantly speed up Rust builds on subsequent runs * Fix cx_collections export_csv 500 error - Handle nil organization in User#cx_collections to prevent NoMethodError - Add eager loading for service_provider.organization and cx_collection_details - Add missing database indexes on cx_collections, cx_collection_details, cx_responses Fixes the 'We're sorry, but something went wrong' error at: /admin/cx_collections/export_csv * Update schema.rb with new indexes for CircleCI * Update schema version to include new migration * Add tests for User#cx_collections method * Fix widget renderer load when native lib missing (#1913) * Fix User#cx_collections specs for Service owner (#1915) (#1917) * Release: set prod disk quota to 2G (#1919) * Add Cargo caching and library linkage verification to CircleCI - Add restore/save cache for Cargo target and registry directories - Use Cargo.lock checksum for cache key to ensure proper invalidation - Verify Rust library linkage with ldd before deploy - Fail fast if library has unresolved dependencies - Should significantly speed up Rust builds on subsequent runs * Fix cx_collections export_csv 500 error - Handle nil organization in User#cx_collections to prevent NoMethodError - Add eager loading for service_provider.organization and cx_collection_details - Add missing database indexes on cx_collections, cx_collection_details, cx_responses Fixes the 'We're sorry, but something went wrong' error at: /admin/cx_collections/export_csv * Update schema.rb with new indexes for CircleCI * Update schema version to include new migration * Add tests for User#cx_collections method * Fix widget renderer load when native lib missing (#1913) * Fix User#cx_collections specs for Service owner (#1915) * Fix production manifest for rust buildpack (#1918) * fix: remove empty secret keys from manifest to prevent wiping env vars on deploy Empty values in the manifest were overwriting secrets set via cf set-env. Secrets should only be managed via cf set-env, not in the manifest. * fix: Use fba-usa-modal class for USWDS Modal compatibility * fix: Add CSS support to Rust widget renderer to fix modal positioning * fix: Use parent_id instead of parent in Organization factory * Increase Cloud Foundry start timeout to 180s and fix Sidekiq health check type * Fix Sidekiq crash and optimize Rust build script - Added rust-buildpack to Sidekiq deployment - Updated build_widget_renderer.sh to handle workspace paths and avoid rebuilds - Added rust-buildpack to touchpoints-demo manifest * build(cf): simplify widget_renderer build script and ignore rules Refactors the `.profile.d/build_widget_renderer.sh` script to remove complex logic for locating Rust dependencies, building from source, and checking library linkage. The script now focuses solely on setting `LD_LIBRARY_PATH` and ensuring the prebuilt `libwidget_renderer.so` is in the correct location. Additionally, updates `.cfignore` to exclude the `target/` directory and specific release artifacts, while ensuring the root `libwidget_renderer.so` is preserved. This suggests a shift towards deploying a precompiled binary rather than building the Rust extension during the Cloud Foundry deployment process. * Increase deployment timeout and add widget_renderer fallback to resolve startup crashes * fix(widget_renderer): restore LoadError and adjust app timeout - Re-enable raising `LoadError` in `widget_renderer.rb` when the native library is missing, removing the previous fallback log message. This ensures the application fails fast if the required extension is absent. - Reduce application timeout from 600 to 180 seconds in `touchpoints.yml` to better align with platform constraints or performance expectations. - Remove the hardcoded `WEB_CONCURRENCY: 1` environment variable from `touchpoints.yml`, allowing the buildpack or platform defaults to manage concurrency. * ci: increase deployment wait time and enable static files in dev - Increase the `max_wait` time in `.circleci/deploy.sh` from 600 to 800 seconds to prevent timeouts during longer deployment processes. - Update `config/environments/development.rb` to conditionally enable the public file server based on the `RAILS_SERVE_STATIC_FILES` environment variable, aligning development behavior with other environments when needed. * ci(deploy): increase timeouts and enable static file serving - Increase Cloud Foundry push timeout from 180s to 600s in deployment scripts and `touchpoints.yml` to prevent timeouts during startup. - Enable `RAILS_SERVE_STATIC_FILES` in production configuration and manifest to allow the application to serve precompiled assets directly. - Update `deploy.sh` to accept a manifest path argument and refactor retry logic for better error handling. * Decouple db:migrate from deploy: migrations must be run separately to avoid CF 180s timeout * Add automated pre-deploy migrations via cf run-task to avoid 180s timeout during app start * Set health check type to process for sidekiq worker before rolling deploy * Fix sidekiq worker timeout: explicitly set to 180s before rolling deploy * Fix flaky logo upload test: add wait time to prevent Selenium stale element race condition * Fix cf set-health-check: use --invocation-timeout instead of --timeout * Fix Rack::Attack test: create actual form fixture to avoid 404 responses * Scale sidekiq worker to 1 instance during rolling deploy to avoid org memory quota exceeded * Stop sidekiq worker before push to free memory for staging (avoids org quota exceeded) * Fix cf run-task syntax: add --command flag for migrations * Skip WidgetRenderer load during migrations - library not built in task droplet * Fix Rack::Attack test: add valid submission params to avoid 400 errors * Temporarily disable pre-deploy migrations to unblock deployment * Fix widget_renderer initializer - use simpler skip detection logic * Fix deployment: restore db:migrate in manifest and enable migrations in deploy script * Revert migrations to start command - Rust library not available in cf tasks * Build Rust library at runtime in .profile.d script * Revert to working widget_renderer script that copies prebuilt library * Keep prebuilt Rust library during deployment to ensure correct linking with CF Ruby installation * Fix deploy-sidekiq.sh: remove explicit buildpack flags to avoid re-installing Rust - Remove -b flags from cf push in deploy-sidekiq.sh - Let CF auto-detect buildpacks from app metadata like deploy.sh does - Prevents unnecessary reinstallation of Rust during staging - Matches web deployment behavior for consistency * Fix touchpoints.yml: comment out buildpacks to prevent Rust reinstallation - Comment out explicit buildpacks in manifest - Let CF auto-detect buildpacks from app metadata - Prevents re-running supply phase (Rust installation) during deployment - Rust library already built in CircleCI via bundle install (gem extensions) - Matches deploy-sidekiq.sh approach for consistency * Fix flaky timing test in submission_digest mailer spec Use a single time_threshold let variable to ensure consistent timestamp comparison instead of calling days_ago.days.ago multiple times which can result in 1-second differences in CI environments. * Fix custom-button-modal USWDS initialization - Add try/catch error handling - Add conditional checks for fbaUswds methods - Initialize custom button element for custom-button-modal - Prevents modal from appearing visible at page bottom * Bump Cargo version to force Rust rebuild * Bump widget_renderer version to force Cargo rebuild * Force cargo clean before build to ensure recompilation * Bump widget_renderer gem version to 0.1.2 to force rebuild * Force Rust rebuild with BUILD_ID and version bump * Bump widget_renderer to 0.1.2 to force CF to rebuild native extension * Update Gemfile.lock for widget_renderer 0.1.2 * Add Rust library verification before CF push * Prioritize workspace-level Rust library and bump to 0.1.3 * Invalidate CircleCI cargo cache to force fresh Rust build * Fix Rust widget renderer modal button initialization The Rust widget renderer was missing the USWDS Modal initialization for the #fba-button element used in 'modal' delivery method forms. This caused the toast/feedback button to not open the modal when clicked, instead rendering the form inline at the bottom of the page. Added initialization for #fba-button to match the ERB template behavior in _fba.js.erb (lines 858-875). Fixes Zendesk ticket #37620 * Fix breaking changes from PR review 1. Fix modal_class prefix logic: Now respects load_css setting - When load_css=true: uses 'fba-usa-modal' prefix - When load_css=false: uses 'usa-modal' (no prefix) - Matches ERB template behavior in _fba.js.erb line 110 2. Fix CSS backtick escaping: Added escape for backticks in CSS - Prevents JavaScript syntax errors when CSS contains backticks - CSS is inserted into JS template literals using backticks 3. Remove expired certificate file: tmp_expired_login_gov_cert.pem - Certificate expired Aug 2023 - Added *.pem to .gitignore to prevent future accidental commits
1 parent bbcb0ac commit 35b2d51

29 files changed

Lines changed: 412 additions & 232 deletions

.cfignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@
3838
/public/packs-test
3939
/node_modules
4040

41-
# Ignore Rust build artifacts, but keep the prebuilt widget library
41+
# Ignore Rust build artifacts
4242
target/
4343
ext/widget_renderer/target/
44-
!ext/widget_renderer/target/
45-
!ext/widget_renderer/target/release/
46-
!ext/widget_renderer/target/release/libwidget_renderer.so
4744
!ext/widget_renderer/libwidget_renderer.so

.circleci/config.yml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ jobs:
5757
5858
- restore_cache:
5959
keys:
60-
- v1-cargo-{{ checksum "ext/widget_renderer/Cargo.lock" }}
61-
- v1-cargo-
60+
- v2-cargo-{{ checksum "ext/widget_renderer/Cargo.lock" }}
61+
- v2-cargo-
6262

6363
- run:
6464
name: Build widget renderer (Rust)
@@ -89,7 +89,7 @@ jobs:
8989
- ext/widget_renderer/target
9090
- ~/.cargo/registry
9191
- ~/.cargo/git
92-
key: v1-cargo-{{ checksum "ext/widget_renderer/Cargo.lock" }}
92+
key: v2-cargo-{{ checksum "ext/widget_renderer/Cargo.lock" }}
9393

9494
# Download and cache dependencies
9595
- restore_cache:
@@ -147,12 +147,11 @@ jobs:
147147
echo "Skipping Sidekiq deploy on parallel node ${CIRCLE_NODE_INDEX}"
148148
exit 0
149149
fi
150-
# Remove prebuilt Rust library - it must be built on CF with the correct Ruby paths
151-
# The library built on CircleCI links against /usr/local/lib/libruby.so.3.2
152-
# but on CF, Ruby is in /home/vcap/deps/*/ruby/lib/
153-
echo "Removing prebuilt Rust library (will be rebuilt on CF)..."
154-
rm -rf ext/widget_renderer/target/release/libwidget_renderer.so 2>/dev/null || true
155-
rm -f ext/widget_renderer/libwidget_renderer.so 2>/dev/null || true
150+
# Keep prebuilt Rust library - extconf.rb builds it during bundle install with correct paths
151+
# The library is built with rutie which properly links against the CF Ruby installation
152+
# echo "Removing prebuilt Rust library (will be rebuilt on CF)..."
153+
# rm -rf ext/widget_renderer/target/release/libwidget_renderer.so 2>/dev/null || true
154+
# rm -f ext/widget_renderer/libwidget_renderer.so 2>/dev/null || true
156155
./.circleci/deploy-sidekiq.sh
157156
no_output_timeout: 30m
158157

@@ -166,10 +165,10 @@ jobs:
166165
fi
167166
# Wait for Sidekiq deployment to complete before starting web deploy
168167
sleep 120
169-
# Remove prebuilt Rust library - it must be built on CF with the correct Ruby paths
170-
echo "Removing prebuilt Rust library (will be rebuilt on CF)..."
171-
rm -rf ext/widget_renderer/target/release/libwidget_renderer.so 2>/dev/null || true
172-
rm -f ext/widget_renderer/libwidget_renderer.so 2>/dev/null || true
168+
# Keep prebuilt Rust library - extconf.rb builds it during bundle install with correct paths
169+
# echo "Removing prebuilt Rust library (will be rebuilt on CF)..."
170+
# rm -rf ext/widget_renderer/target/release/libwidget_renderer.so 2>/dev/null || true
171+
# rm -f ext/widget_renderer/libwidget_renderer.so 2>/dev/null || true
173172
./.circleci/deploy.sh
174173
no_output_timeout: 30m
175174

.circleci/deploy-sidekiq.sh

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,43 @@ cf_push_with_retry() {
102102
# Wait for any in-progress deployment
103103
wait_for_deployment "$app_name"
104104

105+
# Update app to use 180s invocation timeout and process health check before rolling deploy
106+
echo "Updating health check configuration for $app_name..."
107+
cf set-health-check "$app_name" process --invocation-timeout 180 || true
108+
sleep 2
109+
110+
# Get current instance count and scale down to 1 to avoid memory quota issues during rolling deploy
111+
echo "Checking current instance count for $app_name..."
112+
local current_instances=$(cf app "$app_name" | grep "^instances:" | awk '{print $2}' | cut -d'/' -f2 || echo "1")
113+
echo "Current instances: $current_instances"
114+
115+
if [ "$current_instances" -gt 1 ]; then
116+
echo "Scaling down to 1 instance to free memory for rolling deploy..."
117+
cf scale "$app_name" -i 1 || true
118+
sleep 5
119+
fi
120+
105121
for i in $(seq 1 $max_retries); do
106122
echo "Attempt $i of $max_retries to push $app_name..."
107-
if cf push "$app_name" --strategy rolling; then
123+
124+
# Stop the app first to free memory for staging
125+
echo "Stopping $app_name to free memory for staging..."
126+
cf stop "$app_name" || true
127+
sleep 5
128+
129+
# Push without rolling strategy (direct replacement since we stopped it)
130+
# Let CF auto-detect buildpacks to avoid re-running supply phase (Rust already built in CircleCI)
131+
if cf push "$app_name" \
132+
-t 180 \
133+
--health-check-type process; then
108134
echo "Successfully pushed $app_name"
135+
136+
# Scale back up to original instance count
137+
if [ "$current_instances" -gt 1 ]; then
138+
echo "Scaling up to $current_instances instances..."
139+
cf scale "$app_name" -i "$current_instances" || true
140+
fi
141+
109142
release_deploy_lock "$app_name"
110143
trap - EXIT # Clear the trap
111144
return 0
@@ -120,6 +153,12 @@ cf_push_with_retry() {
120153
fi
121154
done
122155

156+
# If we failed, try to scale back up anyway
157+
if [ "$current_instances" -gt 1 ]; then
158+
echo "Deploy failed, attempting to scale back up to $current_instances instances..."
159+
cf scale "$app_name" -i "$current_instances" || true
160+
fi
161+
123162
release_deploy_lock "$app_name"
124163
trap - EXIT # Clear the trap
125164
echo "Failed to push $app_name after $max_retries attempts"
@@ -132,6 +171,8 @@ then
132171
# Log into CF and push
133172
cf login -a $CF_API_ENDPOINT -u $CF_PRODUCTION_SPACE_DEPLOYER_USERNAME -p $CF_PRODUCTION_SPACE_DEPLOYER_PASSWORD -o $CF_ORG -s prod
134173
echo "PUSHING to PRODUCTION..."
174+
echo "Syncing Login.gov environment variables..."
175+
./.circleci/sync-login-gov-env.sh touchpoints-production-sidekiq-worker
135176
cf_push_with_retry touchpoints-production-sidekiq-worker
136177
echo "Push to Production Complete."
137178
else

.circleci/deploy.sh

Lines changed: 101 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ release_deploy_lock() {
6363
# Wait for any in-progress deployments to complete before starting
6464
wait_for_deployment() {
6565
local app_name="$1"
66-
local max_wait=600 # 10 minutes max
66+
local max_wait=800 # 13 minutes and 20 seconds max
6767
local wait_interval=15
6868
local waited=0
6969

@@ -87,12 +87,87 @@ wait_for_deployment() {
8787
return 0
8888
}
8989

90+
# Run migrations as a CF task and wait for completion
91+
run_migrations() {
92+
local app_name="$1"
93+
local max_wait=1800 # 30 minutes max for migrations
94+
local wait_interval=10
95+
local waited=0
96+
97+
echo "Running database migrations for $app_name..."
98+
99+
# Start migration task
100+
local task_output=$(cf run-task "$app_name" --command "bundle exec rails db:migrate" --name "pre-deploy-migrations" 2>&1)
101+
echo "$task_output"
102+
103+
# Extract task ID from output
104+
local task_id=$(echo "$task_output" | grep -oE 'task id:[[:space:]]+[0-9]+' | grep -oE '[0-9]+' || echo "")
105+
106+
if [ -z "$task_id" ]; then
107+
echo "Warning: Could not determine task ID, checking tasks list..."
108+
sleep 5
109+
task_id=$(cf tasks "$app_name" | grep "pre-deploy-migrations" | grep "RUNNING" | head -1 | awk '{print $1}')
110+
fi
111+
112+
if [ -z "$task_id" ]; then
113+
echo "Error: Failed to start migration task"
114+
return 1
115+
fi
116+
117+
echo "Migration task started with ID: $task_id"
118+
echo "Waiting for migrations to complete..."
119+
120+
# Wait for task to complete
121+
while [ $waited -lt $max_wait ]; do
122+
local task_state=$(cf tasks "$app_name" | grep "^$task_id " | awk '{print $3}')
123+
124+
if [ "$task_state" == "SUCCEEDED" ]; then
125+
echo "✓ Migrations completed successfully"
126+
return 0
127+
elif [ "$task_state" == "FAILED" ]; then
128+
echo "✗ Migration task failed. Checking logs..."
129+
cf logs "$app_name" --recent | grep "pre-deploy-migrations" | tail -50
130+
return 1
131+
fi
132+
133+
if [ $((waited % 30)) -eq 0 ]; then
134+
echo "Migration task still running (state: $task_state, waited ${waited}s)..."
135+
fi
136+
137+
sleep $wait_interval
138+
waited=$((waited + wait_interval))
139+
done
140+
141+
echo "Error: Migration task did not complete within ${max_wait}s"
142+
cf logs "$app_name" --recent | grep "pre-deploy-migrations" | tail -50
143+
return 1
144+
}
145+
90146
# Retry function to handle staging and deployment conflicts
91147
cf_push_with_retry() {
92148
local app_name="$1"
149+
local manifest_path="${2:-}"
150+
local run_migrations="${3:-false}"
93151
local max_retries=5
94152
local retry_delay=90
95153

154+
# Run migrations first if requested
155+
if [ "$run_migrations" == "true" ]; then
156+
if ! run_migrations "$app_name"; then
157+
echo "Error: Migrations failed, aborting deployment"
158+
return 1
159+
fi
160+
fi
161+
162+
# Ensure CircleCI-built Rust library is present
163+
if [ -f "ext/widget_renderer/target/release/libwidget_renderer.so" ]; then
164+
echo "CircleCI-built Rust library found, will be included in deployment"
165+
file ext/widget_renderer/target/release/libwidget_renderer.so
166+
readelf -n ext/widget_renderer/target/release/libwidget_renderer.so | grep "Build ID" || true
167+
else
168+
echo "WARNING: No CircleCI-built Rust library found at ext/widget_renderer/target/release/libwidget_renderer.so"
169+
fi
170+
96171
# Acquire lock first
97172
acquire_deploy_lock "$app_name"
98173

@@ -104,19 +179,30 @@ cf_push_with_retry() {
104179

105180
for i in $(seq 1 $max_retries); do
106181
echo "Attempt $i of $max_retries to push $app_name..."
107-
if cf push "$app_name" --strategy rolling; then
182+
local exit_code=0
183+
184+
set +e
185+
if [ -n "$manifest_path" ]; then
186+
echo "Using manifest: $manifest_path"
187+
cf push "$app_name" -f "$manifest_path" --strategy rolling -t 180
188+
else
189+
cf push "$app_name" --strategy rolling -t 180
190+
fi
191+
exit_code=$?
192+
set -e
193+
194+
if [ $exit_code -eq 0 ]; then
108195
echo "Successfully pushed $app_name"
109196
release_deploy_lock "$app_name"
110197
trap - EXIT # Clear the trap
111198
return 0
112-
else
113-
local exit_code=$?
114-
if [ $i -lt $max_retries ]; then
115-
echo "Push failed (exit code: $exit_code), waiting ${retry_delay}s before retry..."
116-
sleep $retry_delay
117-
# Re-check for in-progress deployments before retrying
118-
wait_for_deployment "$app_name"
119-
fi
199+
fi
200+
201+
if [ $i -lt $max_retries ]; then
202+
echo "Push failed (exit code: $exit_code), waiting ${retry_delay}s before retry..."
203+
sleep $retry_delay
204+
# Re-check for in-progress deployments before retrying
205+
wait_for_deployment "$app_name"
120206
fi
121207
done
122208

@@ -132,7 +218,9 @@ then
132218
# Log into CF and push
133219
cf login -a $CF_API_ENDPOINT -u $CF_PRODUCTION_SPACE_DEPLOYER_USERNAME -p $CF_PRODUCTION_SPACE_DEPLOYER_PASSWORD -o $CF_ORG -s prod
134220
echo "PUSHING web servers to Production..."
135-
cf_push_with_retry touchpoints
221+
echo "Syncing Login.gov environment variables..."
222+
./.circleci/sync-login-gov-env.sh touchpoints
223+
cf_push_with_retry touchpoints touchpoints.yml false
136224
echo "Push to Production Complete."
137225
else
138226
echo "Not on the production branch."
@@ -144,7 +232,7 @@ then
144232
# Log into CF and push
145233
cf login -a $CF_API_ENDPOINT -u $CF_USERNAME -p $CF_PASSWORD -o $CF_ORG -s $CF_SPACE
146234
echo "Pushing web servers to Demo..."
147-
cf_push_with_retry touchpoints-demo
235+
cf_push_with_retry touchpoints-demo "" true
148236
echo "Push to Demo Complete."
149237
else
150238
echo "Not on the main branch."
@@ -156,7 +244,7 @@ then
156244
# Log into CF and push
157245
cf login -a $CF_API_ENDPOINT -u $CF_USERNAME -p $CF_PASSWORD -o $CF_ORG -s $CF_SPACE
158246
echo "Pushing web servers to Staging..."
159-
cf_push_with_retry touchpoints-staging
247+
cf_push_with_retry touchpoints-staging "" true
160248
echo "Push to Staging Complete."
161249
else
162250
echo "Not on the develop branch."

.circleci/sync-login-gov-env.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
require_env() {
6+
local var_name="$1"
7+
if [ -z "${!var_name:-}" ]; then
8+
echo "Missing required env var: ${var_name}" >&2
9+
exit 1
10+
fi
11+
}
12+
13+
escape_private_key() {
14+
ruby -e 'print STDIN.read.gsub("\r\n", "\n").gsub("\n", "\\n")'
15+
}
16+
17+
sync_login_gov_env() {
18+
local app_name="$1"
19+
20+
require_env LOGIN_GOV_CLIENT_ID
21+
require_env LOGIN_GOV_IDP_BASE_URL
22+
require_env LOGIN_GOV_REDIRECT_URI
23+
require_env LOGIN_GOV_PRIVATE_KEY
24+
25+
local private_key_escaped
26+
private_key_escaped="$(printf "%s" "${LOGIN_GOV_PRIVATE_KEY}" | escape_private_key)"
27+
28+
cf set-env "$app_name" LOGIN_GOV_CLIENT_ID "$LOGIN_GOV_CLIENT_ID" >/dev/null
29+
cf set-env "$app_name" LOGIN_GOV_IDP_BASE_URL "$LOGIN_GOV_IDP_BASE_URL" >/dev/null
30+
cf set-env "$app_name" LOGIN_GOV_REDIRECT_URI "$LOGIN_GOV_REDIRECT_URI" >/dev/null
31+
cf set-env "$app_name" LOGIN_GOV_PRIVATE_KEY "$private_key_escaped" >/dev/null
32+
33+
echo "Synced Login.gov env to ${app_name}"
34+
}
35+
36+
if [ "${1:-}" == "" ]; then
37+
echo "Usage: $0 <app-name>" >&2
38+
exit 2
39+
fi
40+
41+
sync_login_gov_env "$1"
42+

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,6 @@ ext/widget_renderer/Makefile
5353
ext/widget_renderer/*.dylib
5454
# Keep the prebuilt Linux .so for Cloud Foundry deployment
5555
!ext/widget_renderer/libwidget_renderer.so
56+
57+
# Certificate files (avoid accidental commits of sensitive keys/certs)
58+
*.pem

0 commit comments

Comments
 (0)