Skip to content

Commit da9dae1

Browse files
authored
Merge pull request #34 from josephw/use-docker
Allow building a Docker image for the Feedvalidator
2 parents 9bb3a63 + d2df756 commit da9dae1

File tree

3 files changed

+96
-0
lines changed

3 files changed

+96
-0
lines changed

Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM debian:9.6
2+
3+
RUN apt-get update
4+
RUN apt-get --yes install apache2
5+
RUN apt-get --yes install python
6+
RUN apt-get --yes install ca-certificates
7+
8+
RUN a2dissite 000-default
9+
10+
RUN a2enmod cgid
11+
RUN a2enmod rewrite
12+
RUN echo 'ServerName feedvalidator.org' >>/etc/apache2/apache2.conf
13+
14+
WORKDIR /feedvalidator
15+
16+
ADD . /feedvalidator
17+
ADD sites-available-feedvalidator.conf /etc/apache2/sites-available/feedvalidator.conf
18+
19+
RUN a2ensite feedvalidator
20+
21+
EXPOSE 80
22+
23+
ENV HTTP_HOST https://feedvalidator.org/
24+
ENV SCRIPT_NAME check.cgi
25+
ENV SCRIPT_FILENAME /feedvalidator/check.cgi
26+
27+
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ operating system supports them. Its web page is at
99
provided.
1010

1111
Python 2.3.x is required, for its Unicode support.
12+
13+
To run with Docker:
14+
docker build -t feedvalidator .
15+
docker run -p 8080:80 feedvalidator

sites-available-feedvalidator.conf

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<VirtualHost *:80>
2+
ServerAdmin webmaster@localhost
3+
4+
DocumentRoot /feedvalidator
5+
<Directory /feedvalidator>
6+
Require all granted
7+
8+
Options +ExecCGI -MultiViews
9+
AddHandler cgi-script .cgi
10+
AddType image/x-icon ico
11+
12+
RewriteRule ^check$ check.cgi
13+
14+
DirectoryIndex index.html check.cgi
15+
</Directory>
16+
17+
ErrorLog ${APACHE_LOG_DIR}/error.log
18+
19+
# Possible values include: debug, info, notice, warn, error, crit,
20+
# alert, emerg.
21+
LogLevel warn
22+
23+
CustomLog ${APACHE_LOG_DIR}/access.log combined
24+
25+
# MAP - bad bots are killing the server (everybody links to their validation results and the bots dutifully crawl it)
26+
RewriteEngine on
27+
RewriteCond %{HTTP_USER_AGENT} BecomeBot [OR]
28+
RewriteCond %{HTTP_USER_AGENT} Crawler [OR]
29+
RewriteCond %{HTTP_USER_AGENT} FatBot [OR]
30+
RewriteCond %{HTTP_USER_AGENT} Feed24 [OR]
31+
RewriteCond %{HTTP_USER_AGENT} Gigabot [OR]
32+
RewriteCond %{HTTP_USER_AGENT} Googlebot [OR]
33+
RewriteCond %{HTTP_USER_AGENT} htdig [OR]
34+
RewriteCond %{HTTP_USER_AGENT} HttpClient [OR]
35+
RewriteCond %{HTTP_USER_AGENT} HTTrack [OR]
36+
RewriteCond %{HTTP_USER_AGENT} IQSearch [OR]
37+
RewriteCond %{HTTP_USER_AGENT} msnbot [OR]
38+
RewriteCond %{HTTP_USER_AGENT} NaverBot [OR]
39+
RewriteCond %{HTTP_USER_AGENT} OmniExplorer [OR]
40+
RewriteCond %{HTTP_USER_AGENT} SietsCrawler [OR]
41+
RewriteCond %{HTTP_USER_AGENT} Thunderbird [OR]
42+
RewriteCond %{HTTP_USER_AGENT} TurnitinBot [OR]
43+
RewriteCond %{HTTP_USER_AGENT} User-Agent [OR]
44+
RewriteCond %{HTTP_USER_AGENT} Yahoo!.Slurp
45+
RewriteRule check - [F,L]
46+
47+
48+
<Files check.cgi>
49+
Deny from feeds01.archive.org
50+
Deny from www.feedvalidator.org
51+
Deny from new.getfilesfast.com
52+
Deny from gnat.yodlee.com
53+
Deny from master.macworld.com
54+
Deny from 62.244.248.104
55+
Deny from 207.97.204.219
56+
Deny from ik63025.ikexpress.com
57+
Deny from 65-86-180-70.client.dsl.net
58+
Deny from vanadium.sabren.com
59+
</Files>
60+
61+
<Files config.py>
62+
ForceType text/plain
63+
</Files>
64+
65+
</VirtualHost>

0 commit comments

Comments
 (0)