Skip to content

Commit ddd51a8

Browse files
committed
Move letsencrypt action from Plain to StaticPages controller
1 parent 76d3532 commit ddd51a8

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

app/controllers/plain_page_controller.rb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,4 @@ class PlainPageController < ScrivitoController
44
def index
55
@dojos = Dojo.all
66
end
7-
8-
def letsencrypt
9-
if params[:id] == ENV['LETSENCRYPT_REQUEST']
10-
render text: ENV['LETSENCRYPT_RESPONSE']
11-
else
12-
render text: 'Failed.'
13-
end
14-
end
157
end

app/controllers/static_pages_controller.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,12 @@ class StaticPagesController < ApplicationController
22
def home
33
@dojos = Dojo.all
44
end
5+
6+
def letsencrypt
7+
if params[:id] == ENV['LETSENCRYPT_REQUEST']
8+
render text: ENV['LETSENCRYPT_RESPONSE']
9+
else
10+
render text: 'Failed.'
11+
end
12+
end
513
end

config/routes.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
get "/blogs/2016/12/12/new-backend", to: redirect('/news/2016/12/12/new-backend')
1212

1313
# Issue SSL Certification
14-
get "/.well-known/acme-challenge/:id" => "page#letsencrypt"
15-
get "/.well-known/acme-challenge/:id" => "plain_page#letsencrypt"
14+
get "/.well-known/acme-challenge/:id" => "static_pages#letsencrypt"
1615

1716
# Sessions
1817
get '/logout', to: 'sessions#destroy'

0 commit comments

Comments
 (0)