9drive 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # 9Drive — Virtual Cloud Storage & Client-Side Productivity Suite
4
4
 
5
- [![Version](https://img.shields.io/badge/version-1.0.4-blue.svg)](package.json)
5
+ [![Version](https://img.shields.io/badge/version-1.0.5-blue.svg)](package.json)
6
6
  [![npm version](https://img.shields.io/npm/v/9drive.svg)](https://www.npmjs.com/package/9drive)
7
7
  [![License](https://img.shields.io/badge/license-Apache%202.0-green.svg)](LICENSE)
8
8
  [![Framework](https://img.shields.io/badge/stack-React%20%7C%20Node%20Express%20%7C%20Prisma%20%7C%20SQLite%20%2F%20MySQL-orange.svg)]()
@@ -27,7 +27,7 @@ function compareVersions(v1, v2) {
27
27
  return 0;
28
28
  }
29
29
  exports.systemRouter.get('/version', async (_req, res) => {
30
- let currentVersion = process.env.NINEDRIVE_VERSION || '1.0.4';
30
+ let currentVersion = process.env.NINEDRIVE_VERSION || '1.0.5';
31
31
  try {
32
32
  const pkgPaths = [
33
33
  path_1.default.resolve(__dirname, '../../../../package.json'),
Binary file
@@ -1 +1 @@
1
- if(!self.define){let e,i={};const s=(s,n)=>(s=new URL(s+".js",n).href,i[s]||new Promise(i=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=i,document.head.appendChild(e)}else e=s,importScripts(s),i()}).then(()=>{let e=i[s];if(!e)throw new Error(`Module ${s} didn’t register its module`);return e}));self.define=(n,r)=>{const o=e||("document"in self?document.currentScript.src:"")||location.href;if(i[o])return;let c={};const d=e=>s(e,o),l={module:{uri:o},exports:c,require:d};i[o]=Promise.all(n.map(e=>l[e]||d(e))).then(e=>(r(...e),c))}}define(["./workbox-9c191d2f"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"pwa-512x512.svg",revision:"212a549c3198cd3c8093f1170db19b79"},{url:"pwa-192x192.svg",revision:"2ecba537d70f38a9003f2fd464820eb5"},{url:"maskable-icon.svg",revision:"621ea3101ca19faea2bc1232d4cbe290"},{url:"index.html",revision:"686203c9657b76abb4388de3b8729be2"},{url:"icons.svg",revision:"21c7473c592c67dc87223d49892c8f0a"},{url:"favicon.svg",revision:"89d5f8a51e975fdb28942b7e16a2eb13"},{url:"favicon.ico",revision:"89d5f8a51e975fdb28942b7e16a2eb13"},{url:"assets/ort.webgpu.bundle.min-BJrZkBGK.js",revision:null},{url:"assets/ort.bundle.min-BWec8A6i.js",revision:null},{url:"assets/index-C7bWEPbJ.css",revision:null},{url:"assets/index-BdvnnDEz.js",revision:null},{url:"favicon.svg",revision:"89d5f8a51e975fdb28942b7e16a2eb13"},{url:"maskable-icon.svg",revision:"621ea3101ca19faea2bc1232d4cbe290"},{url:"pwa-192x192.svg",revision:"2ecba537d70f38a9003f2fd464820eb5"},{url:"pwa-512x512.svg",revision:"212a549c3198cd3c8093f1170db19b79"},{url:"manifest.webmanifest",revision:"ed89a90d9f1a8d403cceaa4d535b939c"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html"),{denylist:[/^\/(auth|connected-accounts|files|folders|invites|provider-configs|public|storage|uploads)(\/|$)/]}))});
1
+ if(!self.define){let e,i={};const s=(s,n)=>(s=new URL(s+".js",n).href,i[s]||new Promise(i=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=i,document.head.appendChild(e)}else e=s,importScripts(s),i()}).then(()=>{let e=i[s];if(!e)throw new Error(`Module ${s} didn’t register its module`);return e}));self.define=(n,r)=>{const c=e||("document"in self?document.currentScript.src:"")||location.href;if(i[c])return;let o={};const d=e=>s(e,c),l={module:{uri:c},exports:o,require:d};i[c]=Promise.all(n.map(e=>l[e]||d(e))).then(e=>(r(...e),o))}}define(["./workbox-9c191d2f"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"pwa-512x512.svg",revision:"212a549c3198cd3c8093f1170db19b79"},{url:"pwa-192x192.svg",revision:"2ecba537d70f38a9003f2fd464820eb5"},{url:"maskable-icon.svg",revision:"621ea3101ca19faea2bc1232d4cbe290"},{url:"index.html",revision:"686203c9657b76abb4388de3b8729be2"},{url:"icons.svg",revision:"21c7473c592c67dc87223d49892c8f0a"},{url:"favicon.svg",revision:"89d5f8a51e975fdb28942b7e16a2eb13"},{url:"favicon.ico",revision:"19589bed51c8711fc6e0be4dbd0a3e85"},{url:"assets/ort.webgpu.bundle.min-BJrZkBGK.js",revision:null},{url:"assets/ort.bundle.min-BWec8A6i.js",revision:null},{url:"assets/index-C7bWEPbJ.css",revision:null},{url:"assets/index-BdvnnDEz.js",revision:null},{url:"favicon.svg",revision:"89d5f8a51e975fdb28942b7e16a2eb13"},{url:"maskable-icon.svg",revision:"621ea3101ca19faea2bc1232d4cbe290"},{url:"pwa-192x192.svg",revision:"2ecba537d70f38a9003f2fd464820eb5"},{url:"pwa-512x512.svg",revision:"212a549c3198cd3c8093f1170db19b79"},{url:"manifest.webmanifest",revision:"ed89a90d9f1a8d403cceaa4d535b939c"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html"),{denylist:[/^\/(auth|connected-accounts|files|folders|invites|provider-configs|public|storage|uploads)(\/|$)/]}))});
package/bin/9drive.js CHANGED
@@ -183,30 +183,43 @@ function handleShortcut() {
183
183
  const platform = process.platform
184
184
 
185
185
  if (platform === 'win32') {
186
- const iconPath = path.join(__dirname, '../backend/public/favicon.ico')
186
+ ensureDirectories()
187
+ const bundledIcon = path.resolve(__dirname, '../backend/public/favicon.ico')
188
+ const persistentIcon = path.join(dataDir, '9drive.ico')
189
+
190
+ if (fs.existsSync(bundledIcon)) {
191
+ try {
192
+ fs.copyFileSync(bundledIcon, persistentIcon)
193
+ } catch {}
194
+ }
195
+
196
+ const iconTarget = fs.existsSync(persistentIcon) ? persistentIcon : bundledIcon
197
+ const hasIcon = fs.existsSync(iconTarget)
198
+ const sanitizedIcon = iconTarget.replace(/\\/g, '\\')
199
+ const sanitizedHome = home.replace(/\\/g, '\\')
187
200
 
188
201
  const vbsScript = `
189
202
  Set oWS = WScript.CreateObject("WScript.Shell")
190
203
  sDesktop = oWS.SpecialFolders("Desktop")
191
204
  sPrograms = oWS.SpecialFolders("Programs")
192
205
 
193
- sLinkFile = sDesktop & "\\9Drive.lnk"
206
+ sLinkFile = sDesktop & "\\NineDrive.lnk"
194
207
  Set oLink = oWS.CreateShortcut(sLinkFile)
195
208
  oLink.TargetPath = "cmd.exe"
196
209
  oLink.Arguments = "/c 9drive"
197
- oLink.Description = "9Drive Personal Cloud Storage"
198
- oLink.WorkingDirectory = "${home.replace(/\\/g, '\\\\')}"
199
- ${fs.existsSync(iconPath) ? `oLink.IconLocation = "${iconPath.replace(/\\/g, '\\\\')}"` : ''}
210
+ oLink.Description = "NineDrive Personal Cloud Storage"
211
+ oLink.WorkingDirectory = "${sanitizedHome}"
212
+ ${hasIcon ? `oLink.IconLocation = "${sanitizedIcon},0"` : ''}
200
213
  oLink.Save
201
214
 
202
215
  On Error Resume Next
203
- sLinkFile2 = sPrograms & "\\9Drive.lnk"
216
+ sLinkFile2 = sPrograms & "\\NineDrive.lnk"
204
217
  Set oLink2 = oWS.CreateShortcut(sLinkFile2)
205
218
  oLink2.TargetPath = "cmd.exe"
206
219
  oLink2.Arguments = "/c 9drive"
207
- oLink2.Description = "9Drive Personal Cloud Storage"
208
- oLink2.WorkingDirectory = "${home.replace(/\\/g, '\\\\')}"
209
- ${fs.existsSync(iconPath) ? `oLink2.IconLocation = "${iconPath.replace(/\\/g, '\\\\')}"` : ''}
220
+ oLink2.Description = "NineDrive Personal Cloud Storage"
221
+ oLink2.WorkingDirectory = "${sanitizedHome}"
222
+ ${hasIcon ? `oLink2.IconLocation = "${sanitizedIcon},0"` : ''}
210
223
  oLink2.Save
211
224
 
212
225
  WScript.Echo sDesktop
@@ -217,9 +230,10 @@ function handleShortcut() {
217
230
  fs.writeFileSync(tempVbs, vbsScript)
218
231
  const output = execSync(`cscript //nologo "${tempVbs}"`, { encoding: 'utf8' }).trim()
219
232
  try { fs.unlinkSync(tempVbs) } catch {}
220
- console.log(' \x1b[32m[✓]\x1b[0m Shortcut Desktop Windows berhasil dipasang!')
221
- console.log(` Lokasi Desktop: \x1b[36m${output}\\9Drive.lnk\x1b[0m`)
222
- console.log(' Sekarang Anda cukup double-click icon "9Drive" di Desktop untuk membuka aplikasi!\n')
233
+ console.log(' \x1b[32m[✓]\x1b[0m Shortcut Desktop Windows dengan icon logo resmi berhasil dipasang!')
234
+ console.log(` Lokasi Desktop: \x1b[36m${output}\\NineDrive.lnk\x1b[0m`)
235
+ console.log(` Icon Logo: \x1b[36m${iconTarget}\x1b[0m`)
236
+ console.log(' Sekarang Anda cukup double-click icon "NineDrive" di Desktop untuk membuka aplikasi!\n')
223
237
  } catch (err) {
224
238
  console.log(' \x1b[31m[x]\x1b[0m Gagal membuat shortcut:', err.message)
225
239
  }
@@ -241,18 +255,20 @@ function handleShortcut() {
241
255
  path.join(home, '.local/share/applications'),
242
256
  path.join(home, 'Desktop'),
243
257
  ]
258
+ const iconFile = path.resolve(__dirname, '../backend/public/favicon.ico')
244
259
  const desktopContent = `[Desktop Entry]
245
- Name=9Drive
246
- Comment=Personal Cloud Storage & Universal API Gateway
260
+ Name=NineDrive
261
+ Comment=NineDrive - Personal Cloud Storage & Universal API Gateway
247
262
  Exec=9drive
248
263
  Terminal=false
249
264
  Type=Application
265
+ Icon=${iconFile}
250
266
  Categories=Network;FileTransfer;Utility;
251
267
  `
252
268
  let created = false
253
269
  for (const dir of desktopDirs) {
254
270
  if (fs.existsSync(dir)) {
255
- const file = path.join(dir, '9drive.desktop')
271
+ const file = path.join(dir, 'ninedrive.desktop')
256
272
  try {
257
273
  fs.writeFileSync(file, desktopContent)
258
274
  fs.chmodSync(file, '755')
@@ -262,7 +278,7 @@ Categories=Network;FileTransfer;Utility;
262
278
  }
263
279
  }
264
280
  if (created) {
265
- console.log(' 9Drive is now available in your application launcher!\n')
281
+ console.log(' NineDrive is now available in your application launcher with official logo!\n')
266
282
  }
267
283
  }
268
284
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "9drive",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "9Drive - Personal Cloud Storage & Universal API Gateway",
5
5
  "main": "bin/9drive.js",
6
6
  "bin": "bin/9drive.js",