Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge branch "dev" into branch "staging" #1282

Merged
merged 6 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: Add automatic page refresh after 2 seconds in loading page
  • Loading branch information
TheophileDiot committed Jun 17, 2024
commit c15954f573d178b9487c8a5270028ee167960a89
9 changes: 9 additions & 0 deletions src/bw/loading/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions src/common/confs/default-server-http.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
}
}
Expand Down
Loading