Ajout de l'article sur la réalisation d'un mirroir pour le site principal du projet Haiku
This commit is contained in:
66
content/post/2024-10-30-Un mirroir pour Haiku/index.en.md
Normal file
66
content/post/2024-10-30-Un mirroir pour Haiku/index.en.md
Normal file
@@ -0,0 +1,66 @@
|
||||
---
|
||||
date: 2024-10-30
|
||||
title: Haiku project main site mirror
|
||||
description: How I created a mirror for the Haiku project main website using a simple bash script.
|
||||
authors:
|
||||
- yann64
|
||||
toc: false
|
||||
category: Haiku
|
||||
tags: Haiku
|
||||
---
|
||||
|
||||
Whenever possible, the Haiku project tries to be self-hosted. This is not without constraints for a project with limited resources, and sometimes the official hosting is not accessible.
|
||||
|
||||
I created a script to create a mirror and be able to access the information when the main site is not accessible: https://barbel.synology.me/haiku/
|
||||
|
||||
I use the following Bash script :
|
||||
|
||||
```bash
|
||||
# Change the following values to configure your mirror
|
||||
|
||||
# Path to the Hugo binary
|
||||
HUGO_PATH="/path/to/hugo"
|
||||
# The mirror website title
|
||||
MIRROR_TITLE="Haiku Project (Yann64's Mirror)"
|
||||
# The mirror base URL (must end with a slash '/')
|
||||
MIRROR_BASEURL="https://barbel.synology.me/haiku/"
|
||||
# Server base directory
|
||||
MIRROR_ROOTPATH="/opt/http"
|
||||
# Full path for Haiku site mirror
|
||||
MIRROR_LOCALPATH="/opt/http/haiku"
|
||||
|
||||
# Update main site to latest version
|
||||
echo "==> Clone website from the official repository :"
|
||||
git clone https://github.com/haiku/website.git
|
||||
cd website
|
||||
|
||||
sed -i "s/title = \"Haiku Project\"/title = \"$MIRROR_TITLE\"/" ./config.toml
|
||||
sed -i "s@baseURL = \"https://www.haiku-os.org/\"@baseURL = \"$MIRROR_BASEURL\"@" ./config.toml
|
||||
|
||||
# Uncomment following lines if you want to change tickets source information
|
||||
#sed -i "s@'https://cgit.haiku-os.org/haiku/commit/?id='@'https://git.barbel.synology.me/Haiku/haiku/commit/'@" ./static/js/activity.js
|
||||
#sed -i "s@https://cgit.haiku-os.org/haiku/log/@https://git.barbel.synology.me/Haiku/haiku/commits/branch/master@ " ./themes/shijin4/layouts/partials/home.html
|
||||
|
||||
echo "==> Site generation using Hugo :"
|
||||
$HUGO_PATH
|
||||
echo "==> Copy files to destination forlder: "$MIRROR_LOCALPATH
|
||||
cd public
|
||||
cp -r * $MIRROR_LOCALPATH
|
||||
cp -r ./images $MIRROR_ROOTPATH
|
||||
|
||||
echo "==> Cleaning"
|
||||
cd ../..
|
||||
rm -rf ./website
|
||||
|
||||
# Update userguide to latest version
|
||||
echo "==> Clone userguide from the official repository :"
|
||||
git clone "https://review.haiku-os.org/userguide"
|
||||
cd userguide
|
||||
echo "==> Copy files to destination forlder: $MIRROR_LOCALPATH/docs"
|
||||
cp -r * "$MIRROR_LOCALPATH/docs"
|
||||
echo "==> Cleaning"
|
||||
cd ..
|
||||
rm -rf ./userguide
|
||||
|
||||
echo "Done !"
|
||||
```
|
||||
Reference in New Issue
Block a user