Browse Source

Automate mirrors page from data/mirrors.yml + Add c3l

revert-177e550a
hellekin 7 years ago
parent
commit
f3d247cd3f
  1. 21
      data/mirrors.yml
  2. 9
      lib/devuan_helpers.rb
  3. 15
      source/pages/os/mirrors.en.html.md.erb
  4. 6
      source/partials/_mirror_fdo.erb

21
data/mirrors.yml

@ -2,15 +2,26 @@
fdo:
- name: neo900
host: devuan-temporary-mirror.almesberger.net
status: working
status: active
path: /files.devuan.org/
protocols:
- http
issue: https://git.devuan.org/devuan-editors/devuan-www/issues/118
maintainer: https://git.devuan.org/u/joerg_rw
frequency: 3600
frequency: 1
bandwidth: 1Gbps / 200Mbps per connection
location: Germany
- name: c3l
host: devuan.c3l.lu
status: active
protocols:
- https
- http
issue: https://git.devuan.org/devuan-editors/devuan-www/issues/121
maintainer: https://git.devuan.org/u/virii
frequency: 4
bandwidth: 1Gpbs
location: Luxemburg
- name: selea
host: devuan.selea.se
status: pending
@ -19,17 +30,17 @@ fdo:
- http
issue: https://git.devuan.org/devuan-editors/devuan-www/issues/120
maintainer: https://git.devuan.org/u/Sweg
frequency: 14400
frequency: 4
bandwidth: 2gbps / 200Mbps per connection
location: Gotherburg, Sweden
- name: 4isp
status: working
status: active
host: devuan.4isp.it
protocols:
- https
- rsync
issue: https://git.devuan.org/devuan-editors/devuan-www/issues/116
maintainer: https://git.devuan.org/u/phcv
frequency: 14400
frequency: 4
bandwidth: 40Mbps
location: Italy

9
lib/devuan_helpers.rb

@ -34,6 +34,15 @@ module DevuanHelpers
link_to(t(:issues), "#{PROJECT_URL}/issues/new?issue[label_ids][]=1291&issue[title]=#{current_page.url}")
end
def fdo_mirror_countries
countries = []
data.mirrors.fdo.sort_by { |m| m.location }.each do |m|
country = m.location.match(/,/) ? m.location.split(',').last.strip : m.location
countries << country unless countries.include?(country)
end
countries.sort
end
def national_mirrors(mirrors, country)
national_mirrors = ""
mirrors.each do |m|

15
source/pages/os/mirrors.en.html.md.erb

@ -7,14 +7,7 @@ title: Devuan Mirrors
This is a list of local mirrors for [files.devuan.org](https://files.devuan.org/).
To add your mirror to this list, please see [MIRRORS.txt](https://files.devuan.org/MIRRORS.txt).
## Germany
<%= national_mirrors(data.mirrors.fdo, 'Germany') %>
## Italy
<%= national_mirrors(data.mirrors.fdo, 'Italy') %>
## Sweden
<%= national_mirrors(data.mirrors.fdo, 'Sweden') %>
<% fdo_mirror_countries.each do |c| %>
## <%= c %>
<%= national_mirrors(data.mirrors.fdo, c) %>
<% end %>

6
source/partials/_mirror_fdo.erb

@ -1,8 +1,8 @@
### <%= link_to(m.name, "http://#{m.host}#{m.path}") %>
<%= content_tag(:h3, link_to(m.name, "http://#{m.host}#{m.path}")) %>
- <%= m.protocols.map do |p|
link_to(p, URI.parse("#{p}://#{m.host}#{m.path}"))
end.join(', ') %>
- Bandwidth: <%= m.bandwidth %>
- Frequency: <%= pluralize(m.frequency / 3600, 'hour') %>
- See <%= link_to('issue', m.issue) %>
- Frequency: <%= pluralize(m.frequency, 'hour') %>
- Status: <%= link_to(m.status, m.issue) %>

Loading…
Cancel
Save