]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1608491 - Improve docker environment for developers wanting to work on bmo code
authordklawren <dklawren@users.noreply.github.com>
Fri, 17 Jan 2020 17:35:43 +0000 (12:35 -0500)
committerGitHub <noreply@github.com>
Fri, 17 Jan 2020 17:35:43 +0000 (12:35 -0500)
18 files changed:
.circleci/config.yml
.dockerignore
Bugzilla/DaemonControl.pm
Dockerfile
Dockerfile.bmo-slim
README.rst
conf/checksetup_answers.txt
docker-compose.test.yml
docker-compose.yml
docker/mysql/bmo.cnf [new file with mode: 0644]
docker/tinyproxy/Dockerfile [new file with mode: 0644]
docker/tinyproxy/tinyproxy.conf [new file with mode: 0644]
scripts/auth-test-app
scripts/entrypoint.pl
scripts/start_morbo
t/db-error-cleanup.pl
t/markdown.t
t/mojo-example.t

index ef74a34e0a498f128fa0bb7dc6db85e589944534..c79d2a4d0f598cf9c0ab0daeeae10be736ea70df 100644 (file)
@@ -52,13 +52,13 @@ jobs:
       - attach_workspace:
           at: /app/build_info
       - run: |
-          docker-compose -f docker-compose.test.yml run --name version_json --entrypoint true bmo-web.vm
+          docker-compose -f docker-compose.test.yml run --name version_json --entrypoint true bmo.test
           docker cp version_json:/app/version.json build_info/version.json
           docker rm version_json
       - run:
           name: build push data
           command: |
-            docker-compose -f docker-compose.test.yml run --name push_data bmo-web.vm push_data
+            docker-compose -f docker-compose.test.yml run --name push_data bmo.test push_data
             docker cp push_data:/app/build_info/blog.push.txt build_info/blog.push.txt
             docker cp push_data:/app/build_info/bug.push.txt build_info/bug.push.txt
             docker cp push_data:/app/build_info/email.push.txt build_info/email.push.txt
@@ -151,7 +151,7 @@ jobs:
           name: run sanity tests
           command: |
             [[ -f build_info/only_version_changed.txt ]] && exit 0
-            docker-compose -f docker-compose.test.yml run --no-deps bmo-web.vm \
+            docker-compose -f docker-compose.test.yml run --no-deps bmo.test \
               test_sanity $(circleci tests glob 't/*.t' 'extensions/*/t/*.t' | \
               circleci tests split) | tee artifacts/$CIRCLE_JOB.txt
       - store_artifacts:
@@ -174,7 +174,7 @@ jobs:
           at: /app/build_info
       - run: |
           [[ -f build_info/only_version_changed.txt ]] && exit 0
-          docker-compose -f docker-compose.test.yml run bmo-web.vm test_webservices | \
+          docker-compose -f docker-compose.test.yml run bmo.test test_webservices | \
             tee artifacts/$CIRCLE_JOB.txt
       - store_artifacts:
           path: /app/artifacts
@@ -196,7 +196,7 @@ jobs:
           at: /app/build_info
       - run: |
           [[ -f build_info/only_version_changed.txt ]] && exit 0
-          docker-compose -f docker-compose.test.yml run bmo-web.vm test_selenium | \
+          docker-compose -f docker-compose.test.yml run bmo.test test_selenium | \
             tee artifacts/$CIRCLE_JOB.txt
       - store_artifacts:
           path: /app/artifacts
@@ -218,7 +218,7 @@ jobs:
           at: /app/build_info
       - run: |
           [[ -f build_info/only_version_changed.txt ]] && exit 0
