aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
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)
+ }
+}