Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

luci-app-tor: Manage tor-hs onion services #6476

Merged
merged 3 commits into from
Dec 4, 2023

Conversation

stokito
Copy link
Contributor

@stokito stokito commented Jul 23, 2023

There was a PR #711 but it was focused on the Proxy configuration which is not fully yet supported by UCI.
The PR adds an ability to configure Tor Hidden Services as a good option to bypass NAT and have a stable access to a router.

Screenshot luci-app-tor: list of onion services

Screenshot luci-app-tor: edit onion service

Later once the main Tor package gains a support of a Proxy/Bridge configuration we can add this to the same luci app as a different view.

If you accept the PR please also check this small improvement openwrt/packages#21642

@ja-pa you created the tor-hs package so please check and leave your feedback

@stokito stokito force-pushed the luci-app-tor branch 2 times, most recently from 49daf87 to 44dc14c Compare August 2, 2023 22:11
@stokito
Copy link
Contributor Author

stokito commented Aug 2, 2023

There is a Name fields that is later used by the tor-hs package when a keys folder created for a service. Ideally instead it should be a uci section name used.
Anyway we can't update existing configuration where sections doesn't have a name.
Still I think that the section name must be set clearly.
So the PR has named hidden-service sections and when adding a new the Name field will be populated with a name of section. Users are free to change it if they need.
Existing unnamed sections will be shown as cfg1234 but their Name field remain intact and even can be edited.
Luci doesn't provide an option to edit section names but that's not critical.

@stangri
Copy link
Member

stangri commented Aug 3, 2023

You may want to make things a little easier and more error-prone for localizers, by changing things like:

_('<a href="https://openwrt.org/docs/guide-user/services/tor/hs" target="_blank">Tor Onion (Hidden) Services</a> are proxy tunnels to your local website, SSH and other services')

to

_('%sTor Onion (Hidden) Services%s are proxy tunnels to your local website, SSH and other services').format('<a href="https://openwrt.org/docs/guide-user/services/tor/hs" target="_blank">', '</a>')

@stokito
Copy link
Contributor Author

stokito commented Aug 3, 2023 via email

@stokito
Copy link
Contributor Author

stokito commented Aug 3, 2023

Damn, it's already exists a PR with the app for the tor-hs #4805
But it stalled. I'll check what left there and will merge with mine work.
I made a search by tor in issues but didn't checked existing PRs :(

@stokito
Copy link
Contributor Author

stokito commented Aug 4, 2023

Ok, I checked and looks like my PR would be better:

  1. The Hidden service status tab is not needed. Instead in my version just a link with onion domain is shown. It anyway can show only those onion services that are managed by the tor-hs
  2. Common settings tab is not needed. No one will ever change anything there. See tor-hs: use named sections packages#21642 (comment)
  3. Hidden service configuration has inline form while in my version it's modal.

@systemcrash
Copy link
Contributor

That's a good idea. Still I feel that it would be better to keep as is for two reasons: * We may have a translated Wiki page * This is more clear and less error-prone.

There is a reason that links should be formatted like this: safety/security is one of them. It also unburdens the language translators.

@stokito
Copy link
Contributor Author

stokito commented Aug 7, 2023

@stangri I changed the link to:

m = new form.Map('tor-hs', _('Tor Onion Services'),
	_(
		'Tor Onion (Hidden) Services are proxy tunnels to your local website, SSH and other services.<br/>' +
		'For further information <a href="%s" target="_blank" rel="noreferrer">check the documentation</a>'
	).format('https://openwrt.org/docs/guide-user/services/tor/hs')
);

@stangri
Copy link
Member

stangri commented Aug 8, 2023

@stangri I changed the link to:

m = new form.Map('tor-hs', _('Tor Onion Services'),
	_(
		'Tor Onion (Hidden) Services are proxy tunnels to your local website, SSH and other services.<br/>' +
		'For further information <a href="%s" target="_blank" rel="noreferrer">check the documentation</a>'
	).format('https://openwrt.org/docs/guide-user/services/tor/hs')
);

Great job! Maybe you'd also consider removing HTML tags from translatable resources too?

@stokito
Copy link
Contributor Author

stokito commented Aug 8, 2023

@stangri I made as you you suggested and spitted.

@stokito
Copy link
Contributor Author

stokito commented Aug 12, 2023

I simplified acl file and made an explicit page for hidden services because in future we will have other pages to configure Tor client options like excluded countries

The tor-hs packages provides Tor Onion (Hidden) Services.
This is a good option to bypass NAT and have stable access to a router.

Later once the main Tor package gains a support of a Proxy/Bridge configuration.
We can add this to the same luci app as a different view.

Signed-off-by: Sergey Ponomarev <[email protected]>
@stokito
Copy link
Contributor Author

stokito commented Dec 4, 2023

@systemcrash I applied changes that you requested.
Also I slightly changed description "A single port", "A pair ".

@systemcrash
Copy link
Contributor

OK, so is the tor-hs and tor service difference here important? Should the luci app be (re)named appropriately? Or can this also manage tor?

@stokito
Copy link
Contributor Author

stokito commented Dec 4, 2023

In future we can add a new tab for the Tor routing configuration: SOCKS port, exclude countries etc. Maybe even we can allow to configure the Tor as VPN.
That's all can be added later but for now the tor package UCI doesn't have that much options.

@systemcrash
Copy link
Contributor

Then the problem we have now is LUCI_DEPENDS:=. Installing this GUI does not imply any tor service is necessary. So as a start, add the tor-hs.

See e.g. pbr Makefile:

PKG_LICENSE:=GPL-3.0-or-later
PKG_MAINTAINER:=Stan Grishin <[email protected]>
PKG_VERSION:=1.1.1-7

LUCI_TITLE:=Policy Based Routing Service Web UI
LUCI_DESCRIPTION:=Provides Web UI for Policy Based Routing Service.
LUCI_DEPENDS:=+luci-base +jsonfilter +pbr

PKG_PROVIDES:=luci-app-vpnbypass luci-app-vpn-policy-routing

@stokito
Copy link
Contributor Author

stokito commented Dec 4, 2023

ok, fixed in the 612738d

@systemcrash
Copy link
Contributor

Great, would you like to add the other fields?
e.g.

PKG_LICENSE:=?
PKG_MAINTAINER:=Sergey Ponomarev <[email protected]>

LUCI_DESCRIPTION:=

PKG_PROVIDES:=

Signed-off-by: Sergey Ponomarev <[email protected]>
@stokito
Copy link
Contributor Author

stokito commented Dec 4, 2023

I added the package version, release and maintainer. Everything else like License will be inherited from Luci.

@systemcrash
Copy link
Contributor

OK, and now for consistency: can you order those additions so they're like other Makefiles? e.g.


PKG_*

LUCI_*

@stokito
Copy link
Contributor Author

stokito commented Dec 4, 2023

As far I know that should be enough: it has own version and maintainer but everything else same as for the luci.
Here is for example transmission app that has only Title and Depends:
https://github.com/openwrt/luci/blob/master/applications/luci-app-transmission/Makefile

@systemcrash systemcrash changed the title luci-app-tor: Manage onion services luci-app-tor: Manage tor-hs onion services Dec 4, 2023
@systemcrash systemcrash merged commit 3283cb2 into openwrt:master Dec 4, 2023
2 checks passed
@stokito stokito deleted the luci-app-tor branch December 4, 2023 19:10
@stokito
Copy link
Contributor Author

stokito commented Dec 4, 2023

Thank you

@systemcrash
Copy link
Contributor

Thanks for your patience 😄

systemcrash pushed a commit that referenced this pull request Dec 4, 2023
* luci-app-tor: Manage Onion services (tor-hs)

The tor-hs packages provides Tor Onion (Hidden) Services.
This is a good option to bypass NAT and have stable access to a router.

Later once the main Tor package gains a support of a Proxy/Bridge configuration.
We can add this to the same luci app as a different view.

Signed-off-by: Sergey Ponomarev <[email protected]>
(cherry picked from commit 3283cb2)
systemcrash pushed a commit that referenced this pull request Dec 4, 2023
* luci-app-tor: Manage Onion services (tor-hs)

The tor-hs packages provides Tor Onion (Hidden) Services.
This is a good option to bypass NAT and have stable access to a router.

Later once the main Tor package gains a support of a Proxy/Bridge configuration.
We can add this to the same luci app as a different view.

Signed-off-by: Sergey Ponomarev <[email protected]>
(cherry picked from commit 3283cb2)
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.

3 participants