diff options
author | FChannel <> | 2021-05-30 17:00:51 -0700 |
---|---|---|
committer | FChannel <> | 2021-05-30 17:00:51 -0700 |
commit | b4e551b3db5a5fc69befeffb7fba17b50dc2e258 (patch) | |
tree | 3a56ce8b8c3d66de893dbe31a2a729838a784475 /main.go | |
parent | 614f50a7bacc878abcaccc9186673ab2958a717d (diff) |
added pem keys to users accounts
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 19 |
1 files changed, 16 insertions, 3 deletions
@@ -38,9 +38,7 @@ var activitystreams = "application/ld+json; profile=\"https://www.w3.org/ns/acti func main() { - if _, err := os.Stat("./public"); os.IsNotExist(err) { - os.Mkdir("./public", 0755) - } + CreatedNeededDirectories() InitCache() @@ -49,6 +47,11 @@ func main() { defer db.Close() RunDatabaseSchema(db) + + CreatePem(db, GetActorByNameFromDB(db, "main")) + + f, _ := os.ReadFile("./pem/board/main-public.pem") + fmt.Println(strings.ReplaceAll(string(f), "\n", `\n`)) go MakeCaptchas(db, 100) @@ -2106,3 +2109,13 @@ func RunDatabaseSchema(db *sql.DB) { CheckError(err, "could not exec databaseschema.psql") } } + +func CreatedNeededDirectories() { + if _, err := os.Stat("./public"); os.IsNotExist(err) { + os.Mkdir("./public", 0755) + } + + if _, err := os.Stat("./pem/board"); os.IsNotExist(err) { + os.MkdirAll("./pem/board", 0700) + } +} |