mailbase

module
v0.0.0-...-431252f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2022 License: BSL-1.0

README

mailbase

Go 1.18 GoReportCard example

Go Docker CodeQL

login/register/logout/delete server with mail checking using go, redis and mysql

Images (must-view) ⬇️

Requirements

  • redis-server: 6.2.0 (with GetDel support)
  • Mysql: 8.0.28 (don't know accurate version, so use my as definitive)
  • Go: 1.18
  • packages: reffered to go.mod

Running

HTTPS is required for jwt cookies

The config template is located in cmd folder

The config parser supports small variety of formats (you can implement new)

go run . -conf conf.toml -type toml

go run . -conf conf.json -type json

go run . -conf conf.yaml -type yaml

Logs are saved in log.txt

With Multiwriter outputs can be expanded to an unlimited count (io.Writer implemented)

log.SetOutput( multiwriter.NewMultiWriter(os.Stderr,fileWriter,otherWriter) )

HTTP mode:

jwt works bad without https (depending on the browser)

Although, you can force it in the config file

[Host]
HTTP = true

In the mails folder you ought to change mail message links

For instance, the default url is https://localhost:8080/api/verify?key=

With an unique site it would look like https://yoursite.com/api/verify?key=

Docker

Image connects to the local databases, --net=host is required

To add execution arguments use the $ARGS environment variable

Images


Session not found -> register/login

Screenshot from 2022-04-11 15-07-03 Screenshot from 2022-04-11 15-07-08


You must verify your mail:

Screenshot from 2022-04-11 15-48-47


Forgot password? Wait for mail

Screenshot from 2022-04-11 15-07-15

Screenshot from 2022-04-11 15-07-37


Then Reset

Screenshot from 2022-04-11 15-07-59


Welcome to main page

Screenshot from 2022-04-11 15-08-54


If you're admin, advanced link will appear

Screenshot from 2022-04-11 15-08-58


Let's write report HTML SUPPORTED

Screenshot from 2022-04-11 15-11-51


Admin panel

Screenshot from 2022-04-11 15-12-02


View reports:

Screenshot from 2022-04-11 15-21-12 Screenshot from 2022-04-11 15-22-34


Read and answer HTML SUPPORTED:

Screenshot from 2022-04-11 15-14-08


Reporter will receive mail:

Screenshot from 2022-04-11 15-38-46


Status of report will be updated:

Screenshot from 2022-04-11 15-14-23


Let's disable server (admin panel wiil be available):

Screenshot from 2022-04-11 15-16-33


Ooops...

Screenshot from 2022-04-11 15-16-44


It would be better to fix this...

Screenshot from 2022-04-11 15-16-55


Superadmins who are granted from console can add/delete admins be theirs email or id

Screenshot from 2022-04-11 15-42-06

nojwt branch

The old unsecured server version works well with http, but all cookies can be stolen easily

Another solution is to use ngrok and the like services to create http tunnel, which allow you to choose newer version with jwt

ngrok example for regions:
ngrok http -region=eu 8080

ngrok http -region=us 8080

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL