2
0
Эх сурвалжийг харах

Added Meteor-Files WRITEABLE_PATH for Sandstorm, Snap and Source.

Thanks to xet7 !

Related export WRITABLE_PATH=$SNAP_COMMON/wekan-uploads/
Lauri Ojansivu 3 жил өмнө
parent
commit
cc0658a225

+ 1 - 0
sandstorm-pkgdef.capnp

@@ -246,6 +246,7 @@ const myCommand :Spk.Manifest.Command = (
     #---------------------------------------------------------------------
     (key = "NODE_OPTIONS", value = "--max_old_space_size=4096"),
     (key = "PATH", value = "/usr/local/bin:/usr/bin:/bin"),
+    (key = "WRITABLE_PATH", value = "/var/wekan-uploads"),
     (key = "RESULTS_PER_PAGE", value = ""),
     (key = "WITH_API", value = "true"),
     (key = "RICHER_CARD_COMMENT_EDITOR", value="false"),

+ 2 - 1
server/migrations.js

@@ -1127,7 +1127,8 @@ Migrations.add('add-card-details-show-lists', () => {
 });
 
 Migrations.add('migrate-attachments-collectionFS-to-ostrioFiles', () => {
-  const storagePath = Attachments.storagePath();
+  //const storagePath = Attachments.storagePath();
+  const storagePath = process.env.WRITABLE_PATH;
   if (!fs.existsSync(storagePath)) {
     console.log("create storagePath because it doesn't exist: " + storagePath);
     fs.mkdirSync(storagePath, { recursive: true });

+ 5 - 3
snap-src/bin/mongodb-control

@@ -26,9 +26,11 @@ fi
 
 # Not in use. If uploads directory does not exist, create it.
 # Wekan will store attachments there.
-#if [ ! -d "$SNAP_COMMON/uploads" ]; then
-#   mkdir "$SNAP_COMMON/uploads"
-#fi
+if [ ! -d "$SNAP_COMMON/wekan-uploads" ]; then
+   mkdir "$SNAP_COMMON/wekan-uploads"
+fi
+
+export WRITABLE_PATH=$SNAP_COMMON/wekan-uploads
 
 # Alternative: When starting MongoDB, and using logfile, truncate log to last 1000 lines of text.
 # 1) If file exists:

+ 3 - 0
start-wekan.sh

@@ -9,6 +9,9 @@
       #---------------------------------------------
       export MONGO_URL='mongodb://127.0.0.1:27017/wekan'
       #---------------------------------------------
+      # WRITEABLE PATH
+      export WRITABLE_PATH=./wekan-uploads
+      #---------------------------------------------
       # Production: https://example.com/wekan
       # Local: http://localhost:2000
       #export ipaddress=$(ifdata -pa eth0)