Skip to content

Cloudflared recipe added - #3415

Open
SNEHASISHROY-125 wants to merge 5 commits into
kivy:developfrom
SNEHASISHROY-125:develop
Open

SNEHASISHROY-125 wants to merge 5 commits into
kivy:developfrom
SNEHASISHROY-125:develop

Conversation

@SNEHASISHROY-125

Copy link
Copy Markdown
Contributor
Cloudflare

Cloudflared recipe depends on libcloudflared added ++

more Info: https://developers.cloudflare.com/tunnel/

ss

what does it offer:

  • Managed Tunnel
  • Quick Tunnel

Usage:

from cloudflared.android.helper.cloudflared import (
    start_cloudflared,
    stop_cloudflared,
)

# Create a managed tunnel.
start_cloudflared(token="<your-managed-tunnel-token>")

# Or expose a local server with a quick tunnel.
start_cloudflared(
    url="http://127.0.0.1:8769",  # your locally running server that you want to take public
    emails=["person1@example.com", "person2@example.com"],  # or emails=[] not mandatory
)

# Get quick tunnel url
def get_quick_tunnel_url(*args):
    from cloudflared.android.helper.cloudflared import cloudflared
    if cloudflared is None:
        return "N/A"
    return cloudflared.get("temp_url", "N/A")

# Stop the active tunnel.
stop_cloudflared()

@kuzeyron

Copy link
Copy Markdown
Contributor
pythonforandroid/recipes/cloudflared/__init__.py:18:29: W292 no newline at end of file
pythonforandroid/recipes/libcloudflared/__init__.py:3:1: F401 're' imported but unused
pythonforandroid/recipes/libcloudflared/__init__.py:180:5: E303 too many blank lines (2)
pythonforandroid/recipes/libcloudflared/__init__.py:298:32: W292 no newline at end of file

Also with libcloudflared, if you could remove as many "new/empty-lines" as possible.

@kuzeyron

Copy link
Copy Markdown
Contributor
pythonforandroid/recipes/cloudflared/__init__.py:4:1: E302 expected 2 blank lines, found 1
pythonforandroid/recipes/cloudflared/__init__.py:15:1: E305 expected 2 blank lines after class or function definition, found 1
pythonforandroid/recipes/cloudflared/__init__.py:15:29: W292 no newline at end of file
pythonforandroid/recipes/libcloudflared/__init__.py:13:1: E302 expected 2 blank lines, found 1
pythonforandroid/recipes/libcloudflared/__init__.py:289:1: E305 expected 2 blank lines after class or function definition, found 1
pythonforandroid/recipes/libcloudflared/__init__.py:289:32: W292 no newline at end of file

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 63.074% (-0.6%) from 63.674% — SNEHASISHROY-125:develop into kivy:develop

class CloudflaredRecipe(PythonRecipe):

version = "1.4.0"
url = "https://github.com/SNEHASISHROY-125/cloudflared4kivy/releases/download/latest/cloudflared-{version}.tar.gz"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's rename the recipe to cloudflared4kivy instead. And I encourage you to publish it on PYPI and then continue with PR here. (just to reserve this name)

from pythonforandroid.logger import info


class CloudflaredRecipe(PythonRecipe):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's also switch to PyProjectRecipe instead.


GO_VERSION = "1.27.4"

GO_RELEASES = {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As this is a GOLANG recipe, let's try to generalize this class same as RustCompiledComponentsRecipe to maybe something like GoCompiledComponentsRecipe. And use that as a subclass for this recipe.

@@ -0,0 +1,28 @@

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's also eliminate the need of a build.sh file, these all commands can be called from python recipe itself with sh module.

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.

4 participants