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'- REQUIRED_KEYS =
%w{gitlab_repo email domain}
Class Method Summary collapse
- .base_path ⇒ Object
- .branch ⇒ Object
- .delay_time ⇒ Object
- .domain ⇒ Object
- .email ⇒ Object
- .endpoint ⇒ Object
- .filename ⇒ Object
- .gitlab_repo ⇒ 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
32 33 34 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 32 def base_path jekyll_config['base_path'] || '' end |
.branch ⇒ Object
56 57 58 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 56 def branch jekyll_config['branch'] || DEFAULT_BRANCH end |
.delay_time ⇒ Object
68 69 70 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 68 def delay_time jekyll_config['delay_time'] || DEFAULT_DELAY_TIME end |
.domain ⇒ Object
52 53 54 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 52 def domain jekyll_config['domain'] end |
.email ⇒ Object
48 49 50 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 48 def email jekyll_config['email'] end |
.endpoint ⇒ Object
24 25 26 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 24 def endpoint jekyll_config['endpoint'] || DEFAULT_ENDPOINT end |
.filename ⇒ Object
60 61 62 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 60 def filename jekyll_config['filename'] || DEFAULT_FILENAME end |
.gitlab_repo ⇒ Object
28 29 30 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 28 def gitlab_repo jekyll_config['gitlab_repo'] end |
.initial_delay ⇒ Object
64 65 66 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 64 def initial_delay jekyll_config['initial_delay'] || DEFAULT_INITIAL_DELAY end |
.jekyll_config ⇒ Object
80 81 82 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 80 def jekyll_config @jekyll_config ||= (Jekyll.configuration({})['gitlab-letsencrypt'] || {}) end |
.layout ⇒ Object
40 41 42 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 40 def layout jekyll_config['layout'] || DEFAULT_LAYOUT end |
.personal_access_token ⇒ Object
44 45 46 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 44 def personal_access_token jekyll_config['personal_access_token'].presence || ENV['GITLAB_TOKEN'].presence end |
.pretty_url? ⇒ Boolean
36 37 38 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 36 def pretty_url? !!jekyll_config['pretty_url'] end |
.reset! ⇒ Object
76 77 78 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 76 def reset! @jekyll_config = nil end |
.scheme ⇒ Object
72 73 74 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 72 def scheme jekyll_config['scheme'] || DEFAULT_SCHEME end |
.valid? ⇒ Boolean
20 21 22 |
# File 'lib/jekyll/gitlab/letsencrypt/configuration.rb', line 20 def valid? REQUIRED_KEYS.all? { |key| jekyll_config.has_key? key } && personal_access_token end |