Mattias Bodlund 1 year ago
parent
commit
bf0ad68f3e
5 changed files with 162 additions and 175 deletions
  1. +18
    -5
      config/puma.rb
  2. +10
    -0
      config/sidekiq.yml
  3. +45
    -57
      public/404.html
  4. +45
    -57
      public/422.html
  5. +44
    -56
      public/500.html

+ 18
- 5
config/puma.rb View File

@ -20,16 +20,29 @@ end
# Specifies the `worker_timeout` threshold that Puma will use to wait before # Specifies the `worker_timeout` threshold that Puma will use to wait before
# terminating a worker in development environments. # terminating a worker in development environments.
worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
# worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
# Specifies the `port` that Puma will listen on to receive requests; default is 3000. # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
port ENV.fetch("PORT") { 3000 }
# port ENV.fetch("PORT") { 3000 }
# Specifies the `environment` that Puma will run in. # Specifies the `environment` that Puma will run in.
environment ENV.fetch("RAILS_ENV") { "development" }
environment ENV.fetch("RAILS_ENV") { "production" }
# Specifies the `pidfile` that Puma will use. # Specifies the `pidfile` that Puma will use.
pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
# pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
app_dir = File.expand_path("../..", __FILE__)
shared_dir = "#{app_dir}/tmp/pids"
# Logging
stdout_redirect "#{app_dir}/log/puma_access.log", "#{app_dir}/log/puma_error.log", true
# Set up socket location
bind "unix://#{shared_dir}/puma.sock"
# Allow puma to be restarted by `bin/rails restart` command. # Allow puma to be restarted by `bin/rails restart` command.
plugin :tmp_restart
# plugin :tmp_restart

+ 10
- 0
config/sidekiq.yml View File

@ -0,0 +1,10 @@
---
:concurrency: 5
staging:
:concurrency: 10
production:
:concurrency: 10
:queues:
- critical
- default
- low

+ 45
- 57
public/404.html View File

@ -3,65 +3,53 @@
<head> <head>
<title>The page you were looking for doesn't exist (404)</title> <title>The page you were looking for doesn't exist (404)</title>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<style> <style>
.rails-default-error-page {
background-color: #EFEFEF;
color: #2E2F30;
text-align: center;
font-family: arial, sans-serif;
margin: 0;
}
.rails-default-error-page div.dialog {
width: 95%;
max-width: 33em;
margin: 4em auto 0;
}
.rails-default-error-page 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);
}
.rails-default-error-page h1 {
font-size: 100%;
color: #730E15;
line-height: 1.5em;
}
.rails-default-error-page 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);
}
body {
background-color: #1D1D1B;
color: #e1e1e1;
text-align: center;
font-family: system-ui, sans-serif;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
}
body {
min-height: 100vh;
min-height: 100svh;
}
h2 {
margin: 0;
font-size: 400px;
line-height: 1;
position: absolute;
top: -0.4em;
left: -0.1em;
font-weight: 700;
color: #333;
}
h1 {
margin: 0;
font-size: 2em;
font-weight: 300;
}
p {
margin: 1em 0;
}
</style> </style>
</head> </head>
<body class="rails-default-error-page">
<!-- This file lives in public/404.html -->
<div class="dialog">
<div>
<h1>The page you were looking for doesn't exist.</h1>
<p>You may have mistyped the address or the page may have moved.</p>
</div>
<p>If you are the application owner check the logs for more information.</p>
<body>
<div>
<h2>404</h2>
<h1>The page you were looking for doesn't exist.</h1>
<p>You may have mistyped the address or the page may have moved.</p>
</div> </div>
</body> </body>
</html>
</html>

+ 45
- 57
public/422.html View File

@ -3,65 +3,53 @@
<head> <head>
<title>The change you wanted was rejected (422)</title> <title>The change you wanted was rejected (422)</title>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<style> <style>
.rails-default-error-page {
background-color: #EFEFEF;
color: #2E2F30;
text-align: center;
font-family: arial, sans-serif;
margin: 0;
}
.rails-default-error-page div.dialog {
width: 95%;
max-width: 33em;
margin: 4em auto 0;
}
.rails-default-error-page 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);
}
.rails-default-error-page h1 {
font-size: 100%;
color: #730E15;
line-height: 1.5em;
}
.rails-default-error-page 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);
}
body {
background-color: #1D1D1B;
color: #e1e1e1;
text-align: center;
font-family: system-ui, sans-serif;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
}
body {
min-height: 100vh;
min-height: 100svh;
}
h2 {
margin: 0;
font-size: 400px;
line-height: 1;
position: absolute;
top: -0.4em;
left: -0.1em;
font-weight: 700;
color: #333;
}
h1 {
margin: 0;
font-size: 2em;
font-weight: 300;
}
p {
margin: 1em 0;
}
</style> </style>
</head> </head>
<body class="rails-default-error-page">
<!-- This file lives in public/422.html -->
<div class="dialog">
<div>
<h1>The change you wanted was rejected.</h1>
<p>Maybe you tried to change something you didn't have access to.</p>
</div>
<p>If you are the application owner check the logs for more information.</p>
<body>
<div>
<h2>422</h2>
<h1>The change you wanted was rejected.</h1>
<p>Maybe you tried to change something you didn't have access to.</p>
</div> </div>
</body> </body>
</html>
</html>

+ 44
- 56
public/500.html View File

@ -3,64 +3,52 @@
<head> <head>
<title>We're sorry, but something went wrong (500)</title> <title>We're sorry, but something went wrong (500)</title>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<style> <style>
.rails-default-error-page {
background-color: #EFEFEF;
color: #2E2F30;
text-align: center;
font-family: arial, sans-serif;
margin: 0;
}
.rails-default-error-page div.dialog {
width: 95%;
max-width: 33em;
margin: 4em auto 0;
}
.rails-default-error-page 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);
}
.rails-default-error-page h1 {
font-size: 100%;
color: #730E15;
line-height: 1.5em;
}
.rails-default-error-page 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);
}
body {
background-color: #1D1D1B;
color: #e1e1e1;
text-align: center;
font-family: system-ui, sans-serif;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
}
body {
min-height: 100vh;
min-height: 100svh;
}
h2 {
margin: 0;
font-size: 400px;
line-height: 1;
position: absolute;
top: -0.4em;
left: -0.1em;
font-weight: 700;
color: #333;
}
h1 {
margin: 0;
font-size: 2em;
font-weight: 300;
}
p {
margin: 1em 0;
}
</style> </style>
</head> </head>
<body class="rails-default-error-page">
<!-- This file lives in public/500.html -->
<div class="dialog">
<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>
<body>
<div>
<h2>500</h2>
<h1>Ops! We're sorry, but something went wrong.</h1>
</div> </div>
</body> </body>
</html>
</html>

Loading…
Cancel
Save