Skip to content

Commit

Permalink
feat: webdav rights, only start workers if invoked
Browse files Browse the repository at this point in the history
  • Loading branch information
Dwynr committed May 28, 2024
1 parent 8aa8396 commit 31cb36d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@filen/desktop",
"version": "0.1.10",
"version": "0.1.11",
"description": "Filen Desktop Client",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
3 changes: 2 additions & 1 deletion src/fuse/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ export class FUSEWorker {
}
}

if (IS_NODE) {
// Only start the worker if it is actually invoked.
if (process.argv.slice(2).includes("--filen-desktop-worker") && IS_NODE) {
// TODO: Remove

const baseTmpPath = pathModule.join(os.tmpdir(), "filen-desktop")
Expand Down
2 changes: 1 addition & 1 deletion src/sync/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class SyncWorker {
}

// Only start the worker if it is actually invoked.
if (process.argv.slice(2).includes("--worker") && IS_NODE) {
if (process.argv.slice(2).includes("--filen-desktop-worker") && IS_NODE) {
// TODO: Proper init
const syncWorker = new SyncWorker({
dbPath: "",
Expand Down
5 changes: 3 additions & 2 deletions src/webdav/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export type WebDAVUser = {
name: string
password: string
isAdmin: boolean
rights?: WebDAV.BasicPrivilege[] | string[]
}

/**
Expand Down Expand Up @@ -64,7 +65,7 @@ export class WebDAVWorker {
for (const user of users) {
const usr = userManager.addUser(user.name, user.password, user.isAdmin)

privilegeManager.setRights(usr, "/", ["all"])
privilegeManager.setRights(usr, "/", user.rights ? user.rights : ["all"])
}

this.webdavServer = new WebDAV.WebDAVServer({
Expand Down Expand Up @@ -104,7 +105,7 @@ export class WebDAVWorker {
}

// Only start the worker if it is actually invoked.
if (process.argv.slice(2).includes("--worker") && IS_NODE) {
if (process.argv.slice(2).includes("--filen-desktop-worker") && IS_NODE) {
const webdavWorker = new WebDAVWorker({
users: [
{
Expand Down

0 comments on commit 31cb36d

Please sign in to comment.