From f25e3f766c39e8f2a936121d25994b05fe0ac75a Mon Sep 17 00:00:00 2001 From: Tiara Rodney Date: Sat, 9 Apr 2022 02:27:41 +0200 Subject: [PATCH] feat(samples): init httpaste.it sample --- samples/httpaste.it/docker-compose.yml | 33 +++++++++++++++ samples/httpaste.it/httpaste/config.ini | 16 +++++++ samples/httpaste.it/httpd/Dockerfile | 3 ++ samples/httpaste.it/httpd/httpd.conf | 55 +++++++++++++++++++++++++ 4 files changed, 107 insertions(+) create mode 100644 samples/httpaste.it/docker-compose.yml create mode 100644 samples/httpaste.it/httpaste/config.ini create mode 100644 samples/httpaste.it/httpd/Dockerfile create mode 100644 samples/httpaste.it/httpd/httpd.conf 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