mirror of
https://github.com/hugmouse/maddy-password-reset.git
synced 2025-04-11 10:10:26 +00:00
refactor(README): better description of the project
This commit is contained in:
parent
bb7695b7b0
commit
02a75b7d53
1 changed files with 33 additions and 25 deletions
58
README.md
58
README.md
|
@ -1,50 +1,58 @@
|
||||||

|

|
||||||
|
|
||||||
# Maddy password reset service
|
# Maddy Password Reset Service
|
||||||
|
|
||||||
Runs an HTTP server that serves password reset form.
|
Runs an HTTP server that serves a password reset form.
|
||||||
|
It should be installed on the same server where Maddy is running.
|
||||||
|
|
||||||
Still Work In Progress! And so no LICENSE file is provided. It will be here eventually.
|
## How It Works
|
||||||
|
|
||||||
|
It runs the `maddy creds password -p` command to change a user's password.
|
||||||
|
|
||||||
|
### Use Cases
|
||||||
|
|
||||||
|
- You are currently logged into your mailbox and want to reset the password.
|
||||||
|
- For example, you registered a user, and the user wants to change their password.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
For the time being, you have to compile it yourself.
|
For the time being, you need to compile it yourself.
|
||||||
In the future there will be prebuilt binaries.
|
|
||||||
|
|
||||||
### Requirements
|
### Requirements
|
||||||
|
|
||||||
- Go
|
- Go
|
||||||
- Maddy
|
- Maddy (on the server, we need its CLI)
|
||||||
|
|
||||||
|
To build this project, install `Go` and execute the following command:
|
||||||
|
|
||||||
To build this project install `Go` and execute this:
|
|
||||||
```shell
|
```shell
|
||||||
go build ./main.go
|
go build ./main.go
|
||||||
```
|
```
|
||||||
|
|
||||||
Make sure to configure it first! First compilation will take moderate amount of time.
|
Make sure to configure it first! The first compilation will take a moderate amount of time.
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
By default, the web server starts on `:1323'. Make sure you hide it behind a reverse proxy.
|
By default, the web server starts on `:1323`. Make sure you hide it behind a reverse proxy.
|
||||||
|
|
||||||
You will probably need to edit the `reset.gohtml` template to suit your needs.
|
You will probably need to edit the `reset.gohtml` template to suit your needs.
|
||||||
For now, it contains a reset page in Russian for my hobby mail service.
|
For now, it contains a reset page in Russian for my hobby mail service.
|
||||||
|
|
||||||
The only way to change the configuration is to change the consts in the `main.go` file:
|
The only way to change the configuration is to modify the constants in the `main.go` file:
|
||||||
|
|
||||||
- `MaddyPath` - path to maddy's database, e.g.: `/var/lib/maddy/credentials.db`
|
- `MaddyPath` – Path to Maddy's database, e.g., `/var/lib/maddy/credentials.db`
|
||||||
- `HostingURL` - your domain name, for example: `http://localhost:1323/`
|
- `HostingURL` – Your domain name, for example: `http://localhost:1323/`
|
||||||
- `SMTPMailUsername` - your full email address, for example: `robot@local.host`
|
- `SMTPMailUsername` – Your full email address, for example: `robot@local.host`
|
||||||
- `SMTPMailPassword` - your mailbox password
|
- `SMTPMailPassword` – Your mailbox password
|
||||||
- `SMTPMailHostname` - your mail hostname, for example: `mx1.local.host`
|
- `SMTPMailHostname` – Your mail hostname, for example: `mx1.local.host`
|
||||||
- `MXServer` - your mail `MX` entry + `PORT`, for example: `mx1.local.host:587`
|
- `MXServer` – Your mail `MX` entry and `PORT`, for example: `mx1.local.host:587`
|
||||||
- `EmailFrom` - the `$FROM` section of an EmailTemplate, for example: `robot@local.host`
|
- `EmailFrom` – The `$FROM` section of an email template, for example: `robot@local.host`
|
||||||
- `EmailSubject` - the `$SUBJECT` section of an EmailTemplate
|
- `EmailSubject` – The `$SUBJECT` section of an email template
|
||||||
- `EmailMessage` - the `$MESSAGE` section of an EmailTemplate. Remember to provide a password reset link for a user `$RESET_LINK`. For example: `Here's your reset link: $RESET_LINK\r\n`
|
- `EmailMessage` – The `$MESSAGE` section of an email template. Remember to provide a password reset link for the user using `$RESET_LINK`. For example: `Here's your reset link: $RESET_LINK\r\n`
|
||||||
- `EmailTemplate`- your reset email message
|
- `EmailTemplate` – Your reset email message
|
||||||
- `HTTPServerPort` - HTTP server port
|
- `HTTPServerPort` – HTTP server port
|
||||||
|
|
||||||
`EmailTemplate` example:
|
### `EmailTemplate` Example
|
||||||
|
|
||||||
```text
|
```text
|
||||||
"To: $TO\r\n" +
|
"To: $TO\r\n" +
|
||||||
|
@ -53,4 +61,4 @@ The only way to change the configuration is to change the consts in the `main.go
|
||||||
"Subject: $SUBJECT\r\n" +
|
"Subject: $SUBJECT\r\n" +
|
||||||
"\r\n" +
|
"\r\n" +
|
||||||
"$MESSAGE\r\n"
|
"$MESSAGE\r\n"
|
||||||
```
|
```
|
||||||
|
|
Loading…
Add table
Reference in a new issue