Giter Club home page Giter Club logo

teleport's Introduction

Teleport

This is an unofficial tool which generates WireGuard VPN configurations for AmpliFi Teleport-enabled routers so you can access your local network from the outside. It was made because there is no AmpliFi Teleport desktop tool available yet, only mobile apps.

Steps to use it:

  1. pip install -r requirements.txt
  2. Generate a PIN from within the AmpliFi app.
  3. python main.py --pin AB123, replacing AB123 with the PIN from step 2.
  4. Paste the outputted WireGuard config into a WireGuard client and connect.
  5. Repeat steps 3 and 4 everytime you want to connect, but without the --pin argument.

teleport's People

Contributors

alexanderhenne avatar lipov3cz3k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

teleport's Issues

Works for a very short period of time then stops

Using the generated info works for a short period (first session) and then the client receives no data via the tunnel.

You can deactivate/reactivate the tunnel in WireGuard and it'll connect successfully but the client won't receive data.

Guessing it's something Ubiquiti have changed on their end.

issue with requirements

I have pulled python3 from python.org and pip via curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

When I run pip install -r requirements.txt I get this:

Collecting aiortc==1.2.0
  Using cached aiortc-1.2.0.tar.gz (1.2 MB)
  Preparing metadata (setup.py) ... done
Collecting requests==2.25.1
  Using cached requests-2.25.1-py2.py3-none-any.whl (61 kB)
Collecting cryptography<39
  Using cached cryptography-38.0.4-cp36-abi3-macosx_10_10_universal2.whl (5.4 MB)
Collecting aioice<0.8.0,>=0.7.5
  Using cached aioice-0.7.6-py3-none-any.whl (23 kB)
Collecting av<9.0.0,>=8.0.0
  Using cached av-8.1.0.tar.gz (2.4 MB)
  Preparing metadata (setup.py) ... done
Collecting cffi>=1.0.0
  Using cached cffi-1.15.1-cp311-cp311-macosx_11_0_arm64.whl (174 kB)
Requirement already satisfied: crc32c>=2.1 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from aiortc==1.2.0->-r requirements.txt (line 1)) (2.3.post0)
Collecting pyee>=6.0.0
  Using cached pyee-9.0.4-py2.py3-none-any.whl (14 kB)
Collecting pylibsrtp>=0.5.6
  Using cached pylibsrtp-0.8.0-cp311-cp311-macosx_11_0_arm64.whl (52 kB)
Collecting chardet<5,>=3.0.2
  Using cached chardet-4.0.0-py2.py3-none-any.whl (178 kB)
Collecting idna<3,>=2.5
  Using cached idna-2.10-py2.py3-none-any.whl (58 kB)
Collecting urllib3<1.27,>=1.21.1
  Using cached urllib3-1.26.15-py2.py3-none-any.whl (140 kB)
Requirement already satisfied: certifi>=2017.4.17 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from requests==2.25.1->-r requirements.txt (line 2)) (2022.12.7)
Collecting dnspython>=2.0.0
  Using cached dnspython-2.3.0-py3-none-any.whl (283 kB)
Requirement already satisfied: netifaces in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from aioice<0.8.0,>=0.7.5->aiortc==1.2.0->-r requirements.txt (line 1)) (0.11.0)
Collecting pycparser
  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Collecting typing-extensions
  Using cached typing_extensions-4.5.0-py3-none-any.whl (27 kB)
