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

Updates the location the binding.pem is downloaded to for Lockr support #2859

Closed
wants to merge 2 commits into from
Closed
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
16 changes: 8 additions & 8 deletions integrations/lando-pantheon/scripts/auth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ if [ ! -z "$AUTH" ]; then
terminus site:info $SITE || exit 1
lando_green "Access confirmed!"

# LOCKR integration
# Lockr integration
# If we don't have our dev cert already let's get it
if ! openssl x509 -noout -text -in /var/www/certs/binding.pem 2>/dev/null | grep Pantheon 1>/dev/null; then
echo "Pantheon LOCKR setup"
rm -f /var/www/certs/binding.pem
$(terminus connection:info $SITE.dev --field=sftp_command):certs/binding.pem /var/www/certs/binding.pem
if ! openssl x509 -noout -text -in /certs/binding.pem 2>/dev/null | grep Pantheon 1>/dev/null; then
echo "Pantheon Lockr setup"
rm -f /certs/binding.pem
$(terminus connection:info $SITE.dev --field=sftp_command):certs/binding.pem /certs/binding.pem
fi

# Lets also check to see if we should refresh our cert
if openssl x509 -checkend 86400 -noout -in /var/www/certs/binding.pem; then
if openssl x509 -checkend 86400 -noout -in /certs/binding.pem; then
lando_green "Cert is good!"
else
rm -f /var/www/certs/binding.pem
$(terminus connection:info $SITE.dev --field=sftp_command):certs/binding.pem /var/www/certs/binding.pem
rm -f /certs/binding.pem
$(terminus connection:info $SITE.dev --field=sftp_command):certs/binding.pem /certs/binding.pem
fi
fi
fi
3 changes: 3 additions & 0 deletions plugins/lando-core/scripts/add-cert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ cp -f /certs/cert.key /certs/server.key
# Set the cert and key on host to host-uid/gid ownership
chown "$LANDO_HOST_UID:$LANDO_HOST_GID" "/lando/certs/${LANDO_SERVICE_NAME}.${LANDO_APP_PROJECT}.crt"
chown "$LANDO_HOST_UID:$LANDO_HOST_GID" "/lando/certs/${LANDO_SERVICE_NAME}.${LANDO_APP_PROJECT}.key"
# Change permissions on the folder to let others install certs as needed
chgrp www-data /certs
chmod 775 /certs

# Trust our root CA
if [ ! -f "$CA_CERT_CONTAINER" ]; then
Expand Down