Create basic server
Includes app config and some initialization
This commit is contained in:
26
keys.go
Normal file
26
keys.go
Normal 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
|
||||
}
|
Reference in New Issue
Block a user