Atualização automática: 2026-05-18 11:36:09

This commit is contained in:
Hermes
2026-05-18 11:36:09 +00:00
parent 1db7b228bd
commit 1fde3c5cab
2 changed files with 20 additions and 2 deletions
+4
View File
@@ -68,6 +68,8 @@ services:
volumes:
- ./services/api-gateway:/app
- /app/node_modules
- ./cloned-sites:/app/cloned-sites
- /root/Desktop/Clonados:/root/Desktop/Clonados
# Crawler Service
crawler-service:
@@ -87,6 +89,8 @@ services:
volumes:
- ./services/crawler:/app
- /app/node_modules
- ./cloned-sites:/app/cloned-sites
- /root/Desktop/Clonados:/root/Desktop/Clonados
volumes:
postgres_data:
+16 -2
View File
@@ -83,9 +83,9 @@ app.post('/api/wget-clone', async (req, res) => {
const containerId = require('os').hostname();
const cloneDir = directory.split('/').pop();
const hostDir = '/root/Desktop/Clonados';
exec(`docker cp ${containerId}:${directory} ${hostDir}/ 2>/dev/null`, (err) => {
exec(`mkdir -p ${hostDir} && cp -r ${directory} ${hostDir}/ 2>/dev/null || docker cp ${containerId}:${directory} ${hostDir}/ 2>/dev/null`, (err) => {
if (err) console.log('⚠️ Sync to host failed:', err.message);
else console.log('✅ Clone synced to host:', cloneDir);
else console.log('✅ Clone synced to host Desktop:', cloneDir);
});
}
@@ -152,6 +152,20 @@ app.post('/api/smart-clone', (req, res) => {
if (matches && matches.length > 0) {
const lastMatch = matches[matches.length - 1];
const result = JSON.parse(lastMatch);
// Sync to host /root/Desktop/Clonados
const directory = result.data?.directory || result.directory || result.path;
if (result.success && directory) {
const { exec } = require('child_process');
const containerId = require('os').hostname();
const cloneDir = directory.split('/').pop();
const hostDir = '/root/Desktop/Clonados';
exec(`mkdir -p ${hostDir} && cp -r ${directory} ${hostDir}/ 2>/dev/null || docker cp ${containerId}:${directory} ${hostDir}/ 2>/dev/null`, (err) => {
if (err) console.log('⚠️ SmartClone sync to host failed:', err.message);
else console.log('✅ SmartClone synced to host Desktop:', cloneDir);
});
}
res.json({
success: result.success,
data: result,