@glicogh/healthcare-cdk 0.1.68 → 0.1.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,3 @@
1
-
2
1
  # install certbot
3
2
  sudo snap install core
4
3
  sudo snap refresh core
@@ -10,16 +9,6 @@ sudo ln -s /snap/bin/certbot /usr/bin/certbot
10
9
  aws s3 cp s3://$public_bucket_name/ssl/ /etc/letsencrypt/live --recursive
11
10
  sudo chown -R ubuntu:ubuntu /etc/letsencrypt/live
12
11
 
13
- # obtain SSL certificate (if it doesn't exist) and sync to S3 bucket
14
- if [[ ! -f "/etc/letsencrypt/live/$api_gateway_domain_name/fullchain.pem" ]]; then
15
- sudo certbot certonly --nginx -d $api_gateway_domain_name --agree-tos --non-interactive -m mistabiggx@gmail.com --no-eff-email --quiet --deploy-hook "aws s3 sync /etc/letsencrypt/live s3://$public_bucket_name/ssl/"
16
- fi
17
-
18
- # register SSL renewal cron
19
- certbot_cron_command="/usr/bin/certbot renew --deploy-hook \"aws s3 sync /etc/letsencrypt/live s3://$public_bucket_name/ssl/\" >> $logs_dir/{{serviceName}}-ssl-renewal.log"
20
- certbot_cron_job="0 0,12 * * * $certbot_cron_command"
21
- ( ( crontab -l || true ) | ( grep -v -F "$certbot_cron_command" || true ) ; echo "$certbot_cron_job" ) | crontab -
22
-
23
12
  # install nginx
24
13
  sudo apt install curl gnupg2 ca-certificates lsb-release ubuntu-keyring -yq
25
14
  curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor | sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
@@ -29,6 +18,9 @@ echo -e "Package: *\nPin: origin nginx.org\nPin: release o=nginx\nPin-Priority:
29
18
  sudo apt update -yq
30
19
  sudo apt install nginx nodejs dnsmasq supervisor -yq
31
20
 
21
+ # test certbot with dry-run to ensure it can successfully obtain a certificate for the API Gateway domain name (will not actually obtain a certificate due to --dry-run flag). This would also create the necessary nginx configuration for certbot to use during the real certificate obtaining process.
22
+ sudo certbot certonly --nginx -d $api_gateway_domain_name --agree-tos --non-interactive -m mistabiggx@gmail.com --no-eff-email --quiet --dry-run
23
+
32
24
  # copy appropriate server_name.conf based on env
33
25
  cat $service_dir/nginx/microservices/server_name.{{envName}}.conf | sudo tee $service_dir/nginx/microservices/server_name.conf
34
26
 
@@ -55,3 +47,13 @@ sudo systemctl restart dnsmasq
55
47
 
56
48
  # start nginx server
57
49
  sudo systemctl restart nginx
50
+
51
+ # obtain SSL certificate (if it doesn't exist) and sync to S3 bucket.
52
+ if [[ ! -f "/etc/letsencrypt/live/$api_gateway_domain_name/fullchain.pem" ]]; then
53
+ sudo certbot certonly --nginx -d $api_gateway_domain_name --agree-tos --non-interactive -m mistabiggx@gmail.com --no-eff-email --quiet --deploy-hook "aws s3 sync /etc/letsencrypt/live s3://$public_bucket_name/ssl/"
54
+ fi
55
+
56
+ # register SSL renewal cron
57
+ certbot_cron_command="/usr/bin/certbot renew --deploy-hook \"aws s3 sync /etc/letsencrypt/live s3://$public_bucket_name/ssl/\" >> $logs_dir/{{serviceName}}-ssl-renewal.log"
58
+ certbot_cron_job="0 0,12 * * * $certbot_cron_command"
59
+ ( ( crontab -l || true ) | ( grep -v -F "$certbot_cron_command" || true ) ; echo "$certbot_cron_job" ) | crontab -
@@ -1,4 +1,3 @@
1
-
2
1
  # install certbot
