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,26 @@
const fs = require('fs');
const { execSync } = require('child_process');
module.exports = function(app, checkApiKey) {
app.get('/action/getrepos', checkApiKey, (req, res) => {
const repoPath = '/var/svn'; // Updated correct path
try {
// Read the repositories directory
const repos = fs.readdirSync(repoPath)
.filter(item => fs.statSync(`${repoPath}/${item}`).isDirectory())
.filter(item => fs.existsSync(`${repoPath}/${item}/format`)); // Verify it's a SVN repo
res.json({
repositories: repos,
count: repos.length
});
} catch (error) {
res.status(500).json({
error: "Error reading repositories",
details: error.message
});
}
});
};