Class: Jekyll::Gitlab::Letsencrypt::Configuration
- Inherits:
-
Object
- Object
- Jekyll::Gitlab::Letsencrypt::Configuration
- Defined in:
- lib/jekyll/gitlab/letsencrypt/configuration.rb
Constant Summary collapse
- DEFAULT_FILENAME =
'letsencrypt_challenge.html'- DEFAULT_ENDPOINT =
'https://acme-v01.api.letsencrypt.org/'- DEFAULT_BRANCH =
'master'- DEFAULT_LAYOUT =
'null'- DEFAULT_INITIAL_DELAY =
120- DEFAULT_DELAY_TIME =
15- DEFAULT_SCHEME =
'http'- DEFAULT_GITLAB_URL =
'https://gitlab.com'- DEFAULT_COMMIT_MESSAGE =
"Automated Let's Encrypt renewal"- REQUIRED_KEYS =
%w{gitlab_repo email domain}
Class Method Summary collapse
- .base_path ⇒ Object
- .branch ⇒ Object
- .commit_message ⇒ Object
- .delay_time ⇒ Object
- .domain ⇒ Object
- .email ⇒ Object
- .endpoint ⇒ Object
- .filename ⇒ Object
- .gitlab_repo ⇒ Object
- .gitlab_url ⇒ Object
- .initial_delay ⇒ Object
- .jekyll_config ⇒ Object
- .layout ⇒ Object
- .personal_access_token ⇒ Object
- .pretty_url? ⇒ Boolean
- .reset! ⇒ Object
- .scheme ⇒ Object
- .valid? ⇒ Boolean
Class Method Details
.base_path ⇒ Object
38 39 40 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 38 def base_path jekyll_config['base_path'] || '' end |
.branch ⇒ Object
62 63 64 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 62 def branch jekyll_config['branch'] || DEFAULT_BRANCH end |
.commit_message ⇒ Object
90 91 92 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 90 def jekyll_config['commit_message'] || DEFAULT_COMMIT_MESSAGE end |
.delay_time ⇒ Object
74 75 76 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 74 def delay_time jekyll_config['delay_time'] || DEFAULT_DELAY_TIME end |
.domain ⇒ Object
58 59 60 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 58 def domain jekyll_config['domain'] end |
.email ⇒ Object
54 55 56 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 54 def email jekyll_config['email'] end |
.endpoint ⇒ Object
26 27 28 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 26 def endpoint jekyll_config['endpoint'] || DEFAULT_ENDPOINT end |
.filename ⇒ Object
66 67 68 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 66 def filename jekyll_config['filename'] || DEFAULT_FILENAME end |
.gitlab_repo ⇒ Object
34 35 36 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 34 def gitlab_repo jekyll_config['gitlab_repo'] end |
.gitlab_url ⇒ Object
30 31 32 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 30 def gitlab_url jekyll_config['gitlab_url'] || DEFAULT_GITLAB_URL end |
.initial_delay ⇒ Object
70 71 72 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 70 def initial_delay jekyll_config['initial_delay'] || DEFAULT_INITIAL_DELAY end |
.jekyll_config ⇒ Object
86 87 88 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 86 def jekyll_config @jekyll_config ||= (Jekyll.configuration({})['gitlab-letsencrypt'] || {}) end |
.layout ⇒ Object
46 47 48 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 46 def layout jekyll_config['layout'] || DEFAULT_LAYOUT end |
.personal_access_token ⇒ Object
50 51 52 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 50 def personal_access_token jekyll_config['personal_access_token'].presence || ENV['GITLAB_TOKEN'].presence end |
.pretty_url? ⇒ Boolean
42 43 44 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 42 def pretty_url? !!jekyll_config['pretty_url'] end |
.reset! ⇒ Object
82 83 84 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 82 def reset! @jekyll_config = nil end |
.scheme ⇒ Object
78 79 80 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 78 def scheme jekyll_config['scheme'] || DEFAULT_SCHEME end |
.valid? ⇒ Boolean
22 23 24 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 22 def valid? REQUIRED_KEYS.all? { |key| jekyll_config.has_key? key } && personal_access_token end |