Skip to content

Commit

Permalink
www/squid: fill with source code
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed Dec 19, 2023
1 parent af9f4ab commit 54a0e44
Show file tree
Hide file tree
Showing 89 changed files with 7,231 additions and 0 deletions.
1 change: 1 addition & 0 deletions www/squid/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
PLUGIN_NAME= squid
PLUGIN_VERSION= 1.0.d
PLUGIN_REVISION= 1
PLUGIN_COMMENT= Squid is a caching proxy for the web
PLUGIN_DEPENDS= squid squid-langpack
PLUGIN_TIER= 2
Expand Down
79 changes: 79 additions & 0 deletions www/squid/src/etc/inc/plugins.inc.d/squid.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?php

/*
* Copyright (C) 2016 Deciso B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

function squid_services()
{
global $config;

$services = array();

if (
isset($config['OPNsense']['proxy']['general']['enabled']) &&
$config['OPNsense']['proxy']['general']['enabled'] == 1
) {
$services[] = array(
'description' => gettext('Squid Web Proxy'),
'configd' => array(
'restart' => array('proxy restart'),
'start' => array('proxy start'),
'stop' => array('proxy stop'),
),
'pidfile' => '/var/run/squid/squid.pid',
'name' => 'squid',
);
}

return $services;
}

function squid_xmlrpc_sync()
{
$result = array();

$result[] = array(
'description' => gettext('Squid Web Proxy'),
'section' => 'OPNsense.proxy',
'id' => 'squid',
'services' => ["squid"],
);

return $result;
}

/**
* our squid instance by default logs to file, when syslog is selected, we need a target definition to catch traffic.
* which flushes our local traffic to /var/log/squid.log (which would otherwise end up in /var/log/squid/access.log)
*/
function squid_syslog()
{
$logfacilities = array();
$logfacilities['squid'] = array(
'facility' => array('(squid-1)')
);
return $logfacilities;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta type="copyright" content="Copyright (C) 1996-2023 The Squid Software Foundation and contributors">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>ERROR: The requested URL could not be retrieved</title>
<!--EMBED:start-->
<!-- leave this block as is, our parser will convert links to inline content -->
<link rel="stylesheet" type="text/css" href="errorpage.css">
<!--EMBED:end -->
<style type="text/css"><!--
%l

body
:lang(fa) { direction: rtl; font-size: 100%; font-family: Tahoma, Roya, sans-serif; float: right; }
:lang(he) { direction: rtl; }
--></style>
</head><body id=%c>
<div id="titles">
<h1>ERROR</h1>
<h2>The requested URL could not be retrieved</h2>
</div>
<hr>

<div id="content">
<p>The following error was encountered while trying to retrieve the URL: <a href="%U">%U</a></p>

<blockquote id="error">
<p><b>Access Denied.</b></p>
</blockquote>

<p>Access control configuration prevents your request from being allowed at this time. Please contact your service provider if you feel this is incorrect.</p>

<p>Your cache administrator is <a href="mailto:%w%W">%w</a>.</p>
<br>
</div>

<hr>
<div id="footer">
<p>Generated %T by %h (%s)</p>
<!-- %c -->
</div>
</body></html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta type="copyright" content="Copyright (C) 1996-2023 The Squid Software Foundation and contributors">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>ERROR: The requested URL could not be retrieved</title>
<!--EMBED:start-->
<!-- leave this block as is, our parser will convert links to inline content -->
<link rel="stylesheet" type="text/css" href="errorpage.css">
<!--EMBED:end -->
<style type="text/css"><!--
%l

body
:lang(fa) { direction: rtl; font-size: 100%; font-family: Tahoma, Roya, sans-serif; float: right; }
:lang(he) { direction: rtl; }
--></style>
</head><body id=%c>
<div id="titles">
<h1>ERROR</h1>
<h2>The requested URL could not be retrieved</h2>
</div>
<hr>

<div id="content">
<p>The following error was encountered while trying to retrieve the URL: <a href="%U">%U</a></p>

<blockquote id="error">
<p><b>Time Quota Exceeded.</b></p>
</blockquote>

<p>This proxy limits your time online with a quota. Your time budget is now empty but will be refilled when the configured time period starts again.</p>
<p>These limits have been established by the Internet Service Provider who operates this cache. Please contact them directly if you feel this is an error.</p>

<p>Your cache administrator is <a href="mailto:%w%W">%w</a>.</p>
<br>
</div>

<hr>
<div id="footer">
<p>Generated %T by %h (%s)</p>
<!-- %c -->
</div>
</body></html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta type="copyright" content="Copyright (C) 1996-2023 The Squid Software Foundation and contributors">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Web Browser Configuration</title>
<!--EMBED:start-->
<!-- leave this block as is, our parser will convert links to inline content -->
<link rel="stylesheet" type="text/css" href="errorpage.css">
<!--EMBED:end -->
<style type="text/css"><!--
%l

body
:lang(fa) { direction: rtl; font-size: 100%; font-family: Tahoma, Roya, sans-serif; float: right; }
:lang(he) { direction: rtl; }
--></style>
</head><body id=%c>
<div id="titles">
<h1>ERROR</h1>
<h2>Web Browser Configuration</h2>
</div>
<hr>

<div id="content">
<blockquote id="error">
<p>Your Web Browser configuration needs to be corrected to use this network.</p>
</blockquote>

<p>How to find these settings in your browser:</p>

<div id="firefox">
For Firefox browsers go to:
<ul>
<li>Tools -&gt; Options -&gt; Advanced -&gt; Network -&gt; Connection Settings</li>
<li>In the HTTP proxy box type the proxy name %h and port %b.</li>
</ul>
</div>

<div id="microsoft">
For Internet Explorer browsers go to:
<ul>
<li>Tools -&gt; Internet Options -&gt; Connection -&gt; LAN Settings -&gt;Proxy</li>
<li>In the HTTP proxy box type the proxy name %h and port %b.</li>
</ul>
</div>

<div id="opera">
For Opera browsers go to:
<ul>
<li>Tools -&gt; Preferences -&gt; Advanced -&gt; Network -&gt; Proxy Servers</li>
<li>In the HTTP proxy box type the proxy name %h and port %b.</li>
</ul>
</div>

<p>Your cache administrator is <a href="mailto:%w%W">%w</a>.</p>
<br>
</div>

<hr>
<div id="footer">
<p>Generated %T by %h (%s)</p>
<!-- %c -->
</div>
</body></html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta type="copyright" content="Copyright (C) 1996-2023 The Squid Software Foundation and contributors">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Web Browser Configuration</title>
<!--EMBED:start-->
<!-- leave this block as is, our parser will convert links to inline content -->
<link rel="stylesheet" type="text/css" href="errorpage.css">
<!--EMBED:end -->
<style type="text/css"><!--
%l

body
:lang(fa) { direction: rtl; font-size: 100%; font-family: Tahoma, Roya, sans-serif; float: right; }
:lang(he) { direction: rtl; }
--></style>
</head><body id=%c>
<div id="titles">
<h1>ERROR</h1>
<h2>Web Browser Configuration</h2>
</div>
<hr>

<div id="content">
<blockquote id="error">
<p>Your Web Browser configuration needs to be corrected to use this network.</p>
</blockquote>

<p>How to find these settings in your browser:</p>

<div id="firefox">
For Firefox browsers go to:
<ul>
<li>Tools -&gt; Options -&gt; Advanced -&gt; Network -&gt; Connection Settings</li>
<li>Select Auto-detect proxy settings for this network</li>
</ul>
</div>

<div id="microsoft">
For Internet Explorer browsers go to:
<ul>
<li>Tools -&gt; Internet Options -&gt; Connection -&gt; LAN Settings -&gt;Proxy</li>
<li>Select Automatically detect settings</li>
</ul>
</div>

<div id="opera">
For Opera browsers go to:
<ul>
<li>Tools -&gt; Preferences -&gt; Advanced -&gt; Network -&gt; Proxy Servers</li>
<li>Select Use Automatic proxy configuration</li>
</ul>
</div>

<p>Your cache administrator is <a href="mailto:%w%W">%w</a>.</p>
<br>
</div>

<hr>
<div id="footer">
<p>Generated %T by %h (%s)</p>
<!-- %c -->
</div>
</body></html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta type="copyright" content="Copyright (C) 1996-2023 The Squid Software Foundation and contributors">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>ERROR: Cache Access Denied</title>
<!--EMBED:start-->
<!-- leave this block as is, our parser will convert links to inline content -->
<link rel="stylesheet" type="text/css" href="errorpage.css">
<!--EMBED:end -->
<style type="text/css"><!--
%l

body
:lang(fa) { direction: rtl; font-size: 100%; font-family: Tahoma, Roya, sans-serif; float: right; }
:lang(he) { direction: rtl; }
--></style>
</head><body id=%c>
<div id="titles">
<h1>ERROR</h1>
<h2>Cache Access Denied.</h2>
</div>
<hr>

<div id="content">
<p>The following error was encountered while trying to retrieve the URL: <a href="%U">%U</a></p>

<blockquote id="error">
<p><b>Cache Access Denied.</b></p>
</blockquote>

<p>Sorry, you are not currently allowed to request %U from this cache until you have authenticated yourself.</p>

<p>Please contact the <a href="mailto:%w%W">cache administrator</a> if you have difficulties authenticating yourself.</p>

<br>
</div>

<hr>
<div id="footer">
<p>Generated %T by %h (%s)</p>
<!-- %c -->
</div>
</body></html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta type="copyright" content="Copyright (C) 1996-2023 The Squid Software Foundation and contributors">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>ERROR: Cache Manager Access Denied</title>
<!--EMBED:start-->
<!-- leave this block as is, our parser will convert links to inline content -->
<link rel="stylesheet" type="text/css" href="errorpage.css">
<!--EMBED:end -->
<style type="text/css"><!--
%l

body
:lang(fa) { direction: rtl; font-size: 100%; font-family: Tahoma, Roya, sans-serif; float: right; }
:lang(he) { direction: rtl; }
--></style>
</head><body id=%c>
<div id="titles">
<h1>ERROR</h1>
<h2>Cache Manager Access Denied.</h2>
</div>
<hr>

<div id="content">
<p>The following error was encountered while trying to retrieve the URL: <a href="%U">%U</a></p>

<blockquote id="error">
<p><b>Cache Manager Access Denied.</b></p>
</blockquote>

<p>Sorry, you are not currently allowed to request %U from this cache manager until you have authenticated yourself.</p>

<p>Please contact the <a href="mailto:%w%W">cache administrator</a> if you have difficulties authenticating yourself or, if you <em>are</em> the administrator, read Squid documentation on cache manager interface and check cache log for more detailed error messages.</p>

<br>
</div>

<hr>
<div id="footer">
<p>Generated %T by %h (%s)</p>
<!-- %c -->
</div>
</body></html>
Loading

0 comments on commit 54a0e44

Please sign in to comment.