Skip to content
Snippets Groups Projects

enable setting introducer url using env variable

Merged jkito requested to merge introducer into main
3 unresolved threads

check if the LEAP_INTRODUCER_URL env variable is non-empty and use its value as introducer URL

this allows us to test the introducer feature in the client

Merge request reports

Pipeline failed for de44d07f on introducer

Approval is optional

Merged by jkitojkito 4 months ago (Dec 4, 2024 7:28am UTC)

Merge details

  • Changes merged into with de44d07f.
  • Did not delete the source branch.

Pipeline #253819 failed

Pipeline failed for de44d07f on main

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Can you please add LEAP_INTRODUCER_URL env to docs/debug.rst?

    • Hey,

      Have you tested this? I had some issues and pushed some fixes:

      When running with
      LEAP_INTRODUCER_URL="obfsvpnintro://localhost:4430/?cert=MpRqHUJtZuL1ZUB3agXPGJJ0aZTIc20N5haBkAllf2CaTnaWOAtJGfUCgv0XCOJzt1qpfQ&fqdn=localhost&kcp=0"
      I got:

      2024-10-16T08:41:34+02:00 DBG failed to create http client from introducer error="expected a FQDN, got: localhost"

      This was fixed in bitmask-core, so I updated the dependency.

      Then I needed to fix the recent API changes in DoGeolocationLookup. It now only returns an error. Before also a string was returned.

      Then, when I tried, I got:

      2024-10-16T08:54:55+02:00 WRN Could not update lastUsed timestamp for introducer error="introducer not found"   

      So we need to add the introducer to the database first. How do we want to handle this? We could run storage.AddIntroducer(url), but this part is currently only used/encapsulated in bitmaks-core. Also we need to remove it from the database after the run. So it's not super simple. What do you think? Let me think about this again

      Edited by Pea Nut
    • Author Maintainer

      No did not test it yet, thanks for doing that, feel free to add more commits to fix it up!

    • Author Maintainer

      So we need to add the introducer to the database first. How do we want to handle this? We could run storage.AddIntroducer(url), but this part is currently only used/encapsulated in bitmaks-core. Also we need to remove it from the database after the run. So it's not super simple. What do you think? Let me think about this again

      i think this belongs in bitmask-core itself, when it tries to update the lastUsed timestamp if it doesn't find a introducer it can simply add it to the storage, iirc this was the behavior before in bitmask-core when using the earlier version of the storage mechanism

    • Hm, I like to be explicit and keep it the way it currently is: add, use it and remove introducer (from storage layer). What do you say @cyberta

    • I don't have a strong opinion on that. Either works, I have a slight preference for keeping add and update as different actions. Explicitly adding an introducer makes it maybe easier to follow the code? There are some other code changes in the pipeline regarding the storage layer to avoid implicit initialization of it (bitmask-core#24). Having distinct actions add, update and remove seems to fit in that context.

    • I now have a working version that I'm happy with. @jkito can you review please? I use this go.work:

      go 1.22.2
      
      use (
          .
          ../bitmask-core
      )

      There, I'm on origin/fix-29 which fixes some introducerURL things. To test, I use

      export LEAP_INTRODUCER_URL="obfsvpnintro://localhost:4430/?cert=HtqKzIacN3%2Ba6AAS%2BXlnw%2FlEgHRLIm%2BmEFtIgFQ26vxWa4aFy07XhWIRjK6kZ1YpxejkRA&fqdn=localhost&kcp=0&auth=123"

      (Don't forget to url encode). If you have problems with the test setup, just ask.

    • btw: I only tested it with V5, so it probably won't work with v3. Need to check it.

    • Please register or sign in to reply
  • Pea Nut added 5 commits

    added 5 commits

    • 7e176df8 - 1 commit from branch main
    • 3d692de0 - chore: replace ioutil with io module
    • a76e1ddb - enable setting introducer url using env variable
    • 4a2204df - Update to latest bitmask-core (commit 0812b9aadf98)
    • a823f622 - Update calls to DoGeolocationLookup after API change

    Compare with previous version

  • Pea Nut added 2 commits

    added 2 commits

    • 9a0b0824 - Improve error handling when checking downloaded pem cert
    • 776d7e95 - DEV: Add introducer to storage if not yet happened

    Compare with previous version

  • assigned to @peanut2

    • There are more things to fix. Now we have a version that works (most of the time) with v5. But there is still a database issue. And a corner case bug:

      2024-10-16T10:27:55+02:00 TRC Checking for a valid OpenVPN client credentials (key and certificate) path=/tmp/leap-566310687/openvpn.pem               
      2024-10-16T10:27:55+02:00 WRN Could not decode pem data data="404 page not found\n"     
      
      T 127.0.0.1:41124 -> 127.0.0.1:8443 [AP] #774                                                                          
      GET /api/5/openvpn/cert HTTP/1.1.                                                                                      
      Host: localhost:8443.                                                                                                  
      User-Agent: Go-http-client/1.1.                                                                                        
      Accept: application/json.                                                                                              
      Accept-Encoding: gzip.                                     
      .                                                          
                                                                 
                                                                 
      T 127.0.0.1:8443 -> 127.0.0.1:41124 [AP] #776              
      HTTP/1.1 200 OK.                                           
      Cache-Control: no-cache.                                   
      Content-Type: text/plain; charset=UTF-8.
      Date: Wed, 16 Oct 2024 08:27:55 GMT.
      Content-Length: 19.                                        
      .                                                          
      404 page not found          

      Don't know why/when this happens

    • These days the openvpn cert endpoint from riseup is flaky and returns 404 from time to time. Against which provider did you test?

    • It's "just" a RiseUp problem. I described it here: menshen#60 (comment 1223051)

    • Please register or sign in to reply
  • Pea Nut added 2h of time spent at 2024-10-15

    added 2h of time spent at 2024-10-15

  • changed milestone to %2025.02 LEAP VPN Release

  • Pea Nut mentioned in issue #897 (closed)

    mentioned in issue #897 (closed)

  • Pea Nut mentioned in merge request bitmask-core!34 (merged)

    mentioned in merge request bitmask-core!34 (merged)

  • Pea Nut added 21 commits

    added 21 commits

    • 776d7e95...d8337b7f - 11 earlier commits
    • e11ac2fd - change obfsvpn version to v1.1.0
    • 9a04b348 - helper: use unix socket for local api
    • 95a5862d - create 0.24.10-rc.1 release and update CHANGELOG
    • aec8c140 - chore: replace ioutil with io module
    • 8d19435d - enable setting introducer url using env variable
    • 16f3183d - Update to latest bitmask-core (commit 0812b9aadf98)
    • 86ae330f - Update calls to DoGeolocationLookup after API change
    • b8a689ea - Improve error handling when checking downloaded pem cert
    • bc565825 - Initialize and close bitmask-core storage
    • 31b6f2e4 - DEV: Add introducer to storage if not yet happened

    Compare with previous version

  • Pea Nut requested review from @jkito and removed review request for @peanut2

    requested review from @jkito and removed review request for @peanut2

  • Pea Nut added 1h 30m of time spent at 2024-10-21

    added 1h 30m of time spent at 2024-10-21

  • Author Maintainer

    @peanut2 could you please resolve merge conflicts and rebase it on main

  • Pea Nut added 21 commits

    added 21 commits

    • 31b6f2e4...91a2ce8d - 13 commits from branch main
    • 4815ff5e - Strip port of menshen host before resolving with logDnsLookup
    • 4e8ddf2e - chore: replace ioutil with io module
    • ffe8da8b - enable setting introducer url using env variable
    • 9b26ea17 - Update to latest bitmask-core (commit 0812b9aadf98)
    • fbc0feaa - Update calls to DoGeolocationLookup after API change
    • 072ed564 - Improve error handling when checking downloaded pem cert
    • f4e62a17 - Initialize and close bitmask-core storage
    • 3a8aaf52 - DEV: Add introducer to storage if not yet happened

    Compare with previous version

  • Pea Nut added 1 commit

    added 1 commit

    • 09c9d39b - Add introducer to storage before using it when supplied via env

    Compare with previous version

  • rebased and ready to merge I think.

  • jkito
  • jkito
  • jkito added 11 commits

    added 11 commits

    • 09c9d39b...82cc49bb - 3 commits from branch main
    • dc1d5ada - Strip port of menshen host before resolving with logDnsLookup
    • b53473e6 - chore: replace ioutil with io module
    • 3f63e043 - enable setting introducer url using env variable
    • 07da5efd - Update to latest bitmask-core (commit 0812b9aadf98)
    • 132dc10e - Update calls to DoGeolocationLookup after API change
    • c4836287 - Improve error handling when checking downloaded pem cert
    • e51b45c7 - Initialize and close bitmask-core storage
    • c8a05473 - Add introducer to storage before using it when supplied via env

    Compare with previous version

  • jkito
  • Pea Nut added 1 commit

    added 1 commit

    • f3ff01fd - Apply 1 suggestion(s) to 1 file(s)

    Compare with previous version

  • Pea Nut added 2 commits

    added 2 commits

    • 63713458 - Initialize and close bitmask-core storage
    • c4382c68 - Add introducer to storage before using it when supplied via env

    Compare with previous version

  • jkito added 9 commits

    added 9 commits

    • e3c92310 - 1 commit from branch main
    • dd29081b - Strip port of menshen host before resolving with logDnsLookup
    • 685cb3c9 - chore: replace ioutil with io module
    • 0654238c - enable setting introducer url using env variable
    • 466c1b6b - Update to latest bitmask-core (commit 0812b9aadf98)
    • 343288d0 - Update calls to DoGeolocationLookup after API change
    • 767a99a7 - Improve error handling when checking downloaded pem cert
    • 46394fa8 - Initialize and close bitmask-core storage
    • 0c50e899 - Add introducer to storage before using it when supplied via env

    Compare with previous version

  • jkito
    jkito @jkito started a thread on commit 46394fa8
  • 34 35 Msg("Using API URL from env")
    35 36 }
    36 37
    38 err := storage.InitAppStorage()
    39 if err != nil {
    40 return nil, fmt.Errorf("Could not initialize bitmask-core storage: %v", err)
    41 }
    42
  • jkito added 6 commits

    added 6 commits

    • 0bd196e7 - enable setting introducer url using env variable
    • 1f2cd70d - Update to latest bitmask-core (commit 0812b9aadf98)
    • 1f91f6f8 - Update calls to DoGeolocationLookup after API change
    • c6bca076 - Improve error handling when checking downloaded pem cert
    • 1a5a5a07 - Initialize and close bitmask-core storage
    • de44d07f - Add introducer to storage before using it when supplied via env

    Compare with previous version

  • jkito enabled an automatic merge when all merge checks for de44d07f pass

    enabled an automatic merge when all merge checks for de44d07f pass

  • jkito canceled the automatic merge

    canceled the automatic merge

  • merged

  • Please register or sign in to reply
    Loading