3
2
  sudo snap install core
4
3
  sudo snap refresh core
@@ -10,16 +9,6 @@ sudo ln -s /snap/bin/certbot /usr/bin/certbot
10
9
  aws s3 cp s3://$public_bucket_name/ssl/ /etc/letsencrypt/live --recursive
11
10
  sudo chown -R ubuntu:ubuntu /etc/letsencrypt/live
12
11
 
13
- # obtain SSL certificate (if it doesn't exist) and sync to S3 bucket
14
- if [[ ! -f "/etc/letsencrypt/live/$portal_domain_name/fullchain.pem" ]]; then
15
- sudo certbot certonly --nginx -d $portal_domain_name --agree-tos --non-interactive -m mistabiggx@gmail.com --no-eff-email --quiet --deploy-hook "aws s3 sync /etc/letsencrypt/live s3://$public_bucket_name/ssl/"
16
- fi
17
-
18
- # register SSL renewal cron
19
- certbot_cron_command="/usr/bin/certbot renew --deploy-hook \"aws s3 sync /etc/letsencrypt/live s3://$public_bucket_name/ssl/\" >> $logs_dir/{{serviceName}}-ssl-renewal.log"
20
- certbot_cron_job="0 0,12 * * * $certbot_cron_command"
21
- ( ( crontab -l || true ) | ( grep -v -F "$certbot_cron_command" || true ) ; echo "$certbot_cron_job" ) | crontab -
22
-
23
12
  # install nginx
24
13
  sudo apt install curl gnupg2 ca-certificates lsb-release ubuntu-keyring -yq
25
14
  curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor | sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
@@ -29,6 +18,9 @@ echo -e "Package: *\nPin: origin nginx.org\nPin: release o=nginx\nPin-Priority:
29
18
  sudo apt update -yq
30
19
  sudo apt install nginx npm -yq
31
20
 
21
+ # test certbot with dry-run to ensure it can successfully obtain a certificate for the Portal domain name (will not actually obtain a certificate due to --dry-run flag). This would also create the necessary nginx configuration for certbot to use during the real certificate obtaining process.
22
+ sudo certbot certonly --nginx -d $portal_domain_name --agree-tos --non-interactive -m mistabiggx@gmail.com --no-eff-email --quiet --dry-run
23
+
32
24
  cd $service_dir
33
25
 
34
26
  # create .env
@@ -54,3 +46,13 @@ sudo NODE_OPTIONS="--max-old-space-size=2048 NUXT_TELEMETRY_DISABLED=1" npm run
54
46
 
55
47
  # start nginx server
56
48
  sudo systemctl restart nginx
49
+
50
+ # obtain SSL certificate (if it doesn't exist) and sync to S3 bucket
51
+ if [[ ! -f "/etc/letsencrypt/live/$portal_domain_name/fullchain.pem" ]]; then
52
+ sudo certbot certonly --nginx -d $portal_domain_name --agree-tos --non-interactive -m mistabiggx@gmail.com --no-eff-email --quiet --deploy-hook "aws s3 sync /etc/letsencrypt/live s3://$public_bucket_name/ssl/"
53
+ fi
54
+
55
+ # register SSL renewal cron
56
+ certbot_cron_command="/usr/bin/certbot renew --deploy-hook \"aws s3 sync /etc/letsencrypt/live s3://$public_bucket_name/ssl/\" >> $logs_dir/{{serviceName}}-ssl-renewal.log"
57
+ certbot_cron_job="0 0,12 * * * $certbot_cron_command"
58
+ ( ( crontab -l || true ) | ( grep -v -F "$certbot_cron_command" || true ) ; echo "$certbot_cron_job" ) | crontab -
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glicogh/healthcare-cdk",
3
- "version": "0.1.68",
3
+ "version": "0.1.70",
4
4
  "description": "CDK automations",
