Adding optional S3, fail-mastodon

lolsob-rspec
Eugen Rochko 2016-11-06 18:35:46 +01:00
parent 5ad6611101
commit eb6ad973d1
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-av-transcoder'
gem 'aws-sdk', '~> 2.3'
gem 'http'
gem 'httplog'

View File

@ -44,6 +44,12 @@ GEM
ast (2.3.0)
av (0.9.0)
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-transpiler (0.7.0)
babel-source (>= 4.0, < 6)
@ -139,6 +145,7 @@ GEM
jbuilder (2.6.0)
activesupport (>= 3.0.0, < 5.1)
multi_json (~> 1.2)
jmespath (1.3.1)
jquery-rails (4.1.1)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
@ -374,6 +381,7 @@ PLATFORMS
DEPENDENCIES
active_record_query_trace
addressable
aws-sdk (~> 2.3)
better_errors
binding_of_caller
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">
<head>
<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">
<link href="https://fonts.googleapis.com/css?family=Roboto:400" rel="stylesheet">
<style>
body {
background-color: #EFEFEF;
color: #2E2F30;
text-align: center;
font-family: arial, sans-serif;
margin: 0;
}
body {
font-family: 'Roboto', sans-serif;
background: #282c37;
color: #9baec8;
text-align: center;
margin: 0;
padding: 20px;
}
div.dialog {
width: 95%;
max-width: 33em;
margin: 4em auto 0;
}
.dialog img {
display: block;
margin: 20px auto;
margin-top: 50px;
max-width: 600px;
height: auto;
}
div.dialog > div {
border: 1px solid #CCC;
border-right-color: #999;
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);
}
.dialog h1 {
font: 20px/28px 'Roboto', sans-serif;
font-weight: 400;
}
</style>
</head>
<body>
<!-- This file lives in public/500.html -->
<div class="dialog">
<img src="oops.png" alt="Mastodon" />
<div>
<h1>We're sorry, but something went wrong.</h1>
</div>
<p>If you are the application owner check the logs for more information.</p>
</div>
</body>
</html>

BIN
public/oops.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB