added admin control panel for making posts, with basic authentication
This commit is contained in:
@@ -5,7 +5,7 @@ import (
|
||||
"os"
|
||||
)
|
||||
|
||||
func LoadAdminHash(path string) string {
|
||||
func LoadAdminHash(path string) [32]byte {
|
||||
file, err := os.Open(path)
|
||||
if err != nil {
|
||||
panic("Could not find DSN for database...")
|
||||
@@ -14,7 +14,11 @@ func LoadAdminHash(path string) string {
|
||||
reader := bufio.NewScanner(file)
|
||||
// The dsn should be the first line of the file
|
||||
if reader.Scan() {
|
||||
return reader.Text()
|
||||
var buff [32]byte
|
||||
for i, b := range reader.Bytes() {
|
||||
buff[i] = b
|
||||
}
|
||||
return buff
|
||||
}
|
||||
panic(path + " is empty...")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user