5
5
  "bin": {
6
6
  "cdk": "bin/cdk.js"
@@ -1,4 +1,3 @@
1
-
2
1
  # install certbot
3
2
  sudo snap install core
4
3
  sudo snap refresh core
@@ -10,16 +9,6 @@ sudo ln -s /snap/bin/certbot /usr/bin/certbot
10
9
  aws s3 cp s3://$public_bucket_name/ssl/ /etc/letsencrypt/live --recursive
11
10
  sudo chown -R ubuntu:ubuntu /etc/letsencrypt/live
12
11
 
13
- # obtain SSL certificate (if it doesn't exist) and sync to S3 bucket
14
- if [[ ! -f "/etc/letsencrypt/live/$api_gateway_domain_name/fullchain.pem" ]]; then
15
- sudo certbot certonly --nginx -d $api_gateway_domain_name --agree-tos --non-interactive -m mistabiggx@gmail.com --no-eff-email --quiet --deploy-hook "aws s3 sync /etc/letsencrypt/live s3://$public_bucket_name/ssl/"
16
- fi
17
-
18
- # register SSL renewal cron
19
- certbot_cron_command="/usr/bin/certbot renew --deploy-hook \"aws s3 sync /etc/letsencrypt/live s3://$public_bucket_name/ssl/\" >> $logs_dir/{{serviceName}}-ssl-renewal.log"
20
- certbot_cron_job="0 0,12 * * * $certbot_cron_command"
21
- ( ( crontab -l || true ) | ( grep -v -F "$certbot_cron_command" || true ) ; echo "$certbot_cron_job" ) | crontab -
22
-
23
12
  # install nginx
24
13
  sudo apt install curl gnupg2 ca-certificates lsb-release ubuntu-keyring -yq
25
14
  curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor | sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
@@ -29,6 +18,9 @@ echo -e "Package: *\nPin: origin nginx.org\nPin: release o=nginx\nPin-Priority:
29
18
  sudo apt update -yq
30
19
  sudo apt install nginx nodejs dnsmasq supervisor -yq
31
20
 
21
+ # test certbot with dry-run to ensure it can successfully obtain a certificate for the API Gateway domain name (will not actually obtain a certificate due to --dry-run flag). This would also create the necessary nginx configuration for certbot to use during the real certificate obtaining process.
22
+ sudo certbot certonly --nginx -d $api_gateway_domain_name --agree-tos --non-interactive -m mistabiggx@gmail.com --no-eff-email --quiet --dry-run
23
+
32
24
  # copy appropriate server_name.conf based on env
33
25
  cat $service_dir/nginx/microservices/server_name.{{envName}}.conf | sudo tee $service_dir/nginx/microservices/server_name.conf
34
26
 
@@ -55,3 +47,13 @@ sudo systemctl restart dnsmasq
55
47
 
56
48
  # start nginx server
57
49
  sudo systemctl restart nginx
50
+
51
+ # obtain SSL certificate (if it doesn't exist) and sync to S3 bucket.
52
+ if [[ ! -f "/etc/letsencrypt/live/$api_gateway_domain_name/fullchain.pem" ]]; then
53
+ sudo certbot certonly --nginx -d $api_gateway_domain_name --agree-tos --non-interactive -m mistabiggx@gmail.com --no-eff-email --quiet --deploy-hook "aws s3 sync /etc/letsencrypt/live s3://$public_bucket_name/ssl/"
54
+ fi
55
+
56
+ # register SSL renewal cron
57
+ certbot_cron_command="/usr/bin/certbot renew --deploy-hook \"aws s3 sync /etc/letsencrypt/live s3://$public_bucket_name/ssl/\" >> $logs_dir/{{serviceName}}-ssl-renewal.log"
58
+ certbot_cron_job="0 0,12 * * * $certbot_cron_command"
59
+ ( ( crontab -l || true ) | ( grep -v -F "$certbot_cron_command" || true ) ; echo "$certbot_cron_job" ) | crontab -
@@ -1,4 +1,3 @@
1
-
2
1
  # install certbot
3
2
  sudo snap install core
4
3
  sudo snap refresh core
@@ -10,16 +9,6 @@ sudo ln -s /snap/bin/certbot /usr/bin/certbot
10
9
  aws s3 cp s3://$public_bucket_name/ssl/ /etc/letsencrypt/live --recursive
11
10
  sudo chown -R ubuntu:ubuntu /etc/letsencrypt/live
12
11
 
13
- # obtain SSL certificate (if it doesn't exist) and sync to S3 bucket
14
- if [[ ! -f "/etc/letsencrypt/live/$portal_domain_name/fullchain.pem" ]]; then
15
- sudo certbot certonly --nginx -d $portal_domain_name --agree-tos --non-interactive -m mistabiggx@gmail.com --no-eff-email --quiet --deploy-hook "aws s3 sync /etc/letsencrypt/live s3://$public_bucket_name/ssl/"
16
- fi
17
-
18
- # register SSL renewal cron
19
- certbot_cron_command="/usr/bin/certbot renew --deploy-hook \"aws s3 sync /etc/letsencrypt/live s3://$public_bucket_name/ssl/\" >> $logs_dir/{{serviceName}}-ssl-renewal.log"
20
- certbot_cron_job="0 0,12 * * * $certbot_cron_command"
21
- ( ( crontab -l || true ) | ( grep -v -F "$certbot_cron_command" || true ) ; echo "$certbot_cron_job" ) | crontab -
22
-
23
12
  # install nginx
24
13
  sudo apt install curl gnupg2 ca-certificates lsb-release ubuntu-keyring -yq
25
14
  curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor | sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
@@ -29,6 +18,9 @@ echo -e "Package: *\nPin: origin nginx.org\nPin: release o=nginx\nPin-Priority:
29
18
  sudo apt update -yq
30
19
  sudo apt install nginx npm -yq
31
20
 
21
+ # test certbot with dry-run to ensure it can successfully obtain a certificate for the Portal domain name (will not actually obtain a certificate due to --dry-run flag). This would also create the necessary nginx configuration for certbot to use during the real certificate obtaining process.
22
+ sudo certbot certonly --nginx -d $portal_domain_name --agree-tos --non-interactive -m mistabiggx@gmail.com --no-eff-email --quiet --dry-run
23
+
32
24
  cd $service_dir
33
25
 
34
26
  # create .env
@@ -54,3 +46,13 @@ sudo NODE_OPTIONS="--max-old-space-size=2048 NUXT_TELEMETRY_DISABLED=1" npm run
54
46
 
55
47
  # start nginx server
56
48
  sudo systemctl restart nginx
49
+
50
+ # obtain SSL certificate (if it doesn't exist) and sync to S3 bucket
51
+ if [[ ! -f "/etc/letsencrypt/live/$portal_domain_name/fullchain.pem" ]]; then
52
+ sudo certbot certonly --nginx -d $portal_domain_name --agree-tos --non-interactive -m mistabiggx@gmail.com --no-eff-email --quiet --deploy-hook "aws s3 sync /etc/letsencrypt/live s3://$public_bucket_name/ssl/"
53
+ fi
54
+
55
+ # register SSL renewal cron
56
+ certbot_cron_command="/usr/bin/certbot renew --deploy-hook \"aws s3 sync /etc/letsencrypt/live s3://$public_bucket_name/ssl/\" >> $logs_dir/{{serviceName}}-ssl-renewal.log"
57
+ certbot_cron_job="0 0,12 * * * $certbot_cron_command"
58
+ ( ( crontab -l || true ) | ( grep -v -F "$certbot_cron_command" || true ) ; echo "$certbot_cron_job" ) | crontab -