Skip to content

Commit e42d124

Browse files
authored
Merge pull request #865 from openwebwork/rel-ww2.14
Rel ww2.14
2 parents 2ebce59 + 1a067f7 commit e42d124

File tree

153 files changed

+70644
-27209
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+70644
-27209
lines changed

.dockerignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Dockerfile
2+
logs/*
3+
tmp/*
4+
htdocs/tmp/*
5+
htdocs/DATA/library*.json
6+
htdocs/DATA/tagging-taxonomy.json
7+
htdocs/DATA/textbooks-tree.json
8+
.git
9+
.data
10+
.idea

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,6 @@ math4-overrides.css
3232
math4-overrides.js
3333
DATA/*
3434
*.swp
35-
.dump_past_answers_salt
35+
.dump_past_answers_salt
36+
.data
37+
.idea

Dockerfile

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
FROM ubuntu:16.04
2+
3+
4+
ENV PG_BRANCH=rel-PG-2.14 \
5+
WEBWORK_URL=/webwork2 \
6+
WEBWORK_ROOT_URL=http://localhost \
7+
WEBWORK_DB_HOST=db \
8+
WEBWORK_DB_PORT=3306 \
9+
WEBWORK_DB_NAME=webwork \
10+
WEBWORK_DB_USER=webworkWrite \
11+
WEBWORK_DB_PASSWORD=passwordRW \
12+
WEBWORK_SMTP_SERVER=localhost \
13+
14+
WEBWORK_TIMEZONE=America/New_York \
15+
APACHE_RUN_USER=www-data \
16+
APACHE_RUN_GROUP=www-data \
17+
# temporary state file location. This might be changed to /run in Wheezy+1 \
18+
APACHE_PID_FILE=/var/run/apache2/apache2.pid \
19+
APACHE_RUN_DIR=/var/run/apache2 \
20+
APACHE_LOCK_DIR=/var/lock/apache2 \
21+
# Only /var/log/apache2 is handled by /etc/logrotate.d/apache2.
22+
APACHE_LOG_DIR=/var/log/apache2 \
23+
APP_ROOT=/opt/webwork \
24+
DEV=0
25+
26+
ENV WEBWORK_DB_DSN=DBI:mysql:${WEBWORK_DB_NAME}:${WEBWORK_DB_HOST}:${WEBWORK_DB_PORT} \
27+
WEBWORK_ROOT=$APP_ROOT/webwork2 \
28+
PG_ROOT=$APP_ROOT/pg \
29+
PATH=$PATH:$APP_ROOT/webwork2/bin
30+
31+
RUN apt-get update \
32+
&& apt-get install -y --no-install-recommends --no-install-suggests \
33+
apache2 \
34+
curl \
35+
dvipng \
36+
gcc \
37+
libapache2-request-perl \
38+
libcrypt-ssleay-perl \
39+
libdatetime-perl \
40+
libdancer-perl \
41+
libdancer-plugin-database-perl \
42+
libdbd-mysql-perl \
43+
libemail-address-perl \
44+
libexception-class-perl \
45+
libextutils-xsbuilder-perl \
46+
libfile-find-rule-perl-perl \
47+
libgd-perl \
48+
libhtml-scrubber-perl \
49+
libjson-perl \
50+
liblocale-maketext-lexicon-perl \
51+
libmail-sender-perl \
52+
libmime-tools-perl \
53+
libnet-ip-perl \
54+
libnet-ldap-perl \
55+
libnet-oauth-perl \
56+
libossp-uuid-perl \
57+
libpadwalker-perl \
58+
libpath-class-perl \
59+
libphp-serialization-perl \
60+
libsoap-lite-perl \
61+
libsql-abstract-perl \
62+
libstring-shellquote-perl \
63+
libtemplate-perl \
64+
libtext-csv-perl \
65+
libtimedate-perl \
66+
libuuid-tiny-perl \
67+
libxml-parser-perl \
68+
libxml-writer-perl \
69+
libapache2-reload-perl \
70+
make \
71+
netpbm \
72+
preview-latex-style \
73+
texlive \
74+
texlive-latex-extra \
75+
libc6-dev \
76+
git \
77+
mysql-client \
78+
&& curl -Lk https://cpanmin.us | perl - App::cpanminus \
79+
&& cpanm install XML::Parser::EasyTree Iterator Iterator::Util Pod::WSDL Array::Utils HTML::Template XMLRPC::Lite Mail::Sender Email::Sender::Simple Data::Dump Statistics::R::IO \
80+
&& rm -fr /var/lib/apt/lists/* ./cpanm /root/.cpanm /tmp/*
81+
82+
RUN mkdir -p $APP_ROOT/courses $APP_ROOT/libraries $APP_ROOT/webwork2
83+
84+
85+
# Block to include webwork2 in the container, when needed, instead of getting it from a bind mount.
86+
# Uncomment when needed, and set the correct branch name on the following line.
87+
#ENV WEBWORK_BRANCH=rel-ww2.14 # need a valid branch name from https://github.com/openwebwork/webwork2
88+
#RUN curl -fSL https://github.com/openwebwork/webwork2/archive/${WEBWORK_BRANCH}.tar.gz -o /tmp/${WEBWORK_BRANCH}.tar.gz \
89+
# && cd /tmp \
90+
# && tar xzf /tmp/${WEBWORK_BRANCH}.tar.gz \
91+
# && mv webwork2-${WEBWORK_BRANCH} $APP_ROOT/webwork2 \
92+
# && rm -rf /tmp/${WEBWORK_BRANCH}.tar.gz /tmp/webwork2-${WEBWORK_BRANCH}
93+
94+
RUN curl -fSL https://github.com/openwebwork/pg/archive/${PG_BRANCH}.tar.gz -o /tmp/${PG_BRANCH}.tar.gz \
95+
&& tar xzf /tmp/${PG_BRANCH}.tar.gz \
96+
&& mv pg-${PG_BRANCH} $APP_ROOT/pg \
97+
&& rm /tmp/${PG_BRANCH}.tar.gz \
98+
&& curl -fSL https://github.com/openwebwork/webwork-open-problem-library/archive/master.tar.gz -o /tmp/opl.tar.gz \
99+
&& tar xzf /tmp/opl.tar.gz \
100+
&& mv webwork-open-problem-library-master $APP_ROOT/libraries/webwork-open-problem-library \
101+
&& rm /tmp/opl.tar.gz
102+
103+
RUN curl -fSL https://github.com/mathjax/MathJax/archive/master.tar.gz -o /tmp/mathjax.tar.gz \
104+
&& tar xzf /tmp/mathjax.tar.gz \
105+
&& mv MathJax-master $APP_ROOT/MathJax \
106+
&& rm /tmp/mathjax.tar.gz
107+
#&& rm /tmp/VERSION
108+
#curl -fSL https://github.com/openwebwork/webwork2/archive/WeBWorK-${WEBWORK_VERSION}.tar.gz -o /tmp/WeBWorK-${WEBWORK_VERSION}.tar.gz \
109+
#&& tar xzf /tmp/WeBWorK-${WEBWORK_VERSION}.tar.gz \
110+
#&& mv webwork2-WeBWorK-${WEBWORK_VERSION} $APP_ROOT/webwork2 \
111+
#&& rm /tmp/WeBWorK-${WEBWORK_VERSION}.tar.gz \
112+
113+
114+
RUN echo "PATH=$PATH:$APP_ROOT/webwork2/bin" >> /root/.bashrc
115+
116+
COPY . $APP_ROOT/webwork2
117+
118+
119+
# Move these lines into docker-entrypoint.sh so the bind mount of courses
120+
# will be available
121+
#RUN cd $APP_ROOT/webwork2/courses.dist \
122+
# && cp *.lst $APP_ROOT/courses/ \
123+
# && cp -R modelCourse $APP_ROOT/courses/
124+
125+
RUN cd $APP_ROOT/pg/lib/chromatic \
126+
&& gcc color.c -o color
127+
128+
# setup apache
129+
RUN cd $APP_ROOT/webwork2/conf \
130+
&& cp webwork.apache2.4-config.dist webwork.apache2.4-config \
131+
&& cp $APP_ROOT/webwork2/conf/webwork.apache2.4-config /etc/apache2/conf-enabled/webwork.conf \
132+
&& a2dismod mpm_event \
133+
&& a2enmod mpm_prefork \
134+
&& sed -i -e 's/Timeout 300/Timeout 1200/' /etc/apache2/apache2.conf \
135+
&& sed -i -e 's/MaxRequestWorkers 150/MaxRequestWorkers 20/' \
136+
-e 's/MaxConnectionsPerChild 0/MaxConnectionsPerChild 100/' \
137+
/etc/apache2/mods-available/mpm_prefork.conf \
138+
&& cp $APP_ROOT/webwork2/htdocs/favicon.ico /var/www/html \
139+
&& sed -i -e 's/^<Perl>$/\
140+
PerlPassEnv WEBWORK_URL\n\
141+
PerlPassEnv WEBWORK_ROOT_URL\n\
142+
PerlPassEnv WEBWORK_DB_DSN\n\
143+
PerlPassEnv WEBWORK_DB_USER\n\
144+
PerlPassEnv WEBWORK_DB_PASSWORD\n\
145+
PerlPassEnv WEBWORK_SMTP_SERVER\n\
146+
PerlPassEnv WEBWORK_SMTP_SENDER\n\
147+
PerlPassEnv WEBWORK_TIMEZONE\n\
148+
\n<Perl>/' /etc/apache2/conf-enabled/webwork.conf
149+
150+
RUN cd $APP_ROOT/webwork2/ \
151+
&& chown www-data DATA ../courses htdocs/tmp htdocs/applets logs tmp $APP_ROOT/pg/lib/chromatic \
152+
&& chmod -R u+w DATA ../courses htdocs/tmp htdocs/applets logs tmp $APP_ROOT/pg/lib/chromatic
153+
154+
COPY docker-entrypoint.sh /usr/local/bin/
155+
156+
ENTRYPOINT ["docker-entrypoint.sh"]
157+
158+
EXPOSE 80
159+
160+
WORKDIR $APP_ROOT
161+
162+
CMD ["apache2", "-DFOREGROUND"]

LICENSE

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
Online Homework Delivery System
33
Version 2.*
44

5-
Copyright 2000-2018, The WeBWorK Project
5+
Copyright 2000-2019, The WeBWorK Project
6+
67
All rights reserved.
78

89
This program is free software; you can redistribute it and/or modify

PG_VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

PG_VERSION

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
$PG_VERSION ='PG-2.14';
2+
$PG_COPYRIGHT_YEARS = '1996-2018';
3+
4+
1;

VERSION

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
$WW_VERSION = 'WeBWorK-2.13';
2-
$WW_COPYRIGHT_YEARS = '1996-2017';
1+
2+
$WW_VERSION = 'WeBWorK-2.14';
3+
$WW_COPYRIGHT_YEARS = '1996-2018';
34

45
1;

bin/OPL-update

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,9 @@ sub safe_get_id {
297297
my $addifnew = shift;
298298
my @insertvalues = @_;
299299
#print "\nCalled with $tablename, $idname, $whereclause, [".join(',', @$wherevalues)."], (".join(',', @insertvalues).")\n";
300+
for my $j (0..$#insertvalues) {
301+
$insertvalues[$j] =~ s/"/\\\"/g;
302+
}
300303

301304
my $query = "SELECT $idname FROM `$tablename` ".$whereclause;
302305
my $sth = $dbh->prepare($query);
@@ -312,7 +315,6 @@ sub safe_get_id {
312315
$insertvalues[$j] = NULL;
313316
}
314317
}
315-
#print "INSERT INTO $tablename VALUES( ".join(',',@insertvalues).")\n";
316318
$dbh->do("INSERT INTO `$tablename` VALUES(". join(',',@insertvalues) .")");
317319
dbug "INSERT INTO $tablename VALUES( ".join(',',@insertvalues).")\n";
318320
$sth = $dbh->prepare($query);

bin/check_modules.pl

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
Carp
4444
CGI
4545
Class::Accessor
46-
Crypt::SSLeay
46+
#Crypt::SSLeay
4747
Dancer
4848
Dancer::Plugin::Database
4949
Data::Dump
@@ -55,11 +55,11 @@
5555
DBD::mysql
5656
DBI
5757
Digest::MD5
58-
Digest::SHA
58+
Digest::SHA
5959
Email::Address
60-
Email::Simple;
61-
Email::Sender::Simple
62-
Email::Sender::Transport::SMTP
60+
Email::Simple
61+
Email::Sender::Simple
62+
Email::Sender::Transport::SMTP
6363
Errno
6464
Exception::Class
6565
File::Copy
@@ -83,8 +83,7 @@
8383
JSON
8484
Locale::Maketext::Lexicon
8585
Locale::Maketext::Simple
86-
LWP::Protocol::https
87-
Mail::Sender
86+
LWP::Protocol::https
8887
MIME::Base64
8988
Net::IP
9089
Net::LDAPS

clients/old/check2_problems_in_dir.sh

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)