Create basic server

Includes app config and some initialization
This commit is contained in:
Matt Baer
2018-10-15 14:44:15 -04:00
parent 343f67dc97
commit 16473c97b7
6 changed files with 233 additions and 0 deletions

26
keys.go Normal file
View File

@@ -0,0 +1,26 @@
package writefreely
import (
"io/ioutil"
)
type keychain struct {
cookieAuthKey, cookieKey []byte
}
func initKeys(app *app) error {
var err error
app.keys = &keychain{}
app.keys.cookieAuthKey, err = ioutil.ReadFile("keys/cookies_auth.aes256")
if err != nil {
return err
}
app.keys.cookieKey, err = ioutil.ReadFile("keys/cookies_enc.aes256")
if err != nil {
return err
}
return nil
}