Compare commits

...

2 commits

Author SHA1 Message Date
Ell c5d8df7e8a actions: automatically purge CF caches 2024-05-03 15:46:03 +02:00
Ell 88de317ee2 added a cookie notification to the website 2024-05-03 15:34:43 +02:00
4 changed files with 41 additions and 2 deletions

View file

@ -38,8 +38,13 @@ jobs:
run: |
curl -L --output cloudflared.deb https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb && sudo dpkg -i cloudflared.deb
mkdir ~/.ssh && echo "${{ secrets.ELLBOT_KEY }}" > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
rsync -rv --delete -e 'ssh -o "ProxyCommand cloudflared access ssh --hostname %h" -o "StrictHostKeyChecking=no"' web/_site/. ellbot@ssh.ellpeck.de:/var/www/tinylifegame
rsync -rv --delete -e 'ssh -o "ProxyCommand cloudflared access ssh --hostname %h" -o "StrictHostKeyChecking=no"' web/_site/. ellbot@ssh.ellpeck.de:/var/www/tinylifegame
- name: Purge Cloudflare cache
uses: NathanVaughn/actions-cloudflare-purge@v3.1.0
with:
cf_zone: ${{ secrets.CLOUDFLARE_ZONE }}
cf_auth: ${{ secrets.CLOUDFLARE_TOKEN }}
docs:
runs-on: ubuntu-latest
permissions:
@ -73,3 +78,8 @@ jobs:
curl -L --output cloudflared.deb https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb && sudo dpkg -i cloudflared.deb
mkdir ~/.ssh && echo "${{ secrets.ELLBOT_KEY }}" > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
rsync -rv --delete -e 'ssh -o "ProxyCommand cloudflared access ssh --hostname %h" -o "StrictHostKeyChecking=no"' docs/_site/. ellbot@ssh.ellpeck.de:/var/www/tinylifedocs
- name: Purge Cloudflare cache
uses: NathanVaughn/actions-cloudflare-purge@v3.1.0
with:
cf_zone: ${{ secrets.CLOUDFLARE_ZONE }}
cf_auth: ${{ secrets.CLOUDFLARE_TOKEN }}

17
web/_includes/cookie.html Normal file
View file

@ -0,0 +1,17 @@
<div id="cookieinfo"></div>
<script>
if (localStorage.getItem("notification") !== "true") {
$("#cookieinfo").html( /*html*/ `
<div class="alert alert-danger alert-dismissible fade show" role="alert">
This site uses your browser's local storage to store information about your browsing activity.
<br>For more information, please check out the <a href="https://ellpeck.de/privacy">privacy policy</a>.
<button type="button" class="close" data-dismiss="alert" id="notif-close">
<span>&times;</span>
</button>
</div>
`);
$("#notif-close").on("click", function () {
localStorage.setItem("notification", "true");
});
}
</script>

View file

@ -50,6 +50,7 @@
</script>
{% include navbar.html %}
{% include cookie.html %}
{{ content }}

View file

@ -54,6 +54,17 @@ a:visited.wide-link {
padding-top: 70px;
}
#cookieinfo {
position: fixed;
top: 80px;
left: 0;
right: 0;
max-width: 700px;
margin-left: auto;
margin-right: auto;
z-index: 500;
}
.section {
width: 95%;
max-width: 850px;