Building wheels for collected packages: aiortc, av
  Building wheel for aiortc (setup.py) ... error
  error: subprocess-exited-with-error
  
  ร— python setup.py bdist_wheel did not run successfully.
  โ”‚ exit code: 1
  โ•ฐโ”€> [35 lines of output]
      /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
        warnings.warn(
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/ml/88rl8rbx11g__x77rx7nll_00000gn/T/pip-install-72d47f56/aiortc_a16a9401454444258cce8fad413895f2/setup.py", line 44, in <module>
          setuptools.setup(
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/__init__.py", line 86, in setup
          _install_setup_requires(attrs)
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/__init__.py", line 80, in _install_setup_requires
          dist.fetch_build_eggs(dist.setup_requires)
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/dist.py", line 875, in fetch_build_eggs
          resolved_dists = pkg_resources.working_set.resolve(
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pkg_resources/__init__.py", line 789, in resolve
          dist = best[req.key] = env.best_match(
                                 ^^^^^^^^^^^^^^^
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pkg_resources/__init__.py", line 1075, in best_match
          return self.obtain(req, installer)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pkg_resources/__init__.py", line 1087, in obtain
          return installer(requirement)
                 ^^^^^^^^^^^^^^^^^^^^^^
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/dist.py", line 945, in fetch_build_egg
          return fetch_build_egg(self, req)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/installer.py", line 87, in fetch_build_egg
          wheel.install_as_egg(dist_location)
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/wheel.py", line 110, in install_as_egg
          self._install_as_egg(destination_eggdir, zf)
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/wheel.py", line 118, in _install_as_egg
          self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/wheel.py", line 162, in _convert_metadata
          os.rename(dist_info, egg_info)
      OSError: [Errno 66] Directory not empty: '/private/var/folders/ml/88rl8rbx11g__x77rx7nll_00000gn/T/pip-install-72d47f56/aiortc_a16a9401454444258cce8fad413895f2/.eggs/cffi-1.15.1-py3.11-macosx-10.9-universal2.egg/cffi-1.15.1.dist-info' -> '/private/var/folders/ml/88rl8rbx11g__x77rx7nll_00000gn/T/pip-install-72d47f56/aiortc_a16a9401454444258cce8fad413895f2/.eggs/cffi-1.15.1-py3.11-macosx-10.9-universal2.egg/EGG-INFO'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for aiortc
  Running setup.py clean for aiortc
  error: subprocess-exited-with-error
  
  ร— python setup.py clean did not run successfully.
  โ”‚ exit code: 1
  โ•ฐโ”€> [35 lines of output]
      /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
        warnings.warn(
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/ml/88rl8rbx11g__x77rx7nll_00000gn/T/pip-install-72d47f56/aiortc_a16a9401454444258cce8fad413895f2/setup.py", line 44, in <module>
          setuptools.setup(
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/__init__.py", line 86, in setup
          _install_setup_requires(attrs)
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/__init__.py", line 80, in _install_setup_requires
          dist.fetch_build_eggs(dist.setup_requires)
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/dist.py", line 875, in fetch_build_eggs
          resolved_dists = pkg_resources.working_set.resolve(
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pkg_resources/__init__.py", line 789, in resolve
          dist = best[req.key] = env.best_match(
                                 ^^^^^^^^^^^^^^^
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pkg_resources/__init__.py", line 1075, in best_match
          return self.obtain(req, installer)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pkg_resources/__init__.py", line 1087, in obtain
          return installer(requirement)
                 ^^^^^^^^^^^^^^^^^^^^^^
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/dist.py", line 945, in fetch_build_egg
          return fetch_build_egg(self, req)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/installer.py", line 87, in fetch_build_egg
          wheel.install_as_egg(dist_location)
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/wheel.py", line 110, in install_as_egg
          self._install_as_egg(destination_eggdir, zf)
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/wheel.py", line 118, in _install_as_egg
          self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/wheel.py", line 162, in _convert_metadata
          os.rename(dist_info, egg_info)
      OSError: [Errno 66] Directory not empty: '/private/var/folders/ml/88rl8rbx11g__x77rx7nll_00000gn/T/pip-install-72d47f56/aiortc_a16a9401454444258cce8fad413895f2/.eggs/cffi-1.15.1-py3.11-macosx-10.9-universal2.egg/cffi-1.15.1.dist-info' -> '/private/var/folders/ml/88rl8rbx11g__x77rx7nll_00000gn/T/pip-install-72d47f56/aiortc_a16a9401454444258cce8fad413895f2/.eggs/cffi-1.15.1-py3.11-macosx-10.9-universal2.egg/EGG-INFO'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed cleaning build dir for aiortc
  Building wheel for av (setup.py) ... error
  error: subprocess-exited-with-error
  
  ร— python setup.py bdist_wheel did not run successfully.
  โ”‚ exit code: 1
  โ•ฐโ”€> [29 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.macosx-10.9-universal2-cpython-311
      creating build/lib.macosx-10.9-universal2-cpython-311/av
      copying av/deprecation.py -> build/lib.macosx-10.9-universal2-cpython-311/av
      copying av/datasets.py -> build/lib.macosx-10.9-universal2-cpython-311/av
      copying av/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/av
      copying av/__main__.py -> build/lib.macosx-10.9-universal2-cpython-311/av
      creating build/lib.macosx-10.9-universal2-cpython-311/av/video
      copying av/video/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/av/video
      creating build/lib.macosx-10.9-universal2-cpython-311/av/codec
      copying av/codec/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/av/codec
      creating build/lib.macosx-10.9-universal2-cpython-311/av/container
      copying av/container/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/av/container
      creating build/lib.macosx-10.9-universal2-cpython-311/av/audio
      copying av/audio/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/av/audio
      creating build/lib.macosx-10.9-universal2-cpython-311/av/subtitles
      copying av/subtitles/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/av/subtitles
      creating build/lib.macosx-10.9-universal2-cpython-311/av/filter
      copying av/filter/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/av/filter
      creating build/lib.macosx-10.9-universal2-cpython-311/av/sidedata
      copying av/sidedata/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/av/sidedata
      creating build/lib.macosx-10.9-universal2-cpython-311/av/data
      copying av/data/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/av/data
      running build_ext
      running config
      pkg-config is required for building PyAV
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for av
  Running setup.py clean for av
Failed to build aiortc av
Installing collected packages: av, urllib3, typing-extensions, pycparser, idna, dnspython, chardet, requests, pyee, cffi, aioice, pylibsrtp, cryptography, aiortc
  Running setup.py install for av ... error
  error: subprocess-exited-with-error
  
  ร— Running setup.py install for av did not run successfully.
  โ”‚ exit code: 1
  โ•ฐโ”€> [31 lines of output]
      running install
      /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.macosx-10.9-universal2-cpython-311
      creating build/lib.macosx-10.9-universal2-cpython-311/av
      copying av/deprecation.py -> build/lib.macosx-10.9-universal2-cpython-311/av
      copying av/datasets.py -> build/lib.macosx-10.9-universal2-cpython-311/av
      copying av/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/av
      copying av/__main__.py -> build/lib.macosx-10.9-universal2-cpython-311/av
      creating build/lib.macosx-10.9-universal2-cpython-311/av/video
      copying av/video/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/av/video
      creating build/lib.macosx-10.9-universal2-cpython-311/av/codec
      copying av/codec/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/av/codec
      creating build/lib.macosx-10.9-universal2-cpython-311/av/container
      copying av/container/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/av/container
      creating build/lib.macosx-10.9-universal2-cpython-311/av/audio
      copying av/audio/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/av/audio
      creating build/lib.macosx-10.9-universal2-cpython-311/av/subtitles
      copying av/subtitles/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/av/subtitles
      creating build/lib.macosx-10.9-universal2-cpython-311/av/filter
      copying av/filter/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/av/filter
      creating build/lib.macosx-10.9-universal2-cpython-311/av/sidedata
      copying av/sidedata/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/av/sidedata
      creating build/lib.macosx-10.9-universal2-cpython-311/av/data
      copying av/data/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/av/data
      running build_ext
      running config
      pkg-config is required for building PyAV
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

ร— Encountered error while trying to install package.
โ•ฐโ”€> av

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

python newbie here... any quick fixes?

thanks... :)

Connecting Question

Hi. Thanks for creating this app. If I can get it to work it would be amazing. No problem following steps 1 - 3. I see the connection on my amplifi app afterward. For Step 4, do I paste the Public Key generated into the Private Key in the tunnel? That's what I tried it saved and activated, but doesn't seem to be creating a tunnel to my amplifi.
Screenshot 2023-06-19 172639

Error while creating Teleport token from PIN

When I execute python main.py --pin {ccnnn}, I get the result:
ERROR:root:'cryptography.hazmat.bindings._rust.x509.Certificat' object has no attribute '_x509'

Upon first trying to generate the token, I got a warning about having an old version of pyOpenSSL, followed by this error:
value=certificate_digest(self._cert._x509), # type: ignore ERROR:root:[WinError 2] The system cannot find the file specified
After upgrading, I get the error message stated above(top).
Is there anything more I can provide to help resolve the issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.