aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorFChannel <>2021-05-30 17:00:51 -0700
committerFChannel <>2021-05-30 17:00:51 -0700
commitb4e551b3db5a5fc69befeffb7fba17b50dc2e258 (patch)
tree3a56ce8b8c3d66de893dbe31a2a729838a784475 /main.go
parent614f50a7bacc878abcaccc9186673ab2958a717d (diff)
added pem keys to users accounts
Diffstat (limited to 'main.go')
-rw-r--r--main.go19
1 files changed, 16 insertions, 3 deletions
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)
+ }
+}