Skip to content

πŸ“š The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.

Fix

Smaug6739d1cc5d48d2b7
diff --git a/.github/workflows/deploy_to_prod.yml b/.github/workflows/deploy_to_prod.yml
index 6fc4b909..54443db0 100755
--- a/.github/workflows/deploy_to_prod.yml
+++ b/.github/workflows/deploy_to_prod.yml
@@ -64,7 +64,6 @@ jobs:
- name: Extract Archives on Remote
run: |
ssh -i deploy_key ${SSH_USER}@"${INPUT_HOST}" "cd ${INPUT_REMOTE} && tar -xzf frontend.tar.gz && tar -xzf backend.tar.gz && rm frontend.tar.gz backend.tar.gz"
- ssh -i deploy_key ${SSH_USER}@"${INPUT_HOST}" "cd ${INPUT_REMOTE} && mv backend/config.toml config.toml"
- name: Start application
run: |
diff --git a/backend/app/migrations.go b/backend/app/migrations.go
index 17dc20c9..254ca4f0 100644
--- a/backend/app/migrations.go
+++ b/backend/app/migrations.go
@@ -1,6 +1,9 @@
package app
import (
+ "fmt"
+ "os"
+
"github.com/golang-migrate/migrate/v4"
"github.com/golang-migrate/migrate/v4/database/mysql"
_ "github.com/golang-migrate/migrate/v4/source/file"
@@ -11,7 +14,7 @@ func Migrate(config *Config) {
defer db.Close()
driver, _ := mysql.WithInstance(db, &mysql.Config{})
m, err := migrate.NewWithDatabaseInstance(
- "file://migrations",
+ fmt.Sprintf("file://%smigrations", os.Getenv("CPWD")), // Use PWD to get the current working directory
"mysql",
driver,
)
diff --git a/backend/server/server.go b/backend/server/server.go
index 0fb603b2..2a45ee39 100644
--- a/backend/server/server.go
+++ b/backend/server/server.go
@@ -21,8 +21,7 @@ func SetupServer() (*gin.Engine, *app.App) {
fmt.Fprintln(os.Stderr, "Error getting cwd:", err)
os.Exit(1)
}
-
- absPath := filepath.Join(workingDir, "config.toml")
+ absPath := filepath.Join(workingDir, fmt.Sprintf("%sconfig.toml", os.Getenv("CPWD")))
config := app.Config{}
_, err = toml.DecodeFile(absPath, &config)
if err != nil {
diff --git a/ecosystem.config.js b/ecosystem.config.js
index 7c76d21e..2d655382 100644
--- a/ecosystem.config.js
+++ b/ecosystem.config.js
@@ -9,6 +9,7 @@ module.exports = {
DOMAIN_CLIENT: 'https://alexandrie-hub.fr',
MINIO_ENDPOINT: 'localhost:9000',
MINIO_BUCKET: 'alexandrie',
+ CPWD: './backend/',
},
},
{