Skip to content

Commit

Permalink
generate a more complete website, with json, tsv, and more
Browse files Browse the repository at this point in the history
this centralises all mirror information to one page, and allows for more
easily setting up new mirrors, because the mirror information, xmirror
data files, and prometheus configurationo can be generated at onces.

For now, just vendor some assets from voidlinux.org.
  • Loading branch information
classabbyamp committed Nov 16, 2023
1 parent fd9e60c commit 9212952
Show file tree
Hide file tree
Showing 15 changed files with 645 additions and 50 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/list-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
on:
pull_request:
paths:
- mirrors.yaml
- generate-site.py
- web/**
push:
branches:
- 'master'
- master
paths:
- 'mirrors.lst'
- mirrors.yaml
- generate-site.py
- web/**

name: Deploy to Github Pages

Expand All @@ -17,15 +24,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: classabbyamp/treeless-checkout-action@v1
- name: Prepare
run: python3 -m venv env && env/bin/pip install PyYAML
- name: Create file structure
run: make deploy
run: PYTHON=env/bin/python make deploy
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: build
if: github.event == 'push'
permissions:
pages: write
id-token: write
Expand Down
13 changes: 3 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ VERSION ?= 0.3
DESTDIR ?=
PREFIX ?= /usr/local
MIRRORURL ?= https://xmirror.voidlinux.org/raw/mirrors.lst
PYTHON ?= python3

.PHONY: all completions install clean deploy

Expand Down Expand Up @@ -31,13 +32,5 @@ clean:
README: xmirror.1
mandoc -Tutf8 $< | col -bx >$@

deploy: mirrors.lst
mkdir -p _site/raw
# a hacky but simple homepage that redirects to the manpage
@echo 'generating redirect page at _site/index.html'
@printf '<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0; url=' > _site/index.html
@printf "'https://man.voidlinux.org/xmirror.1'" >> _site/index.html
@printf '" /></head>' >> _site/index.html
@printf '<body><p><a href="https://man.voidlinux.org/xmirror.1">Redirect</a></p></body>' >> _site/index.html
@printf '</html>\n' >> _site/index.html
cp mirrors.lst _site/raw/
deploy: mirrors.yaml web/index.html.in
$(PYTHON) web/generate-site.py _site
36 changes: 0 additions & 36 deletions mirrors.lst

This file was deleted.

160 changes: 160 additions & 0 deletions mirrors.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
- base_url: https://repo-fi.voidlinux.org/
region: EU
location: Helsinki, Finland
tier: 1
enabled: true
- base_url: https://repo-de.voidlinux.org/
region: EU
location: Frankfurt, Germany
tier: 1
enabled: true
- base_url: https://repo-us.voidlinux.org/
region: NA
location: Kansas City, USA
tier: 1
enabled: false
- base_url: https://repo-fastly.voidlinux.org/
region: World
location: Fastly Global CDN
tier: 1
enabled: true
- base_url: https://mirrors.servercentral.com/voidlinux/
region: NA
location: Chicago, USA
tier: 1
enabled: true
- base_url: https://mirror.ps.kz/voidlinux/
region: AS
location: Almaty, Kazakhstan
tier: 2
enabled: true
- base_url: https://mirror.nju.edu.cn/voidlinux/
region: AS
location: China
tier: 2
enabled: true
- base_url: https://mirrors.bfsu.edu.cn/voidlinux/
region: AS
location: Beijing, China
tier: 2
enabled: true
- base_url: https://mirrors.cnnic.cn/voidlinux/
region: AS
location: Beijing, China
tier: 2
enabled: true
- base_url: https://mirrors.tuna.tsinghua.edu.cn/voidlinux/
region: AS
location: Beijing, China
tier: 2
enabled: true
- base_url: https://mirror.sjtu.edu.cn/voidlinux/
region: AS
location: Shanghai, China
tier: 2
enabled: true
- base_url: https://repo.jing.rocks/voidlinux/
region: AS
location: Tokyo, Japan
tier: 2
enabled: true
- base_url: https://void.webconverger.org/
region: AS
location: Singapore
tier: 2
enabled: true
- base_url: http://ftp.dk.xemacs.org/voidlinux/
region: EU
location: Denmark
tier: 2
enabled: true
- base_url: https://mirrors.dotsrc.org/voidlinux/
region: EU
location: Denmark
tier: 2
enabled: true
- base_url: https://ftp.cc.uoc.gr/mirrors/linux/voidlinux/
region: EU
location: Greece
tier: 2
enabled: true
- base_url: https://quantum-mirror.hu/mirrors/pub/voidlinux/
region: EU
location: Hungary
tier: 2
enabled: true
- base_url: https://voidlinux.mirror.garr.it/
region: EU
location: Italy
tier: 2
enabled: true
- base_url: https://void.cijber.net/
region: EU
location: Amsterdam, Netherlands
tier: 2
enabled: true
- base_url: https://void.sakamoto.pl/
region: EU
location: Warsaw, Poland
tier: 2
enabled: true
- base_url: http://ftp.debian.ru/mirrors/voidlinux/
region: EU
location: Russia
tier: 2
enabled: true
- base_url: https://mirror.yandex.ru/mirrors/voidlinux/
region: EU
location: Russia
tier: 2
enabled: true
- base_url: https://ftp.lysator.liu.se/pub/voidlinux/
region: EU
location: Sweden
tier: 2
enabled: true
- base_url: https://mirror.accum.se/mirror/voidlinux/
region: EU
location: Sweden
tier: 2
enabled: true
- base_url: https://mirror.puzzle.ch/voidlinux/
region: EU
location: Bern, Switzerland
tier: 2
enabled: true
- base_url: https://mirror.vofr.net/voidlinux/
region: NA
location: California, USA
tier: 2
enabled: true
- base_url: https://mirror2.sandyriver.net/pub/voidlinux/
region: NA
location: Kentucky, USA
tier: 2
enabled: true
- base_url: https://mirror.clarkson.edu/voidlinux/
region: NA
location: New York, USA
tier: 2
enabled: true
- base_url: https://mirror.aarnet.edu.au/pub/voidlinux/
region: OC
location: Canberra, Australia
tier: 2
enabled: true
- base_url: https://ftp.swin.edu.au/voidlinux/
region: OC
location: Melbourne, Australia
tier: 2
enabled: true
- base_url: https://voidlinux.com.br/repo/
region: SA
location: Ouro Preto, Brazil
tier: 2
enabled: true
- base_url: http://void.chililinux.com/voidlinux/
region: SA
location: Pimenta Bueno, Brazil
tier: 2
enabled: true
5 changes: 5 additions & 0 deletions web/assets/bootstrap.min.css

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions web/assets/bootstrap.min.js

Large diffs are not rendered by default.

Binary file added web/assets/favicon.ico
Binary file not shown.
Binary file added web/assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions web/assets/font-ubuntu.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@font-face {
font-family: 'Ubuntu';
font-style: normal;
font-weight: 300;
src: local('Ubuntu Light'), local('Ubuntu-Light'), url(https://fonts.gstatic.com/s/ubuntu/v11/4iCv6KVjbNBYlgoC1CzjsGyI.ttf) format('truetype');
}
@font-face {
font-family: 'Ubuntu';
font-style: normal;
font-weight: 700;
src: local('Ubuntu Bold'), local('Ubuntu-Bold'), url(https://fonts.gstatic.com/s/ubuntu/v11/4iCv6KVjbNBYlgoCxCvjsGyI.ttf) format('truetype');
}
4 changes: 4 additions & 0 deletions web/assets/jquery.min.js

Large diffs are not rendered by default.

99 changes: 99 additions & 0 deletions web/assets/misc.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
a {
color:#478061;
}
a:hover {
text-decoration:none;
color:black;
}
.navbar {
background-color:#478061;
border:0;
z-index: 1;
}
.nav li:hover {
background-color: black;
}
h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
padding-top:0.5em;
}
.btn-green {
color: #fff;
background-color: #478061;
border-color: #478061;
}
.btn-green:hover {
color: #fff;
background-color: black;
border-color: black;
}


@media (prefers-color-scheme: dark) {
body {
color: #ccc;
background-color: #222;
}
h1, h2, h3, h4, h5, h6 { color: #ccc; }
a {
color: #62b086;
}
a:hover {
color: #ccc;
}
hr {
border-top: 1px solid #888;
}
code {
background-color: inherit;
color: white;
}
pre {
background-color: #404040;
color: #d0d0d0;
}
.nav li:hover {
background-color: #222;
}
.navbar {
background-color: #295340;
}
}


table {
border-collapse: collapse;
overflow-y: auto;
border: 1px #478061 solid;
table-layout: fixed;
}

table td {
padding: 6px 20px;
}

table thead {
background: #478061;
color: #fff;
}

table thead th {
font-weight: 700;
text-align: center;
padding: 6px 20px;
}

thead th:nth-child(1) {
width: 50%;
}

thead th:nth-child(2) {
width: 20%;
}

thead th:nth-child(3) {
width: 30%;
}

tbody tr:nth-child(2n) {
background: #2c2c2c;
}
Loading

0 comments on commit 9212952

Please sign in to comment.