NodeJS API for contact forms
 
 
Go to file
Keith Irwin 4bb76aa4a1
test: Create mailer test to use with uptime kuma
2023-09-22 20:54:38 -06:00
.dockerignore Removed hcaptcha 2023-04-01 00:00:33 -06:00
.env.sample Added .env.sample 2023-03-07 14:42:00 -07:00
.gitignore Removed hcaptcha 2023-04-01 00:00:33 -06:00
Dockerfile Added docker 2021-11-24 13:12:48 -07:00
LICENSE Added documentation and clientside code 2021-11-26 09:36:06 -07:00
README.md Removed hcaptcha 2023-04-01 00:00:33 -06:00
docker-compose.yml.sample Removed hcaptcha 2023-04-01 00:00:33 -06:00
index.html.sample Removed hcaptcha 2023-04-01 00:00:33 -06:00
index.js test: Create mailer test to use with uptime kuma 2023-09-22 20:54:38 -06:00
package-lock.json refactor: ⬆️ Updated npm and installed cors 2023-09-20 19:03:49 -06:00
package.json refactor: ⬆️ Updated npm and installed cors 2023-09-20 19:03:49 -06:00

README.md

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 sends the message by email

Setting up a server

Download the source; it's not on docker hub.

git clone https://gitea.gf4.pw/ki9/mailapi.git
cd mailapi

Copy the sample environment files and edit them to suit your needs.

cp .env.sample .env
cp docker-compose.yml.sample docker-compose.yml

Start the service with docker:

docker-compose up -d

...or start the service directly, or with a daemon manager:

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.