forked from BgLUG/bglug.it
Compare commits
6 Commits
639eaa88bc
...
617a4c7ebe
Author | SHA1 | Date | |
---|---|---|---|
617a4c7ebe | |||
69842eb740 | |||
4662d6f842 | |||
164f69ae43 | |||
f8d27e3914 | |||
a985989c3e |
71
.gitea/workflows/external_links.yaml
Normal file
71
.gitea/workflows/external_links.yaml
Normal file
@ -0,0 +1,71 @@
|
||||
---
|
||||
name: External links check
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "30 18 * * 2"
|
||||
|
||||
jobs:
|
||||
scan:
|
||||
name: Check all external links
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: catthehacker/ubuntu:act-latest
|
||||
|
||||
steps:
|
||||
|
||||
- name: checkout repo
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true # Fetch Hugo themes (true OR recursive)
|
||||
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
|
||||
|
||||
- name: restore resources from cache
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: |
|
||||
resources
|
||||
key: bglug-it-hugo-resources
|
||||
|
||||
- name: update git hash
|
||||
run: |
|
||||
H=$(git rev-parse --short=10 HEAD)
|
||||
echo "commit: $H"
|
||||
sed -i "s/AbbreviatedHash\:.*$/AbbreviatedHash: ${H}/" config/_default/params.yaml
|
||||
|
||||
- name: Build Hugo
|
||||
run: |
|
||||
wget -O - https://github.com/gohugoio/hugo/releases/download/v0.135.0/hugo_extended_0.135.0_linux-amd64.tar.gz | tar zxv
|
||||
./hugo --gc --minify --cleanDestinationDir
|
||||
|
||||
- name: store resources into cache
|
||||
uses: actions/cache/save@v4
|
||||
if: always() # salva in cache anche se la build fallisce
|
||||
with:
|
||||
path: |
|
||||
resources
|
||||
key: bglug-it-hugo-resources
|
||||
|
||||
- name: parse all the links
|
||||
shell: bash
|
||||
run: |
|
||||
echo "Calculating a list of URLs"
|
||||
grep --ignore-case --recursive --only-matching --no-filename \
|
||||
--include \*.html --perl-regexp '(?<=href=")[^"]*' public/ | \
|
||||
grep ^http | \
|
||||
grep --invert-match --extended-regexp \
|
||||
--file .gitea/workflows/extlinks_whitelist_patterns.list | \
|
||||
sort -u > all_links.list
|
||||
echo "List contains $(cat all_links.list | wc -l) URLs"
|
||||
unreachable_count=0
|
||||
while IFS= read -r url; do
|
||||
response_code=$(curl --head --silent --output /dev/null --retry 2 --connect-timeout 2 --write-out "%{http_code}" "$url" || true)
|
||||
if [[ ! $response_code == 200 && ! $response_code =~ 3[0-9]{2} ]]; then
|
||||
echo "UNREACHABLE ($response_code): $url"
|
||||
unreachable_count=$((unreachable_count+1))
|
||||
fi
|
||||
done < all_links.list
|
||||
echo "List parsed. Unreachable URLs: $unreachable_count"
|
||||
if [[ $unreachable_count -gt 0 ]] ; then
|
||||
exit 1
|
||||
fi
|
6
.gitea/workflows/extlinks_whitelist_patterns.list
Normal file
6
.gitea/workflows/extlinks_whitelist_patterns.list
Normal file
@ -0,0 +1,6 @@
|
||||
https?\:\/\/localhost
|
||||
https?\:\/\/(www\.)?bglug\.it
|
||||
https\:\/\/git\.libreschool\.org\/BgLUG\/bglug\.it\/src
|
||||
https?\:\/\/192\.168\.[0-9]+\.[0-9]+
|
||||
https?\:\/\/172\.16\.[0-9]+\.[0-9]+
|
||||
https?\:\/\/10\.[0-9]+\.[0-9]+\.[0-9]+
|
@ -51,6 +51,7 @@ hugo server -D
|
||||
This website can be used as a container image; to do so in docker:
|
||||
|
||||
```sh
|
||||
hugo --baseURL http://127.0.0.1:6080 --gc --minify --cleanDestinationDir
|
||||
docker build -t bglug-website .
|
||||
```
|
||||
|
||||
|
@ -7,7 +7,6 @@ logo: logo_tondo.svg
|
||||
author: BgLUG
|
||||
theme: hugo-arcana
|
||||
copyright: 2024 © Bergamo Linux Users Group
|
||||
paginate: 20
|
||||
timeout: 1800s
|
||||
enableRobotsTXT: true
|
||||
enableGitInfo: true
|
||||
@ -257,3 +256,11 @@ imaging:
|
||||
exif:
|
||||
disableDate: true
|
||||
disableLatLong: true
|
||||
|
||||
module:
|
||||
mounts:
|
||||
source: static/.well-known
|
||||
target: static/.well-known
|
||||
|
||||
pagination:
|
||||
pagerSize: 20
|
||||
|
@ -121,7 +121,7 @@ Mio padre, tra i tanti buoni consigli che mi ha dato, mi ripeteva sempre _"Nessu
|
||||
[3]: http://www.valueram.com/datasheets/KVR533D2N4_1G.pdf
|
||||
[4]: http://www.samsung.com/global/business/hdd/productmodel.do?group=72&type=62&subtype=67&model_cd=298
|
||||
[5]: http://www.mini-box.com/s.nl/it.A/id.417/.f?sc=8
|
||||
[6]: http://http://www.shopelectronic.it/product.asp?Id=14507
|
||||
[6]: http://www.shopelectronic.it/product.asp?Id=14507
|
||||
[7]: http://cartft.de/ "CarTFT"
|
||||
[8]: http://www.totalmodding.com/ "Totalmodding"
|
||||
[9]: http://www.shopelectronic.it/ "Shopelectronic"
|
||||
|
9
layouts/partials/head/head.html
Normal file
9
layouts/partials/head/head.html
Normal file
@ -0,0 +1,9 @@
|
||||
{{ $options := (dict "targetPath" "style.css" "outputStyle" "compressed" "enableSourceMap" .Site.Params.enableSourceMaps) }}
|
||||
{{ $style := resources.Get "sass/main.scss" | resources.ExecuteAsTemplate "main.scss" . | css.Sass $options }}
|
||||
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }} | {{ .Site.Title }}{{ end }}</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
|
||||
<link rel="stylesheet" href="{{ $style.RelPermalink }}" />
|
||||
{{- partial "analytics/google-tag-manager/head.html" . -}}
|
||||
{{- partial "head/custom.html" . -}}
|
||||
{{- template "_internal/twitter_cards.html" . -}}
|
4
static/.well-known/security.txt
Normal file
4
static/.well-known/security.txt
Normal file
@ -0,0 +1,4 @@
|
||||
Contact: mailto:info@bglug.it
|
||||
Expires: 2026-10-25T21:00:00.000Z
|
||||
Preferred-Languages: it, en, fr
|
||||
Canonical: https://bglug.it/.well-known/security.txt
|
Loading…
x
Reference in New Issue
Block a user