Skip to content

Commit

Permalink
Merge pull request #865 from openwebwork/rel-ww2.14
Browse files Browse the repository at this point in the history
Rel ww2.14
  • Loading branch information
mgage authored Dec 30, 2018
2 parents 2ebce59 + 1a067f7 commit e42d124
Show file tree
Hide file tree
Showing 153 changed files with 70,644 additions and 27,209 deletions.
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Dockerfile
logs/*
tmp/*
htdocs/tmp/*
htdocs/DATA/library*.json
htdocs/DATA/tagging-taxonomy.json
htdocs/DATA/textbooks-tree.json
.git
.data
.idea
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ math4-overrides.css
math4-overrides.js
DATA/*
*.swp
.dump_past_answers_salt
.dump_past_answers_salt
.data
.idea
162 changes: 162 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
FROM ubuntu:16.04


ENV PG_BRANCH=rel-PG-2.14 \
WEBWORK_URL=/webwork2 \
WEBWORK_ROOT_URL=http://localhost \
WEBWORK_DB_HOST=db \
WEBWORK_DB_PORT=3306 \
WEBWORK_DB_NAME=webwork \
WEBWORK_DB_USER=webworkWrite \
WEBWORK_DB_PASSWORD=passwordRW \
WEBWORK_SMTP_SERVER=localhost \
WEBWORK_SMTP_SENDER=webwork@example.com \
WEBWORK_TIMEZONE=America/New_York \
APACHE_RUN_USER=www-data \
APACHE_RUN_GROUP=www-data \
# temporary state file location. This might be changed to /run in Wheezy+1 \
APACHE_PID_FILE=/var/run/apache2/apache2.pid \
APACHE_RUN_DIR=/var/run/apache2 \
APACHE_LOCK_DIR=/var/lock/apache2 \
# Only /var/log/apache2 is handled by /etc/logrotate.d/apache2.
APACHE_LOG_DIR=/var/log/apache2 \
APP_ROOT=/opt/webwork \
DEV=0

ENV WEBWORK_DB_DSN=DBI:mysql:${WEBWORK_DB_NAME}:${WEBWORK_DB_HOST}:${WEBWORK_DB_PORT} \
WEBWORK_ROOT=$APP_ROOT/webwork2 \
PG_ROOT=$APP_ROOT/pg \
PATH=$PATH:$APP_ROOT/webwork2/bin

RUN apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
apache2 \
curl \
dvipng \
gcc \
libapache2-request-perl \
libcrypt-ssleay-perl \
libdatetime-perl \
libdancer-perl \
libdancer-plugin-database-perl \
libdbd-mysql-perl \
libemail-address-perl \
libexception-class-perl \
libextutils-xsbuilder-perl \
libfile-find-rule-perl-perl \
libgd-perl \
libhtml-scrubber-perl \
libjson-perl \
liblocale-maketext-lexicon-perl \
libmail-sender-perl \
libmime-tools-perl \
libnet-ip-perl \
libnet-ldap-perl \
libnet-oauth-perl \
libossp-uuid-perl \
libpadwalker-perl \
libpath-class-perl \
libphp-serialization-perl \
libsoap-lite-perl \
libsql-abstract-perl \
libstring-shellquote-perl \
libtemplate-perl \
libtext-csv-perl \
libtimedate-perl \
libuuid-tiny-perl \
libxml-parser-perl \
libxml-writer-perl \
libapache2-reload-perl \
make \
netpbm \
preview-latex-style \
texlive \
texlive-latex-extra \
libc6-dev \
git \
mysql-client \
&& curl -Lk https://cpanmin.us | perl - App::cpanminus \
&& 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 \
&& rm -fr /var/lib/apt/lists/* ./cpanm /root/.cpanm /tmp/*

RUN mkdir -p $APP_ROOT/courses $APP_ROOT/libraries $APP_ROOT/webwork2


# Block to include webwork2 in the container, when needed, instead of getting it from a bind mount.
# Uncomment when needed, and set the correct branch name on the following line.
#ENV WEBWORK_BRANCH=rel-ww2.14 # need a valid branch name from https://github.com/openwebwork/webwork2
#RUN curl -fSL https://github.com/openwebwork/webwork2/archive/${WEBWORK_BRANCH}.tar.gz -o /tmp/${WEBWORK_BRANCH}.tar.gz \
# && cd /tmp \
# && tar xzf /tmp/${WEBWORK_BRANCH}.tar.gz \
# && mv webwork2-${WEBWORK_BRANCH} $APP_ROOT/webwork2 \
# && rm -rf /tmp/${WEBWORK_BRANCH}.tar.gz /tmp/webwork2-${WEBWORK_BRANCH}

RUN curl -fSL https://github.com/openwebwork/pg/archive/${PG_BRANCH}.tar.gz -o /tmp/${PG_BRANCH}.tar.gz \
&& tar xzf /tmp/${PG_BRANCH}.tar.gz \
&& mv pg-${PG_BRANCH} $APP_ROOT/pg \
&& rm /tmp/${PG_BRANCH}.tar.gz \
&& curl -fSL https://github.com/openwebwork/webwork-open-problem-library/archive/master.tar.gz -o /tmp/opl.tar.gz \
&& tar xzf /tmp/opl.tar.gz \
&& mv webwork-open-problem-library-master $APP_ROOT/libraries/webwork-open-problem-library \
&& rm /tmp/opl.tar.gz

RUN curl -fSL https://github.com/mathjax/MathJax/archive/master.tar.gz -o /tmp/mathjax.tar.gz \
&& tar xzf /tmp/mathjax.tar.gz \
&& mv MathJax-master $APP_ROOT/MathJax \
&& rm /tmp/mathjax.tar.gz
#&& rm /tmp/VERSION
#curl -fSL https://github.com/openwebwork/webwork2/archive/WeBWorK-${WEBWORK_VERSION}.tar.gz -o /tmp/WeBWorK-${WEBWORK_VERSION}.tar.gz \
#&& tar xzf /tmp/WeBWorK-${WEBWORK_VERSION}.tar.gz \
#&& mv webwork2-WeBWorK-${WEBWORK_VERSION} $APP_ROOT/webwork2 \
#&& rm /tmp/WeBWorK-${WEBWORK_VERSION}.tar.gz \


RUN echo "PATH=$PATH:$APP_ROOT/webwork2/bin" >> /root/.bashrc

COPY . $APP_ROOT/webwork2


# Move these lines into docker-entrypoint.sh so the bind mount of courses
# will be available
#RUN cd $APP_ROOT/webwork2/courses.dist \
# && cp *.lst $APP_ROOT/courses/ \
# && cp -R modelCourse $APP_ROOT/courses/

RUN cd $APP_ROOT/pg/lib/chromatic \
&& gcc color.c -o color

# setup apache
RUN cd $APP_ROOT/webwork2/conf \
&& cp webwork.apache2.4-config.dist webwork.apache2.4-config \
&& cp $APP_ROOT/webwork2/conf/webwork.apache2.4-config /etc/apache2/conf-enabled/webwork.conf \
&& a2dismod mpm_event \
&& a2enmod mpm_prefork \
&& sed -i -e 's/Timeout 300/Timeout 1200/' /etc/apache2/apache2.conf \
&& sed -i -e 's/MaxRequestWorkers 150/MaxRequestWorkers 20/' \
-e 's/MaxConnectionsPerChild 0/MaxConnectionsPerChild 100/' \
/etc/apache2/mods-available/mpm_prefork.conf \
&& cp $APP_ROOT/webwork2/htdocs/favicon.ico /var/www/html \
&& sed -i -e 's/^<Perl>$/\
PerlPassEnv WEBWORK_URL\n\
PerlPassEnv WEBWORK_ROOT_URL\n\
PerlPassEnv WEBWORK_DB_DSN\n\
PerlPassEnv WEBWORK_DB_USER\n\
PerlPassEnv WEBWORK_DB_PASSWORD\n\
PerlPassEnv WEBWORK_SMTP_SERVER\n\
PerlPassEnv WEBWORK_SMTP_SENDER\n\
PerlPassEnv WEBWORK_TIMEZONE\n\
\n<Perl>/' /etc/apache2/conf-enabled/webwork.conf

RUN cd $APP_ROOT/webwork2/ \
&& chown www-data DATA ../courses htdocs/tmp htdocs/applets logs tmp $APP_ROOT/pg/lib/chromatic \
&& chmod -R u+w DATA ../courses htdocs/tmp htdocs/applets logs tmp $APP_ROOT/pg/lib/chromatic

COPY docker-entrypoint.sh /usr/local/bin/

ENTRYPOINT ["docker-entrypoint.sh"]

EXPOSE 80

WORKDIR $APP_ROOT

CMD ["apache2", "-DFOREGROUND"]
3 changes: 2 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
Online Homework Delivery System
Version 2.*

Copyright 2000-2018, The WeBWorK Project
Copyright 2000-2019, The WeBWorK Project

All rights reserved.

This program is free software; you can redistribute it and/or modify
Expand Down
1 change: 0 additions & 1 deletion PG_VERSION

This file was deleted.

4 changes: 4 additions & 0 deletions PG_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$PG_VERSION ='PG-2.14';
$PG_COPYRIGHT_YEARS = '1996-2018';

1;
5 changes: 3 additions & 2 deletions VERSION
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
$WW_VERSION = 'WeBWorK-2.13';
$WW_COPYRIGHT_YEARS = '1996-2017';

$WW_VERSION = 'WeBWorK-2.14';
$WW_COPYRIGHT_YEARS = '1996-2018';

1;
4 changes: 3 additions & 1 deletion bin/OPL-update
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,9 @@ sub safe_get_id {
my $addifnew = shift;
my @insertvalues = @_;
#print "\nCalled with $tablename, $idname, $whereclause, [".join(',', @$wherevalues)."], (".join(',', @insertvalues).")\n";
for my $j (0..$#insertvalues) {
$insertvalues[$j] =~ s/"/\\\"/g;
}

my $query = "SELECT $idname FROM `$tablename` ".$whereclause;
my $sth = $dbh->prepare($query);
Expand All @@ -312,7 +315,6 @@ sub safe_get_id {
$insertvalues[$j] = NULL;
}
}
#print "INSERT INTO $tablename VALUES( ".join(',',@insertvalues).")\n";
$dbh->do("INSERT INTO `$tablename` VALUES(". join(',',@insertvalues) .")");
dbug "INSERT INTO $tablename VALUES( ".join(',',@insertvalues).")\n";
$sth = $dbh->prepare($query);
Expand Down
13 changes: 6 additions & 7 deletions bin/check_modules.pl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
Carp
CGI
Class::Accessor
Crypt::SSLeay
#Crypt::SSLeay
Dancer
Dancer::Plugin::Database
Data::Dump
Expand All @@ -55,11 +55,11 @@
DBD::mysql
DBI
Digest::MD5
Digest::SHA
Digest::SHA
Email::Address
Email::Simple;
Email::Sender::Simple
Email::Sender::Transport::SMTP
Email::Simple
Email::Sender::Simple
Email::Sender::Transport::SMTP
Errno
Exception::Class
File::Copy
Expand All @@ -83,8 +83,7 @@
JSON
Locale::Maketext::Lexicon
Locale::Maketext::Simple
LWP::Protocol::https
Mail::Sender
LWP::Protocol::https
MIME::Base64
Net::IP
Net::LDAPS
Expand Down
16 changes: 0 additions & 16 deletions clients/old/check2_problems_in_dir.sh

This file was deleted.

Loading

0 comments on commit e42d124

Please sign in to comment.