ubuntu resolute

This commit is contained in:
Maxime KINTS
2026-05-16 23:42:06 +02:00
commit c0f607fa0b
944 changed files with 112243 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
const fs = require('fs');
module.exports = function(app, checkApiKey) {
app.get('/action/getusers', checkApiKey, (req, res) => {
const passwdFilePath = '/etc/apache2/dav_svn.passwd';
try {
const fileContent = fs.readFileSync(passwdFilePath, 'utf8');
const users = fileContent
.split('\n')
.filter(line => line.trim() !== '')
.map(line => {
const username = line.split(':')[0];
return username;
});
res.json({
users: users,
count: users.length
});
} catch (error) {
res.status(500).json({
error: "Error reading users file",
details: error.message
});
}
});
};