-          docker-compose -f docker-compose.test.yml run bmo-web.vm test_bmo -q -f t/bmo/*.t
+          docker-compose -f docker-compose.test.yml run bmo.test test_bmo -q -f t/bmo/*.t
       - *store_log
 
 workflows:
index 49c8cc8726a7c7f1902f9b357ccd877a85ca3ae9..1574d719ab38f8bae1888beaf96212eb6d2b1e57 100644 (file)
@@ -9,6 +9,8 @@ data
 localconfig
 pm_to_blib
 template_cache
+Vagrantfile
+vagrant_support
 \#*\#
 */\#*\#
 */*/\#*\#
index 70ea09a2928aa65d9ebb81f91328e885ef80ab47..8c352941e8faced681d518fa2f1431f0160fdd6c 100644 (file)
@@ -46,6 +46,7 @@ my $JOBQUEUE_BIN  = catfile($BUGZILLA_DIR, 'jobqueue.pl');
 my $CEREAL_BIN    = catfile($BUGZILLA_DIR, 'scripts', 'cereal.pl');
 my $BUGZILLA_BIN  = catfile($BUGZILLA_DIR, 'bugzilla.pl');
 my $HYPNOTOAD_BIN = catfile($BUGZILLA_DIR, 'local', 'bin', 'hypnotoad');
+my $MORBO_BIN     = catfile($BUGZILLA_DIR, 'scripts', 'start_morbo');
 my @PERL5LIB      = (
   $BUGZILLA_DIR,
   catdir($BUGZILLA_DIR, 'lib'),
@@ -55,6 +56,7 @@ my @PERL5LIB      = (
 my %HTTP_BACKENDS = (
   hypnotoad => [$HYPNOTOAD_BIN, $BUGZILLA_BIN, '-f'],
   simple    => [$BUGZILLA_BIN,  'daemon'],
+  morbo     => [$MORBO_BIN]
 );
 
 sub catch_signal {
index 99e58e05d7ac3a8c14412f3606df7f0b7343401d..7aeba27de7adf47cd54364d28a4af09bff3ad56c 100644 (file)
@@ -12,6 +12,8 @@ ENV CIRCLE_SHA1=${CIRCLE_SHA1}
 
 ENV LOG4PERL_CONFIG_FILE=log4perl-json.conf
 
+RUN apt-get install -y rsync
+
 # we run a loopback logging server on this TCP port.
 ENV LOGGING_PORT=5880
 
index 8b58067692c1ca06323d849900ab8f363feb3757..4de74b80cf0effa4537bd05c8d6b1ef803070ffb 100644 (file)
@@ -2,9 +2,19 @@ FROM perl:5.30.0-slim AS builder
 
 RUN apt-get update
 RUN apt-get install -y \
-    build-essential curl libssl-dev zlib1g-dev openssl \
-    libexpat-dev cmake git libcairo-dev libgd-dev \
-    default-libmysqlclient-dev unzip wget
+    apt-file \
+    build-essential \
+    cmake \
+    curl \
+    default-libmysqlclient-dev \
+    git \
+    libcairo-dev \
+    libexpat-dev \
+    libgd-dev \
+    libssl-dev \
+    openssl \
+    zlib1g-dev
+
 RUN cpanm --notest --quiet App::cpm Module::CPANfile Carton::Snapshot
 
 WORKDIR /app
@@ -15,7 +25,6 @@ RUN cpm install
 # secure mail loop fixes
 RUN cpm install http://s3.amazonaws.com/moz-devservices-bmocartons/third-party/Crypt-OpenPGP-1.15.tar.gz
 
-RUN apt-get install -y apt-file
 RUN apt-file update
 RUN find local -name '*.so' -exec ldd {} \; \
     | egrep -v 'not.found|not.a.dynamic.executable' \
@@ -31,6 +40,13 @@ ENV DEBIAN_FRONTEND noninteractive
 COPY --from=builder /app/local /app/local
 COPY --from=builder /app/PACKAGES /app/PACKAGES
 
-RUN apt-get update && apt-get upgrade -y && apt-get install -y curl git libcap2-bin xz-utils vim $(cat /app/PACKAGES)
+RUN apt-get update \
+    && apt-get install -y \
+       curl \
+       git \
+       libcap2-bin \
+       rsync \
+       $(cat /app/PACKAGES) \
+    && rm -rf /var/cache/apt/* /var/lib/apt/lists/*
 
 RUN useradd -u 10001 -U app -m && setcap 'cap_net_bind_service=+ep' /usr/local/bin/perl
index c2aa78e1ab0b5d0b2ea5868588cd3a7b89fa306f..ac0219b12fe4bc212ccdc2b5f9126426d5e41edc 100644 (file)
@@ -58,20 +58,20 @@ If this fails, please file a bug `using this link <https://bugzilla.mozilla.org/
 
 Otherwise, you should have a working BMO developer machine!
 
-To test it, you'll want to add an entry to /etc/hosts for bmo-web.vm pointing
+To test it, you'll want to add an entry to /etc/hosts for bmo.test pointing
 to 192.168.3.43.
 
 Then you must start the development webserver with ``vagrant ssh web -c 'start_morbo'``.
 
-After that, you should be able to visit http://bmo-web.vm/ from your browser.
-You can login as vagrant@bmo-web.vm with the password "vagrant01!" (without
+After that, you should be able to visit http://bmo.test/ from your browser.
+You can login as vagrant@bmo.test with the password "vagrant01!" (without
 quotes).
 
 The development server (morbo) can also serve the site via HTTPS.
 
 Run `vagrant ssh web`, that should put you in the `/vagrant` directory.
-While there run `openssl req -newkey rsa:2048 -sha256 -nodes -keyout bmo-web.vm-key.pem -x509 -days 365 -out bmo-web.vm.pem`.
-Restart morbo and you should now be able to visit https://bmo-web.vm.
+While there run `openssl req -newkey rsa:2048 -sha256 -nodes -keyout bmo.test-key.pem -x509 -days 365 -out bmo.test.pem`.
+Restart morbo and you should now be able to visit https://bmo.test.
 
 Vagrant and Windows Hyper-Vagrant
 ---------------------------------
@@ -130,7 +130,7 @@ Update hosts file in Windows to allow accessing the webserver by hostname.
 - Type `notepad` in the search field.
 - Right click the Notepad icon and choose `Run as administrator`.
 - From Notepad, open the following file: ``C:\Windows\System32\Drivers\etc\hosts``.
-- Add ``192.168.3.43 bmo-web.vm`` to the end of the file.
+- Add ``192.168.3.43 bmo.test`` to the end of the file.
 - Select File > Save to save your changes.
 
 Still in Powershell as Administrator, set an environment variable to use for Vagrantfile.
@@ -278,8 +278,8 @@ The procedure should be similar for other browsers.
 
 .. _`Firefox Connection Settings`: https://support.mozilla.org/en-US/kb/connection-settings-firefox
 
-After that, you should be able to visit http://bmo-web.vm/ from your browser.
-You can login as vagrant@bmo-web.vm with the password "vagrant01!" (without
+After that, you should be able to visit http://bmo.test/ from your browser.
+You can login as vagrant@bmo.test with the password "vagrant01!" (without
 quotes).
 
 Ensuring your Docker setup on Ubuntu 16.04
@@ -531,7 +531,7 @@ Testing Emails
 --------------
 
 With vagrant have two options to test emails sent by a local Bugzilla instance. You can configure
-which setting you want to use by going to http://bmo-web.vm/editparams.cgi?section=mta and
+which setting you want to use by going to http://bmo.test/editparams.cgi?section=mta and
 changing the mail_delivery_method to either 'Test' or 'Sendmail'. Afterwards restart BMO with
 ``vagrant reload``. With docker, only the default 'Test' option is supported.
 
@@ -540,17 +540,17 @@ changing the mail_delivery_method to either 'Test' or 'Sendmail'. Afterwards res
 
 With this option, all mail will be appended to a ``mailer.testfile``.
 
-- Using docker, run ``docker-compose run bmo-web.vm cat /app/data/mailer.testfile``.
+- Using docker, run ``docker-compose run bmo.test cat /app/data/mailer.testfile``.
 - Using vagrant, run ``vagrant ssh web`` and then navigate to ``/vagrant/data/mailer.testfile``.
 
 'Sendmail' option (Default for Vagrant)
 ---------------------------------------
 
 This option is useful if you want to preview email using a real mail client.
-An imap server is running on bmo-web.vm on port 143 and you can connect to it with
+An imap server is running on bmo.test on port 143 and you can connect to it with
 the following settings:
 
-- host: bmo-web.vm
+- host: bmo.test
 - port: 143
 - encryption: No SSL, Plaintext password
 - username: vagrant
@@ -561,10 +561,10 @@ multiple imap accounts.
 
 `Thunderbird's`_ wizard to add a new "Existing Mail Account" doesn't work with bmo-web. It
 fails because it wants to create a mail account with both incoming mail (IMAP) and outgoing
-mail (SMTP, which bmo-web.vm doesn't provide). To work around this, using a regular email
+mail (SMTP, which bmo.test doesn't provide). To work around this, using a regular email
 account to first setup, then modify the settings of that account: Right Click the account in
 the left side bar > Settings > Server Settings. Update the server settings to match those
-listed above. Afterwards, you may update the account name to be vagrant@bmo-web.vm. Thunderbird
+listed above. Afterwards, you may update the account name to be vagrant@bmo.test. Thunderbird
 will now pull email from BMO. You can try it out by commenting on a bug.
 
 .. _`Thunderbird's`: https://www.mozilla.org/en-US/thunderbird/
index 236139fa6859c6e46a053ec0a2f87039f6b2ea20..2a9d6dc32cdd4194b58672519c539234ee624b73 100644 (file)
@@ -1,4 +1,4 @@
-$answer{'ADMIN_EMAIL'}          = 'vagrant@bmo-web.vm';
+$answer{'ADMIN_EMAIL'}          = 'vagrant@bmo.test';
 $answer{'ADMIN_OK'}             = 'Y';
 $answer{'ADMIN_PASSWORD'}       = 'vagrant01!';
 $answer{'passwdqc_min'}         = '8, 8, 8, 8, 8';
index b9a05aefe89e576d405729de721e3aed85726bf5..4bae22506c2e39a318f784296bd8798871f17798 100644 (file)
@@ -5,7 +5,7 @@
 version: '3'
 
 services:
-  bmo-web.vm:
+  bmo.test:
     image: bmo
     command: dev_httpd
     tmpfs:
@@ -13,7 +13,7 @@ services:
       - /run
     environment:
       - 'BMO_inbound_proxies=*'
-      - BMO_db_host=bmo-db.vm
+      - BMO_db_host=bmo.db
       - BMO_db_name=bugs
       - BMO_db_pass=bugs
       - BMO_db_user=bugs
@@ -36,11 +36,11 @@ services:
       - TWD_HOST=selenium
       - TWD_PORT=4444
     depends_on:
-      - bmo-db.vm
+      - bmo.db
       - memcached
       - selenium
 
-  bmo-db.vm:
+  bmo.db:
     image: mozillabteam/bmo-mysql:5.7
     logging:
       driver: "none"
index 36c20e5f9c37b1ae9473d0097ca50f17cf2374b4..0e59b3f3d17aac76d29639d0a7d157065994e0ba 100644 (file)
@@ -2,39 +2,41 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-version: '2'
+version: '3.4'
 
 services:
-  bmo-web.vm:
+  bmo.test:
     build: &bmo_build
       context: .
       dockerfile: Dockerfile
     command: dev_httpd
     volumes:
       - bmo-data-dir:/app/data
+      - .:/mnt/sync
     tmpfs:
       - /tmp
       - /run
     environment: &bmo_env
-      - LOCALCONFIG_ENV=1
-      - LOG4PERL_CONFIG_FILE=log4perl-docker.conf
-      - BUGZILLA_ALLOW_INSECURE_HTTP=1
-      - HTTP_BACKEND=simple
-      - PORT=80
-      - BMO_db_host=bmo-db.vm
+      - 'BMO_inbound_proxies=*'
+      - BMO_db_host=bmo.db
       - BMO_db_name=bugs
-      - BMO_db_user=bugs
       - BMO_db_pass=bugs
-      - BMO_urlbase=http://bmo-web.vm/
+      - BMO_db_user=bugs
       - BMO_memcached_namespace=bugzilla
       - BMO_memcached_servers=memcached:11211
-      - 'BMO_inbound_proxies=*'
+      - BMO_urlbase=http://bmo.test/
+      - BUGZILLA_ALLOW_INSECURE_HTTP=1
       - BZ_ANSWERS_FILE=/app/conf/checksetup_answers.txt
+      - HTTP_BACKEND=morbo
+      - LOCALCONFIG_ENV=1
+      - LOG4PERL_CONFIG_FILE=log4perl-docker.conf
+      - MOJO_LISTEN=http://*:80
+      - PORT=80
     depends_on:
-      - bmo-db.vm
+      - bmo.db
       - memcached
 
-  bmo-jobqueue.vm:
+  bmo.jobqueue:
     build: *bmo_build
     command: jobqueue
     volumes:
@@ -45,13 +47,52 @@ services:
     environment: *bmo_env
     restart: always
     depends_on:
-      - bmo-db.vm
+      - bmo.db
+      - memcached
+
+  bmo.feed:
+    build: *bmo_build
+    command:
+      - perl
+      - extensions/PhabBugz/bin/phabbugz_feed.pl
+      - start
+      - '-d'
+      - '-f'
+    volumes:
+      - bmo-data-dir:/app/data
+    tmpfs:
+      - /tmp
+      - /run
+    environment: *bmo_env
+    restart: always
+    depends_on:
+      - bmo.db
+      - memcached
+
+  bmo.pushd:
+    build: *bmo_build
+    command:
+      - perl
+      - extensions/Push/bin/bugzilla-pushd.pl
+      - start
+      - '-d'
+      - '-f'
+    volumes:
+      - bmo-data-dir:/app/data
+    tmpfs:
+      - /tmp
+      - /run
+    environment: *bmo_env
+    restart: always
+    depends_on:
+      - bmo.db
       - memcached
 
-  bmo-db.vm:
-    image: mozillabteam/bmo-mysql:5.7
+  bmo.db:
+    image: mysql:5.7
     volumes:
       - bmo-mysql-db:/var/lib/mysql
+      - ./docker/mysql:/etc/mysql/conf.d
     logging:
       driver: "none"
     environment:
@@ -64,9 +105,11 @@ services:
     image: memcached:latest
 
   tinyproxy:
-    image: mozillabteam/tinyproxy
+    build:
+      context: docker/tinyproxy
+      dockerfile: ./Dockerfile
     ports:
-      - "1091:1090"
+      - "1080:1080"
 
 volumes:
   bmo-mysql-db:
diff --git a/docker/mysql/bmo.cnf b/docker/mysql/bmo.cnf
new file mode 100644 (file)
index 0000000..e05c42e
--- /dev/null
@@ -0,0 +1,8 @@
+[mysqld]
+max_allowed_packet = 10485760
+innodb_file_format    = Barracuda
+innodb_file_per_table = 1
+innodb_large_prefix   = 1
+
+[mysql]
+max_allowed_packet = 10485760
diff --git a/docker/tinyproxy/Dockerfile b/docker/tinyproxy/Dockerfile
new file mode 100644 (file)
index 0000000..2f17d04
--- /dev/null
@@ -0,0 +1,13 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+FROM alpine:3.3
+
+RUN apk --no-cache add tinyproxy
+
+COPY tinyproxy.conf /tinyproxy.conf
+
+EXPOSE 1080
+ENTRYPOINT ["tinyproxy"]
+CMD ["-d", "-c", "/tinyproxy.conf"]
diff --git a/docker/tinyproxy/tinyproxy.conf b/docker/tinyproxy/tinyproxy.conf
new file mode 100644 (file)
index 0000000..76d436a
--- /dev/null
@@ -0,0 +1,330 @@
+##
+## tinyproxy.conf -- tinyproxy daemon configuration file
+##
+## This example tinyproxy.conf file contains example settings
+## with explanations in comments. For decriptions of all
+## parameters, see the tinproxy.conf(5) manual page.
+##
+
+#
+# User/Group: This allows you to set the user and group that will be
+# used for tinyproxy after the initial binding to the port has been done
+# as the root user. Either the user or group name or the UID or GID
+# number may be used.
+#
+#User nobody
+#Group nogroup
+
+#
+# Port: Specify the port which tinyproxy will listen on.  Please note
+# that should you choose to run on a port lower than 1024 you will need
+# to start tinyproxy using root.
+#
+Port 1080
+
+#
+# Listen: If you have multiple interfaces this allows you to bind to
+# only one. If this is commented out, tinyproxy will bind to all
+# interfaces present.
+#
+#Listen 192.168.0.1
+
+#
+# Bind: This allows you to specify which interface will be used for
+# outgoing connections.  This is useful for multi-home'd machines where
+# you want all traffic to appear outgoing from one particular interface.
+#
+#Bind 192.168.0.1
+
+#
+# BindSame: If enabled, tinyproxy will bind the outgoing connection to the
+# ip address of the incoming connection.
+#
+#BindSame yes
+
+#
+# Timeout: The maximum number of seconds of inactivity a connection is
+# allowed to have before it is closed by tinyproxy.
+#
+Timeout 60
+
+#
+# ErrorFile: Defines the HTML file to send when a given HTTP error
+# occurs.  You will probably need to customize the location to your
+# particular install.  The usual locations to check are:
+#   /usr/local/share/tinyproxy
+#   /usr/share/tinyproxy
+#   /etc/tinyproxy
+#
+#ErrorFile 404 "/usr/share/tinyproxy/404.html"
+#ErrorFile 400 "/usr/share/tinyproxy/400.html"
+#ErrorFile 503 "/usr/share/tinyproxy/503.html"
+#ErrorFile 403 "/usr/share/tinyproxy/403.html"
+#ErrorFile 408 "/usr/share/tinyproxy/408.html"
+
+#
+# DefaultErrorFile: The HTML file that gets sent if there is no
+# HTML file defined with an ErrorFile keyword for the HTTP error
+# that has occured.
+#
+DefaultErrorFile "/usr/share/tinyproxy/default.html"
+
+#
+# StatHost: This configures the host name or IP address that is treated
+# as the stat host: Whenever a request for this host is received,
+# Tinyproxy will return an internal statistics page instead of
+# forwarding the request to that host.  The default value of StatHost is
+# tinyproxy.stats.
+#
+#StatHost "tinyproxy.stats"
+#
+
+#
+# StatFile: The HTML file that gets sent when a request is made
+# for the stathost.  If this file doesn't exist a basic page is
+# hardcoded in tinyproxy.
+#
+StatFile "/usr/share/tinyproxy/stats.html"
+
+#
+# Logfile: Allows you to specify the location where information should
+# be logged to.  If you would prefer to log to syslog, then disable this
+# and enable the Syslog directive.  These directives are mutually
+# exclusive.
+#
+Logfile "/var/log/tinyproxy/tinyproxy.log"
+
+#
+# Syslog: Tell tinyproxy to use syslog instead of a logfile.  This
+# option must not be enabled if the Logfile directive is being used.
+# These two directives are mutually exclusive.
+#
+#Syslog On
+
+#
+# LogLevel:
+#
+# Set the logging level. Allowed settings are:
+#      Critical        (least verbose)
+#      Error
+#      Warning
+#      Notice
+#      Connect         (to log connections without Info's noise)
+#      Info            (most verbose)
+#
+# The LogLevel logs from the set level and above. For example, if the
+# LogLevel was set to Warning, then all log messages from Warning to
+# Critical would be output, but Notice and below would be suppressed.
+#
+LogLevel Info
+
+#
+# PidFile: Write the PID of the main tinyproxy thread to this file so it
+# can be used for signalling purposes.
+#
+PidFile "/var/run/tinyproxy/tinyproxy.pid"
+
+#
+# XTinyproxy: Tell Tinyproxy to include the X-Tinyproxy header, which
+# contains the client's IP address.
+#
+#XTinyproxy Yes
+
+#
+# Upstream:
+#
+# Turns on upstream proxy support.
+#
+# The upstream rules allow you to selectively route upstream connections
+# based on the host/domain of the site being accessed.
+#
+# For example:
+#  # connection to test domain goes through testproxy
+#  upstream testproxy:8008 ".test.domain.invalid"
+#  upstream testproxy:8008 ".our_testbed.example.com"
+#  upstream testproxy:8008 "192.168.128.0/255.255.254.0"
+#
+#  # no upstream proxy for internal websites and unqualified hosts
+#  no upstream ".internal.example.com"
+#  no upstream "www.example.com"
+#  no upstream "10.0.0.0/8"
+#  no upstream "192.168.0.0/255.255.254.0"
+#  no upstream "."
+#
+#  # connection to these boxes go through their DMZ firewalls
+#  upstream cust1_firewall:8008 "testbed_for_cust1"
+#  upstream cust2_firewall:8008 "testbed_for_cust2"
+#
+#  # default upstream is internet firewall
+#  upstream firewall.internal.example.com:80
+#
+# The LAST matching rule wins the route decision.  As you can see, you
+# can use a host, or a domain:
+#  name     matches host exactly
+#  .name    matches any host in domain "name"
+#  .        matches any host with no domain (in 'empty' domain)
+#  IP/bits  matches network/mask
+#  IP/mask  matches network/mask
+#
+#Upstream some.remote.proxy:port
+
+#
+# MaxClients: This is the absolute highest number of threads which will
+# be created. In other words, only MaxClients number of clients can be
+# connected at the same time.
+#
+MaxClients 50
+
+#
+# MinSpareServers/MaxSpareServers: These settings set the upper and
+# lower limit for the number of spare servers which should be available.
+#
+# If the number of spare servers falls below MinSpareServers then new
+# server processes will be spawned.  If the number of servers exceeds
+# MaxSpareServers then the extras will be killed off.
+#
+MinSpareServers 5
+MaxSpareServers 20
+
+#
+# StartServers: The number of servers to start initially.
+#
+StartServers 10
+
+#
+# MaxRequestsPerChild: The number of connections a thread will handle
+# before it is killed. In practise this should be set to 0, which
+# disables thread reaping. If you do notice problems with memory
+# leakage, then set this to something like 10000.
+#
+MaxRequestsPerChild 1000
+
+#
+# Allow: Customization of authorization controls. If there are any
+# access control keywords then the default action is to DENY. Otherwise,
+# the default action is ALLOW.
+#
+# The order of the controls are important. All incoming connections are
+# tested against the controls based on order.
+#
+#Allow 127.0.0.1
+#Allow 192.168.0.0/16
+#Allow 172.16.0.0/12
+#Allow 10.0.0.0/8
+
+#
+# AddHeader: Adds the specified headers to outgoing HTTP requests that
+# Tinyproxy makes. Note that this option will not work for HTTPS
+# traffic, as Tinyproxy has no control over what headers are exchanged.
+#
+#AddHeader "X-My-Header" "Powered by Tinyproxy"
+
+#
+# ViaProxyName: The "Via" header is required by the HTTP RFC, but using
+# the real host name is a security concern.  If the following directive
+# is enabled, the string supplied will be used as the host name in the
+# Via header; otherwise, the server's host name will be used.
+#
+ViaProxyName "tinyproxy"
+
+#
+# DisableViaHeader: When this is set to yes, Tinyproxy does NOT add
+# the Via header to the requests. This virtually puts Tinyproxy into
+# stealth mode. Note that RFC 2616 requires proxies to set the Via
+# header, so by enabling this option, you break compliance.
+# Don't disable the Via header unless you know what you are doing...
+#
+#DisableViaHeader Yes
+
+#
+# Filter: This allows you to specify the location of the filter file.
+#
+#Filter "/etc/filter"
+
+#
+# FilterURLs: Filter based on URLs rather than domains.
+#
+#FilterURLs On
+
+#
+# FilterExtended: Use POSIX Extended regular expressions rather than
+# basic.
+#
+#FilterExtended On
+
+#
+# FilterCaseSensitive: Use case sensitive regular expressions.
+#
+#FilterCaseSensitive On
+
+#
+# FilterDefaultDeny: Change the default policy of the filtering system.
+# If this directive is commented out, or is set to "No" then the default
+# policy is to allow everything which is not specifically denied by the
+# filter file.
+#
+# However, by setting this directive to "Yes" the default policy becomes
+# to deny everything which is _not_ specifically allowed by the filter
+# file.
+#
+#FilterDefaultDeny Yes
+
+#
+# Anonymous: If an Anonymous keyword is present, then anonymous proxying
+# is enabled.  The headers listed are allowed through, while all others
+# are denied. If no Anonymous keyword is present, then all headers are
+# allowed through.  You must include quotes around the headers.
+#
+# Most sites require cookies to be enabled for them to work correctly, so
+# you will need to allow Cookies through if you access those sites.
+#
+#Anonymous "Host"
+#Anonymous "Authorization"
+#Anonymous "Cookie"
+
+#
+# ConnectPort: This is a list of ports allowed by tinyproxy when the
+# CONNECT method is used.  To disable the CONNECT method altogether, set
+# the value to 0.  If no ConnectPort line is found, all ports are
+# allowed (which is not very secure.)
+#
+# The following two ports are used by SSL.
+#
+#ConnectPort 443
+#ConnectPort 563
+
+#
+# Configure one or more ReversePath directives to enable reverse proxy
+# support. With reverse proxying it's possible to make a number of
+# sites appear as if they were part of a single site.
+#
+# If you uncomment the following two directives and run tinyproxy
+# on your own computer at port 8888, you can access Google using
+# http://localhost:8888/google/ and Wired News using
+# http://localhost:8888/wired/news/. Neither will actually work
+# until you uncomment ReverseMagic as they use absolute linking.
+#
+#ReversePath "/google/"        "http://www.google.com/"
+#ReversePath "/wired/" "http://www.wired.com/"
+
+#
+# When using tinyproxy as a reverse proxy, it is STRONGLY recommended
+# that the normal proxy is turned off by uncommenting the next directive.
+#
+#ReverseOnly Yes
+
+#
+# Use a cookie to track reverse proxy mappings. If you need to reverse
+# proxy sites which have absolute links you must uncomment this.
+#
+#ReverseMagic Yes
+
+#
+# The URL that's used to access this reverse proxy. The URL is used to
+# rewrite HTTP redirects so that they won't escape the proxy. If you
+# have a chain of reverse proxies, you'll need to put the outermost
+# URL here (the address which the end user types into his/her browser).
+#
+# If not set then no rewriting occurs.
+#
+#ReverseBaseURL "http://localhost:8888/"
index 419565ca5be192d2a47722ff8cf58340a5354bb4..19c0fc192a089c7ebf390ecb349c2e936a950d65 100755 (executable)
@@ -12,7 +12,7 @@ use warnings;
 use Mojolicious::Lite;
 use Digest::SHA qw(sha256_hex);
 
-my $BUGZILLA_URL = $ENV{AUTH_TEST_BUGZILLA_URL} // 'http://bmo-web.vm/auth.cgi';
+my $BUGZILLA_URL = $ENV{AUTH_TEST_BUGZILLA_URL} // 'http://bmo.test/auth.cgi';
 my $APP_DESC     = $ENV{AUTH_TEST_APP_DESC} // 'AuthTest';
 my %SECRETS;
 
index 3d71fb4905f87579aed5a64916d4dcd63e18c044..499bbd4c38b747ee6f9452ca97141e291131cc93 100755 (executable)
@@ -122,7 +122,7 @@ sub cmd_dev_httpd {
     run(
       'perl', 'scripts/generate_bmo_data.pl',
       '--param' => 'use_mailer_queue=0',
-      'vagrant@bmo-web.vm'
+      'vagrant@bmo.test'
     );
   }
 
index 4a0bb3467630f954bb9a418d34932a6503b23f07..b741214e05e4683788fb4fa18f72d72d60bc2421 100755 (executable)
@@ -25,8 +25,8 @@ use Env qw(
 
 chdir $BUGZILLA_DIR;
 
-my $cert_file = catfile($BUGZILLA_DIR, 'bmo-web.vm.pem');
-my $key_file  = catfile($BUGZILLA_DIR, 'bmo-web.vm-key.pem');
+my $cert_file = catfile($BUGZILLA_DIR, 'bmo.test.pem');
+my $key_file  = catfile($BUGZILLA_DIR, 'bmo.test-key.pem');
 
 if ($MOJO_LISTEN && -f $cert_file && -f $key_file) {
   $MOJO_LISTEN .= ",https://*:443?cert=$cert_file&key=$key_file";
index cfbf8b7b26264de862972ad2134e2935d785db98..da269ccbe0063a12623fbbc676dd88a96871558e 100644 (file)
@@ -17,7 +17,7 @@ BEGIN {
 
 END { unlink('data/db/db_errors') }
 
-use Bugzilla::Test::MockLocalconfig (urlbase => 'http://bmo-web.vm');
+use Bugzilla::Test::MockLocalconfig (urlbase => 'http://bmo.test');
 use Bugzilla::Test::MockDB;
 use Test2::V0;
 use Test2::Tools::Exception qw(dies lives);
index c4118a4fa3580833fcc99b7234099257316ff903..8fb3e071ef51e9b4b97704415d6ea421a132bc1b 100644 (file)
@@ -10,7 +10,7 @@ use warnings;
 use lib qw( . lib local/lib/perl5 );
 
 use Bugzilla::Test::MockDB;
-use Bugzilla::Test::MockLocalconfig urlbase => 'http://bmo-web.vm/';
+use Bugzilla::Test::MockLocalconfig urlbase => 'http://bmo.test/';
 use Bugzilla::Test::MockParams (password_complexity => 'no_constraints');
 use Mojo::DOM;
 use Bugzilla;
index c9e104acffa292a02f85dab97d6214555e15ac56..fe58eac07e5d26a773fe14f3692c572400111178 100644 (file)
@@ -20,7 +20,7 @@ BEGIN {
 
 # this provides a default urlbase.
 # Most localconfig options the other Bugzilla::Test::Mock* modules take care for us.
-use Bugzilla::Test::MockLocalconfig (urlbase => 'http://bmo-web.vm');
+use Bugzilla::Test::MockLocalconfig (urlbase => 'http://bmo.test');
 
 # This configures an in-memory SQLite database.
 use Bugzilla::Test::MockDB;