Skip to content

Commit

Permalink
Initial updog commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sc0tfree committed Feb 18, 2020
1 parent 680ae8a commit ee2203b
Show file tree
Hide file tree
Showing 55 changed files with 11,649 additions and 1 deletion.
174 changes: 174 additions & 0 deletions .gitignore
@@ -0,0 +1,174 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
.idea/

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
3 changes: 3 additions & 0 deletions MANIFEST.in
@@ -0,0 +1,3 @@
graft updog/static
graft updog/templates
global-exclude *.pyc
67 changes: 66 additions & 1 deletion README.md
@@ -1 +1,66 @@
# updog
![Version 1.0](http://img.shields.io/badge/version-v1.0-green.svg)
![Python 3.8](http://img.shields.io/badge/python-3.8-blue.svg)
![MIT License](http://img.shields.io/badge/license-MIT%20License-blue.svg)
[![sc0tfree Twitter](http://img.shields.io/twitter/url/http/shields.io.svg?style=social&label=Follow)](https://twitter.com/sc0tfree)

<p>
<img src="https://sc0tfree.squarespace.com/s/updog.png" width=85px alt="updog"/>
</p>

Updog is a replacement for Python's `SimpleHTTPServer`.
It allows uploading and downloading via HTTP/S,
can set ad hoc SSL certificates and use HTTP basic auth.

<p align="center">
<img src="https://sc0tfree.squarespace.com/s/updog-screenshot.png" alt="Updog screenshot"/>
</p>

## Installation

Install using pip:

`pip3 install updog`

## Usage

`updog [-d DIRECTORY] [-p PORT] [--password PASSWORD] [--ssl]`

| Argument | Description |
|-------------------------------------|--------------------------------------------------|
| -d DIRECTORY, --directory DIRECTORY | Root directory [Default=.] |
| -p PORT, --port PORT | Port to serve [Default=9090] |
| --password PASSWORD | Use a password to access the page. (No username) |
| --ssl | Enable transport encryption via SSL |
| --version | Show version |
| -h, --help | Show help |

## Examples

**Serve from your current directory:**

`updog`

**Serve from another directory:**

`updog -d /another/directory`

**Serve from port 1234:**

`updog -p 1234`

**Password protect the page:**

`updog --password examplePassword123!`

*Please note*: updog uses HTTP basic authentication.
To login, you should leave the username blank and just
enter the password in the password field.

**Use an SSL connection:**

`updog --ssl`

## Thanks

A special thank you to [Nicholas Smith](http://nixmith.com) for
designing the updog logo.
5 changes: 5 additions & 0 deletions requirements.txt
@@ -0,0 +1,5 @@
colorama
flask
flask_httpauth
werkzeug
pyopenssl
Empty file added setup.cfg
Empty file.
60 changes: 60 additions & 0 deletions setup.py
@@ -0,0 +1,60 @@
from setuptools import setup
from os import path
import updog


this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()

setup(
name='updog',
version=updog.version,
url='https://github.com/sc0tfree/updog',
# GitHub releases in format "updog-X.Y"
download_url = 'https://github.com/sc0tfree/updog/archive/updog-' + updog.version + '.tar.gz',
license='MIT',
author='sc0tfree',
author_email='henry@sc0tfree.com',
description='Updog is a replacement for Python\'s SimpleHTTPServer. '
'It allows uploading and downloading via HTTP/S, can set '
'ad hoc SSL certificates and use http basic auth.',
long_description=long_description,
long_description_content_type='text/markdown',
keywords='HTTP server SimpleHTTPServer directory',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Environment :: Web Environment',
'Framework :: Flask',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Operating System :: MacOS',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Topic :: Communications :: File Sharing',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: WSGI',
'Topic :: Security'
],
packages=['updog', 'updog.utils'],
entry_points={
'console_scripts': 'updog = updog.__main__:main'
},
include_package_data=True,
install_requires=[
'colorama',
'flask',
'flask_httpauth',
'werkzeug',
'pyopenssl'
],
)
4 changes: 4 additions & 0 deletions updog/__init__.py
@@ -0,0 +1,4 @@
version_info = (0,9)
version = '.'.join(str(c) for c in version_info)

base_directory = ''

0 comments on commit ee2203b

Please sign in to comment.