diff options
| author | Simeon Simeonov | 2023-07-07 10:04:04 +0200 |
|---|---|---|
| committer | Simeon Simeonov | 2023-07-07 10:04:04 +0200 |
| commit | c4cc9c90b3546e72efbaeb9cb632b9d98288bac1 (patch) | |
| tree | c3ca05b349f719ecc1afd2ebb7016373f030d7c1 /README.md | |
| parent | e62d7c5ea3bc014123cf6f78e5345c588cd4f068 (diff) | |
Add basic https support and format the code using black -S
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 20 |
1 files changed, 16 insertions, 4 deletions
| @@ -31,8 +31,8 @@ To my amazement I wasn't able to find any free software matching that criteria. | |||
| 31 | The main purpose of *ngus* is to accept file uploads as POST requests from an | 31 | The main purpose of *ngus* is to accept file uploads as POST requests from an |
| 32 | HTTP client. | 32 | HTTP client. |
| 33 | 33 | ||
| 34 | Currently *ngus* does not provide encryption (HTTPS) support. Many different | 34 | Currently *ngus* provides only simple encryption (HTTPS) support. Many |
| 35 | tools can be employed to serve as an HTTPS proxy. | 35 | different tools can be employed to serve as an HTTPS proxy. |
| 36 | 36 | ||
| 37 | See the examples bellow for more details! | 37 | See the examples bellow for more details! |
| 38 | 38 | ||
| @@ -49,7 +49,9 @@ See the examples bellow for more details! | |||
| 49 | ### Gentoo | 49 | ### Gentoo |
| 50 | 50 | ||
| 51 | ```bash | 51 | ```bash |
| 52 | layman -a sgs | 52 | # add sgs' custom repository using app-eselect/eselect-repository |
| 53 | eselect repository add sgs | ||
| 54 | |||
| 53 | emerge www-servers/ngus | 55 | emerge www-servers/ngus |
| 54 | ``` | 56 | ``` |
| 55 | 57 | ||
| @@ -107,6 +109,16 @@ The default form input field name is *ufile*. That can be changed by using the | |||
| 107 | curl --basic -u uname -F "uploadfile=@myfile.zip" http://158.39.125.240:8080 | 109 | curl --basic -u uname -F "uploadfile=@myfile.zip" http://158.39.125.240:8080 |
| 108 | ``` | 110 | ``` |
| 109 | 111 | ||
| 112 | Simple encryption (HTTPS) support | ||
| 113 | |||
| 114 | ```bash | ||
| 115 | # creating a self-signed key / certificate pair valid for 356 days | ||
| 116 | openssl req -sha256 -newkey rsa:4096 -nodes -x509 -extensions v3_ca -subj "/C=NO/O=MyOrg/CN=uploads.myhostname.net" -days 365 -keyout uploads.myhostname.net.key.pem -out uploads.myhostname.net.cert.pem | ||
| 117 | python -m ngus -H 0.0.0.0 -p 8080 -b "uname:foo" -k uploads.myhostname.net.key.pem -c uploads.myhostname.net.cert.pem -u /home/s/uploads | ||
| 118 | # since the certificate is self-signed, it can serve as a CA to itself in this example | ||
| 119 | curl --basic -u uname -F "ufile=@myfile.zip" --cacert uploads.myhostname.net.cert.pem https://uploads.myhostname.net:8080 | ||
| 120 | ``` | ||
| 121 | |||
| 110 | 122 | ||
| 111 | ### Using *nginx* as a proxy | 123 | ### Using *nginx* as a proxy |
| 112 | 124 | ||
| @@ -138,7 +150,7 @@ described in the examples above. | |||
| 138 | 150 | ||
| 139 | location / { | 151 | location / { |
| 140 | # point at the ngus instance running on a private network address | 152 | # point at the ngus instance running on a private network address |
| 141 | proxy_pass http://192.168.1.240:8080/; | 153 | proxy_pass http://158.39.125.240:8080/; |
| 142 | } | 154 | } |
| 143 | 155 | ||
| 144 | } | 156 | } |
