mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
fix: remove debugging console log
This commit is contained in:
1 parent
40b6d3cd86
commit
917083ad30
7 files changed
+1
-23
No files matched your search
@@ -5,7 +5,6 @@ import { pushToSession } from '../socket.js'
|
||||
const commandCompleteCallbacks = new Map()
|
||||
|
||||
export async function newCommand(req, res) {
|
||||
console.log('new command:', req.body)
|
||||
const { command, pwd, output, error, ...additionalData } = req.body
|
||||
|
||||
if (!command) {
|
||||
|
||||
@@ -10,16 +10,12 @@ function sanitizeId(id) {
|
||||
export function checkFile(id, file) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const cmd = buildFileCheckCmd(file)
|
||||
console.log(cmd)
|
||||
// WARNING: This is vulnerable to command injection
|
||||
execFile(
|
||||
'docker',
|
||||
['exec', sanitizeId(id), ...cmd],
|
||||
{ timeout: 1000 },
|
||||
(error, stdout, stderr) => {
|
||||
if (stderr) console.log('error', error)
|
||||
if (stdout) console.log('stdout', stdout)
|
||||
if (error) console.log('error', error)
|
||||
(error) => {
|
||||
const exists = !error
|
||||
if (exists === file.exists) {
|
||||
resolve(true)
|
||||
|
||||
@@ -72,7 +72,6 @@ export default class CommandHandler extends SessionHandler {
|
||||
if (files.length === 0) {
|
||||
return true
|
||||
}
|
||||
console.log('checkFiles', files)
|
||||
try {
|
||||
const checks = await Promise.all(
|
||||
files.map((f) => checkFile(this.session.containerId, f))
|
||||
|
||||
Reference in new issue
Block a user