commit 4dc11bc8a458230e04c8cf6eecb5480aa914d11c Author: h3artbl33d Date: Sat Mar 8 16:47:10 2025 +0100 First version diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57d6332 --- /dev/null +++ b/.gitignore @@ -0,0 +1,33 @@ +### +# Repo-specific +dst + +### +# Default ignores +_site/ +.idea/ +build/ +captures/ +debug/ +dist/ +log/ +logs/ +temp/ +tmp/ +vendor/ +*~ +*.core +*.key +*.log +*.out +*.pem +*.tmp +._* +.DS_Store +.DS_Store? +.Spotlight-V100 +.Trashes +.godot +.gradle +Thumbs.db +secring.* diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..e8cf20c --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,11 @@ +Copyright 2025 h3artbl33d + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..a290838 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# HardenedBSD website + +This is a work in progress. Uses `ssg` (copy located in `bin/`) to generate the output. diff --git a/bin/drupal-to-static b/bin/drupal-to-static new file mode 100755 index 0000000..35eb124 --- /dev/null +++ b/bin/drupal-to-static @@ -0,0 +1,24 @@ +#!/bin/sh -e +########################################### +### Convert Drupal articles to Markdown ### +########################################### +NAME="drupal2markdown" +VER="2025030801" +CSI='\033[' +TEXT_RESET="${CSI}0m" +TEXT_OOPSL="${CSI}1;31m" +TEXT_ECHO="${CSI}1;35m" +TEXT_OK="${CSI}1;32m" + +RUN() { + test -n "$1" || USAGE + test -n "$2" || usage +} + +USAGE() { + echo "${TEXT_ECHO}${NAME} ${VER} ${TEXT_RESET}" + echo "${TEXT_OK}usage: ${0##*/} input.sql outdir/ ${TEXT_RESET}" >&2 + exit 1 +} + +RUN "$@" diff --git a/bin/ssg b/bin/ssg new file mode 100755 index 0000000..d2da40b --- /dev/null +++ b/bin/ssg @@ -0,0 +1,244 @@ +#!/bin/sh -e +# +# https://romanzolotarev.com/bin/ssg +# copyright 2018 roman zolotarev +# copyright 2019-2022 romanzolotarev.com ou +# +# permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# the software is provided "as is" and the author disclaims all warranties +# with regard to this software including all implied warranties of +# merchantability and fitness. in no event shall the author be liable for +# any special, direct, indirect, or consequential damages or any damages +# whatsoever resulting from loss of use, data or profits, whether in an +# action of contract, negligence or other tortious action, arising out of +# or in connection with the use or performance of this software. +# + +main() { + test -n "$1" || usage + test -n "$2" || usage + test -n "$3" || usage + test -n "$4" || usage + test -d "$1" || no_dir "$1" + test -d "$2" || no_dir "$2" + + src=$(readlink_f "$1") + dst=$(readlink_f "$2") + + IGNORE=$( + if ! test -f "$src/.ssgignore"; then + printf ' ! -path "*/.*"' + return + fi + while read -r x; do + test -n "$x" || continue + printf ' ! -path "*/%s*"' "$x" + done <"$src/.ssgignore" + ) + + # files + + title="$3" + + h_file="$src/_header.html" + f_file="$src/_footer.html" + test -f "$f_file" && FOOTER=$(cat "$f_file") && export FOOTER + test -f "$h_file" && HEADER=$(cat "$h_file") && export HEADER + + list_dirs "$src" | + (cd "$src" && cpio -pdu "$dst") + + fs=$( + if test -f "$dst/.files"; then + list_affected_files "$src" "$dst/.files" + else + list_files "$1" + fi + ) + + if test -n "$fs"; then + echo "$fs" | tee "$dst/.files" + + if echo "$fs" | grep -q '\.md$'; then + if test -x "$(which lowdown 2>/dev/null)"; then + echo "$fs" | grep '\.md$' | + render_md_files_lowdown "$src" "$dst" "$title" + else + if test -x "$(which Markdown.pl 2>/dev/null)"; then + echo "$fs" | grep '\.md$' | + render_md_files_Markdown_pl "$src" "$dst" "$title" + else + echo "couldn't find lowdown nor Markdown.pl" + exit 3 + fi + fi + fi + + echo "$fs" | grep '\.html$' | + render_html_files "$src" "$dst" "$title" + + echo "$fs" | grep -Ev '\.md$|\.html$' | + (cd "$src" && cpio -pu "$dst") + fi + + printf '[ssg] ' >&2 + print_status 'file, ' 'files, ' "$fs" >&2 + + # sitemap + + base_url="$4" + date=$(date +%Y-%m-%d) + urls=$(list_pages "$src") + + test -n "$urls" && + render_sitemap "$urls" "$base_url" "$date" >"$dst/sitemap.xml" + + print_status 'url' 'urls' "$urls" >&2 + echo >&2 +} + +readlink_f() { + file="$1" + cd "$(dirname "$file")" + file=$(basename "$file") + while test -L "$file"; do + file=$(readlink "$file") + cd "$(dirname "$file")" + file=$(basename "$file") + done + dir=$(pwd -P) + echo "$dir/$file" +} + +print_status() { + test -z "$3" && printf 'no %s' "$2" && return + + echo "$3" | awk -v singular="$1" -v plural="$2" ' + END { + if (NR==1) printf NR " " singular + if (NR>1) printf NR " " plural + }' +} + +usage() { + echo "usage: ${0##*/} src dst title base_url" >&2 + exit 1 +} + +no_dir() { + echo "${0##*/}: $1: No such directory" >&2 + exit 2 +} + +list_dirs() { + cd "$1" && eval "find . -type d ! -name '.' ! -path '*/_*' $IGNORE" +} + +list_files() { + cd "$1" && eval "find . -type f ! -name '.' ! -path '*/_*' $IGNORE" +} + +list_dependant_files() { + e="\\( -name '*.html' -o -name '*.md' -o -name '*.css' -o -name '*.js' \\)" + cd "$1" && eval "find . -type f ! -name '.' ! -path '*/_*' $IGNORE $e" +} + +list_newer_files() { + cd "$1" && eval "find . -type f ! -name '.' $IGNORE -newer $2" +} + +has_partials() { + grep -qE '^./_.*\.html$|^./_.*\.js$|^./_.*\.css$' +} + +list_affected_files() { + fs=$(list_newer_files "$1" "$2") + + if echo "$fs" | has_partials; then + list_dependant_files "$1" + else + echo "$fs" + fi +} + +render_html_files() { + while read -r f; do + render_html_file "$3" <"$1/$f" >"$2/$f" + done +} + +render_md_files_lowdown() { + while read -r f; do + lowdown \ + --html-no-escapehtml \ + --html-no-skiphtml \ + --parse-no-metadata \ + --parse-no-autolink <"$1/$f" | + render_html_file "$3" \ + >"$2/${f%\.md}.html" + done +} + +render_md_files_Markdown_pl() { + while read -r f; do + Markdown.pl <"$1/$f" | + render_html_file "$3" \ + >"$2/${f%\.md}.html" + done +} + +render_html_file() { + # h/t Devin Teske + awk -v title="$1" ' + { body = body "\n" $0 } + END { + body = substr(body, 2) + if (body ~ /<\/?[Hh][Tt][Mm][Ll]/) { + print body + exit + } + if (match(body, /<[[:space:]]*[Hh]1(>|[[:space:]][^>]*>)/)) { + t = substr(body, RSTART + RLENGTH) + sub("<[[:space:]]*/[[:space:]]*[Hh]1.*", "", t) + gsub(/^[[:space:]]*|[[:space:]]$/, "", t) + if (t) title = t " — " title + } + n = split(ENVIRON["HEADER"], header, /\n/) + for (i = 1; i <= n; i++) { + if (match(tolower(header[i]), "")) { + head = substr(header[i], 1, RSTART - 1) + tail = substr(header[i], RSTART + RLENGTH) + print head "" title "" tail + } else print header[i] + } + print body + print ENVIRON["FOOTER"] + }' +} + +list_pages() { + e="\\( -name '*.html' -o -name '*.md' \\)" + cd "$1" && eval "find . -type f ! -path '*/.*' ! -path '*/_*' $IGNORE $e" | + sed 's#^./##;s#.md$#.html#;s#/index.html$#/#' +} + +render_sitemap() { + urls="$1" + base_url="$2" + date="$3" + + echo '' + echo '' + echo "$urls" | + sed -E 's#^(.*)$#'"$base_url"'/\1'"$date"'1.0#' + echo '' +} + +main "$@" diff --git a/src/_footer.html b/src/_footer.html new file mode 100644 index 0000000..d2aa49c --- /dev/null +++ b/src/_footer.html @@ -0,0 +1,5 @@ + + + +
Copyright © 2014 - 2025 HardenedBSD | Follow us on: Mastodon
+ diff --git a/src/_header.html b/src/_header.html new file mode 100644 index 0000000..9884f7d --- /dev/null +++ b/src/_header.html @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+
\ No newline at end of file diff --git a/src/assets/css/base.css b/src/assets/css/base.css new file mode 100644 index 0000000..0b999f7 --- /dev/null +++ b/src/assets/css/base.css @@ -0,0 +1,31 @@ +*{ + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body{ + background-color: var(--white); + font-family: 'Open Sans', sans-serif; +} + +a{ + text-decoration: none; +} + +ul{ + list-style: none; +} + +h1, h2, h3 { + margin-top: 5px; + margin-bottom: 5px; +} + + +@media (prefers-color-scheme: dark) { + a, a:link, a:visited { color: var(--lightblue); } + body, html { background-color: var(--darkgray); color: #bebebe; } + pre { background-color: #111111; color: #aaaaaa; } + .clean { background-color: #111111; color: #aaaaaa; } +} \ No newline at end of file diff --git a/src/assets/css/elements.css b/src/assets/css/elements.css new file mode 100644 index 0000000..8297bdb --- /dev/null +++ b/src/assets/css/elements.css @@ -0,0 +1,40 @@ +/* Generic elements */ + +main { + max-width: var(--article); + padding: 1rem; + margin-left: auto; + margin-right: auto; +} + +pre, code { + background-color: var(--black); + padding: 5px; + font-family: 'Fira Code', monospace; +} + +footer { + background-color: var(--black); + position: fixed; + left: 0; + bottom: 0; + width: 100%; + font-size: 12px; + font-weight: 400; + color: var(--mute); + padding: 1rem; + text-align: center; +} + +/* Blog */ + +.blogmeta { + font-weight: 400; + font-size: 12px; + font-style: normal; +} + +.blogauthor, +.blogauthor a { + color: var(--lightblue); +} \ No newline at end of file diff --git a/src/assets/css/fonts.css b/src/assets/css/fonts.css new file mode 100644 index 0000000..5c8243e --- /dev/null +++ b/src/assets/css/fonts.css @@ -0,0 +1,69 @@ +@font-face { + font-family: 'Open Sans'; + src: url('../fonts/oslight.woff') format('woff'); + font-weight: 300; + font-style: normal; +} + +@font-face { + font-family: 'Open Sans'; + src: url('../fonts/oslighti.woff') format('woff'); + font-weight: 300; + font-style: italic; +} + +@font-face { + font-family: 'Open Sans'; + src: url('../fonts/osreg.woff') format('woff'); + font-weight: 400; + font-style: normal; +} + +@font-face { + font-family: 'Open Sans'; + src: url('../fonts/osita.woff') format('woff'); + font-weight: 400; + font-style: italic; +} + +@font-face { + font-family: 'Open Sans'; + src: url('../fonts/ossb.woff') format('woff'); + font-weight: 500; + font-style: normal; +} + +@font-face { + font-family: 'Open Sans'; + src: url('../fonts/ossbi.woff') format('woff'); + font-weight: 500; + font-style: italic; +} + +@font-face { + font-family: 'Open Sans'; + src: url('../fonts/osbold.woff') format('woff'); + font-weight: 600; + font-style: normal; +} + +@font-face { + font-family: 'Open Sans'; + src: url('../fonts/osboldi.woff') format('woff'); + font-weight: 600; + font-style: italic; +} + +@font-face { + font-family: 'Open Sans'; + src: url('../fonts/osebold.woff') format('woff'); + font-weight: 800; + font-style: normal; +} + +@font-face { + font-family: 'Open Sans'; + src: url('../fonts/eosboldi.woff') format('woff'); + font-weight: 800; + font-style: italic; +} \ No newline at end of file diff --git a/src/assets/css/header.css b/src/assets/css/header.css new file mode 100644 index 0000000..0d29e15 --- /dev/null +++ b/src/assets/css/header.css @@ -0,0 +1,97 @@ +.header { + background-color: var(--black); + position: sticky; + top: 0; + width: 100%; +} + +.logo { + display: inline-block; + color: var(--white); + font-size: 60px; + font-weight: 600; + margin-left: 10px; +} + +.nav { + width: 100%; + height: 100%; + position: fixed; + background-color: var(--black); + font-weight: 600; + overflow: hidden; +} + +.menu a { + display: block; + padding: 30px; + color: var(--white); +} + +.menu a:hover { + background-color: var(--gray); +} + +.nav { + max-height: 0; + transition: max-height .5s ease-out; +} + +.mnav { + cursor: pointer; + float: right; + padding: 40px 20px; +} + +.mnav-line { + background: var(--white); + display: block; + height: 2px; + position: relative; + width: 24px; +} + +.mnav-line::before, +.mnav-line::after{ + background: var(--white); + content: ''; + display: block; + height: 100%; + position: absolute; + transition: all .2s ease-out; + width: 100%; +} + +.mnav-line::before { + top: 5px; +} + +.mnav-line::after { + top: -5px; +} + +.slide-menu { + display: none; +} + +.slide-menu:checked ~ nav{ + max-height: 100%; +} + +.slide-menu:checked ~ .mnav .mnav-line { + background: transparent; +} + +.slide-menu:checked ~ .mnav .mnav-line::before { + transform: rotate(-45deg); + top:0; +} + +.slide-menu:checked ~ .mnav .mnav-line::after { + transform: rotate(45deg); + top:0; +} + +body:has(.slide-menu:checked) { + overflow: hidden; +} \ No newline at end of file diff --git a/src/assets/css/media.css b/src/assets/css/media.css new file mode 100644 index 0000000..3c1e8be --- /dev/null +++ b/src/assets/css/media.css @@ -0,0 +1,28 @@ +@media (min-width: 1100px) { + .nav{ + max-height: none; + top: 0; + position: relative; + float: right; + width: fit-content; + background-color: transparent; + } + .menu li{ + float: left; + } + .menu a:hover{ + background-color: transparent; + color: var(--gray); + + } + .hamb{ + display: none; + } +} + +@media (prefers-color-scheme: dark) { + a, a:link, a:visited { color: var(--lightblue); } + body, html { background-color: var(--darkgray); color: #bebebe; } + pre { background-color: #111111; color: #aaaaaa; } + .clean { background-color: #111111; color: #aaaaaa; } +} \ No newline at end of file diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..babf497 --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,27 @@ +/************************************************** + *** HARDENEDBSD STYLESHEET *** + *** --- *** + *** @package: hardenedbsd *** + *** @version: 2025030801 *** + *** @author: h3artbl33d *** + *** *** + *** Contents: *** + *** 1. Imports *** + *** 2. Overrides *** + **************************************************/ + +/** Imports **/ + +@import url('variables.css'); +@import url('base.css'); +@import url('fonts.css'); +@import url('header.css'); +@import url('elements.css'); +@import url('media.css'); + +/** Overrides **/ + +.test { + font-family: var(--monospace), monospace; + font-color: var(--red); +} \ No newline at end of file diff --git a/src/assets/css/variables.css b/src/assets/css/variables.css new file mode 100644 index 0000000..1031d04 --- /dev/null +++ b/src/assets/css/variables.css @@ -0,0 +1,13 @@ +:root{ + /* Colors */ + --white: #f9f9f9; + --black: #111111; + --darkgray: #333333; + --gray: #85888C; + --lightblue: #2fbef2; + --darkblue: #00324a; + --mute: #bbbbbb; + /* Breakpoints */ + --fullwidth: 100%; + --article: 53rem; +} \ No newline at end of file diff --git a/src/assets/fonts/osbold.woff b/src/assets/fonts/osbold.woff new file mode 100644 index 0000000..0415e8b Binary files /dev/null and b/src/assets/fonts/osbold.woff differ diff --git a/src/assets/fonts/osboldi.woff b/src/assets/fonts/osboldi.woff new file mode 100644 index 0000000..0626041 Binary files /dev/null and b/src/assets/fonts/osboldi.woff differ diff --git a/src/assets/fonts/osebold.woff b/src/assets/fonts/osebold.woff new file mode 100644 index 0000000..7e08081 Binary files /dev/null and b/src/assets/fonts/osebold.woff differ diff --git a/src/assets/fonts/oseboldi.woff b/src/assets/fonts/oseboldi.woff new file mode 100644 index 0000000..b4ef9f8 Binary files /dev/null and b/src/assets/fonts/oseboldi.woff differ diff --git a/src/assets/fonts/osita.woff b/src/assets/fonts/osita.woff new file mode 100644 index 0000000..8830ad3 Binary files /dev/null and b/src/assets/fonts/osita.woff differ diff --git a/src/assets/fonts/oslight.woff b/src/assets/fonts/oslight.woff new file mode 100644 index 0000000..57a9615 Binary files /dev/null and b/src/assets/fonts/oslight.woff differ diff --git a/src/assets/fonts/oslighti.woff b/src/assets/fonts/oslighti.woff new file mode 100644 index 0000000..eac0bb1 Binary files /dev/null and b/src/assets/fonts/oslighti.woff differ diff --git a/src/assets/fonts/osreg.woff b/src/assets/fonts/osreg.woff new file mode 100644 index 0000000..e1153e3 Binary files /dev/null and b/src/assets/fonts/osreg.woff differ diff --git a/src/assets/fonts/ossb.woff b/src/assets/fonts/ossb.woff new file mode 100644 index 0000000..c5c64ed Binary files /dev/null and b/src/assets/fonts/ossb.woff differ diff --git a/src/assets/fonts/ossbi.woff b/src/assets/fonts/ossbi.woff new file mode 100644 index 0000000..36581b7 Binary files /dev/null and b/src/assets/fonts/ossbi.woff differ diff --git a/src/assets/img/apple-touch-icon.png b/src/assets/img/apple-touch-icon.png new file mode 100644 index 0000000..476fdfa Binary files /dev/null and b/src/assets/img/apple-touch-icon.png differ diff --git a/src/assets/img/favicon-96x96.png b/src/assets/img/favicon-96x96.png new file mode 100644 index 0000000..d8d11b3 Binary files /dev/null and b/src/assets/img/favicon-96x96.png differ diff --git a/src/assets/img/favicon.ico b/src/assets/img/favicon.ico new file mode 100644 index 0000000..be8e9ae Binary files /dev/null and b/src/assets/img/favicon.ico differ diff --git a/src/assets/img/favicon.svg b/src/assets/img/favicon.svg new file mode 100644 index 0000000..744f58c --- /dev/null +++ b/src/assets/img/favicon.svg @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/src/assets/img/web-app-manifest-192x192.png b/src/assets/img/web-app-manifest-192x192.png new file mode 100644 index 0000000..aa1a889 Binary files /dev/null and b/src/assets/img/web-app-manifest-192x192.png differ diff --git a/src/assets/img/web-app-manifest-512x512.png b/src/assets/img/web-app-manifest-512x512.png new file mode 100644 index 0000000..fa5cdc5 Binary files /dev/null and b/src/assets/img/web-app-manifest-512x512.png differ diff --git a/src/index.md b/src/index.md new file mode 100644 index 0000000..ae9d97b --- /dev/null +++ b/src/index.md @@ -0,0 +1,11 @@ +# Home + +HardenedBSD is a secure and humane *BSD operating system. + +### Download HardenedBSD + +You can download HardenedBSD from either our installer site or from one of the [mirrors](mirrors.html). + +Inline code: `$ fetch https://installers.hardenedbsd.org/pub/keys/ssh.pub.txt` + +### Recent news