forked from opnsense/plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
89 changed files
with
7,231 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
42 changes: 42 additions & 0 deletions
42
www/squid/src/opnsense/data/proxy/template_error_pages/ERR_ACCESS_DENIED.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
43 changes: 43 additions & 0 deletions
43
www/squid/src/opnsense/data/proxy/template_error_pages/ERR_ACL_TIME_QUOTA_EXCEEDED.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
64 changes: 64 additions & 0 deletions
64
www/squid/src/opnsense/data/proxy/template_error_pages/ERR_AGENT_CONFIGURE.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 -> Options -> Advanced -> Network -> 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 -> Internet Options -> Connection -> LAN Settings ->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 -> Preferences -> Advanced -> Network -> 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> |
64 changes: 64 additions & 0 deletions
64
www/squid/src/opnsense/data/proxy/template_error_pages/ERR_AGENT_WPAD.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 -> Options -> Advanced -> Network -> 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 -> Internet Options -> Connection -> LAN Settings ->Proxy</li> | ||
<li>Select Automatically detect settings</li> | ||
</ul> | ||
</div> | ||
|
||
<div id="opera"> | ||
For Opera browsers go to: | ||
<ul> | ||
<li>Tools -> Preferences -> Advanced -> Network -> 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> |
43 changes: 43 additions & 0 deletions
43
www/squid/src/opnsense/data/proxy/template_error_pages/ERR_CACHE_ACCESS_DENIED.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
43 changes: 43 additions & 0 deletions
43
www/squid/src/opnsense/data/proxy/template_error_pages/ERR_CACHE_MGR_ACCESS_DENIED.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
Oops, something went wrong.