diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..21a59e8 --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright © 2021 Keith Irwin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..f85f2f8 --- /dev/null +++ b/README.md @@ -0,0 +1,62 @@ +# mailapi + +This is a PGP-enabled contact form that you can use. It has two parts: + + - A static web form that uses javascript to encrypt a message and send it to an api endpoint + - An API which checks the captcha and sends the message by email + +## Setting up a server + +Download the source; it's not on docker hub. + +```sh +git clone https://gitea.gf4.pw/ki9/mailapi.git +cd mailapi +``` + +Copy the sample environment files and edit them to suit your needs. + +```sh +cp .env.sample .env +cp docker-compose.yml.sample docker-compose.yml +``` + +Start the service with docker: + +```sh +docker-compose up -d +``` + +...*or* start the service directly, or with a daemon manager: + +```sh +npm run start +``` + +The API should now be listening on port 8080 or whatever you set in the `docker-compose.yml`. You may choose to run this through a proxy server or whatever. + +## Serving the clientside app + +You can use the contact form in `index.html.sample`. Tweak it to your needs and put it in your clientside code. I'm not offering support for your particular set up, but the code in both `index.html.sample` and `index.js` is short and easy to modify to your use case. + +## MIT License + +Copyright © 2021 Keith Irwin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/index.html.sample b/index.html.sample new file mode 100644 index 0000000..f00579f --- /dev/null +++ b/index.html.sample @@ -0,0 +1,77 @@ +

You may use this web form to contact us. Your message will be encrypted. A copy of your message will not be sent to you unless we reply. For an encrypted reply, paste or link your public key.

+ + + +

+

+

+

+ +

+ +

+ +

This page is protected by hCaptcha so its Privacy Policy and Terms of Service apply.

+ + + +