updogfx 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
updogfx-0.1.0/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 EFXTv
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ ...
7
+
@@ -0,0 +1,3 @@
1
+ include README.md
2
+ include LICENSE
3
+ recursive-include updogfx/templates *.html
updogfx-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,39 @@
1
+ Metadata-Version: 2.4
2
+ Name: updogfx
3
+ Version: 0.1.0
4
+ Summary: A simple file server inspired by Updog, with reverse SSH support.
5
+ Home-page: https://github.com/efxtv/updogfx
6
+ Author: EFXTv
7
+ Author-email: efxtve@gmail.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.6
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: Flask>=2.0.0
15
+ Requires-Dist: requests>=2.26.0
16
+ Dynamic: author
17
+ Dynamic: author-email
18
+ Dynamic: classifier
19
+ Dynamic: description
20
+ Dynamic: description-content-type
21
+ Dynamic: home-page
22
+ Dynamic: license-file
23
+ Dynamic: requires-dist
24
+ Dynamic: requires-python
25
+ Dynamic: summary
26
+
27
+ # UpdogFX
28
+
29
+ A simple HTTP file server with reverse SSH tunneling, inspired by Updog.
30
+
31
+ ## Features
32
+ - Upload and download files via HTTP
33
+ - Reverse SSH tunneling support using Serveo
34
+ - Lightweight and Termux/Linux compatible
35
+
36
+ ## Installation
37
+
38
+ ```bash
39
+ pip install updogfx
@@ -0,0 +1,13 @@
1
+ # UpdogFX
2
+
3
+ A simple HTTP file server with reverse SSH tunneling, inspired by Updog.
4
+
5
+ ## Features
6
+ - Upload and download files via HTTP
7
+ - Reverse SSH tunneling support using Serveo
8
+ - Lightweight and Termux/Linux compatible
9
+
10
+ ## Installation
11
+
12
+ ```bash
13
+ pip install updogfx
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
updogfx-0.1.0/setup.py ADDED
@@ -0,0 +1,29 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name="updogfx",
5
+ version="0.1.0",
6
+ description="A simple file server inspired by Updog, with reverse SSH support.",
7
+ long_description=open("README.md").read(),
8
+ long_description_content_type="text/markdown",
9
+ author="EFXTv",
10
+ author_email="efxtve@gmail.com",
11
+ url="https://github.com/efxtv/updogfx",
12
+ packages=find_packages(),
13
+ include_package_data=True,
14
+ install_requires=[
15
+ "Flask>=2.0.0",
16
+ "requests>=2.26.0"
17
+ ],
18
+ entry_points={
19
+ "console_scripts": [
20
+ "updogfx=updogfx.app:main",
21
+ ]
22
+ },
23
+ classifiers=[
24
+ "Programming Language :: Python :: 3",
25
+ "License :: OSI Approved :: MIT License",
26
+ "Operating System :: OS Independent",
27
+ ],
28
+ python_requires=">=3.6",
29
+ )
@@ -0,0 +1,2 @@
1
+ __version__ = "0.1.0"
2
+
@@ -0,0 +1,5 @@
1
+ from .app import main
2
+
3
+ if __name__ == "__main__":
4
+ main()
5
+
@@ -0,0 +1,122 @@
1
+ #!/usr/bin/env python3
2
+
3
+ import argparse
4
+ from flask import Flask, render_template, request, redirect, url_for, send_from_directory
5
+ import os
6
+ import urllib.parse
7
+ import socket
8
+ import logging
9
+ import subprocess
10
+ import re
11
+ import sys
12
+
13
+ # About : inspired by updog we named it updogfx Date 18/05/2025
14
+ # Supports most Linux-based OS with SSH and Bash installed
15
+ # Version 2.0
16
+
17
+ # Suppress Flask and Werkzeug logs
18
+ log = logging.getLogger('werkzeug')
19
+ log.setLevel(logging.CRITICAL)
20
+
21
+ cli = logging.getLogger('flask.cli')
22
+ cli.setLevel(logging.CRITICAL)
23
+
24
+ # Flask setup
25
+ UPLOAD_FOLDER = os.getcwd()
26
+ app = Flask(__name__, template_folder=os.path.join(os.getcwd(), "templates"))
27
+ app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
28
+
29
+ def parse_arguments():
30
+ parser = argparse.ArgumentParser(description='Simple file upload server with options.')
31
+ parser.add_argument('-d', '--directory', default=UPLOAD_FOLDER,
32
+ help='Directory to store uploaded files (default: current directory)')
33
+ return parser.parse_args()
34
+
35
+ def setup_directory(directory):
36
+ if not os.path.exists(directory):
37
+ os.makedirs(directory)
38
+ flush_print(f"[+] Upload directory created: {directory}")
39
+
40
+ def save_file(file, filename):
41
+ file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))
42
+
43
+ @app.route('/')
44
+ def index():
45
+ files = os.listdir(app.config['UPLOAD_FOLDER'])
46
+ return render_template('index.html', files=files)
47
+
48
+ @app.route('/upload', methods=['POST'])
49
+ def upload_file():
50
+ if 'file' not in request.files or request.files['file'].filename == '':
51
+ return redirect(request.url)
52
+ file = request.files['file']
53
+ filename = urllib.parse.quote(file.filename)
54
+ save_file(file, filename)
55
+ flush_print(f"[+] File uploaded: {urllib.parse.unquote(filename)}")
56
+ return redirect(url_for('index'))
57
+
58
+ @app.route('/uploads/<path:filename>')
59
+ def uploaded_file(filename):
60
+ filename = urllib.parse.unquote(filename)
61
+ flush_print(f"[+] File downloaded: {filename}")
62
+ return send_from_directory(app.config['UPLOAD_FOLDER'], filename)
63
+
64
+ def linkgens():
65
+ try:
66
+ # Start the SSH process
67
+ process = subprocess.Popen(
68
+ ['ssh', '-o', 'StrictHostKeyChecking=no', '-R', '80:127.0.0.1:8080', 'serveo.net'],
69
+ stdout=subprocess.PIPE,
70
+ stderr=subprocess.STDOUT,
71
+ text=True
72
+ )
73
+
74
+ # Read output line by line
75
+ while True:
76
+ output = process.stdout.readline()
77
+ if output == '' and process.poll() is not None:
78
+ break
79
+ if output:
80
+ match = re.search(r'https://[a-zA-Z0-9]+\.serveo\.net', output)
81
+ if match:
82
+ flush_print(f"Upload on: {match.group(0)}")
83
+ break
84
+
85
+ except Exception as e:
86
+ flush_print(f"Error: {e}")
87
+
88
+ def flush_print(message):
89
+ """Prints the message immediately without buffering."""
90
+ print(message, flush=True)
91
+
92
+ def suppress_flask_logs():
93
+ """Suppresses Flask startup messages."""
94
+ sys.stdout = open(os.devnull, 'w')
95
+ sys.stderr = open(os.devnull, 'w')
96
+
97
+ def main():
98
+ args = parse_arguments()
99
+ app.config['UPLOAD_FOLDER'] = args.directory
100
+ setup_directory(app.config['UPLOAD_FOLDER'])
101
+
102
+ # Get local IP
103
+ try:
104
+ local_ip = socket.gethostbyname(socket.gethostname())
105
+ except socket.gaierror:
106
+ local_ip = "127.0.0.1"
107
+
108
+ port = 8080
109
+ flush_print(f"\nUpload on: http://{local_ip}:{port}")
110
+
111
+ # Start Serveo reverse tunnel and display link
112
+ linkgens()
113
+
114
+ # Suppress Flask logs
115
+ suppress_flask_logs()
116
+
117
+ # Start Flask app
118
+ app.run(host='0.0.0.0', port=port, debug=True, use_reloader=False, threaded=True)
119
+
120
+ if __name__ == '__main__':
121
+ main()
122
+
@@ -0,0 +1,39 @@
1
+ Metadata-Version: 2.4
2
+ Name: updogfx
3
+ Version: 0.1.0
4
+ Summary: A simple file server inspired by Updog, with reverse SSH support.
5
+ Home-page: https://github.com/efxtv/updogfx
6
+ Author: EFXTv
7
+ Author-email: efxtve@gmail.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.6
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: Flask>=2.0.0
15
+ Requires-Dist: requests>=2.26.0
16
+ Dynamic: author
17
+ Dynamic: author-email
18
+ Dynamic: classifier
19
+ Dynamic: description
20
+ Dynamic: description-content-type
21
+ Dynamic: home-page
22
+ Dynamic: license-file
23
+ Dynamic: requires-dist
24
+ Dynamic: requires-python
25
+ Dynamic: summary
26
+
27
+ # UpdogFX
28
+
29
+ A simple HTTP file server with reverse SSH tunneling, inspired by Updog.
30
+
31
+ ## Features
32
+ - Upload and download files via HTTP
33
+ - Reverse SSH tunneling support using Serveo
34
+ - Lightweight and Termux/Linux compatible
35
+
36
+ ## Installation
37
+
38
+ ```bash
39
+ pip install updogfx
@@ -0,0 +1,13 @@
1
+ LICENSE
2
+ MANIFEST.in
3
+ README.md
4
+ setup.py
5
+ updogfx/__init__.py
6
+ updogfx/__main__.py
7
+ updogfx/app.py
8
+ updogfx.egg-info/PKG-INFO
9
+ updogfx.egg-info/SOURCES.txt
10
+ updogfx.egg-info/dependency_links.txt
11
+ updogfx.egg-info/entry_points.txt
12
+ updogfx.egg-info/requires.txt
13
+ updogfx.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ updogfx = updogfx.app:main
@@ -0,0 +1,2 @@
1
+ Flask>=2.0.0
2
+ requests>=2.26.0
@@ -0,0 +1 @@
1
+ updogfx