add keeweb

This commit is contained in:
2025-07-26 17:20:03 +02:00
parent 194144120f
commit 1a8f4d6613
10 changed files with 147 additions and 0 deletions

View File

@ -0,0 +1,21 @@
const webdav = require('webdav-server').v2;
const adminUser = process.env.WEBDAV_USER || 'admin';
const adminPass = process.env.WEBDAV_PASS || 'password';
const userManager = new webdav.SimpleUserManager();
const user = userManager.addUser(adminUser, adminPass, false); // false = pas admin système
const privilegeManager = new webdav.SimplePathPrivilegeManager();
const server = new webdav.WebDAVServer({
port: 9999,
hostname: '0.0.0.0',
httpAuthentication: new webdav.HTTPBasicAuthentication(userManager, 'default realm'),
privilegeManager,
rootFileSystem: new webdav.PhysicalFileSystem('/data')
});
server.start(() => {
console.log(`WebDAV server running at http://0.0.0.0:9999 as ${adminUser}`);
});