Discourse: Setup a nice error page during upgrades.

This commit is contained in:
Julien Palard 2022-09-30 14:08:28 +02:00
parent 47452f07f2
commit 7c1c464316
Signed by: mdk
GPG Key ID: 0EFC1AC1006886F8
4 changed files with 86 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -28,7 +28,11 @@
error_log /var/log/nginx/{{ discourse_domain }}-error.log;
include snippets/letsencrypt-{{ discourse_domain }}.conf;
client_max_body_size 4m;
location / {
error_page 502 =502 /errorpages/discourse_offline.html;
proxy_intercept_errors on;
proxy_pass http://unix:/var/discourse/shared/standalone/nginx.http.sock:;
proxy_set_header Host $http_host;
proxy_http_version 1.1;
@ -36,9 +40,28 @@
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Real-IP $remote_addr;
}
location /errorpages/ {
alias /var/www/discourse-errorpages/;
}
}
- name: Setup discourse
template:
src: app.yml
dest: /var/discourse/containers/app.yml
- name: Setup sorry page
template:
src: discourse_offline.html
dest: /var/www/discourse-errorpages/
- name: Setup sorry logo
copy:
src: d-logo-sketch.png
dest: /var/www/discourse-errorpages/d-logo-sketch.png
- name: Setup sorry sob
copy:
src: sob.png
dest: /var/www/discourse-errorpages/sob.png

View File

@ -0,0 +1,63 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="refresh" content="60">
<title>Discourse offline</title>
<style>
.center {
display: flex;
justify-content: center;
}
.container {
background: #DDD;
max-width: 500px;
padding: 50px 50px 30px 50px;
margin-top: 50px;
}
.title {
padding-top: 20px;
}
h1, p {
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
}
@keyframes spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
.spinner {
animation: spin 5s infinite linear;
height: 30px;
width: 30px;
border: 4px solid #919191;
border-right-color: transparent;
border-radius: 50%;
margin-top: 20px;
}
</style>
</head>
<body>
<div class="center">
<div class="container">
<div class="center">
<img src="/errorpages/d-logo-sketch.png" alt="Discourse logo" width="244" height="66">
</div>
<h1 class="title">Désolé&hellip;</h1>
<div class="center">
<img src="/errorpages/sob.png" alt="sob" width="72" height="72">
</div>
<p>Notre Discourse n'est pas disponible.</p>
<p>Pas de panique, on est probablement juste en train de faire une mise à jour.</p>
<p>
Vous pouvez vérifier qu'on est au courant sur
<a href="https://web.libera.chat/#afpy">IRC</a>,
<a href="https://mamot.fr/@afpy">mastodon</a>
ou <a href="https://twitter.com/asso_python_fr">twitter</a>.
</p>
<div class="center">
<div class="spinner"></div>
</div>
</div>
</div>
</body>
</html>