refactor: repo (#1070)

This commit is contained in:
Mo
2022-06-07 07:18:41 -05:00
committed by GitHub
parent 4c65784421
commit f4ef63693c
1102 changed files with 5786 additions and 3366 deletions

View File

@@ -0,0 +1,46 @@
class ApplicationController < ActionController::Base
protect_from_forgery with: :null_session
after_action :set_csrf_cookie
after_action :allow_iframe
layout :false
def app
end
rescue_from ActionView::MissingTemplate do |exception|
end
def route_not_found
render :json => {:error => {:message => "Not found."}}, :status => 404
end
protected
def allow_iframe
response.headers.except! 'X-Frame-Options'
end
def set_csrf_cookie
cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?
end
def append_info_to_payload(payload)
super
unless payload[:status]
return
end
payload[:level] = 'INFO'
if payload[:status] >= 500
payload[:level] = 'ERROR'
elsif payload[:status] >= 400
payload[:level] = 'WARN'
end
end
end

View File

@@ -0,0 +1,5 @@
class HealthCheckController < ApplicationController
def index
render :plain => "OK"
end
end

View File

@@ -0,0 +1,10 @@
class StandardNotesFormatter < ActiveSupport::Logger::SimpleFormatter
def call(severity, timestamp, _progname, message)
{
level: severity,
time: timestamp,
message: message,
ddsource: ['ruby'],
}.to_json + "\n"
end
end

View File

@@ -0,0 +1,56 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta content="IE=edge" http-equiv="X-UA-Compatible"/>
<meta content="width=device-width, initial-scale=1" name="viewport"/>
<link rel="canonical" href="<%= ENV['APP_HOST'] %>" />
<link href="favicon/apple-touch-icon.png" rel="apple-touch-icon" sizes="180x180"></link>
<link href="favicon/favicon-32x32.png" rel="icon" sizes="32x32" type="image/png"></link>
<link href="favicon/favicon-16x16.png" rel="icon" sizes="16x16" type="image/png"></link>
<link href="manifest.webmanifest" rel="manifest"></link>
<link color="#5bbad5" href="favicon/safari-pinned-tab.svg" rel="mask-icon"></link>
<meta name="theme-color" content="#ffffff">
<meta content="Standard Notes" name="apple-mobile-web-app-title"/>
<meta content="Standard Notes" name="application-name"/>
<base href="/"></base>
<title>Notes · Standard Notes</title>
<meta name="description" content="Standard Notes is an easy-to-use encrypted note-taking app for digitalists and professionals. Capture your notes, documents, and life's work all in one place."/>
<meta name="twitter:title" content="Standard Notes, an end-to-end encrypted notes app."/>
<meta name="twitter:description" content="Standard Notes is an easy-to-use encrypted note-taking app for digitalists and professionals. Capture your notes, documents, and life's work all in one place."/>
<meta name="twitter:site" content="@standardnotes"/>
<meta name="twitter:card" content="summary"/>
<meta name="og:title" content="Standard Notes, an end-to-end encrypted notes app."/>
<meta name="og:description" content="Standard Notes is an easy-to-use encrypted note-taking app for digitalists and professionals. Capture your notes, documents, and life's work all in one place."/>
<script>
window.defaultSyncServer = "<%= ENV['DEFAULT_SYNC_SERVER'] %>";
window.defaultFilesHost = "<%= ENV['DEFAULT_FILES_HOST'] %>";
window.enabledUnfinishedFeatures = "<%= ENV['ENABLE_UNFINISHED_FEATURES'] %>" === 'true';
window.websocketUrl = "<%= ENV['WEBSOCKET_URL'] %>";
window.purchaseUrl = "<%= ENV['PURCHASE_URL'] %>";
window.plansUrl = "<%= ENV['PLANS_URL'] %>";
window.dashboardUrl = "<%= ENV['DASHBOARD_URL'] %>";
</script>
<% if Rails.env.development? %>
<%= javascript_include_tag "app.js", debug: true %>
<% else %>
<%= javascript_include_tag "app.js", debug: false %>
<% end %>
<%= stylesheet_link_tag "app.css", media: "all", debug: false %>
</head>
<body>
</body>
</html>

View File

@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Standard Notes</title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
</head>
<body>
<%= yield %>
</body>
</html>