[wiki] [sites] Update proxyconfig patch and documentation. || Russell Wood

From: <git_AT_suckless.org>
Date: Thu, 05 Sep 2024 13:40:07 +0200

commit db11143178de137e993ff081767fa5c8dbcc7921
Author: Russell Wood <rjw_AT_lab.lan>
Date: Thu Sep 5 21:27:34 2024 +1000

    Update proxyconfig patch and documentation.

diff --git a/surf.suckless.org/patches/proxyconfig/index.md b/surf.suckless.org/patches/proxyconfig/index.md
index 87291e0c..77cb5f80 100644
--- a/surf.suckless.org/patches/proxyconfig/index.md
+++ b/surf.suckless.org/patches/proxyconfig/index.md
_AT_@ -1,4 +1,4 @@
-proxyconfig
+Proxy Config
 ===========
 
 Description
_AT_@ -6,19 +6,38 @@ Description
 
 This patch allows you to specify proxy settings in your config.h file.
 
-It contains an enum which wraps the three proxy modes supported by Webkit:
+It supports the three proxy modes in Webkit:
 
-* CustomProxy allows you to specify a custom proxy URL and list of hosts to ignore.
-* SystemProxy uses your system proxy settings (which on *nix is your http_proxy environment variable).
-* NoProxy ensures that a proxy is never used.
+* CustomProxy: specify a custom proxy URL and list of hosts to ignore.
+* SystemProxy: use your desktop environment proxy settings or `http_proxy` environment variable.
+* NoProxy: ensures that a proxy is never used.
 
-To use this patch, first set your ProxyMode Parameter to the desired value.
-If you're using CustomProxy, you then need to set your ProxyUrl Parameter to the URL of your proxy, for example, "http://localhost:8080", or "socks://localhost:9050".
-You may also optionally set your ProxyIgnoreHosts to specify a list of URLs which will not have their connections proxied. Please note that the SystemProxy mode will not respect your ProxyIgnoreHosts list -- my testing indicates that Webkit doesn't support this.
+Usage
+-----
 
-The default value is SystemProxy, which preserves the default behavior of vanilla surf out of the box.
+Once the patch is applied, modify the ProxyMode, ProxyUrl and ProxyIgnoreHosts variables as required. For example, if using a custom proxy server then the variables might be set as:
+
+``
+[ProxyIgnoreHosts] = { { .v = (char *[]){ "localhost","local.lan",NULL } }, },
+[ProxyMode] = { { .i = CustomProxy }, },
+[ProxyUrl] = { { .v = (char *) "http://proxy.local.lan:8080/"}, },
+``
+
+The default value is SystemProxy, which preserves the default behavior of surf.
+
+Note that the SystemProxy mode will not respect your ProxyIgnoreHosts list.
+
+FreeBSD Ports
+-------------
+
+To apply this patch to the `www/surf` port on FreeBSD, create the `files` directory within the port directory and copy the patch into it. If you have your own pre-defined `config.h` file, you can build and install the port using the using the `SURF_CONF=/path/to/surf/config.h` `make` variable. Otherwise, run `make patch` to apply the patch to the source files, edit `work/surf-VERSION/config.def.h`, set the variables as required and then build and install the port as per usual.
 
 Download
 --------
 
-* [surf-proxyconfig-20210503-7dcce9e.diff](surf-proxyconfig-20210503-7dcce9e.diff)
+* [patch-proxyconfig-20240905.diff](patch-proxyconfig-20240905.diff)
+
+Reference
+---------
+
+* [https://webkitgtk.org/reference/webkit2gtk/2.35.1/WebKitNetworkProxySettings.html](Webkit Network Proxy Settings Reference)
diff --git a/surf.suckless.org/patches/proxyconfig/surf-proxyconfig-20210503-7dcce9e.diff b/surf.suckless.org/patches/proxyconfig/patch-proxyconfig-20240905.diff
similarity index 69%
rename from surf.suckless.org/patches/proxyconfig/surf-proxyconfig-20210503-7dcce9e.diff
rename to surf.suckless.org/patches/proxyconfig/patch-proxyconfig-20240905.diff
index ef17ea83..d4d905ec 100644
--- a/surf.suckless.org/patches/proxyconfig/surf-proxyconfig-20210503-7dcce9e.diff
+++ b/surf.suckless.org/patches/proxyconfig/patch-proxyconfig-20240905.diff
_AT_@ -1,20 +1,8 @@
-From d0ba61a0e75cfc7b8e6d70d6f323d53295e628ad Mon Sep 17 00:00:00 2001
-From: weirdling <maddy_AT_clappe.rs>
-Date: Mon, 3 May 2021 14:46:24 +0100
-Subject: [PATCH] Implement proxy settings
-
----
- config.def.h |  3 +++
- surf.c       | 32 ++++++++++++++++++++++++++++++++
- 2 files changed, 35 insertions(+)
-
-diff --git a/config.def.h b/config.def.h
-index be168ab..46d164e 100644
---- a/config.def.h
-+++ b/config.def.h
-_AT_@ -43,6 +43,9 @@ static Parameter defconfig[ParameterLast] = {
+--- config.def.h.orig	2024-09-05 06:51:02 UTC
++++ config.def.h
+_AT_@ -36,6 +36,9 @@ static Parameter defconfig[ParameterLast] = {
+ 	[LoadImages]          =       { { .i = 1 },     },
  	[MediaManualPlay]     =       { { .i = 1 },     },
- 	[Plugins]             =       { { .i = 1 },     },
  	[PreferredLanguages]  =       { { .v = (char *[]){ NULL } }, },
 +	[ProxyIgnoreHosts]    =       { { .v = (char *[]){ NULL } }, },
 +	[ProxyMode]           =       { { .i = SystemProxy }, },
_AT_@ -22,10 +10,8 @@ index be168ab..46d164e 100644
  	[RunInFullscreen]     =       { { .i = 0 },     },
  	[ScrollBars]          =       { { .i = 1 },     },
  	[ShowIndicators]      =       { { .i = 1 },     },
-diff --git a/surf.c b/surf.c
-index ac832ff..5c74560 100644
---- a/surf.c
-+++ b/surf.c
+--- surf.c.orig	2024-09-05 06:51:09 UTC
++++ surf.c
 _AT_@ -50,6 +50,12 @@ enum {
  	OnAny   = OnDoc | OnLink | OnImg | OnMedia | OnEdit | OnBar | OnSel,
  };
_AT_@ -33,23 +19,23 @@ index ac832ff..5c74560 100644
 +enum {
 +	CustomProxy = WEBKIT_NETWORK_PROXY_MODE_CUSTOM,
 +	SystemProxy = WEBKIT_NETWORK_PROXY_MODE_DEFAULT,
-+	NoProxy		= WEBKIT_NETWORK_PROXY_MODE_NO_PROXY,
++	NoProxy   = WEBKIT_NETWORK_PROXY_MODE_NO_PROXY,
 +};
 +
  typedef enum {
- 	AcceleratedCanvas,
  	AccessMicrophone,
-_AT_@ -73,6 +79,9 @@ typedef enum {
+ 	AccessWebcam,
+_AT_@ -72,6 +78,9 @@ typedef enum {
  	LoadImages,
  	MediaManualPlay,
- 	Plugins,
+ 	PreferredLanguages,
 +	ProxyIgnoreHosts,
 +	ProxyMode,
 +	ProxyUrl,
- 	PreferredLanguages,
  	RunInFullscreen,
  	ScrollBars,
-_AT_@ -1111,6 +1120,7 @@ newview(Client *c, WebKitWebView *rv)
+ 	ShowIndicators,
+_AT_@ -1099,6 +1108,7 @@ newview(Client *c, WebKitWebView *rv)
  	WebKitWebContext *context;
  	WebKitCookieManager *cookiemanager;
  	WebKitUserContentManager *contentmanager;
_AT_@ -57,7 +43,7 @@ index ac832ff..5c74560 100644
  
  	/* Webview */
  	if (rv) {
-_AT_@ -1171,6 +1181,28 @@ newview(Client *c, WebKitWebView *rv)
+_AT_@ -1157,6 +1167,28 @@ newview(Client *c, WebKitWebView *rv)
  		webkit_web_context_set_tls_errors_policy(context,
  		    curconfig[StrictTLS].val.i ? WEBKIT_TLS_ERRORS_POLICY_FAIL :
  		    WEBKIT_TLS_ERRORS_POLICY_IGNORE);
_AT_@ -86,6 +72,3 @@ index ac832ff..5c74560 100644
  		/* disk cache */
  		webkit_web_context_set_cache_model(context,
  		    curconfig[DiskCache].val.i ? WEBKIT_CACHE_MODEL_WEB_BROWSER :
--- 
-2.31.1
-
Received on Thu Sep 05 2024 - 13:40:07 CEST

This archive was generated by hypermail 2.3.0 : Thu Sep 05 2024 - 13:48:51 CEST