Skip to content

Commit

Permalink
Move DMCA to a static site
Browse files Browse the repository at this point in the history
  • Loading branch information
Firefishy committed Dec 11, 2024
1 parent b0f3bba commit 7bfd2a3
Show file tree
Hide file tree
Showing 15 changed files with 386 additions and 353 deletions.
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/vendor
composer.phar
.DS_Store
_site
.sass-cache
.jekyll-cache
.jekyll-metadata
vendor
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.3.6
25 changes: 25 additions & 0 deletions 404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
permalink: /404.html
layout: default
---

<style type="text/css" media="screen">
.container {
margin: 10px auto;
max-width: 600px;
text-align: center;
}
h1 {
margin: 30px 0;
font-size: 4em;
line-height: 1;
letter-spacing: -1px;
}
</style>

<div class="container">
<h1>404</h1>

<p><strong>Page not found :(</strong></p>
<p>The requested page could not be found.</p>
</div>
63 changes: 42 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,51 @@
FROM docker.io/library/php:7-apache
# This file is used if building for Production environments
# It uses a multi-stage build to run jekyll to populate an nginx container

# Use port 8080
RUN sed -i "s/80/8080/g" /etc/apache2/sites-available/000-default.conf /etc/apache2/ports.conf
FROM docker.io/library/ruby:3.3 as build

# Install composer requirements
# Add Gem build requirements
RUN apt-get update && apt-get install -y \
libzip-dev \
zip \
&& docker-php-ext-install zip \
&& rm -rf /var/lib/apt/lists/*
g++ \
make \
&& rm -rf /var/lib/apt/lists/*

# Install composer
COPY --from=docker.io/library/composer:2 /usr/bin/composer /usr/bin/composer
# Create app directory
WORKDIR /app

WORKDIR /var/www/html/
ADD . /var/www/html/
# Add Gemfile and Gemfile.lock
ADD Gemfile* /app/

# Add user
RUN groupadd -r user && useradd -m -r -g user user
RUN mkdir -p /var/www/html/vendor && chown user:user /var/www/html/vendor
USER user
# Install Gems
RUN gem install bundler -v 2.5.23 \
&& bundle config build.nokogiri --use-system-libraries \
&& bundle config --global jobs $(nproc) \
&& bundle config set deployment 'true' \
&& bundle config set no-cache 'true' \
&& bundle install \
&& bundle clean

# Install composer dependencies
RUN composer install --no-dev --no-cache --no-interaction --no-progress --optimize-autoloader
# Copy Site Files
COPY . .

# Basic Linting
RUN php -l index.php
ENV JEKYLL_ENV=production

CMD ["docker-php-entrypoint", "apache2-foreground"]
# Run jekyll build site
RUN bundle exec jekyll build --verbose

#-------------------------------------------------
# https://github.com/nginxinc/docker-nginx-unprivileged
FROM ghcr.io/nginxinc/nginx-unprivileged:stable-alpine as webserver

RUN echo "absolute_redirect off;" >/etc/nginx/conf.d/no-absolute_redirect.conf
RUN echo "gzip_static on; gzip_proxied any;" >/etc/nginx/conf.d/gzip_static.conf
# brotli_static not yet available in standard nginx distribution
# RUN echo "brotli_static on; brotli_proxied any;" >/etc/nginx/conf.d/brotli_static.conf

# Copy built site from build stage
COPY --from=build /app/_site /usr/share/nginx/html

# Test configuration during docker build
RUN nginx -t

# Port the container will listen on
EXPOSE 8080
23 changes: 23 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
source "https://rubygems.org"

gem "jekyll", "~> 4.3.4"
gem "minima", "~> 2.5"
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.12"
gem 'jekyll-gzip'
# gem 'jekyll-brotli'
end

# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
platforms :mingw, :x64_mingw, :mswin, :jruby do
gem "tzinfo", ">= 1", "< 3"
gem "tzinfo-data"
end

# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1", :platforms => [:mingw, :x64_mingw, :mswin]

# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
# do not have a Java counterpart.
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]
185 changes: 185 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
bigdecimal (3.1.8)
colorator (1.1.0)
concurrent-ruby (1.3.4)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
eventmachine (1.2.7)
ffi (1.17.0)
ffi (1.17.0-aarch64-linux-gnu)
ffi (1.17.0-aarch64-linux-musl)
ffi (1.17.0-arm-linux-gnu)
ffi (1.17.0-arm-linux-musl)
ffi (1.17.0-arm64-darwin)
ffi (1.17.0-x86-linux-gnu)
ffi (1.17.0-x86-linux-musl)
ffi (1.17.0-x86_64-darwin)
ffi (1.17.0-x86_64-linux-gnu)
ffi (1.17.0-x86_64-linux-musl)
forwardable-extended (2.6.0)
google-protobuf (4.29.1)
bigdecimal
rake (>= 13)
google-protobuf (4.29.1-aarch64-linux)
bigdecimal
rake (>= 13)
google-protobuf (4.29.1-arm64-darwin)
bigdecimal
rake (>= 13)
google-protobuf (4.29.1-x86-linux)
bigdecimal
rake (>= 13)
google-protobuf (4.29.1-x86_64-darwin)
bigdecimal
rake (>= 13)
google-protobuf (4.29.1-x86_64-linux)
bigdecimal
rake (>= 13)
http_parser.rb (0.8.0)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
jekyll (4.3.4)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 1.0)
jekyll-sass-converter (>= 2.0, < 4.0)
jekyll-watch (~> 2.0)
kramdown (~> 2.3, >= 2.3.1)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (>= 0.3.6, < 0.5)
pathutil (~> 0.9)
rouge (>= 3.0, < 5.0)
safe_yaml (~> 1.0)
terminal-table (>= 1.8, < 4.0)
webrick (~> 1.7)
jekyll-feed (0.17.0)
jekyll (>= 3.7, < 5.0)
jekyll-gzip (2.5.1)
jekyll (>= 3.0, < 5.0)
jekyll-sass-converter (3.0.0)
sass-embedded (~> 1.54)
jekyll-seo-tag (2.8.0)
jekyll (>= 3.8, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
kramdown (2.5.1)
rexml (>= 3.3.9)
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.4)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
minima (2.5.2)
jekyll (>= 3.5, < 5.0)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (6.0.1)
rake (13.2.1)
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rexml (3.3.9)
rouge (4.5.1)
safe_yaml (1.0.5)
sass-embedded (1.82.0)
google-protobuf (~> 4.28)
rake (>= 13)
sass-embedded (1.82.0-aarch64-linux-android)
google-protobuf (~> 4.28)
sass-embedded (1.82.0-aarch64-linux-gnu)
google-protobuf (~> 4.28)
sass-embedded (1.82.0-aarch64-linux-musl)
google-protobuf (~> 4.28)
sass-embedded (1.82.0-aarch64-mingw-ucrt)
google-protobuf (~> 4.28)
sass-embedded (1.82.0-arm-linux-androideabi)
google-protobuf (~> 4.28)
sass-embedded (1.82.0-arm-linux-gnueabihf)
google-protobuf (~> 4.28)
sass-embedded (1.82.0-arm-linux-musleabihf)
google-protobuf (~> 4.28)
sass-embedded (1.82.0-arm64-darwin)
google-protobuf (~> 4.28)
sass-embedded (1.82.0-riscv64-linux-android)
google-protobuf (~> 4.28)
sass-embedded (1.82.0-riscv64-linux-gnu)
google-protobuf (~> 4.28)
sass-embedded (1.82.0-riscv64-linux-musl)
google-protobuf (~> 4.28)
sass-embedded (1.82.0-x86-cygwin)
google-protobuf (~> 4.28)
sass-embedded (1.82.0-x86-linux-android)
google-protobuf (~> 4.28)
sass-embedded (1.82.0-x86-linux-gnu)
google-protobuf (~> 4.28)
sass-embedded (1.82.0-x86-linux-musl)
google-protobuf (~> 4.28)
sass-embedded (1.82.0-x86-mingw-ucrt)
google-protobuf (~> 4.28)
sass-embedded (1.82.0-x86_64-cygwin)
google-protobuf (~> 4.28)
sass-embedded (1.82.0-x86_64-darwin)
google-protobuf (~> 4.28)
sass-embedded (1.82.0-x86_64-linux-android)
google-protobuf (~> 4.28)
sass-embedded (1.82.0-x86_64-linux-gnu)
google-protobuf (~> 4.28)
sass-embedded (1.82.0-x86_64-linux-musl)
google-protobuf (~> 4.28)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
unicode-display_width (2.6.0)
webrick (1.9.1)

PLATFORMS
aarch64-linux
aarch64-linux-android
aarch64-linux-gnu
aarch64-linux-musl
aarch64-mingw-ucrt
arm-linux-androideabi
arm-linux-gnu
arm-linux-gnueabihf
arm-linux-musl
arm-linux-musleabihf
arm64-darwin
riscv64-linux-android
riscv64-linux-gnu
riscv64-linux-musl
ruby
x86-cygwin
x86-linux
x86-linux-android
x86-linux-gnu
x86-linux-musl
x86-mingw-ucrt
x86_64-cygwin
x86_64-darwin
x86_64-linux
x86_64-linux-android
x86_64-linux-gnu
x86_64-linux-musl

DEPENDENCIES
http_parser.rb (~> 0.6.0)
jekyll (~> 4.3.4)
jekyll-feed (~> 0.12)
jekyll-gzip
minima (~> 2.5)
tzinfo (>= 1, < 3)
tzinfo-data
wdm (~> 0.1)

BUNDLED WITH
2.5.23
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# dmca.openstreetmap.org

PHP quickforms website for OpenStreetMap.org DMCA notification website.
Jejyll website for OpenStreetMap.org DMCA website.
32 changes: 32 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
title: OpenStreetMap Foundation - DMCA Notice Procedure
description: "How to send a DMCA notice to the OpenStreetMap Foundation."
baseurl: "" # the subpath of your site, e.g. /blog
url: "https://dmca.openstreetmap.org" # the base hostname & protocol for your site, e.g. http://example.com

markdown: kramdown

# Build settings
theme: minima
plugins:
- jekyll-feed
- jekyll-gzip

# Exclude from processing.
# The following items will not be processed, by default.
# Any item listed under the `exclude:` key here will be automatically added to
# the internal "default list".
#
# Excluded items can be processed by explicitly listing the directories or
# their entries' file path in the `include:` list.
#
# exclude:
# - .sass-cache/
# - .jekyll-cache/
# - gemfiles/
# - Gemfile
# - Gemfile.lock
# - node_modules/
# - vendor/bundle/
# - vendor/cache/
# - vendor/gems/
# - vendor/ruby/
20 changes: 20 additions & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ page.title }} | {{ site.title }}</title>
<link rel="stylesheet" href="/assets/style.css">
</head>
<body>
<header>
<h1><a href="{{ site.baseurl }}/">{{ site.title }}</a></h1>
</header>
<main>
{{ content }}
</main>
<footer>
<p>&copy; {{ "now" | date: "%Y" }} OpenStreetMap Foundation</p>
</footer>
</body>
</html>
16 changes: 16 additions & 0 deletions assets/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
body {
font-family: Arial, sans-serif;
line-height: 1.6;
margin: 0 auto;
padding: 2rem;
max-width: 800px;
}
header, footer {
text-align: center;
margin-bottom: 2rem;
}
header h1 a {
text-decoration: none;
color: #333;
}

Loading

0 comments on commit 7bfd2a3

Please sign in to comment.