Skip to content

luci-app-privoxy: add support for https inspection#8689

Open
ricsc wants to merge 2 commits into
openwrt:masterfrom
ricsc:feature/privoxy-https-inspection
Open

luci-app-privoxy: add support for https inspection#8689
ricsc wants to merge 2 commits into
openwrt:masterfrom
ricsc:feature/privoxy-https-inspection

Conversation

@ricsc
Copy link
Copy Markdown
Contributor

@ricsc ricsc commented Jun 7, 2026

Enables the user to create a custom ca and enable https inspection

Pull request details

Description

Add support for https inspection

Screenshot or video of changes (if applicable)

Maintainer

@hnyman


Tested on

OpenWrt version: TRUNK and 25.12
LuCI version: openwrt-25.12 branch 26.155.67407
Web browser(s): Chrome,Firefox


Checklist

Enables the user to create a custom ca and enable https inspection

Signed-off-by: Richard Schneidt <ricsc@t-online.de>
Copy link
Copy Markdown
Collaborator

@openwrt-ai openwrt-ai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the HTTPS-inspection changes (1 commit, 2 files). A few issues to address; see inline comments. The backend dependency on openwrt/packages#29660 is disclosed in the checklist, so the new UCI options not yet existing in a consumer is expected and not flagged.


Generated by Claude Code

"file": {
"/etc/config/privoxy": ["write"],
"/etc/privoxy/regenerate_ca": ["write"]
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The view calls callRcInit('privoxy', 'reload') (the rc ubus object's init method) in both handleSaveApply and the regenerate handler, but this ACL never grants access to it. Without a "ubus": { "rc": ["init"] } entry, non-root ACL groups will get an access-denied error on the reload call. Peer apps that use rc init grant it in both scopes (see luci-app-unbound and luci-app-ocserv).

Suggested change
}
"file": {
"/etc/config/privoxy": ["write"],
"/etc/privoxy/regenerate_ca": ["write"]
},
"ubus": {
"rc": [ "init" ]
}

Generated by Claude Code

downloadBtn.inputstyle = 'primary';
downloadBtn.inputtitle = _('Download CA Certificate');
downloadBtn.onclick = L.bind(function() {
var certDir = document.querySelector('input[name="w.-privoxy.-privoxy.certdir"]');
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This selector will never match any element, so the download always silently falls back to the default /etc/privoxy/ssl. LuCI form widgets do not emit a name="w.-..." attribute. For a form.Value, the <input> carries id="widget.cbid.privoxy.privoxy.certdir" and no name attribute at all (see form.js renderWidget passing only id, and ui.js Textfield.render setting name from options.name, which is undefined here).

Use the form API instead of DOM scraping, e.g. read the live value via the option's formvalue:

var dir = certdir.formvalue('privoxy') || '/etc/privoxy/ssl';

The same broken selector is used in the updateCertPath() post-render handler (lines 467, 468, 476), so the dynamic path display and the input listener never attach either; please convert those to the form API as well.


Generated by Claude Code

if (confirm(_('Are you sure you want to regenerate the CA certificate? This will cause SSL warnings on all clients until the new certificate is installed.'))) {
// Create marker file to trigger certificate regeneration
return fs.write('/etc/privoxy/regenerate_ca', '1').then(function() {
console.log('UCI: marker file created successfully');
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: leftover debug logging. console.log('UCI: marker file created successfully') here and console.error('UCI error:', err) on line 306 should be removed before merge; the user-facing notifications already cover both the success and error paths.


Generated by Claude Code

Enables the user to create a custom ca and enable https inspection

Signed-off-by: Richard Schneidt <ricsc@t-online.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants