mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
chore: Add automatic page refresh after 2 seconds in loading page
This commit is contained in:
parent
788ca5945c
commit
c15954f573
2 changed files with 16 additions and 3 deletions
|
|
@ -256,6 +256,15 @@
|
|||
</div>
|
||||
<!-- text -->
|
||||
|
||||
{-raw-}
|
||||
<script nonce="{{ nonce_script }}">
|
||||
// Automatically refresh the page after 2 seconds
|
||||
setTimeout(() => {
|
||||
location.reload();
|
||||
}, 2000);
|
||||
</script>
|
||||
{-raw-}
|
||||
|
||||
<footer class="fixed bottom-1.5 lg:bottom-2">
|
||||
<div class="flex justify-center pb-2">
|
||||
<img
|
||||
|
|
|
|||
|
|
@ -67,18 +67,22 @@ server {
|
|||
end
|
||||
|
||||
local nonce_style = rand(16)
|
||||
local nonce_script = rand(16)
|
||||
|
||||
-- Override CSP header
|
||||
ngx.header["Content-Security-Policy"] = "default-src 'none'; form-action 'self'; img-src 'self' data:; style-src 'self' 'nonce-"
|
||||
ngx.header["Content-Security-Policy"] = "default-src 'none'; script-src http: https: 'unsafe-inline' 'strict-dynamic' 'nonce-"
|
||||
.. nonce_script
|
||||
.. "'; style-src 'nonce-"
|
||||
.. nonce_style
|
||||
.. "'; font-src 'self' data:; base-uri 'self'; require-trusted-types-for 'script';"
|
||||
.. "'; base-uri 'none'; img-src 'self' data:; font-src 'self' data:; require-trusted-types-for 'script';"
|
||||
|
||||
-- Remove server header
|
||||
ngx.header["Server"] = nil
|
||||
|
||||
-- Render template
|
||||
render("index.html", {
|
||||
nonce_style = nonce_style
|
||||
nonce_style = nonce_style,
|
||||
nonce_script = nonce_script
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue