Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
librehealth.io
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
4
Issues
4
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
LibreHealth
librehealth.io
Commits
a1db586c
Verified
Commit
a1db586c
authored
Jan 03, 2019
by
Robby O'Connor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add scheduled gitlab CI job which Use acme.sh and DNS challenge
parent
06bb0465
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
.gitlab-ci.yml
.gitlab-ci.yml
+12
-0
letsencrypt_generate.sh
scripts/letsencrypt_generate.sh
+15
-0
No files found.
.gitlab-ci.yml
View file @
a1db586c
...
...
@@ -17,3 +17,15 @@ pages:
-
public
only
:
-
master
letsencrypt-renewal
:
image
:
neilpang/acme.sh
only
:
-
schedules
variables
:
GITLAB_TOKEN
:
$GITLAB_TOKEN
GITLAB_PROJECT_ID
:
"
1926532"
GITLAB_DOMAIN
:
librehealth.io
GANDI_LIVEDNS_KEY
:
$GANDI_LIVEDNS_KEY
script
:
-
./scripts/letsencrypt_generate.sh
scripts/letsencrypt_generate.sh
0 → 100755
View file @
a1db586c
#!/bin/bash
end_epoch
=
$(
date
-d
"
$(
echo
| openssl s_client
-connect
librehealth.io:443
-servername
librehealth.io 2>/dev/null | openssl x509
-enddate
-noout
|
cut
-d
'='
-f2
)
"
"+%s"
)
current_epoch
=
$(
date
"+%s"
)
renew_days_threshold
=
30
days_diff
=
$((
(
$end_epoch
-
$current_epoch
)
/
60
/
60
/
24
))
if
[
$days_diff
-lt
$renew_days_threshold
]
;
then
echo
"Certificate is
$days_diff
days old, renewing now."
acme.sh
--issue
-d
librehealth.io
--dns
dns_gandi_livedns
--accountemail
infrastructure@librehealth.io
--always-force-new-domain-key
--days
30
echo
"acme.sh finished. Updating GitLab Pages domains."
acme.sh
--deploy
--deploy-hook
gitlab
-d
librehealth.io
else
echo
"Certificate still valid for
$days_diff
days, no renewal required."
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment