add support for arbitrary proxies #479

Merged
dr-bonez merged 3 commits from feature/proxy into master 2021-07-01 19:46:19 +00:00
dr-bonez commented 2021-04-13 18:23:31 +00:00 (Migrated from gitlab.com)
  • I agree to release my code and all other changes of this MR under the Apache-2.0 license

Adds support for arbitrary proxy configuration. Based on comments from !52.

Examples:

  • No proxy (default):
proxy ="none"
  • Global proxy
[proxy]
global = { url = "socks5h://localhost:9050" }
  • Proxy some domains
[proxy]
[[proxy.by_domain]]
url = "socks5h://localhost:9050"
include = ["*.onion", "matrix.myspecial.onion"]
exclude = ["*.myspecial.onion"]

Include vs. Exclude

If include is an empty list, it is assumed to be ["*"].

If a domain matches both the exclude and include list, the proxy will only be used if it was included because of a more specific rule than it was excluded. In the above example, the proxy would be used for ordinary.onion, matrix.myspecial.onion, but not hello.myspecial.onion.

- [x] I agree to release my code and all other changes of this MR under the Apache-2.0 license Adds support for arbitrary proxy configuration. Based on comments from !52. ## Examples: - No proxy (default): ```toml proxy ="none" ``` - Global proxy ```toml [proxy] global = { url = "socks5h://localhost:9050" } ``` - Proxy some domains ```toml [proxy] [[proxy.by_domain]] url = "socks5h://localhost:9050" include = ["*.onion", "matrix.myspecial.onion"] exclude = ["*.myspecial.onion"] ``` ## Include vs. Exclude If include is an empty list, it is assumed to be `["*"]`. If a domain matches both the exclude and include list, the proxy will only be used if it was included because of a more specific rule than it was excluded. In the above example, the proxy would be used for `ordinary.onion`, `matrix.myspecial.onion`, but not `hello.myspecial.onion`.
timokoesters (Migrated from gitlab.com) approved these changes 2021-04-13 18:23:31 +00:00
dr-bonez commented 2021-04-13 19:34:41 +00:00 (Migrated from gitlab.com)

mentioned in merge request !55

mentioned in merge request !55
dr-bonez commented 2021-04-14 15:25:51 +00:00 (Migrated from gitlab.com)

added 112 commits

  • e4d16d0c...f6c4da82 - 111 commits from branch famedly:master
  • 2521506b - add support for arbitrary proxies

Compare with previous version

added 112 commits <ul><li>e4d16d0c...f6c4da82 - 111 commits from branch <code>famedly:master</code></li><li>2521506b - add support for arbitrary proxies</li></ul> [Compare with previous version](/famedly/conduit/-/merge_requests/54/diffs?diff_id=171677717&start_sha=e4d16d0cb12c64bfda9f8d211f26187300ae5c79)
dr-bonez commented 2021-04-14 15:27:39 +00:00 (Migrated from gitlab.com)

rebased

rebased
dr-bonez commented 2021-04-14 15:52:09 +00:00 (Migrated from gitlab.com)

added 3 commits

  • 2521506b...18398e1f - 2 commits from branch famedly:master
  • 7641d65e - add support for arbitrary proxies

Compare with previous version

added 3 commits <ul><li>2521506b...18398e1f - 2 commits from branch <code>famedly:master</code></li><li>7641d65e - add support for arbitrary proxies</li></ul> [Compare with previous version](/famedly/conduit/-/merge_requests/54/diffs?diff_id=171694245&start_sha=2521506b136d7cc06f5b4ae4fe0e6f71b1e77c94)
dr-bonez commented 2021-05-04 17:57:38 +00:00 (Migrated from gitlab.com)

added 53 commits

  • 7641d65e...b42d3485 - 51 commits from branch famedly:master
  • 469a18b0 - add support for arbitrary proxies
  • 970e9d14 - add debug

Compare with previous version

added 53 commits <ul><li>7641d65e...b42d3485 - 51 commits from branch <code>famedly:master</code></li><li>469a18b0 - add support for arbitrary proxies</li><li>970e9d14 - add debug</li></ul> [Compare with previous version](/famedly/conduit/-/merge_requests/54/diffs?diff_id=181065593&start_sha=7641d65e3b025fc2badce34d3d9ff90b67290d45)
dr-bonez commented 2021-05-04 18:19:15 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
dr-bonez commented 2021-05-12 20:31:02 +00:00 (Migrated from gitlab.com)

added 18 commits

  • 970e9d14...f3e63116 - 17 commits from branch famedly:master
  • 1e84fedc - add support for arbitrary proxies

Compare with previous version

added 18 commits <ul><li>970e9d14...f3e63116 - 17 commits from branch <code>famedly:master</code></li><li>1e84fedc - add support for arbitrary proxies</li></ul> [Compare with previous version](/famedly/conduit/-/merge_requests/54/diffs?diff_id=185097969&start_sha=970e9d140aea534bf38285790b6d584452c7b98c)
dr-bonez commented 2021-05-12 20:34:12 +00:00 (Migrated from gitlab.com)

rebased again

rebased again
dr-bonez commented 2021-06-17 20:47:25 +00:00 (Migrated from gitlab.com)

added 77 commits

  • 1e84fedc...2ac7b6d4 - 76 commits from branch famedly:master
  • 72662fd8 - add support for arbitrary proxies

Compare with previous version

added 77 commits <ul><li>1e84fedc...2ac7b6d4 - 76 commits from branch <code>famedly:master</code></li><li>72662fd8 - add support for arbitrary proxies</li></ul> [Compare with previous version](/famedly/conduit/-/merge_requests/54/diffs?diff_id=202522749&start_sha=1e84fedc82fb7120b946d37c3653cee28bf0a843)
dr-bonez commented 2021-06-17 20:48:59 +00:00 (Migrated from gitlab.com)

and again...

and again...
dr-bonez commented 2021-07-01 18:48:20 +00:00 (Migrated from gitlab.com)

added 13 commits

  • 72662fd8...cc911105 - 11 commits from branch famedly:master
  • b2d55160 - add support for arbitrary proxies
  • f25f61d4 - fix errors introduced by rebase

Compare with previous version

added 13 commits <ul><li>72662fd8...cc911105 - 11 commits from branch <code>famedly:master</code></li><li>b2d55160 - add support for arbitrary proxies</li><li>f25f61d4 - fix errors introduced by rebase</li></ul> [Compare with previous version](/famedly/conduit/-/merge_requests/54/diffs?diff_id=209311118&start_sha=72662fd88515ade6415367dc5b3b28ec5799fe03)
timokoesters commented 2021-07-01 19:03:26 +00:00 (Migrated from gitlab.com)

Can you put all of this in a new file instead of database.rs?

Can you put all of this in a new file instead of database.rs?
timokoesters commented 2021-07-01 19:03:27 +00:00 (Migrated from gitlab.com)

Instead of getting the most specific domain you could also just take the first matching domain to make the code simpler. That's okay if it's documented

Instead of getting the most specific domain you could also just take the first matching domain to make the code simpler. That's okay if it's documented
timokoesters commented 2021-07-01 19:03:27 +00:00 (Migrated from gitlab.com)

Do you need this level of complexity?

Do you need this level of complexity?
timokoesters commented 2021-07-01 19:04:42 +00:00 (Migrated from gitlab.com)

Looks good. Can you add some documentation on how to use this feature? In the default config (commented out by default) or in a (new?) markdown documentation file (maybe something for "Advanced features"?)

Looks good. Can you add some documentation on how to use this feature? In the default config (commented out by default) or in a (new?) markdown documentation file (maybe something for "Advanced features"?)
dr-bonez commented 2021-07-01 19:10:08 +00:00 (Migrated from gitlab.com)

Include and Exclude lists are separate. If there's a url that matches a rule in both lists, this is the most sane way to handle it.

Include and Exclude lists are separate. If there's a url that matches a rule in both lists, this is the most sane way to handle it.
dr-bonez commented 2021-07-01 19:10:09 +00:00 (Migrated from gitlab.com)

Will do. The body of this PR sufficient?

Will do. The body of this PR sufficient?
timokoesters commented 2021-07-01 19:11:09 +00:00 (Migrated from gitlab.com)

Yeah, we can merge it if you move it to another file and add documentation

Yeah, we can merge it if you move it to another file and add documentation
dr-bonez commented 2021-07-01 19:38:31 +00:00 (Migrated from gitlab.com)

changed this line in version 8 of the diff

changed this line in [version 8 of the diff](/famedly/conduit/-/merge_requests/54/diffs?diff_id=209327967&start_sha=f25f61d4a9e42d29704c357868074e45d24bd4df#807f8cc29c3a1b7fdbb4f1c57d0b409b889620fd_205_91)
dr-bonez commented 2021-07-01 19:38:32 +00:00 (Migrated from gitlab.com)

changed this line in version 8 of the diff

changed this line in [version 8 of the diff](/famedly/conduit/-/merge_requests/54/diffs?diff_id=209327967&start_sha=f25f61d4a9e42d29704c357868074e45d24bd4df#807f8cc29c3a1b7fdbb4f1c57d0b409b889620fd_136_91)
dr-bonez commented 2021-07-01 19:38:32 +00:00 (Migrated from gitlab.com)

changed this line in version 8 of the diff

changed this line in [version 8 of the diff](/famedly/conduit/-/merge_requests/54/diffs?diff_id=209327967&start_sha=f25f61d4a9e42d29704c357868074e45d24bd4df#807f8cc29c3a1b7fdbb4f1c57d0b409b889620fd_150_91)
dr-bonez commented 2021-07-01 19:38:32 +00:00 (Migrated from gitlab.com)

added 1 commit

Compare with previous version

added 1 commit <ul><li>c53cc03f - address pr comments</li></ul> [Compare with previous version](/famedly/conduit/-/merge_requests/54/diffs?diff_id=209327967&start_sha=f25f61d4a9e42d29704c357868074e45d24bd4df)
dr-bonez commented 2021-07-01 19:39:33 +00:00 (Migrated from gitlab.com)

resolved all threads

resolved all threads
timokoesters commented 2021-07-01 19:42:35 +00:00 (Migrated from gitlab.com)

approved this merge request

approved this merge request
timokoesters (Migrated from gitlab.com) scheduled this pull request to auto merge when all checks succeed 2021-07-01 19:42:37 +00:00
timokoesters commented 2021-07-01 19:46:19 +00:00 (Migrated from gitlab.com)

mentioned in commit 5f6b0c673c

mentioned in commit 5f6b0c673c9911309ae181ef25099acdca238c73
Sign in to join this conversation.
No reviewers
No labels
Android
CS::needs customer feedback
CS::needs follow up
CS::needs on prem installation
CS::waiting
Chrome
Design:: Ready
Design:: in progress
Design::UX
E2EE
Edge
Firefox
GDPR
Iteration 13 IM
Linux
MacOS
Need::Discussion
Need::Steps to reproduce
Need::Upstream fix
Needs:: Planning
Needs::Dev-Team
Needs::More information
Needs::Priority
Needs::Product
Needs::Refinement
Needs::Severity
Priority::1-Critical
Priority::2-Max
Priority::3-Impending
Priority::4-High
Priority::5-Medium
Priority::6-Low
Priority::7-None
Progress::Backlog
Progress::Review
Progress::Started
Progress::Testing
Progress::Triage
Progress::Waiting
Reporter::Sentry
Safari
Target::Community
Target::Customer
Target::Internal
Target::PoC
Target::Security
Team:Customer-Success
Team:Design
Team:Infrastructure
Team:Instant-Messaging
Team:Product
Team:Workflows
Type::Bug
Type::Design
Type::Documentation
Type::Feature
Type::Improvement
Type::Support
Type::Tests
Windows
blocked
blocked-by-spec
cla-signed
conduit
contribution::advanced
contribution::easy
contribution::help needed
from::review
iOS
p::ti-tenant
performance
product::triage
proposal
refactor
release-blocker
s: dart_openapi_codegen
s::Famedly-Patient
s::Org-Directory
s::Passport-Generator
s::Requeuest
s:CRM
s:Famedly-App
s:Famedly-Web
s:Fhiroxide
s:Fhiroxide-cli
s:Fhiroxide-client
s:Fhirs
s:Hedwig
s:LISA
s:Matrix-Dart-SDK
s:Role-Manager
s:Synapse
s:User-Directory
s:WFS-Matrix
s:Workflow Engine
s:dtls
s:famedly-error
s:fcm-shared-isolate
s:matrix-api-lite
s:multiple-tab-detector
s:native-imaging
severity::1
severity::2
severity::3
severity::4
technical-debt
voip
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Matthias/conduit#479
No description provided.