Browse Source

Remove legacy os/packages files and code.

Also updated nginx sample config and removed other webservers.
revert-43b95d76
Evilham 3 years ago
parent
commit
555fb194b2
  1. 467
      bin/update-packages
  2. 7
      config.rb.dist
  3. 28
      etc/apache-production.conf
  4. 102
      etc/nginx-development.conf
  5. 13
      etc/nginx-devuan.org.conf
  6. 80
      etc/nginx-devuan.org.include
  7. 115
      etc/nginx-production.conf
  8. 22
      etc/nginx/sites-available/devuan-web.conf
  9. 59
      etc/nginx/snippets/devuan-web.conf
  10. 6
      lib/devuan_helpers.rb
  11. 19
      source/os/packages/package.md.erb

467
bin/update-packages

@ -1,467 +0,0 @@
#!/usr/bin/env ruby
#
## Update data/devuan_packages.yml
require 'fileutils'
require 'net/https'
require 'uri'
require 'yaml'
require 'xz'
BASE = File.expand_path(File.dirname(File.dirname(__FILE__)))
module Devuan
module Constants
PACKAGES_HOST = "packages.devuan.org"
DISTS_PATH = "merged/dists"
RELEASES = {
stable: :jessie,
testing: :ascii,
unstable: :ceres
}.freeze
end
module Helpers
include Devuan::Constants
def tmp_path(path = '')
path = path.gsub('/', '-').gsub(/[^\w\.-]+/, '').gsub(/[-]+/, '-').strip
[ BASE, 'tmp', path ].compact.join('/')
end
def packages_url(path = '')
suite = RELEASES[@suite] || RELEASES[:stable]
URI.parse("https://#{PACKAGES_HOST}/#{DISTS_PATH}/#{suite}/#{path}")
end
def wget(url)
http = wconnect(url)
http.request(Net::HTTP::Get.new(url.request_uri))
end
def wconnect(url)
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
http
end
end
class WebFile
include ::Devuan::Helpers
attr_reader :data
def initialize(options = {})
@options = default_options.merge(options)
@suite = options[:suite] || RELEASES[:stable]
@uri = packages_url(@options[:uri])
@copy = tmp_path(@options[:uri])
# pass: `fetch: false` to use existing copy
@options[:fetch] = options.key?(:fetch) ? (options[:fetch] === true) : true
@data = {}
_ensure_tmp_dir
end
def uri=(uri)
@options[:uri] = uri
@options[:fetch] = true
@uri = packages_url(@options[:uri])
@copy = tmp_path(@options[:uri])
end
def fetch
if @options[:fetch]
res = wget(@uri)
File.open(@copy, 'w+') { |f| f.puts res.body }
end
if @copy =~ /.xz$/
_decompress_xz(@copy) if @options[:fetch]
@copy.gsub!(/.xz$/, '')
end
end
# Override in inherited class, return @data
def parse
lines = File.readlines(@copy)
raise NotImplementedError
end
protected
def method_missing(*args)
return @data[args.first] if @data.key?(args.first)
super
end
def value_at(line)
line.split(':').last.strip
end
private
def default_options
{ uri: 'Release' }
end
def _decompress_xz(file)
XZ.decompress_file(file, file.gsub(/.xz$/, ''))
end
def _ensure_tmp_dir()
FileUtils.mkdir_p(tmp_path, mode: 1700)
end
end
class GlobalReleaseFile < WebFile
def parse
lines = File.readlines(@copy)
@data[:origin] = value_at(lines[0])
@data[:label] = value_at(lines[1])
@data[:suite] = value_at(lines[2])
@data[:version] = value_at(lines[3])
@data[:codename] = value_at(lines[4])
@data[:valid_from] = value_at(lines[5])
@data[:valid_until] = value_at(lines[6])
@data[:architectures] = value_at(lines[7]).split(' ')
@data[:components] = value_at(lines[8]).split(' ')
@data[:description] = value_at(lines[9])
# Line 10 is the "MD5Sum" title
unless lines[10] =~ /^MD5Sum:$/
$stderr.puts "Changing times! MD5Sum line not found, but: '#{lines[10].strip}'"
return
end
# Grab all the MD5sums for verification
lines.shift 11
sums = lines.inject([]) do |x, l|
s, z, f = l.strip.split(/\s+/, 3)
x << { sum: s, size: z, file: f }
x
end
@data[:sums] = sums.sort_by { |x| x[:file] } rescue sums
@data
end
end
class ArchReleaseFile < WebFile
def parse
lines = File.readlines(@copy)
@data[:archive] = value_at(lines[0])
@data[:origin] = value_at(lines[1])
@data[:label] = value_at(lines[2])
@data[:version] = value_at(lines[3])
@data[:component] = value_at(lines[4])
@data[:architecture] = value_at(lines[5])
@data
end
end
class ArchPackagesFile < WebFile
def count
@data[:packages].size
end
def current_package
@data[:packages][@cursor]
end
def each(&block)
@data[:packages].each(&block)
end
def select(&block)
@data[:packages].select(&block)
end
def first
@cursor = 0
current_package
end
def next
@cursor += 1
current_package
end
def previous
@cursor -= 1
current_package
end
def last
@cursor = count
current_package
end
def parse
lines = File.read(@copy)
pkgs = lines.split("\n\n")
@data[:packages] = []
pkgs.each do |pkg|
x = {}
Devuan::Packages::Fields.each do |field|
key = field.downcase.gsub('-', '_').intern
if Devuan::Packages.stupid_field?(field)
x[:stupid] ||= []
x[:stupid] << field
end
if Devuan::Packages.multiline_field?(field)
x[key] = value_for(field, pkg, :multiline => true)
else
x[key] = value_for(field, pkg)
end
end
@data[:packages] << package_ds(x)
end
reset_cursor!
@data
end
protected
def reset_cursor!
@cursor = 0
end
def value_for(field, string, options = {})
if options[:multiline] # cut to next Field:
$1 if string =~ /^#{field}: (.*?)(\n[A-Z][\w-]+:)/m
else
$1 if string =~ /^#{field}: (.*)$/
end
end
protected
# Turn raw data from Packages into a proper data structure
def package_ds(raw)
pkg = {
name: raw[:package],
provides: raw[:provides],
description: raw[:description],
maintainer: raw[:maintainer],
essential: raw[:essential],
origin: raw[:origin],
priority: raw[:priority],
section: raw[:section],
task: raw[:task],
popcon: popcon_for(raw[:package]),
download_size: raw[:size],
installed_size: raw[:installed_size],
architectures: raw[:architectures],
multi_arch: raw[:multi_arch],
sums: {
md5: raw[:md5sum],
sha1: raw[:sha1],
sha256: raw[:sha256]
},
links: {
avatar: avatar_for(raw[:package]),
homepage: raw[:homepage],
issues: "https://git.devuan.org/devuan-packages/#{raw[:package]}/issues",
milestones: "https://git.devuan.org/devuan-packages/#{raw[:package]}/milestones"
},
upstream: upstream_info_for(raw[:package]),
dependencies: {
breaks: raw[:breaks],
conflicts: raw[:conflicts],
depends: raw[:depends],
pre_depends: raw[:pre_depends],
recommends: raw[:recommends],
suggests: raw[:suggests]
},
releases: {
stable: {
filename: "https://packages.devuan.org/#{raw[:filename]}",
tarball: nil,
version: raw[:version]
},
testing: {
filename: "https://packages.devuan.org/#{raw[:filename]}",
tarball: nil,
version: raw[:version]
},
unstable: {
filename: "https://packages.devuan.org/#{raw[:filename]}",
tarball: nil,
version: raw[:version]
}
},
meta: {
broken_home: raw[:homepage].nil?,
stupid: !raw[:stupid].empty?,
stupid_fields: raw[:stupid]
}
}
end
# Get avatar from gitlab
def avatar_for(pkg)
nil
end
# Get popcon info for package
def popcon_for(pkg)
nil
end
# Get upstream info for package
def upstream_info_for(pkg)
upstream = {
homepage: nil,
issues: nil,
maintainer: nil,
version: nil
}
end
end
module Packages
# grep -e '^[^ :]*: ' tmp/main-binary-amd64-Packages | cut -d: -f1 | sort | uniq
Fields = %w(Apport Architecture Breaks Bugs Build-Essential
Built-Using Conflicts Depends Description Description-md5 Enhances
Essential Filename Ghc-Package Gstreamer-Decoders Gstreamer-Elements
Gstreamer-Encoders Gstreamer-Uri-Sinks Gstreamer-Uri-Sources
Gstreamer-Version Homepage Installed-Size Lua-Versions Maintainer
MD5sum Modaliases Multi-Arch Npp-Applications Npp-Description
Npp-File Npp-Mimetype Npp-Name Origin Original-Maintainer
Original-Source-Maintainer Package Package-Type Postgresql-Version
Pre-Depends Priority Provides Python-Version Python-Versions
Recommends Replaces Ruby-Versions Section SHA1 SHA256 Size Source
Suggests Tag Task Version Xul-Appid)
# Multiline fields
MFields = %w(Description)
# Stupid fields
SFields = %w(Ghc-Package Gstreamer-Decoders Gstreamer-Elements
Gstreamer-Encoders Gstreamer-Uri-Sinks Gstreamer-Uri-Sources
Gstreamer-Version Lua-Versions Npp-Applications Npp-Description
Npp-File Npp-Mimetype Npp-Name Postgresql-Version Python-Version
Python-Versions Ruby-Versions Xul-Appid)
class << self
def multiline_field?(field)
MFields.include?(field)
end
def stupid_field?(field)
SFields.include?(field)
end
def release
return @release unless @release.nil?
@release = Devuan::GlobalReleaseFile.new
@release.fetch
@release.parse
@release
end
def packages
return @packages unless @packages.nil?
@packages = Devuan::ArchPackagesFile.new(uri: "main/binary-amd64/Packages.xz", fetch: false)
@packages.fetch
@packages.parse
@packages
end
# TODO: ask amprolla instead
def blacklisted
[ 'systemd', 'systemd-sysvinit' ]
end
def named(name)
packages.select { |x| x[:package] =~ /#{name}/ }
end
def depending_on(package)
pattern = Regexp.new(package)
packages.select do |x|
x[:pre_depends] =~ pattern || x[:depends] =~ pattern
end
end
def from_devuan
packages.select { |x| x[:releases][:stable][:version] =~ /[+]devuan/ }
end
def save_to_yml
File.open(BASE + '/tmp/packages.yml', 'w+') do |f|
f.puts(YAML.dump(packages))
end
File.open(BASE + '/tmp/devuan_packages.yml', 'w+') do |f|
f.puts(YAML.dump(from_devuan))
end
File.open(BASE + '/tmp/suspicious_packages.yml', 'w+') do |f|
f.puts(YAML.dump(depending_on('libsystemd0')))
end
end
protected
def method_missing(*args)
if packages.respond_to?(args.first)
packages.send(args.shift, *args)
else
super
end
end
end # class << self
end # Module Packages
end # Module Devuan
release = Devuan::GlobalReleaseFile.new(fetch: false)
release.fetch
release.parse
puts "Origin: #{release.origin}, version #{release.version}"
puts "Architectures: #{release.architectures}"
puts "Retrieving package information... Might take a while..."
puts "Retrieved information about #{Devuan::Packages.count} packages."
puts "Among those, #{Devuan::Packages.from_devuan.count} packages were modified by Devuan."
puts "E.g., #{Devuan::Packages.from_devuan.first[:name]}..."
puts "Saving to YAML format"
Devuan::Packages.save_to_yml
puts "Here comes the list of devuan-modified packages..."
puts Devuan::Packages.from_devuan.map { |x| x[:name] }.join(', ')
puts "Here is a list of packages starting with devuan:"
p Devuan::Packages.named('^devuan')
#.map { |x| x[:name] }.join(', ')
puts "#{Devuan::Packages.named('systemd').count} packages contain `systemd` in their name."
# Suspicious packages
libsystemd0_dependent = Devuan::Packages.depending_on('libsystemd0')
systemd_dependent = Devuan::Packages.depending_on('systemd')
remaining_packages_to_fix = libsystemd0_dependent - systemd_dependent
count = remaining_packages_to_fix.count
puts "There are #{libsystemd0_dependent.count} packages depending on libsystemd0:"
p libsystemd0_dependent.class
puts libsystemd0_dependent.map { |e| e[:name] }.join(', ')
p libsystemd0_dependent.first
if count > 0
puts "There are #{count} packages with dependency on systemd."
puts remaining_packages_to_fix.map(&:name).join(', ') unless count > 42
else
puts "Devuan #{release.version} is free from systemd dependencies!"
end

7
config.rb.dist

@ -28,13 +28,6 @@ page "/os/*", :layout => :os
# :which_fake_page => "Rendering a fake page with a local variable" }
# Don't use this for old URLs: see etc/
#activate :devuan_packages
data.devuan.packages.each do |pkg|
proxy "/os/packages/#{pkg.name}.html", "os/packages/package.html",
:locals => { :pkg => pkg }, :ignore => true
end
###
# Variables (DO NOT CHANGE)
###

28
etc/apache-production.conf

@ -1,28 +0,0 @@
#
# beta.devuan.org
#
# Production version
#
<VirtualHost *:80>
ServerName beta.devuan.org
Redirect / https://beta.devuan.org
</VirtualHost>
<VirtualHost *:443>
ServerName beta.devuan.org
ServerAdmin webmaster@devuan.org
DocumentRoot /srv/www/beta.devuan.org
DirectoryIndex index.html
ErrorDocument 404 /_error/404.html
ErrorDocument 403 /_error/403.html
ErrorDocument 500 502 503 /_error/50x.html
# TODO Add TLS configuration
<Location />
Options +Indexes +MultiViews
AllowOverride None
</Location>
</VirtualHost>

102
etc/nginx-development.conf

@ -1,102 +0,0 @@
#
# devuan.org
#
# Development version
#
# Add a fake domain for development:
# echo '127.0.0.1 devuan.invalid' | sudo tee -a /etc/hosts
# Run middleman locally:
# gem install middleman
# middleman server -p 4569
#
upstream devuan_org {
server 127.0.0.1:4569;
}
server {
listen 127.0.0.1:80;
server_name devuan.invalid;
root /srv/www/devuan.invalid/public;
index index.html;
# Old URLs
rewrite ^/communicate.*$ /os/debian-fork permanent;
rewrite ^/donate.*$ /os/donate permanent;
rewrite ^/files/devuan.mp3
/os/download/media/devuan.mp3 permanent;
rewrite ^/files/devuan.wav
/os/download/media/devuan.wav permanent;
rewrite ^/(Devuan_budget|devuan_financial_report_2014).pdf
/os/download/report/devuan_budget_2014.pdf permanent;
rewrite ^/devuan_financial_report_2015.pdf
/os/download/report/devuan_financial_report_2015.pdf permanent;
rewrite ^/newsletter_22dec.html
/os/debian-fork/newsletter-12014-12-22 permanent;
rewrite ^/pub.key /os/keyring/repository@devuan.org.asc permanent;
# Old dismissed locations
# Mirror: comment out if that interferes with your site.
location ^/(css|img|js) { return 404; }
# Is this still needed?
location = /google1b5b85f34f8aa7f8.html {
echo "google-site-verification: google1b5b85f34f8aa7f8.html";
}
# Virtual /my Devuan
location /my {
set $gdo https://git.devuan.org;
set $tdo https://talk.devuan.org;
rewrite ^/my/dashboard $gdo/dashboard redirect;
rewrite ^/my/milestones $gdo/dashboard/milestones redirect;
rewrite ^/my/todo.* $gdo/dashboard/todos?state=pending redirect;
rewrite ^/my/activity $tdo/my/activity redirect;
rewrite ^/my/bookmarks $tdo/my/activity/bookmarks redirect;
rewrite ^/my/messages $tdo/my/messages redirect;
rewrite ^/my/preferences $tdo/my/preferences redirect;
rewrite ^/my/profile $tdo/my/profile redirect;
return 403;
}
location ~ ^(/os/releases) {
rewrite ^/os/releases/stable $1/jessie last;
rewrite ^/os/releases/testing $1/ascii last;
rewrite ^/os/releases/unstable $1/ceres last;
}
# Localize error pages
# Defaults to English
# MIRROR: change /en for your locale!
error_page 403 /en/error/403.html;
error_page 404 /en/error/404.html;
error_page 501 502 503 /en/error/50x.html;
location ~ ^/(de|en|es|fr|it) {
try_files $uri $uri.html $uri/ @backend;
error_page 403 /$1/error/403.html;
error_page 404 /$1/error/404.html;
error_page 501 502 503 /$1/error/50x.html;
}
location / {
try_files $uri $uri.html $uri/ @backend;
error_page 403 /en/error/403.html;
error_page 404 /en/error/404.html;
error_page 501 502 503 /en/error/50x.html;
}
# Links are made like this: /:locale/path
# But English is the default language, so we skip /en
# MIRROR: you may want to switch to your language instead!
rewrite ^/en/(.*)$ /$1 last;
# rewrite ^/fr/(.*)$ /$1 last; # French mirror example
location @backend {
return 404; # Comment this if you want to run middleman locally
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_intercept_errors off;
proxy_pass http://devuan_org;
}
}

13
etc/nginx-devuan.org.conf

@ -1,13 +0,0 @@
#
## devuan.org
#
# Configuration for Jessie beta
#
server {
listen :80;
listen :443;
server_name devuan.org www.devuan.org;
rewrite ^ https://beta.devuan.org$uri redirect;
}

80
etc/nginx-devuan.org.include

@ -1,80 +0,0 @@
# This is the main configuration for devuan.org
# It's included in /etc/nginx/sites-available/devuan.org.conf
# Old URLs
rewrite ^/communicate.*$ /os/debian-fork permanent;
# rewrite ^/releases.*$ https://files.devuan.org permanent;
rewrite ^/os/releases/.*$ /os/releases permanent;
# rewrite ^/os/releases/jessie.*$ https://files.devuan.org permanent;
rewrite ^/donate.*$ /os/donate permanent;
rewrite ^/files/devuan.mp3
/os/download/media/devuan.mp3 permanent;
rewrite ^/files/devuan.wav
/os/download/media/devuan.wav permanent;
rewrite ^/(Devuan_budget|devuan_financial_report_2014).pdf
/os/download/report/devuan_budget_2014.pdf permanent;
rewrite ^/devuan_financial_report_2015.pdf
/os/download/report/devuan_financial_report_2015.pdf permanent;
rewrite ^/newsletter_22dec.html
/os/debian-fork/newsletter-12014-12-22 permanent;
rewrite ^/pub.key /os/download/devuan-release-key.pub permanent;
# Virtual /my Devuan
location /my {
set $gdo https://git.devuan.org;
rewrite ^/my/dashboard $gdo/dashboard redirect;
rewrite ^/my/milestones $gdo/dashboard/milestones redirect;
rewrite ^/my/todo.* $gdo/dashboard/todos?state=pending redirect;
set $tdo https://talk.devuan.org;
rewrite ^/my/activity $tdo/my/activity redirect;
rewrite ^/my/bookmarks $tdo/my/activity/bookmarks redirect;
rewrite ^/my/messages $tdo/my/messages redirect;
rewrite ^/my/preferences $tdo/my/preferences redirect;
}
# Robots
location = /robots.txt {
echo "User-agent: Twitterbot";
echo "Disallow:";
echo "";
echo "User-agent: *";
echo "Disallow: /index.html?";
echo "Disallow: /?";
echo "Disallow: /my";
echo "Disallow: /os/download";
echo "Allow: /os/download/media/devuan.mp3";
echo "Allow: /os/download/media/devuan.wav";
echo "Allow: /os/download/media/devuan_press_kit.zip";
echo "Allow: /os/download/report/devuan_financial_report_2014.pdf";
echo "Allow: /os/download/report/devuan_financial_report_2015.pdf";
echo "Allow: /os/download/devuan_jessie_1.0.0_beta.torrent";
echo "Allow: /os/download/devuan-trademark.pdf";
echo "Disallow: /ui";
echo "Allow: /ui/img/devuan-emblem.png";
echo "Allow: /ui/img/devuan-emblem.svg";
echo "Allow: /ui/img/devuan-logo.png";
echo "Allow: /ui/img/devuan-logo-with-registered-trademark-sign.svg";
echo "Sitemap: /os/sitemap.xml";
}
# Cache assets
location ~* ^/ui/(css|img) {
try_files $uri.gz $uri =404;
expires +1y;
}
# Download (fixes #125)
location ~ ^/os/download {
try_files $uri @files;
}
# TODO: Lookup /etc for matching file and redirect to /os/etc/...
# location @fs {}
location @files {
return 302 https://files.devuan.org/?ref=$uri;
access_log /var/log/nginx/devuan.org_download_redirects.log;
}

115
etc/nginx-production.conf

@ -1,115 +0,0 @@
#
# beta.devuan.org
#
# Production version
#
server {
listen *:80;
server_name beta.devuan.org;
location ~ ^/.well-known/acme-challenge {
root /srv/letsencrypt;
}
rewrite ^ https://$server_name$uri permanent;
}
server {
listen *:443 ssl;
server_name beta.devuan.org;
# Mirror example:
# server_name beta.devuan.org fr.devuan.org devuan.fr;
root /srv/beta.devuan.org/public;
# Old URLs
rewrite ^/communicate.*$ /os/debian-fork permanent;
rewrite ^/donate.*$ /os/donate permanent;
rewrite ^/files/devuan.mp3
/os/download/media/devuan.mp3 permanent;
rewrite ^/files/devuan.wav
/os/download/media/devuan.wav permanent;
rewrite ^/(Devuan_budget|devuan_financial_report_2014).pdf
/os/download/report/devuan_budget_2014.pdf permanent;
rewrite ^/devuan_financial_report_2015.pdf
/os/download/report/devuan_financial_report_2015.pdf permanent;
rewrite ^/newsletter_22dec.html
/os/debian-fork/newsletter-12014-12-22 permanent;
rewrite ^/pub.key /os/keyring/repository@devuan.org.asc;
# Old dismissed locations
# Mirror: comment out if that interferes with your site.
location ^/(css|img|js) { return 404; }
# Moved sitemap up because of conflicting layout
rewrite ^/os/sitemap.xml /sitemap.xml permanent;
# Is this still needed?
location = /google1b5b85f34f8aa7f8.html {
echo "google-site-verification: google1b5b85f34f8aa7f8.html";
}
# Virtual /my Devuan
location /my {
set $gdo https://git.devuan.org;
set $tdo https://talk.devuan.org;
rewrite ^/my/dashboard $gdo/dashboard redirect;
rewrite ^/my/milestones $gdo/dashboard/milestones redirect;
rewrite ^/my/todo.* $gdo/dashboard/todos?state=pending redirect;
rewrite ^/my/activity $tdo/my/activity redirect;
rewrite ^/my/bookmarks $tdo/my/activity/bookmarks redirect;
rewrite ^/my/messages $tdo/my/messages redirect;
rewrite ^/my/preferences $tdo/my/preferences redirect;
rewrite ^/my/profile $tdo/my/profile redirect;
return 403;
}
# Localize error pages, English default
error_page 403 /en/error/403.html;
error_page 404 /en/error/404.html;
error_page 500 502 503 /en/error/50x.html;
location /en/error {
internal;
}
location ~ ^/(de|en|es|fr|it) {
try_files $uri $uri.html $uri/ =404;
error_page 403 /$1/error/403.html;
error_page 404 /$1/error/404.html;
error_page 501 502 503 /$1/error/50x.html;
}
# Links are made like this: /:locale/path
# But English is the default language so we skip /en
# MIRROR: you may want to switch to your language instead!
rewrite ^/en/(.*)$ /$1 last;
# rewrite ^/fr/(.*)$ /$1 last; # French mirror example
# Add TLS configuration
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
ssl_ecdh_curve secp384r1; # Requires nginx >= 1.1.0
ssl_prefer_server_ciphers on;
ssl_session_cache builtin:1000 shared:SSL:10m;
# ssl_session_tickets off; # Requires nginx >= 1.5.9
# ssl_stapling on; # Requires nginx >= 1.3.7
# ssl_stapling_verify on; # Requires nginx => 1.3.7
# Add your DNS resolvers and adjust timeout (default is 5s)
resolver 8.8.8.8 valid=300s;
resolver_timeout 3s;
ssl_certificate /srv/beta.devuan.org/etc/ssl/beta.crt.pem;
ssl_certificate_key /srv/beta.devuan.org/etc/ssl/beta.key.pem;
add_header X-Frame-Options "ALLOW-FROM https://talk.devuan.org";
add_header Access-Control-Allow-Origin https://beta.devuan.org,https://talk.devuan.org,https://git.devuan.org,https://devuan.org;
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
add_header X-Content-Security-Policy "default-src 'self'; script-src 'self'; img-src 'self'";
add_header X-Content-Type-Options nosniff;
location / {
try_files $uri $uri.html $uri/ =404;
}
access_log /var/log/nginx/beta.devuan.org_access.log;
error_log /var/log/nginx/beta.devuan.org_error.log;
}

22
etc/nginx/sites-available/devuan-web.conf

@ -0,0 +1,22 @@
#
# Basic nginx config.
# TLS support, redirects, are missing here.
#
server {
listen 80;
server_name devuanzuwu3xoqwp.onion;
root /var/www/devuan-www/public.current;
include /etc/nginx/snippets/devuan-web.conf;
}
server {
listen 80;
server_name devuan.org www.devuan.org;
root /var/www/devuan-www;
include /etc/nginx/snippets/devuan-web.conf;
}

59
etc/nginx/snippets/devuan-web.conf

@ -0,0 +1,59 @@
#
# BEGIN Old config
# TODO: Check if this is still valid
#
# This is the main configuration for devuan.org
# It's included in /etc/nginx/sites-available/devuan.org.conf
# Old URLs
rewrite ^/communicate.*$ /os/debian-fork permanent;
# rewrite ^/releases.*$ https://files.devuan.org permanent;
rewrite ^/os/releases/.*$ /os/releases permanent;
rewrite ^/os/mirror.*$ /#download permanent;
# https://files.devuan.org permanent;
# rewrite ^/os/releases/jessie.*$ https://files.devuan.org permanent;
rewrite ^/donate.*$ /os/donate permanent;
rewrite ^/files/devuan.mp3
/os/download/media/devuan.mp3 permanent;
rewrite ^/files/devuan.wav
/os/download/media/devuan.wav permanent;
rewrite ^/(Devuan_budget|devuan_financial_report_2014).pdf
/os/download/report/devuan_budget_2014.pdf permanent;
rewrite ^/devuan_financial_report_2015.pdf
/os/download/report/devuan_financial_report_2015.pdf permanent;
rewrite ^/newsletter_22dec.html
/os/debian-fork/newsletter-12014-12-22 permanent;
#
# END Old config
#
# Update this each year to "current" d1conf announcement page.
location ~ ^/d1conf(|/)$ {
return 307 $scheme://$server_name/os/debian-fork/d1conf-announce-20190119;
}
# Redirect legacy package listing to pkginfo.devuan.org
location ~ /os/packages/(.*) {
return 301 https://pkginfo.devuan.org/cgi-bin/d1pkgweb-query?search=$1;
}
# Mirror: change 'en' with your language
# Localize error pages, English default
error_page 403 /error/403.html;
error_page 404 /error/404.html;
error_page 500 501 502 503 /error/50x.html;
location /error {
internal;
}
# Links are made like this: /:locale/path
# But English is the default language so we skip /en
# Mirror: switch to your language instead!
# rewrite ^/fr/(.*)$ /$1 last; # French mirror example
rewrite ^/en/(.*)$ /$1 last; # Mirror: comment out if you mirror a translation
location / {
autoindex off;
try_files $uri $uri/index.html $uri.htm $uri.html =404;
}

6
lib/devuan_helpers.rb

@ -118,12 +118,6 @@ module DevuanHelpers
end || "unknown license: #{l}"
end
def package
# name = current_page.path.split('/').pop.sub!('/(index)?\.html/', '').to_s
# require(__DIR__ + '/plugins/devuan_packages/lib/devuan_packages.rb')
# devuan_packages(name)
end
def pkg_classification(pkg)
c = [pkg.origin, pkg.section, pkg.priority, (t(:essential) if pkg.essential == 'yes')]
content_tag('p', c.compact.join(' : '), class: 'classification')

19
source/os/packages/package.md.erb

@ -1,19 +0,0 @@
---
title: "Devuan Package Search"
---
# Search Devuan Packages
## Devuan's New Package Search Function:
## [https://pkginfo.devuan.org](https://pkginfo.devuan.org)
## Forked and Original Devuan Packages:
## [https://git.devuan.org/groups/devuan-packages](https://git.devuan.org/groups/devuan-packages)
## If you can’t find a package, check the list of banned packages:
## [https://pkgmaster.devuan.org/bannedpackages.txt](https://pkgmaster.devuan.org/bannedpackages.txt)
<!-- title <%= pkg.name %> body <%= partial 'devuan_package', :locals => { pkg: pkg, summary: false } %> -->
Loading…
Cancel
Save