diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index f176647..5321a18 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -22,7 +22,7 @@ jobs: - name: Log in to DockerHub uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKER_USERNAME }} + username: ${{ secrets.DOCKER_USER }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Build and push Docker image diff --git a/webapp/app.js b/webapp/app.js index 5066a40..2c9b6c5 100644 --- a/webapp/app.js +++ b/webapp/app.js @@ -5,12 +5,22 @@ const path = require('path'); const sftpUpload = require('sftp-upload'); const app = express(); -app.use(express.static('public')); // Servir les fichiers statiques comme HTML, CSS, JS +const port = 3000; -// Route pour rechercher la bibliothèque musicale -app.get('/search-music', (req, res) => { - // Implémentation pour rechercher la bibliothèque musicale - exec('find /path/to/network -type d', (error, stdout, stderr) => { +// Servir les fichiers statiques depuis le dossier public +app.use(express.static(path.join(__dirname, 'public'))); + +// Route pour la page d'accueil +app.get('/', (req, res) => { + res.sendFile(path.join(__dirname, 'public', 'index.html')); +}); + +// Route pour rechercher des répertoires +app.get('/find-directory', (req, res) => { + const networkPath = req.query.path; // Récupère le chemin du dossier réseau + + // Commande find + exec(`find ${networkPath} -type d`, (error, stdout, stderr) => { if (error) { return res.status(500).send(`Erreur: ${stderr}`); } @@ -20,7 +30,9 @@ app.get('/search-music', (req, res) => { // Route pour lancer l'analyse app.get('/start-analysis', (req, res) => { - const command = 'blissify init'; + + const networkPath = req.query.path; + const command = `blissify init ${networkPath}`; const analysis = exec(command); analysis.stdout.on('data', (data) => { diff --git a/webapp/public/index.html b/webapp/public/index.html index 26a715e..89df023 100644 --- a/webapp/public/index.html +++ b/webapp/public/index.html @@ -11,7 +11,7 @@

Blissify Webapp

- +