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 +1 -1
- package/backend/dist/modules/system/system.routes.js +1 -1
- package/backend/public/favicon.ico +0 -0
- package/backend/public/sw.js +1 -1
- package/bin/9drive.js +32 -16
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# 9Drive — Virtual Cloud Storage & Client-Side Productivity Suite
|
|
4
4
|
|
|
5
|
-
[](package.json)
|
|
6
6
|
[](https://www.npmjs.com/package/9drive)
|
|
7
7
|
[](LICENSE)
|
|
8
8
|
[]()
|
|
@@ -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.
|
|
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
|
package/backend/public/sw.js
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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 & "\\
|
|
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 = "
|
|
198
|
-
oLink.WorkingDirectory = "${
|
|
199
|
-
${
|
|
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 & "\\
|
|
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 = "
|
|
208
|
-
oLink2.WorkingDirectory = "${
|
|
209
|
-
${
|
|
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}\\
|
|
222
|
-
console.log(
|
|
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=
|
|
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, '
|
|
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('
|
|
281
|
+
console.log(' NineDrive is now available in your application launcher with official logo!\n')
|
|
266
282
|
}
|
|
267
283
|
}
|
|
268
284
|
}
|