Compare commits

...

4 Commits

Author SHA1 Message Date
vilmibm 3d877ea184 switch to crypto/rand 2023-03-10 03:21:26 +00:00
vilmibm 9353e3f414 fix email 2023-03-10 03:21:12 +00:00
vilmibm 9b1143e18d fix issue where msgScroll did not scroll 2023-03-10 03:21:01 +00:00
vilmibm 96d487ede2 wording 2023-03-10 03:20:50 +00:00
4 changed files with 12 additions and 9 deletions

View File

@ -21,12 +21,8 @@ ssh welcome@tilde.town
You'll fill in details like your desired username and SSH public key.
If you're brand new to SSH or have never heard of it that is okay!
This page has information on what SSH is and how to use it, including how to create an ssh key pair which you'll need to access your town account: https://tilde.town/wiki/getting-started/ssh.html
If you run into confusion or problems creating a key pair on your computer, this page can generate one for you: https://tilde.town/keymachine . However you'll still need to save the generated key files to your computer in order to use them.
If you end up stuck, e-mail root@tilde.town with any questions.
See you on the server,

View File

@ -321,6 +321,7 @@ func _main(l *log.Logger, db *sql.DB) error {
}
fmt.Fprintln(msgScroll, player.Say(msg))
fmt.Fprintln(sm.Current.Input, msg)
msgScroll.ScrollToEnd()
}
defer func() {

View File

@ -74,7 +74,7 @@ func (m *ExternalMailer) Send(address, subject, body string) error {
return fmt.Errorf("auth failed for smtp: %w", err)
}
if err = c.Mail("root@tilde.town"); err != nil {
if err = c.Mail(from); err != nil {
return err
}
@ -87,7 +87,7 @@ func (m *ExternalMailer) Send(address, subject, body string) error {
return err
}
_, err = w.Write([]byte(body))
_, err = w.Write([]byte(message))
if err != nil {
return err
}

View File

@ -1,10 +1,11 @@
package invites
import (
"crypto/rand"
"database/sql"
"encoding/base64"
"errors"
"math/rand"
"math/big"
"strings"
"time"
@ -53,7 +54,6 @@ func ConnectDB() (*sql.DB, error) {
}
func generateCode(email string) string {
rand.Seed(time.Now().Unix())
charset := "abcdefghijklmnopqrztuvwxyz"
charset += strings.ToUpper(charset)
@ -62,8 +62,14 @@ func generateCode(email string) string {
code := []byte{}
max := big.NewInt(int64(len(charset)))
for len(code) < codeLen {
code = append(code, charset[rand.Intn(len(charset))])
ix, err := rand.Int(rand.Reader, max)
if err != nil {
// TODO this is bad but I'm just kind of hoping it doesn't happen...often
panic(err)
}
code = append(code, charset[ix.Int64()])
}
code = append(code, ' ')