Skip to content

Commit

Permalink
Merge branch 'dev' into USAGOV-2177
Browse files Browse the repository at this point in the history
  • Loading branch information
whitealbum authored Jan 28, 2025
2 parents b25bbed + aef8bd5 commit 9d2455d
Show file tree
Hide file tree
Showing 28 changed files with 374 additions and 196 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ submitting a pull request.
[back to top](#usagov-2021)
## Checking PHP dode style and syntax errors
## Checking PHP code style and syntax errors
PHPCodesniffer and the parallel linting tools should be installed automatically on a local environment via `composer install`. PHPCodeSniffer is used to ensure new code follows Drupal's coding standard. The parallel linter will check for PHP syntax errors. If they detect any errors, they must be fixed before a PR of changes can be accepted.
The following composer scripts are aliases for running these tools.
Expand All @@ -264,8 +264,12 @@ It's defined as a dev dependency in `composer.json` and will be installed automa
The following composer scripts are aliases for running PHPStan
* Check for errors at the level configured in `phpstan.neon`
`./bin/composer phpcs-errors`:
* Check for errors at the level configured in `phpstan.neon`:
`./bin/composer phpstan`
(optionally, supply a file or directory name starting with `web/`)
## Project restart/reset
Sometimes, Docker problems arise after an upgrade and a more complete restart is needed. After closing down and
Expand Down
3 changes: 1 addition & 2 deletions bin/cloudgov/db-portforward
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,13 @@ cf create-service-key database db-portforward >/dev/null 2>&1
echo "Collecting connection info"
CF_APP_GUID=$(cf app cms --guid)
CF_PROCESS_GUID=`cf curl /v3/apps/${CF_APP_GUID}/processes | jq --raw-output '.resources | .[] | select(.type == "web").guid'`
CF_INFO=$(cf curl /v2/info)
CF_DB_INFO=$(cf service-key database db-portforward)
CF_DB_PORT=$(echo "$CF_DB_INFO" | grep '"port":' | sed 's/.*"port": "\([^"]*\)".*/\1/')
CF_DB_HOST=$(echo "$CF_DB_INFO" | grep '"host":' | sed 's/.*"host": "\([^"]*\)".*/\1/')
CF_DB_USER=$(echo "$CF_DB_INFO" | grep '"username":' | sed 's/.*"username": "\([^"]*\)".*/\1/')
CF_DB_PASS=$(echo "$CF_DB_INFO" | grep '"password":' | sed 's/.*"password": "\([^"]*\)".*/\1/')
CF_DB_NAME=$(echo "$CF_DB_INFO" | grep '"db_name":' | sed 's/.*"db_name": "\([^"]*\)".*/\1/')
CF_SSH_ENDPOINT=$(echo "$CF_INFO" | grep '"app_ssh_endpoint":' | sed 's/.*"app_ssh_endpoint": "\([^:]*\).*".*/\1/')
CF_SSH_ENDPOINT=`cf curl / | jq -r '.links.app_ssh.href | split(":")[0]'`

echo "Creating sql connection"
nohup sshpass -p $(cf ssh-code) ssh -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -4 -N -p 2222 -L $LOCAL_PORT:$CF_DB_HOST:$CF_DB_PORT cf:$CF_PROCESS_GUID/0@$CF_SSH_ENDPOINT >/dev/null 2>&1 &
Expand Down
20 changes: 10 additions & 10 deletions bin/cloudgov/deploy-services
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ generate_string()
generate_cert_json()
{
if command -v openssl >/dev/null ; then
SECAUTHSECRETS=$(cf curl /v2/user_provided_service_instances/$(cf service secauthsecrets --guid) | jq -r '.entity | select(.name == "secauthsecrets") | .credentials' )
SECAUTHSECRETS=$(cf curl /v3/service_instances/$(cf service secauthsecrets --guid)/credentials)
SP_KEY=$(echo -E "$SECAUTHSECRETS" | jq -r '.spkey')
SP_CRT=$(echo -E "$SECAUTHSECRETS" | jq -r '.spcrt')

Expand Down Expand Up @@ -141,15 +141,15 @@ generate_cert_json()
echo "Configuring Secrets Service"
if service_exists "secrets" ; then
echo "secrets already created: updating"
CURR_SECRETS=$(cf curl /v2/user_provided_service_instances/$(cf service secrets --guid))
CURR_CRON_KEY=$(echo $CURR_SECRETS | jq -r '.entity.credentials.CRON_KEY')
CURR_HASH_SALT=$(echo $CURR_SECRETS | jq -r '.entity.credentials.HASH_SALT')
CURR_ROOT_USER_NAME=$(echo $CURR_SECRETS | jq -r '.entity.credentials.ROOT_USER_NAME')
CURR_ROOT_USER_PASS=$(echo $CURR_SECRETS | jq -r '.entity.credentials.ROOT_USER_PASS')
CURR_NEW_RELIC_DISPLAY_NAME=$(echo $CURR_SECRETS | jq -r '.entity.credentials.NEW_RELIC_DISPLAY_NAME')
CURR_NEW_RELIC_APP_NAME=$(echo $CURR_SECRETS | jq -r '.entity.credentials.NEW_RELIC_APP_NAME')
CURR_NEW_RELIC_LICENSE_KEY=$(echo $CURR_SECRETS | jq -r '.entity.credentials.NEW_RELIC_LICENSE_KEY')
CURR_NEW_RELIC_API_KEY=$(echo $CURR_SECRETS | jq -r '.entity.credentials.NEW_RELIC_API_KEY')
CURR_SECRETS=$(cf curl /v3/service_instances/$(cf service secrets --guid)/credentials)
CURR_CRON_KEY=$(echo $CURR_SECRETS | jq -r '.CRON_KEY')
CURR_HASH_SALT=$(echo $CURR_SECRETS | jq -r '.HASH_SALT')
CURR_ROOT_USER_NAME=$(echo $CURR_SECRETS | jq -r '.ROOT_USER_NAME')
CURR_ROOT_USER_PASS=$(echo $CURR_SECRETS | jq -r '.ROOT_USER_PASS')
CURR_NEW_RELIC_DISPLAY_NAME=$(echo $CURR_SECRETS | jq -r '.NEW_RELIC_DISPLAY_NAME')
CURR_NEW_RELIC_APP_NAME=$(echo $CURR_SECRETS | jq -r '.NEW_RELIC_APP_NAME')
CURR_NEW_RELIC_LICENSE_KEY=$(echo $CURR_SECRETS | jq -r '.NEW_RELIC_LICENSE_KEY')
CURR_NEW_RELIC_API_KEY=$(echo $CURR_SECRETS | jq -r '.NEW_RELIC_API_KEY')
if [ -n "$NEW_RELIC_DISPLAY_NAME" ]; then
CURR_NEW_RELIC_DISPLAY_NAME=${NEW_RELIC_DISPLAY_NAME}
fi
Expand Down
2 changes: 1 addition & 1 deletion bin/cloudgov/gsaauth-filegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if [ -z "$SPACE" ]; then
exit 1
fi;

SECAUTHSECRETS=$(cf curl /v2/user_provided_service_instances/$(cf service secauthsecrets --guid) | jq -r '.entity | select(.name == "secauthsecrets") | .credentials' )
SECAUTHSECRETS=$(cf curl /v3/service_instances/$(cf service secauthsecrets --guid)/credentials)
SP_KEY=$(echo -E "$SECAUTHSECRETS" | jq -r '.spkey')
SP_CRT=$(echo -E "$SECAUTHSECRETS" | jq -r '.spcrt')

Expand Down
2 changes: 1 addition & 1 deletion bin/cloudgov/scp-from
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ instance_index=${4:-0}
# https://cloud.gov/knowledge-base/2021-05-17-troubleshooting-ssh-connections/#changes-to-your-app-in-the-capi
# We need the PROCESS_GUID for the "web process" for our app.
echo "getting ssh_host"
ssh_host=`cf curl /v2/info | jq .app_ssh_endpoint | awk -F : '{print $1}' | sed 's/\"//g'`
ssh_host=`cf curl / | jq -r '.links.app_ssh.href | split(":")[0]'`

echo "getting app_guid"
app_guid=`cf env ${app_name} | grep application_id | awk '{print $2}' | sed 's/\"//g' | sed 's/,//g'`
Expand Down
2 changes: 1 addition & 1 deletion bin/cloudgov/scp-to
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ instance_index=${4:-0}
# https://cloud.gov/knowledge-base/2021-05-17-troubleshooting-ssh-connections/#changes-to-your-app-in-the-capi
# We need the PROCESS_GUID for the "web process" for our app.
echo "getting ssh_host"
ssh_host=`cf curl /v2/info | jq .app_ssh_endpoint | awk -F : '{print $1}' | sed 's/\"//g'`
ssh_host=`cf curl / | jq -r '.links.app_ssh.href | split(":")[0]'`

echo "getting app_guid"
app_guid=`cf env ${app_name} | grep application_id | awk '{print $2}' | sed 's/\"//g' | sed 's/,//g'`
Expand Down
4 changes: 2 additions & 2 deletions bin/snapshot-backups/old-db-pull-docker.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
#!/bin/bash

CF_SVC_USER=$1
CF_SVC_PASS=$2
Expand All @@ -12,7 +13,6 @@ cf login -a https://api.fr.cloud.gov -u $CF_SVC_USER -p $CF_SVC_PASS
echo "[INFO] Creating access keys"
cf create-service-key database db-dump >/dev/null 2>&1
CF_GUID=$(cf app cms --guid)
CF_INFO=$(cf curl /v2/info)
CF_DB_INFO=$(cf service-key database db-dump)

CF_DB_PORT=$(echo "$CF_DB_INFO" | grep '"port":' | sed 's/.*"port": "\([^"]*\)".*/\1/')
Expand All @@ -21,7 +21,7 @@ CF_DB_USER=$(echo "$CF_DB_INFO" | grep '"username":' | sed 's/.*"username": "\([
CF_DB_PASS=$(echo "$CF_DB_INFO" | grep '"password":' | sed 's/.*"password": "\([^"]*\)".*/\1/')
CF_DB_NAME=$(echo "$CF_DB_INFO" | grep '"db_name":' | sed 's/.*"db_name": "\([^"]*\)".*/\1/')

CF_SSH_ENDPOINT=$(echo "$CF_INFO" | grep '"app_ssh_endpoint":' | sed 's/.*"app_ssh_endpoint": "\([^:]*\).*".*/\1/')
CF_SSH_ENDPOINT=`cf curl / | jq -r '.links.app_ssh.href | split(":")[0]'`
CF_SSH_CODE=$(cf ssh-code)

echo "[INFO] Creating local sql connection"
Expand Down
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"drupal/admin_toolbar": "^3.4",
"drupal/allowed_formats": "^3.0",
"drupal/autologout": "^2.0",
"drupal/ckeditor5_embedded_content": "^2.0",
"drupal/ckeditor_media_resize": "^1.0@beta",
"drupal/ckeditor_templates": "^1.3",
"drupal/ckeditor_templates_ui": "^1.5",
Expand All @@ -35,6 +36,7 @@
"drupal/ctools": "^3.7",
"drupal/devel": "^5.1",
"drupal/diff": "^1.0",
"drupal/embedded_content": "^2.0",
"drupal/entity_embed": "^1.5",
"drupal/entity_reference_revisions": "^1.9",
"drupal/externalauth": "^2",
Expand Down Expand Up @@ -66,7 +68,7 @@
"drupal/tome": "^1.6",
"drupal/twig_tweak": "^3.1",
"drupal/uswds_base": "^2.4",
"drupal/uswds_ckeditor_integration": "^2.0",
"drupal/uswds_ckeditor_integration": "^3.1",
"drupal/uswds_paragraph_components": "^3.0",
"drupal/views_data_export": "^1.4",
"drupal/views_menu_children_filter": "^3.0@RC",
Expand Down
Loading

0 comments on commit 9d2455d

Please sign in to comment.