Add all files needed to bring up VM and run agaric.com locally

This commit is contained in:
benjamin melançon 2018-08-20 10:45:20 -04:00
parent 52c8b60bac
commit 4d2bc0ee24
742 changed files with 24037 additions and 0 deletions

View file

@ -0,0 +1,38 @@
{% if varnish_version | version_compare('4.0', '>=') %}
vcl 4.0;
{% endif %}
# This is a basic VCL configuration file for varnish. See the vcl(7)
# man page for details on VCL syntax and semantics.
#
# Default backend definition. Set this to point to your content
# server.
backend default {
.host = "{{ varnish_default_backend_host }}";
.port = "{{ varnish_default_backend_port }}";
}
{% if varnish_backends is defined %}
# Other backend servers.
{% for backend, value in varnish_backends.iteritems() %}
backend {{ backend }} {
.host = "{{ value.host }}";
.port = "{{ value.port }}";
}
{% endfor %}
{% endif %}
sub vcl_recv {
{% if varnish_vhosts is defined %}
# Varnish vhosts.
{% for vhost, value in varnish_vhosts.iteritems() if varnish_vhosts is defined %}
{% if loop.first %}
if (req.http.host == "{{ vhost }}" || req.http.host == "www.{{ vhost }}") {
{% else %}
elseif (req.http.host == "{{ vhost }}" || req.http.host == "www.{{ vhost }}") {
{% endif %}
set req.backend_hint = {{ value.backend }};
}
{% endfor %}
{% endif %}
}

View file

@ -0,0 +1 @@
{{ varnish_secret }}

View file

@ -0,0 +1,117 @@
# Configuration file for varnish
#
# /etc/init.d/varnish expects the variable $DAEMON_OPTS to be set from this
# shell script fragment.
#
# Start varnish (only applies to Debian-based hosts)
START=yes
# Maximum number of open files (for ulimit -n)
NFILES={{ varnish_limit_nofile }}
# Locked shared memory (for ulimit -l)
# Default log size is 82MB + header
MEMLOCK=82000
# Maximum number of threads (for ulimit -u)
NPROCS="unlimited"
# Maximum size of corefile (for ulimit -c). Default in Fedora is 0
# DAEMON_COREFILE_LIMIT="unlimited"
# Set this to 1 to make init script reload try to switch vcl without restart.
# To make this work, you need to set the following variables
# explicit: VARNISH_VCL_CONF, VARNISH_ADMIN_LISTEN_ADDRESS,
# VARNISH_ADMIN_LISTEN_PORT, VARNISH_SECRET_FILE, or in short,
# use Alternative 3, Advanced configuration, below
RELOAD_VCL=1
{% if varnish_pidfile %}
# Varnish PID file
PIDFILE="{{ varnish_pidfile }}"
{% endif %}
# This file contains 4 alternatives, please use only one.
## Alternative 1, Minimal configuration, no VCL
#
# Listen on port 6081, administration on localhost:6082, and forward to
# content server on localhost:8080. Use a fixed-size cache file.
#
#DAEMON_OPTS="-a :6081 \
# -T localhost:6082 \
# -b localhost:8080 \
# -u varnish -g varnish \
# -s file,/var/lib/varnish/varnish_storage.bin,1G"
## Alternative 2, Configuration with VCL
#
# Listen on port 6081, administration on localhost:6082, and forward to
# one content server selected by the vcl file, based on the request. Use a
# fixed-size cache file.
#
#DAEMON_OPTS="-a :6081 \
# -T localhost:6082 \
# -f /etc/varnish/default.vcl \
# -u varnish -g varnish \
# -S /etc/varnish/secret \
# -s file,/var/lib/varnish/varnish_storage.bin,1G"
## Alternative 3, Advanced configuration
#
# See varnishd(1) for more information.
#
# # Main configuration file. You probably want to change it :)
VARNISH_VCL_CONF={{ varnish_config_path }}/default.vcl
#
# # Default address and port to bind to
# # Blank address means all IPv4 and IPv6 interfaces, otherwise specify
# # a host name, an IPv4 dotted quad, or an IPv6 address in brackets.
# VARNISH_LISTEN_ADDRESS=
VARNISH_LISTEN_PORT={{ varnish_listen_port }}
#
# # Telnet admin interface listen address and port
VARNISH_ADMIN_LISTEN_ADDRESS={{ varnish_admin_listen_host }}
VARNISH_ADMIN_LISTEN_PORT={{ varnish_admin_listen_port }}
#
# # Shared secret file for admin interface
VARNISH_SECRET_FILE={{ varnish_config_path }}/secret
#
# # The minimum number of worker threads to start
VARNISH_MIN_THREADS=50
#
# # The Maximum number of worker threads to start
VARNISH_MAX_THREADS=1000
#
# # Idle timeout for worker threads
VARNISH_THREAD_TIMEOUT=120
#
# # Backend storage specification
VARNISH_STORAGE="{{ varnish_storage }}"
#
# # Default TTL used when the backend does not specify one
VARNISH_TTL=120
#
# # DAEMON_OPTS is used by the init script. If you add or remove options, make
# # sure you update this section, too.
DAEMON_OPTS="-a ${VARNISH_LISTEN_ADDRESS}:${VARNISH_LISTEN_PORT} \
-f ${VARNISH_VCL_CONF} \
-T ${VARNISH_ADMIN_LISTEN_ADDRESS}:${VARNISH_ADMIN_LISTEN_PORT} \
-t ${VARNISH_TTL} \
-p thread_pool_min=${VARNISH_MIN_THREADS} \
-p thread_pool_max=${VARNISH_MAX_THREADS} \
-p thread_pool_timeout=${VARNISH_THREAD_TIMEOUT} \
{% if varnish_version | version_compare('4.1', '<') %}
-u varnish -g varnish \
{% endif %}
-S ${VARNISH_SECRET_FILE} \
-s ${VARNISH_STORAGE}"
#
## Alternative 4, Do It Yourself. See varnishd(1) for more information.
#
# DAEMON_OPTS=""

View file

@ -0,0 +1,35 @@
# Varnish environment configuration description. This was derived from
# the old style sysconfig/defaults settings
# Set this to 1 to make systemd reload try to switch vcl without restart.
RELOAD_VCL=1
# Main configuration file. You probably want to change it.
VARNISH_VCL_CONF={{ varnish_config_path }}/default.vcl
# Default address and port to bind to. Blank address means all IPv4
# and IPv6 interfaces, otherwise specify a host name, an IPv4 dotted
# quad, or an IPv6 address in brackets.
# VARNISH_LISTEN_ADDRESS=192.168.1.5
VARNISH_LISTEN_PORT={{ varnish_listen_port }}
# Admin interface listen address and port
VARNISH_ADMIN_LISTEN_ADDRESS={{ varnish_admin_listen_host }}
VARNISH_ADMIN_LISTEN_PORT={{ varnish_admin_listen_port }}
# Shared secret file for admin interface
VARNISH_SECRET_FILE={{ varnish_config_path }}/secret
# Backend storage specification, see Storage Types in the varnishd(5)
# man page for details.
VARNISH_STORAGE="{{ varnish_storage }}"
# Default TTL used when the backend does not specify one
VARNISH_TTL=120
# User and group for the varnishd worker processes
VARNISH_USER=varnish
VARNISH_GROUP=varnish
# Other options, see the man page varnishd(1)
#DAEMON_OPTS="-p thread_pool_min=5 -p thread_pool_max=500 -p thread_pool_timeout=300"

View file

@ -0,0 +1,15 @@
[Unit]
Description=Varnish Cache, a high-performance HTTP accelerator
[Service]
Type=forking
{% if varnish_pidfile %}
PIDFile={{ varnish_pidfile }}
{% endif %}
LimitNOFILE={{ varnish_limit_nofile }}
LimitMEMLOCK=82000
ExecStart=/usr/sbin/varnishd -a :{{ varnish_listen_port }} -T {{ varnish_admin_listen_host }}:{{ varnish_admin_listen_port }}{% if varnish_pidfile %} -P {{ varnish_pidfile }}{% endif %} -f {{ varnish_config_path }}/default.vcl -S {{ varnish_config_path }}/secret -s {{ varnish_storage }}
ExecReload=/usr/share/varnish/reload-vcl
[Install]
WantedBy=multi-user.target