diff --git a/.dockerignore b/.dockerignore
new file mode 120000
index 0000000..3e4e48b
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1 @@
+.gitignore
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index e2bd56f..be245d1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,4 +11,4 @@
.coverage
/*.md
/.eggs/
-/devel/
\ No newline at end of file
+/devel/
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..27a6f0c
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,25 @@
+FROM python:3.10-slim
+
+LABEL org.label-schema.schema-version="1.0"
+LABEL org.label-schema.vendor="Tiara Rodney (victoryk.it)"
+LABEL org.label-schema.name="victorykit/httpaste"
+LABEL org.label-schema.description="a versatile HTTP pastebin"
+LABEL org.label-schema.vcs-url="https://bitbucket.org/victorykit/docker-selenium-grid"
+LABEL org.label-schema.docker.cmd="docker run {image-id} {httpaste-args}"
+LABEL org.label-schema.version=$BUILD_VERSION
+LABEL org.label-schema.build-date=$BUILD_DATE
+
+WORKDIR /usr/local/src/httpaste
+
+COPY . .
+
+RUN apt-get update && \
+ apt-get install -y libffi-dev gcc && \
+ python3 -m pip install pipenv && \
+ python3 -m pipenv install --deploy --system --verbose && \
+ python3 setup.py install && \
+ apt-get remove -y libffi-dev gcc && apt-get autoremove -y && apt-get clean -y
+
+ENTRYPOINT ["uwsgi", "--master", "--enable-threads", "--manage-script-name", "-w", "httpaste.wsgi:application"]
+
+CMD ["-s", "/tmp/yourapplication.sock"]
\ No newline at end of file
diff --git a/Pipfile b/Pipfile
index 01b679f..e683928 100644
--- a/Pipfile
+++ b/Pipfile
@@ -7,7 +7,10 @@ name = 'pypi'
python_version = '3'
[packages]
-httpaste = {editable = true, path = "."}
+httpaste-victorykit = {editable = true, path = "."}
+flup = '==1.0.3'
+mysql-connector-python = '==8.0.28'
+uWSGI = '==2.0.20'
[dev-packages]
-tox = '==3.23.0'
\ No newline at end of file
+tox = '==3.23.0'
\ No newline at end of file
diff --git a/Pipfile.lock b/Pipfile.lock
index 4223497..fc24f88 100644
--- a/Pipfile.lock
+++ b/Pipfile.lock
@@ -1,7 +1,7 @@
{
"_meta": {
"hash": {
- "sha256": "6fc8f1480cab514207ed13c95c3533fd240e04aa466d8fe781b969aa42b6313d"
+ "sha256": "e8725ecbf33a0d4931d941bfa72dcb15bbcdbdcff1048ea65a4025146018a498"
},
"pipfile-spec": 6,
"requires": {
@@ -96,11 +96,11 @@
},
"click": {
"hashes": [
- "sha256:5e0d195c2067da3136efb897449ec1e9e6c98282fbf30d7f9e164af9be901a6b",
- "sha256:7ab900e38149c9872376e8f9b5986ddcaf68c0f413cf73678a0bca5547e6f976"
+ "sha256:24e1a4a9ec5bf6299411369b208c1df2188d9eb8d916302fe6bf03faed227f1e",
+ "sha256:479707fe14d9ec9a0757618b7a100a0ae4c4e236fac5b7f80ca68028141a1a72"
],
"markers": "python_version >= '3.7'",
- "version": "==8.1.1"
+ "version": "==8.1.2"
},
"clickclick": {
"hashes": [
@@ -110,9 +110,6 @@
"version": "==20.10.2"
},
"connexion": {
- "extras": [
- "swagger-ui"
- ],
"hashes": [
"sha256:0ba5c163d34cb3cb3bf597d5b95fc14bad5d3596bf10ec86e32cdb63f68d0c8a",
"sha256:26a570a0283bbe4cdaf5d90dfb3441aaf8e18cb9de10f3f96bbc128a8a3d8b47"
@@ -154,9 +151,13 @@
"markers": "python_version >= '3.7'",
"version": "==2.1.1"
},
- "httpaste": {
- "editable": true,
- "path": "."
+ "flup": {
+ "hashes": [
+ "sha256:5eb09f26eb0751f8380d8ac43d1dfb20e1d42eca0fa45ea9289fa532a79cd159",
+ "sha256:ca9fd78e1cc0431da1236f73fafd1c01db684675b4d369460d5f5c62e6f0b8d6"
+ ],
+ "index": "pypi",
+ "version": "==1.0.3"
},
"httpaste-victorykit": {
"editable": true,
@@ -256,6 +257,33 @@
"markers": "python_version >= '3.7'",
"version": "==2.1.1"
},
+ "mysql-connector-python": {
+ "hashes": [
+ "sha256:04d75ec7c181e7907df3d40c2a573063f25ecfc5a95a7a90374861c02ce738a9",
+ "sha256:47f059bc2a7378acd56ac7a60b0526a2ba95d96b696a875b5b233a0feae30980",
+ "sha256:4d126ce5e03675d926a9e49ce1638d06af43ca7bac2b502d93373dc9425d386f",
+ "sha256:50c87ff50762f4a0cc0816365dde0e7de763949e125488b8e872de6471e0e427",
+ "sha256:687071dc9e51892d0861bbcbcbd48e0f3579e3155f2a0ec310198704137c775a",
+ "sha256:73c5149b33401610e28589d1fc669cba11d3b16215a8f6a75f63ece1f3af5f88",
+ "sha256:77ec293e265d01db1896a8e63a16b3d5c848a885cf76c77148adfed8453846e8",
+ "sha256:78bb1abb57bbb85263d65a240a901195e3de0e0992f25e42c48af0869079bb74",
+ "sha256:7d518491d6d51b186b3182b3698b1560d9bd80675c055163359d0aeea0001de1",
+ "sha256:8d8dd02e0e6bb7262156a836c3e83582d1a1a1ebb9d72e777a46813709404601",
+ "sha256:91be638d1b084835edf7aa426d85228174611a1cd6f016ca0f6d4339ac3d9d7b",
+ "sha256:aaec9d13fc0177e421a3c4392f0eaf86347b825949d5dfc202d535cdb1e07f04",
+ "sha256:b3a747c5efd6de7b76686ab93834186e2276a62684600dbede615537040436ca",
+ "sha256:b4c5ce835078555b6640921cae036daad46884dd21027f43c742fb505221e4e6",
+ "sha256:bb317b179bfbb3e86c771bb2b34794188a2d2b010cdaa1b4d1b5ea0961d0812c",
+ "sha256:bd89598b173aa0fc525b59fff6e3598ff3cabad4260a3bb49cf420eac10d3b3b",
+ "sha256:bdb4f187f737316d1c403085b2fb7c91717268d052ecbfc86066cef59f6d72a4",
+ "sha256:c76d771fdce1314b07619efff184ec03f56abef6b4ccdc686d3a995f5b225fec",
+ "sha256:d559f69e8b58ac248e37d30e5676718adf69eeff56ed8a7c03f064d74af68f99",
+ "sha256:e008127430c8dc66bb1b6d6c7a17498ec57ffa81188fc1f8c9f764363c01d12e",
+ "sha256:f5da43c77d409c8135132f5b5aee9ac91c2e97c3f87352e1b3017438a9cb9b82"
+ ],
+ "index": "pypi",
+ "version": "==8.0.28"
+ },
"packaging": {
"hashes": [
"sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb",
@@ -264,6 +292,36 @@
"markers": "python_version >= '3.6'",
"version": "==21.3"
},
+ "protobuf": {
+ "hashes": [
+ "sha256:001c2160c03b6349c04de39cf1a58e342750da3632f6978a1634a3dcca1ec10e",
+ "sha256:0b250c60256c8824219352dc2a228a6b49987e5bf94d3ffcf4c46585efcbd499",
+ "sha256:1d24c81c2310f0063b8fc1c20c8ed01f3331be9374b4b5c2de846f69e11e21fb",
+ "sha256:1eb13f5a5a59ca4973bcfa2fc8fff644bd39f2109c3f7a60bd5860cb6a49b679",
+ "sha256:25d2fcd6eef340082718ec9ad2c58d734429f2b1f7335d989523852f2bba220b",
+ "sha256:32bf4a90c207a0b4e70ca6dd09d43de3cb9898f7d5b69c2e9e3b966a7f342820",
+ "sha256:38fd9eb74b852e4ee14b16e9670cd401d147ee3f3ec0d4f7652e0c921d6227f8",
+ "sha256:47257d932de14a7b6c4ae1b7dbf592388153ee35ec7cae216b87ae6490ed39a3",
+ "sha256:4eda68bd9e2a4879385e6b1ea528c976f59cd9728382005cc54c28bcce8db983",
+ "sha256:52bae32a147c375522ce09bd6af4d2949aca32a0415bc62df1456b3ad17c6001",
+ "sha256:542f25a4adf3691a306dcc00bf9a73176554938ec9b98f20f929a044f80acf1b",
+ "sha256:5b5860b790498f233cdc8d635a17fc08de62e59d4dcd8cdb6c6c0d38a31edf2b",
+ "sha256:6efe066a7135233f97ce51a1aa007d4fb0be28ef093b4f88dac4ad1b3a2b7b6f",
+ "sha256:71b2c3d1cd26ed1ec7c8196834143258b2ad7f444efff26fdc366c6f5e752702",
+ "sha256:7a53d4035427b9dbfbb397f46642754d294f131e93c661d056366f2a31438263",
+ "sha256:7dcd84dc31ebb35ade755e06d1561d1bd3b85e85dbdbf6278011fc97b22810db",
+ "sha256:88c8be0558bdfc35e68c42ae5bf785eb9390d25915d4863bbc7583d23da77074",
+ "sha256:8be43a91ab66fe995e85ccdbdd1046d9f0443d59e060c0840319290de25b7d33",
+ "sha256:8d84453422312f8275455d1cb52d850d6a4d7d714b784e41b573c6f5bfc2a029",
+ "sha256:9d0f3aca8ca51c8b5e204ab92bd8afdb2a8e3df46bd0ce0bd39065d79aabcaa4",
+ "sha256:a1eebb6eb0653e594cb86cd8e536b9b083373fca9aba761ade6cd412d46fb2ab",
+ "sha256:bc14037281db66aa60856cd4ce4541a942040686d290e3f3224dd3978f88f554",
+ "sha256:fbcbb068ebe67c4ff6483d2e2aa87079c325f8470b24b098d6bf7d4d21d57a69",
+ "sha256:fd7133b885e356fa4920ead8289bb45dc6f185a164e99e10279f33732ed5ce15"
+ ],
+ "markers": "python_version >= '3.7'",
+ "version": "==3.20.0"
+ },
"pycparser": {
"hashes": [
"sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9",
@@ -361,13 +419,6 @@
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'",
"version": "==2.27.1"
},
- "swagger-ui-bundle": {
- "hashes": [
- "sha256:b462aa1460261796ab78fd4663961a7f6f347ce01760f1303bbbdf630f11f516",
- "sha256:cea116ed81147c345001027325c1ddc9ca78c1ee7319935c3c75d3669279d575"
- ],
- "version": "==0.0.9"
- },
"urllib3": {
"hashes": [
"sha256:44ece4d53fb1706f667c9bd1c648f5469a2ec925fcf3a776667042d645472c14",
@@ -376,21 +427,28 @@
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'",
"version": "==1.26.9"
},
+ "uwsgi": {
+ "hashes": [
+ "sha256:88ab9867d8973d8ae84719cf233b7dafc54326fcaec89683c3f9f77c002cdff9"
+ ],
+ "index": "pypi",
+ "version": "==2.0.20"
+ },
"werkzeug": {
"hashes": [
- "sha256:094ecfc981948f228b30ee09dbfe250e474823b69b9b1292658301b5894bbf08",
- "sha256:9b55466a3e99e13b1f0686a66117d39bda85a992166e0a79aedfcf3586328f7a"
+ "sha256:3c5493ece8268fecdcdc9c0b112211acd006354723b280d643ec732b6d4063d6",
+ "sha256:f8e89a20aeabbe8a893c24a461d3ee5dad2123b05cc6abd73ceed01d39c3ae74"
],
"markers": "python_version >= '3.7'",
- "version": "==2.1.0"
+ "version": "==2.1.1"
},
"zipp": {
"hashes": [
- "sha256:9f50f446828eb9d45b267433fd3e9da8d801f614129124863f9c51ebceafb87d",
- "sha256:b47250dd24f92b7dd6a0a8fc5244da14608f3ca90a5efcd37a3b1642fac9a375"
+ "sha256:56bf8aadb83c24db6c4b577e13de374ccfb67da2078beba1d037c17980bf43ad",
+ "sha256:c4f6e5bbf48e74f7a38e7cc5b0480ff42b0ae5178957d564d18932525d5cf099"
],
"markers": "python_version >= '3.7'",
- "version": "==3.7.0"
+ "version": "==3.8.0"
}
},
"develop": {
diff --git a/samples/httpaste.it/docker-compose.yml b/samples/httpaste.it/docker-compose.yml
new file mode 100644
index 0000000..35fb3db
--- /dev/null
+++ b/samples/httpaste.it/docker-compose.yml
@@ -0,0 +1,33 @@
+version: "3.3"
+services:
+ httpaste:
+ build:
+ context: ../..
+ dockerfile: Dockerfile
+ environment:
+ HTTPASTE_CONFIGPATH: /usr/local/httpaste/config.ini
+ volumes:
+ -
+ type: volume
+ source: system-shared
+ target: /shared
+ volume:
+ nocopy: true
+ - ./httpaste/config.ini:/usr/local/httpaste/config.ini
+ command: -s /shared/uwsgi.sock --chmod-socket=666
+ httpd:
+ build:
+ context: ./httpd
+ dockerfile: Dockerfile
+ ports:
+ - "80:80"
+ volumes:
+ -
+ type: volume
+ source: system-shared
+ target: /shared
+ volume:
+ nocopy: true
+ - ./httpd/httpd.conf:/usr/local/apache2/conf/httpd.conf
+volumes:
+ system-shared:
\ No newline at end of file
diff --git a/samples/httpaste.it/httpaste/config.ini b/samples/httpaste.it/httpaste/config.ini
new file mode 100644
index 0000000..801d0d6
--- /dev/null
+++ b/samples/httpaste.it/httpaste/config.ini
@@ -0,0 +1,16 @@
+[general]
+salt = '&)UxB-_$Lk$m=CB}dw[d85{-ZWR?uUNx'
+paste_id_size = 8
+paste_key_size = 32
+paste_lifetime = 5
+paste_max_lifetime = 1440
+hmac_iterations = 20000
+paste_default_encoding = 'utf-8'
+
+[backend]
+type = file
+base_dirname = 'sample_data'
+
+[server]
+swagger_ui = False
+bind_address = 'sample.sock'
\ No newline at end of file
diff --git a/samples/httpaste.it/httpd/Dockerfile b/samples/httpaste.it/httpd/Dockerfile
new file mode 100644
index 0000000..afcc50e
--- /dev/null
+++ b/samples/httpaste.it/httpd/Dockerfile
@@ -0,0 +1,3 @@
+FROM httpd:2.4
+
+RUN apt-get update -y && apt-get install -y libapache2-mod-proxy-uwsgi
\ No newline at end of file
diff --git a/samples/httpaste.it/httpd/httpd.conf b/samples/httpaste.it/httpd/httpd.conf
new file mode 100644
index 0000000..0ac6021
--- /dev/null
+++ b/samples/httpaste.it/httpd/httpd.conf
@@ -0,0 +1,55 @@
+
+ServerRoot "/usr/local/apache2"
+
+Listen 0.0.0.0:80
+
+LoadModule mpm_event_module modules/mod_mpm_event.so
+LoadModule authn_core_module modules/mod_authn_core.so
+LoadModule authz_core_module modules/mod_authz_core.so
+#LoadModule brotli_module modules/mod_brotli.so
+LoadModule mime_module modules/mod_mime.so
+LoadModule log_config_module modules/mod_log_config.so
+#LoadModule log_debug_module modules/mod_log_debug.so
+#LoadModule log_forensic_module modules/mod_log_forensic.so
+LoadModule env_module modules/mod_env.so
+LoadModule proxy_module modules/mod_proxy.so
+LoadModule proxy_uwsgi_module modules/mod_proxy_uwsgi.so
+LoadModule unixd_module modules/mod_unixd.so
+
+
+ User www-data
+ Group www-data
+
+
+ServerAdmin you@example.com
+
+
+ErrorLog /proc/self/fd/2
+
+LogLevel warn
+
+
+ LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
+ LogFormat "%h %l %u %t \"%r\" %>s %b" common
+
+
+ # You need to enable mod_logio.c to use %I and %O
+ LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
+
+
+ CustomLog /proc/self/fd/1 common
+
+
+
+ SSLRandomSeed startup builtin
+ SSLRandomSeed connect builtin
+
+
+ServerName 127.0.0.1
+
+
+ #ProxyPreserveHost On
+ SetEnv proxy-sendchunks
+
+ ProxyPass "/" "unix:/shared/uwsgi.sock|uwsgi://localhost/"
+
\ No newline at end of file
diff --git a/tox.ini b/tox.ini
index 28b7f1d..c1f0e88 100644
--- a/tox.ini
+++ b/tox.ini
@@ -35,6 +35,15 @@ deps =
commands =
python3 -m build {posargs}
+[testenv:build-docker]
+description = build docker image
+passenv =
+ DOCKER_*
+allowlist_externals =
+ docker
+ sh
+commands =
+ docker image build -t victorykit/httpaste .
[testenv:docs]
description = build documentation