Skip to content

Commit b95aa89

Browse files
committed
add cloudflare 2fa verify stuff
1 parent fd6c16b commit b95aa89

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

app/controllers/application_controller.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@ class ApplicationController < ActionController::Base
44
def home
55
render "shared/home"
66
end
7+
8+
def cloudflare_verify
9+
render plain: ENV.fetch("CLOUDFLARE_2FA_VERIFY")
10+
end
711
end

app/views/layouts/application.html.haml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
%meta{ "http-equiv": "Content-Type", content: "text/html; charset=utf-8" }
1515
1616
%meta{ name: "viewport", content: "width=device-width,initial-scale=1" }
17+
%meta{ name: "cf-2fa-verify", content: ENV.fetch("CLOUDFLARE_2FA_VERIFY") }
1718
1819
= stylesheet_link_tag :application, data: { turbo_track: "reload" }, media: "all"
1920

config/routes.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
Rails.application.routes.draw do
1717
mount Sidekiq::Web => "sidekiq"
1818

19+
get "/.well-known/cf-2fa-verify.txt" => "application#cloudflare_verify"
20+
1921
get ":sitemap", sitemap: /sitemap[A-Za-z\d.]*/, to: redirect { "https://#{ENV.fetch "CLOUDFLARE_R2_BUCKET_URL"}#{_2.path}" }
2022

2123
root "application#home"

0 commit comments

Comments
 (0)