Compare commits
4 Commits
d82c633ee5
...
3d877ea184
Author | SHA1 | Date |
---|---|---|
vilmibm | 3d877ea184 | |
vilmibm | 9353e3f414 | |
vilmibm | 9b1143e18d | |
vilmibm | 96d487ede2 |
|
@ -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,
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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, ' ')
|
||||
|
|
Loading…
Reference in New Issue