Skip to content

Updated to work properly with SSH cert. Moved scripts to certs direct… - #192

Merged
snekiam merged 1 commit into
devfrom
ssl_cert_updates
Aug 9, 2020
Merged

snekiam merged 1 commit into
devfrom
ssl_cert_updates

Conversation

@snekiam

@snekiam snekiam commented Aug 9, 2020

Copy link
Copy Markdown
Member

…ory.

What's New?

Fixes #188

Type of change (pick-one)

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.
Provide instructions so we can reproduce.
Please also list any relevant details for your test configuration (hardware/operating system/etc).

Checklist (check-all-before-merge)

formatting help: - [x] means "checked' and - [ ] means "unchecked"

  • I documented my code according to the Google Python Style Guide

  • I ran ./build_docs.sh and the docs look fine

  • I ran ./type_check.sh and got no errors

  • I ran ./format.sh because it automatically cleans my code for me 😄

  • I ran ./lint.sh to check for what "format" missed

  • I added my tests to the /tests directory

  • I ran ./run_tests.sh and all the tests pass

@sonarqubecloud

sonarqubecloud Bot commented Aug 9, 2020

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Comment thread scripts/cert-update.sh
@@ -1,5 +1,9 @@
#!/bin/bash

eval `ssh-agent`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will turn on the ssh agent?

https://explainshell.com/explain?cmd=eval+%60ssh-agent%60

interesting.

Comment thread scripts/cert-update.sh
#!/bin/bash

eval `ssh-agent`
ssh-keyscan -H github.com >> ~/.ssh/known_hosts

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this adds the ssh fingerprint of github into the ~/.ssh/known_hosts

https://explainshell.com/explain?cmd=ssh-keyscan+-H+github.com+%3E%3E+%7E%2F.ssh%2Fknown_hosts

Comment thread scripts/cert-update.sh

eval `ssh-agent`
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
ssh-add /nimbus/id_rsa

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add the actual ssh key that was pulled from a github secret

https://explainshell.com/explain?cmd=ssh-add+%2Fnimbus%2Fid_rsa

@@ -0,0 +1 @@
0 15 * * * /nimbus/scripts/cert-update.sh > stdout

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cd /api-certificates
tar xvf letsencrypt_backup.tar -C /
crontab /nimbus/letsencrypt-backup-tar.cron
crontab /nimbus/scripts/letsencrypt-backup-tar.cron

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chidiewenike
chidiewenike self-requested a review August 9, 2020 21:31
@snekiam
snekiam merged commit 927963c into dev Aug 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SSL Certificates not renewing on GCP correctly

4 participants