Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hermes V2 #29

Merged
merged 13 commits into from
Feb 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions .devcontainer/Dockerfile

This file was deleted.

50 changes: 0 additions & 50 deletions .devcontainer/devcontainer.json

This file was deleted.

10 changes: 0 additions & 10 deletions .devcontainer/docker-compose.yml

This file was deleted.

5 changes: 2 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ jobs:
deployments: write
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PNPM
uses: pnpm/action-setup@v2.2.4
uses: pnpm/action-setup@v2
with:
version: latest
run_install: true

- name: Build
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ jobs:
pull-requests: write
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PNPM
uses: pnpm/action-setup@v2.2.4
uses: pnpm/action-setup@v2
with:
version: latest
run_install: true

- name: Build
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PNPM
uses: pnpm/action-setup@v2.2.4
uses: pnpm/action-setup@v2
with:
version: latest
run_install: true

- name: Build All
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,5 @@ dist
docs

.svelte-kit
db.sqlite
.wrangler/
13 changes: 3 additions & 10 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@ overrides:
parser: "svelte"

plugins:
- ./node_modules/prettier-plugin-svelte
- ./node_modules/prettier-plugin-tailwindcss
- ./node_modules/@trivago/prettier-plugin-sort-imports/lib/src/index.js
pluginSearchDirs: false

importOrder:
- "^node:"
- "^[^@.]"
- "^@"
- "^\\."
- prettier-plugin-tailwindcss
- prettier-plugin-organize-imports
- prettier-plugin-svelte
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
# ![](./static/hermes-xs.png) Hermes, mail service
# ![icon](./static/hermes-xs.png) Hermes, mail service

Hermes is an open-source edge email sending service, which is designed to be easy to setup and use.

Example: [https://hermes.csie.cool/](https://hermes.csie.cool/)

| English | Chinese |
|:-------------------------:|:-------------------------:|
|![en](./screenshots/hermes-owner-en.png)|![](./screenshots/hermes-owner-zh.png)|
| English | Chinese |
| :--------------------------------------: | :--------------------------------------: |
| ![en](./screenshots/hermes-owner-en.png) | ![zh](./screenshots/hermes-owner-zh.png) |

## Features

- [x] Easy to Setup - You only need a browser to setup the service
- [x] Token-based authentication - Use allowlist and TTL to control the access
- [x] Web UI - Control the service from the anywhere
- [x] I18n - The web UI supports multiple languages (currently, English and Chinese)
### Ease of Use

## Getting Started
- Manage the service through a web UI
- I18n support (currently, English and Chinese)

> First, you need to have a domain that is managed by Cloudflare.
### Secure

1. Fork the repository
2. Setup the [Cloudflare Pages](https://pages.cloudflare.com/) for your forked repository
3. Binding a KV namespace to your Cloudflare Pages project as `STORE`
4. Set the `app:config` key in the KV namespace to the following JSON:
- Token-based Authentication
- Address and Domain Allowlist
- Auto Expiration

## Getting Started

```json
{
"MAIN_KEY": "YOUR_MAIN_KEY"
}
```
> First, you need to have a domain managed by Cloudflare.

> You can also set other configurations in the `app:config` key, see [config.ts](./src/lib/server/config.ts) for more details.
> For example, you can set `CORS` to `"*"` to allow CORS requests from anywhere.
1. [Fork the repository](https://github.com/JacobLinCool/hermes-mail-service/fork)
2. Setup the [Cloudflare Pages](https://pages.cloudflare.com/) for your forked repository
3. Binding a D1 database to your Cloudflare Pages project as `D1`
4. Open the setup page in your browser!

All of the above can be done in the browser! No need to install anything.

> It uses Mailchannels under the hood, so you also need to setup the [Domain Lockdown](https://community.cloudflare.com/t/introducing-mailchannels-domain-lockdown/523913) before sending emails.
> (Adding `_mailchannels` TXT record with value `v=mc1 cfid=your-hermes.pages.dev` to your domain)

## API Usage

Once you have generated a token, you can use the API to send emails.

See [examples](./examples/) for more details.
See [OpenAPI documentation](hhttps://api-spec.pages.dev/rapidoc?url=https%3A%2F%2Fhermes.csie.cool%2Fapi%2Fopenapi.json) for more information.

## Credits

Expand Down
Loading
Loading