incognitolm commited on
Commit
f60deaa
Β·
verified Β·
1 Parent(s): c7e5683

Update server.js

Browse files
Files changed (1) hide show
  1. server.js +23 -0
server.js CHANGED
@@ -45,6 +45,29 @@ webpush.setVapidDetails(
45
  VAPID_KEYS.privateKey
46
  );
47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  // ── Transparent 1Γ—1 PNG ───────────────────────────────────────────────────
49
  const PIXEL_PNG = Buffer.from(
50
  "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR4AWJiYGBgAAAAAP//XRcpzQAAAAZJREFUAwAADwADJDd96QAAAABJRU5ErkJggg==",
 
45
  VAPID_KEYS.privateKey
46
  );
47
 
48
+ function verifyBucketMount() {
49
+ try {
50
+ const stat = fs.statSync(DATA_DIR);
51
+
52
+ if (!stat.isDirectory()) {
53
+ throw new Error("/data is not a directory");
54
+ }
55
+
56
+ const testFile = path.join(DATA_DIR, ".mount-test");
57
+
58
+ fs.writeFileSync(testFile, "ok");
59
+ fs.unlinkSync(testFile);
60
+
61
+ console.log("[Storage] Bucket mount OK:", DATA_DIR);
62
+
63
+ } catch (err) {
64
+ console.error("[Storage] Bucket mount FAILED:", err.message);
65
+ process.exit(1);
66
+ }
67
+ }
68
+
69
+ verifyBucketMount();
70
+
71
  // ── Transparent 1Γ—1 PNG ───────────────────────────────────────────────────
72
  const PIXEL_PNG = Buffer.from(
73
  "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR4AWJiYGBgAAAAAP//XRcpzQAAAAZJREFUAwAADwADJDd96QAAAABJRU5ErkJggg==",