diff --git a/tinyproxy/filter.conf b/tinyproxy/filter.conf new file mode 100644 index 0000000..2f65eee --- /dev/null +++ b/tinyproxy/filter.conf @@ -0,0 +1,5 @@ +portal.actcorp.in +code.jquery.com +debug.bb8.fun +172.17.0.15.xip.io +ifconfig.co diff --git a/tinyproxy/main.tf b/tinyproxy/main.tf index 84d26c3..ddb70ff 100644 --- a/tinyproxy/main.tf +++ b/tinyproxy/main.tf @@ -11,8 +11,15 @@ resource "docker_container" "tinyproxy" { name = "tinyproxy" image = "${docker_image.tinyproxy.latest}" - // Access is restricted to VPN only - command = ["ANY"] + upload { + content = "${file("${path.module}/tinyproxy.conf")}" + file = "/etc/tinyproxy/tinyproxy.conf" + } + + upload { + content = "${file("${path.module}/filter.conf")}" + file = "/etc/tinyproxy/filter.conf" + } ports { internal = 8888 diff --git a/tinyproxy/tinyproxy.conf b/tinyproxy/tinyproxy.conf new file mode 100644 index 0000000..b5c3a54 --- /dev/null +++ b/tinyproxy/tinyproxy.conf @@ -0,0 +1,180 @@ +## +## 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 tinyproxy +Group tinyproxy + +# +# 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 8888 + +# +# Timeout: The maximum number of seconds of inactivity a connection is +# allowed to have before it is closed by tinyproxy. +# +Timeout 60 + + +# +# 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" + +# +# 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 Notice + + +XTinyproxy No + + +# +# 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 10 + +MinSpareServers 2 +MaxSpareServers 10 + +# +# StartServers: The number of servers to start initially. +# +StartServers 5 + +# +# 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 10000 + +# +# 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 + + +# +# 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/tinyproxy/filter.conf" + +# +# 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