-
Notifications
You must be signed in to change notification settings - Fork 6
Adds setup.py and other details for packaging #10
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
include securedrop_proxy/*.py | ||
include requirements.txt | ||
include README.md | ||
include LICENSE | ||
include setup.py | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we remove this since it's redundant? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will make the python file inclusion explicit. |
||
include Pipfile | ||
include Pipfile.lock | ||
include qubes/securedrop.Proxy | ||
include config-example.yaml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
/home/user/projects/securedrop-proxy/entrypoint.sh | ||
/usr/bin/sd-proxy /etc/sd-proxy.yaml |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# The sd-proxy RPC script triggered by qubes RPC. | ||
|
||
# This script is executed by `/etc/qubes-rpc/sd-proxy`. It must be | ||
# called with exactly one argument: the path to its config file. See | ||
# the README for configuration options. | ||
|
||
import sys | ||
import json | ||
import uuid | ||
import subprocess | ||
|
||
from . import proxy | ||
from . import config | ||
from . import callbacks | ||
from . import main | ||
|
||
|
||
def start(): | ||
# a fresh, new proxy object | ||
p = proxy.Proxy() | ||
|
||
# set up an error handler early, so we can use it during | ||
# configuration, etc | ||
p.on_done = callbacks.err_on_done | ||
|
||
# path to config file must be at argv[1] | ||
if len(sys.argv) != 2: | ||
p.simple_error( | ||
500, "sd-proxy script not called with path to configuration file" | ||
) | ||
p.on_done(p.res) | ||
|
||
# read config. `read_conf` will call `p.on_done` if there is a config | ||
# problem, and will return a Conf object on success. | ||
conf_path = sys.argv[1] | ||
p.conf = config.read_conf(conf_path, p) | ||
|
||
# read user request from STDIN | ||
incoming = [] | ||
for line in sys.stdin: | ||
incoming.append(line) | ||
incoming = "\n".join(incoming) | ||
|
||
main.__main__(incoming, p) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't we want two commits that:
otherwise we'll have two versions of this that are basically the same There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was thinking to remove |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import setuptools | ||
|
||
with open("README.md", "r") as fh: | ||
long_description = fh.read() | ||
|
||
setuptools.setup( | ||
name="securedrop-proxy", | ||
version="0.1.0", | ||
author="Freedom of the Press Foundation", | ||
author_email="[email protected]", | ||
description="SecureDrop Qubes proxy service", | ||
long_description=long_description, | ||
long_description_content_type="text/markdown", | ||
license="GPLv3+", | ||
install_requires=["requests","furl", "pyyaml", "werkzeug"], | ||
python_requires=">=3.5", | ||
url="https://github.com/freedomofpress/securedrop-proxy", | ||
packages=setuptools.find_packages(exclude=["docs", "tests"]), | ||
classifiers=( | ||
"Development Status :: 3 - Alpha", | ||
"Programming Language :: Python :: 3", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", | ||
"Intended Audience :: Developers", | ||
"Operating System :: OS Independent", | ||
), | ||
entry_points={ | ||
'console_scripts': [ | ||
'sd-proxy = securedrop_proxy.entrypoint:start', | ||
], | ||
}, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't have this file yet in the repo btw