From b4e551b3db5a5fc69befeffb7fba17b50dc2e258 Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Sun, 30 May 2021 17:00:51 -0700 Subject: added pem keys to users accounts --- main.go | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index 8d28e33..b38531a 100644 --- a/main.go +++ b/main.go @@ -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) + } +} -- cgit v1.2.3