forked from arp242/goatcounter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace -auth with -email-from (arp242#270)
* Replace -auth with -email-from Sets email address in a few more places as well. * Exit when we can't bind to -listen
- Loading branch information
Showing
12 changed files
with
80 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,5 +14,5 @@ var ( | |
Saas bool | ||
Serve bool | ||
Port string | ||
LoginFrom string | ||
EmailFrom string | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -119,7 +119,7 @@ func Export(ctx context.Context, fp *os.File) { | |
|
||
user := GetUser(ctx) | ||
err = zmail.SendTemplate("GoatCounter export ready", | ||
mail.Address{Name: "GoatCounter export", Address: "[email protected]"}, | ||
mail.Address{Name: "GoatCounter export", Address: cfg.EmailFrom}, | ||
[]mail.Address{{Address: user.Email}}, | ||
"email_export_done.gotxt", struct { | ||
Site Site | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -996,11 +996,22 @@ func (h backend) delete(w http.ResponseWriter, r *http.Request) error { | |
go func() { | ||
defer zlog.Recover() | ||
|
||
contact := "false" | ||
if args.ContactMe { | ||
var u goatcounter.User | ||
err := u.BySite(r.Context(), site.ID) | ||
if err != nil { | ||
zlog.Error(err) | ||
} else { | ||
contact = u.Email | ||
} | ||
} | ||
|
||
zmail.Send("GoatCounter deletion", | ||
mail.Address{Name: "GoatCounter deletion", Address: "[email protected]"}, | ||
[]mail.Address{{Address: "[email protected]"}}, | ||
fmt.Sprintf(`Deleted: %s (%d): contact_me: %t; reason: %s`, | ||
site.Code, site.ID, args.ContactMe, args.Reason)) | ||
mail.Address{Name: "GoatCounter deletion", Address: cfg.EmailFrom}, | ||
[]mail.Address{{Address: cfg.EmailFrom}}, | ||
fmt.Sprintf(`Deleted: %s (%d): contact_me: %s; reason: %s`, | ||
site.Code, site.ID, contact, args.Reason)) | ||
}() | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters