add notif after user is created
This commit is contained in:
parent
d67b330b00
commit
c85e939c65
@ -56,7 +56,7 @@ func SignupPage(c *fiber.Ctx) error {
|
|||||||
return c.SendStatus(fiber.StatusInternalServerError)
|
return c.SendStatus(fiber.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
// send notification to admins
|
// send notification to admins
|
||||||
err = shoutrrr.Send(os.Getenv("PUBLAPI_NOTIFY_SHOUTRRRURL"), "New user signup! Please review /var/publapi/users/"+username+".sh to approve or deny the user. IP: "+ip+" Email: "+email)
|
err = shoutrrr.Send(os.Getenv("PUBLAPI_NOTIFY_SHOUTRRRURL")+os.Getenv("PUBLAPI_NOTIFY_SHOUTRRRURL"), "New user signup! Please review /var/publapi/users/"+username+".sh to approve or deny the user. IP: "+ip+" Email: "+email)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Error sending notification to admins", err)
|
log.Error("Error sending notification to admins", err)
|
||||||
return c.SendStatus(fiber.StatusInternalServerError)
|
return c.SendStatus(fiber.StatusInternalServerError)
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
PUBLAPI_PORT=3000
|
PUBLAPI_PORT=3000
|
||||||
PUBLAPI_NOTIFY_SHOUTRRRURL='matrix://pubnixbot:xxx@projectsegfau.lt/'
|
PUBLAPI_NOTIFY_SHOUTRRRURL='matrix://pubnixbot:xxx@projectsegfau.lt/'
|
||||||
PUBLAPI_EMAIL_SHOUTRRRURL='smtp://pubnix%40projectsegfau.lt:xxx@mail.projectsegfau.lt:587/?auth=Plain&fromaddress=pubnix%40projectsegfau.lt&fromname=Project+Segfault+Pubnix&subject=Your+registration+request+for+the+Project+Segfault+pubnix+has+been+sent&toaddresses='
|
PUBLAPI_EMAIL_SHOUTRRRURL='smtp://pubnix%40projectsegfau.lt:xxx@mail.projectsegfau.lt:587/?auth=Plain&fromaddress=pubnix%40projectsegfau.lt&fromname=Project+Segfault+Pubnix&subject=Your+registration+request+for+the+Project+Segfault+pubnix+has+been+sent&toaddresses='
|
||||||
|
PUBLAPI_NOTIFY_ROOMS='?rooms=!xxx:projectsegfau.lt'
|
||||||
|
@ -36,4 +36,5 @@ We hope you have enough freedom to do what you want. You are limited to 20GB of
|
|||||||
|
|
||||||
We hope you have as much fun as we did making the Pubnix! :D' \
|
We hope you have as much fun as we did making the Pubnix! :D' \
|
||||||
| s-nail -vr pubnix@projectsegfau.lt -s 'Your Project Segfault Pubnix account has been created' {{email}}
|
| s-nail -vr pubnix@projectsegfau.lt -s 'Your Project Segfault Pubnix account has been created' {{email}}
|
||||||
|
source /var/publapi/publapi.env && shoutrrr send -u $PUBLAPI_NOTIFY_SHOUTRRRURL -m "Welcome new user, ~{{username}}!"
|
||||||
rm -rf $0
|
rm -rf $0
|
||||||
|
Loading…
Reference in New Issue
Block a user