Atualização automática: 2026-05-18 11:36:09
This commit is contained in:
@@ -68,6 +68,8 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./services/api-gateway:/app
|
- ./services/api-gateway:/app
|
||||||
- /app/node_modules
|
- /app/node_modules
|
||||||
|
- ./cloned-sites:/app/cloned-sites
|
||||||
|
- /root/Desktop/Clonados:/root/Desktop/Clonados
|
||||||
|
|
||||||
# Crawler Service
|
# Crawler Service
|
||||||
crawler-service:
|
crawler-service:
|
||||||
@@ -87,6 +89,8 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./services/crawler:/app
|
- ./services/crawler:/app
|
||||||
- /app/node_modules
|
- /app/node_modules
|
||||||
|
- ./cloned-sites:/app/cloned-sites
|
||||||
|
- /root/Desktop/Clonados:/root/Desktop/Clonados
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
postgres_data:
|
postgres_data:
|
||||||
|
|||||||
+16
-2
@@ -83,9 +83,9 @@ app.post('/api/wget-clone', async (req, res) => {
|
|||||||
const containerId = require('os').hostname();
|
const containerId = require('os').hostname();
|
||||||
const cloneDir = directory.split('/').pop();
|
const cloneDir = directory.split('/').pop();
|
||||||
const hostDir = '/root/Desktop/Clonados';
|
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);
|
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) {
|
if (matches && matches.length > 0) {
|
||||||
const lastMatch = matches[matches.length - 1];
|
const lastMatch = matches[matches.length - 1];
|
||||||
const result = JSON.parse(lastMatch);
|
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({
|
res.json({
|
||||||
success: result.success,
|
success: result.success,
|
||||||
data: result,
|
data: result,
|
||||||
|
|||||||
Reference in New Issue
Block a user