grim/containers/reviewboard
Turn this repo into a fork of the old base repository but rebase it on debian:buster
--- a/Dockerfile Wed Jul 01 05:02:57 2020 -0500
+++ b/Dockerfile Sat Oct 10 06:53:04 2020 -0500
@@ -1,5 +1,38 @@
-FROM ikatson/reviewboard:latest
+MAINTAINER grim@reaperworld.com +# install the dependencies for reviewboard +RUN apt-get update -y && \ + apt-get install --no-install-recommends -y \ + build-essential python-dev libffi-dev libssl-dev patch \ + python-pip python-setuptools python-wheel python-virtualenv \ + uwsgi uwsgi-plugin-python \ + python-psycopg2 python-ldap \ + git-core mercurial subversion python-svn \ + rm -rf /var/lib/apt/lists/* + python -m virtualenv --system-site-packages /opt/venv && \ + . /opt/venv/bin/activate && \ + pip install "ReviewBoard==${RB_VERSION}" django-storages==1.1.8 oauthlib==1.0.1 semver && \ +# additional housekeeping +ENV PATH="/opt/venv/bin:${PATH}" +COPY start.sh uwsgi.ini shell.sh upgrade-site.py / . /opt/venv/bin/activate && \
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/LICENSE Sat Oct 10 06:53:04 2020 -0500
@@ -0,0 +1,22 @@
+Copyright (c) 2014 Igor Katson +Copyright (c) 2020 Gary Kramlich <grim@reaperworld.com> +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN --- a/README.md Wed Jul 01 05:02:57 2020 -0500
+++ b/README.md Sat Oct 10 06:53:04 2020 -0500
@@ -1,6 +1,8 @@
-This container image is based on docker.io/ikatson/reviewboard. It adds a few
-additional plugins namely rbjbhub and is deployed on
-[reviews.imfreedom.org](https://reviews.imfreedom.org).
+This container image was originally based on docker.io/ikatson/reviewboard. +It is now a fork so that it can be updated going forward. +It adds a few additional plugins to reviewboard, namely rbjbhub and is deployed +on [reviews.imfreedom.org](https://reviews.imfreedom.org). --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/shell.sh Sat Oct 10 06:53:04 2020 -0500
@@ -0,0 +1,7 @@
+cd /var/www/reviewboard/conf +export DJANGO_SETTINGS_MODULE=reviewboard.settings +exec django-admin.py shell --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/start.sh Sat Oct 10 06:53:04 2020 -0500
@@ -0,0 +1,70 @@
+PGUSER="${PGUSER:-reviewboard}" +PGPASSWORD="${PGPASSWORD:-reviewboard}" +PGDB="${PGDB:-reviewboard}" +# Get these variables either from PGPORT and PGHOST, or from +# linked "pg" container. +PGPORT="${PGPORT:-$( echo "${PG_PORT_5432_TCP_PORT:-5432}" )}" +PGHOST="${PGHOST:-$( echo "${PG_PORT_5432_TCP_ADDR:-127.0.0.1}" )}" +# Get these variable either from MEMCACHED env var, or from +# linked "memcached" container. +MEMCACHED_LINKED_NOTCP="${MEMCACHED_PORT#tcp://}" +MEMCACHED="${MEMCACHED:-$( echo "${MEMCACHED_LINKED_NOTCP:-127.0.0.1}" )}" +DOMAIN="${DOMAIN:localhost}" +if [[ "${WAIT_FOR_POSTGRES}" = "true" ]]; then + echo "Waiting for Postgres readiness..." + export PGUSER PGHOST PGPORT PGPASSWORD + until psql "${PGDB}"; do + echo "Postgres is unavailable - sleeping" +if [[ "${SITE_ROOT}" ]]; then + if [[ "${SITE_ROOT}" != "/" ]]; then + # Add trailing and leading slashes to SITE_ROOT if it's not there. + SITE_ROOT="${SITE_ROOT#/}" + SITE_ROOT="/${SITE_ROOT%/}/" +CONFFILE=/var/www/reviewboard/conf/settings_local.py +if [[ ! -d /var/www/reviewboard ]]; then + rb-site install --noinput \ + --domain-name="$DOMAIN" \ + --site-root="$SITE_ROOT" \ + --static-url=static/ --media-url=media/ \ + --db-pass="$PGPASSWORD" \ + --cache-type=memcached --cache-info="$MEMCACHED" \ + --web-server-type=lighttpd --web-server-port=8000 \ + --admin-user=admin --admin-password=admin --admin-email=admin@example.com \ +/upgrade-site.py /var/www/reviewboard/rb-version /var/www/reviewboard +if [[ "${DEBUG}" ]]; then + sed -i 's/DEBUG *= *False/DEBUG=True/' "$CONFFILE" +exec uwsgi --ini /uwsgi.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/upgrade-site.py Sat Oct 10 06:53:04 2020 -0500
@@ -0,0 +1,26 @@
+def main(version_file, site_folder): + running_version = reviewboard.get_version_string() + with open(version_file) as f: + previous_version = f.readline().strip() + previous_version = "0.0.0" + if semver.compare(running_version, previous_version) == 1: + print("ReviewBoard upgrade detected, performing rb-site upgrade") + subprocess.check_call(["rb-site", "upgrade", site_folder]) + with open(version_file, 'w') as f: + f.write(running_version) +if __name__ == "__main__": --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsgi.ini Sat Oct 10 06:53:04 2020 -0500
@@ -0,0 +1,16 @@
+env=DJANGO_SETTINGS_MODULE=reviewboard.settings +pymodule-alias=settings_local=/var/www/reviewboard/conf/settings_local.py +module = django.core.handlers.wsgi:WSGIHandler() +static-map=$(SITE_ROOT)static=/var/www/reviewboard/htdocs/static +static-map=$(SITE_ROOT)media=/var/www/reviewboard/htdocs/media +static-map=$(SITE_ROOT)errordocs=/var/www/reviewboard/htdocs/errordocs +static-safe=/opt/venv/lib/python2.7/site-packages/