Adding optional S3, fail-mastodon

signup-info-prompt
Eugen Rochko 2016-11-06 18:35:46 +01:00
parent 93212bc2c4
commit 3ab193bc3f
5 changed files with 42 additions and 48 deletions

View File

@ -18,6 +18,7 @@ gem 'font-awesome-rails'
gem 'paperclip', '~> 4.3' gem 'paperclip', '~> 4.3'
gem 'paperclip-av-transcoder' gem 'paperclip-av-transcoder'
gem 'aws-sdk', '~> 2.3'
gem 'http' gem 'http'
gem 'httplog' gem 'httplog'

View File

@ -44,6 +44,12 @@ GEM
ast (2.3.0) ast (2.3.0)
av (0.9.0) av (0.9.0)
cocaine (~> 0.5.3) cocaine (~> 0.5.3)
aws-sdk (2.6.18)
aws-sdk-resources (= 2.6.18)
aws-sdk-core (2.6.18)
jmespath (~> 1.0)
aws-sdk-resources (2.6.18)
aws-sdk-core (= 2.6.18)
babel-source (5.8.35) babel-source (5.8.35)
babel-transpiler (0.7.0) babel-transpiler (0.7.0)
babel-source (>= 4.0, < 6) babel-source (>= 4.0, < 6)
@ -139,6 +145,7 @@ GEM
jbuilder (2.6.0) jbuilder (2.6.0)
activesupport (>= 3.0.0, < 5.1) activesupport (>= 3.0.0, < 5.1)
multi_json (~> 1.2) multi_json (~> 1.2)
jmespath (1.3.1)
jquery-rails (4.1.1) jquery-rails (4.1.1)
rails-dom-testing (>= 1, < 3) rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0) railties (>= 4.2.0)
@ -374,6 +381,7 @@ PLATFORMS
DEPENDENCIES DEPENDENCIES
active_record_query_trace active_record_query_trace
addressable addressable
aws-sdk (~> 2.3)
better_errors better_errors
binding_of_caller binding_of_caller
browserify-rails browserify-rails

View File

@ -0,0 +1,10 @@
if ENV['S3_ENABLED'] == 'true'
Paperclip::Attachment.default_options[:storage] = :s3
Paperclip::Attachment.default_options[:s3_credentials] = {
bucket: ENV.fetch('S3_BUCKET'),
access_key_id: ENV.fetch('AWS_ACCESS_KEY_ID'),
secret_access_key: ENV.fetch('AWS_SECRET_ACCESS_KEY'),
s3_region: ENV.fetch('S3_REGION')
}
end

View File

@ -2,66 +2,41 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>We're sorry, but something went wrong (500)</title> <title>We're sorry, but something went wrong</title>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Roboto:400" rel="stylesheet">
<style> <style>
body { body {
background-color: #EFEFEF; font-family: 'Roboto', sans-serif;
color: #2E2F30; background: #282c37;
color: #9baec8;
text-align: center; text-align: center;
font-family: arial, sans-serif;
margin: 0; margin: 0;
padding: 20px;
} }
div.dialog { .dialog img {
width: 95%; display: block;
max-width: 33em; margin: 20px auto;
margin: 4em auto 0; margin-top: 50px;
max-width: 600px;
height: auto;
} }
div.dialog > div { .dialog h1 {
border: 1px solid #CCC; font: 20px/28px 'Roboto', sans-serif;
border-right-color: #999; font-weight: 400;
border-left-color: #999;
border-bottom-color: #BBB;
border-top: #B00100 solid 4px;
border-top-left-radius: 9px;
border-top-right-radius: 9px;
background-color: white;
padding: 7px 12% 0;
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
}
h1 {
font-size: 100%;
color: #730E15;
line-height: 1.5em;
}
div.dialog > p {
margin: 0 0 1em;
padding: 1em;
background-color: #F7F7F7;
border: 1px solid #CCC;
border-right-color: #999;
border-left-color: #999;
border-bottom-color: #999;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
border-top-color: #DADADA;
color: #666;
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
} }
</style> </style>
</head> </head>
<body> <body>
<!-- This file lives in public/500.html -->
<div class="dialog"> <div class="dialog">
<img src="oops.png" alt="Mastodon" />
<div> <div>
<h1>We're sorry, but something went wrong.</h1> <h1>We're sorry, but something went wrong.</h1>
</div> </div>
<p>If you are the application owner check the logs for more information.</p>
</div> </div>
</body> </body>
</html> </html>

BIN
public/oops.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB