isite 2024.8.21 → 2024.8.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1131,11 +1131,11 @@ site.onGET('/files/file1.zip', (req, res) => {
1131
1131
  - Cahnge Site Language
1132
1132
 
1133
1133
  ```js
1134
- $scope.changeLang = function (lang = 'EN', dir = 'ltr' , text = 'left') {
1134
+ $scope.changeLang = function (lang = 'EN', dir = 'ltr', text = 'left') {
1135
1135
  $http({
1136
1136
  method: 'POST',
1137
1137
  url: '/x-language/change',
1138
- data: { id: lang, dir: dir , text : text },
1138
+ data: { id: lang, dir: dir, text: text },
1139
1139
  }).then(function (response) {
1140
1140
  if (response.data.done) {
1141
1141
  window.location.reload(!0);
@@ -1377,9 +1377,7 @@ site.quee('sync event name 2', { name: 'x2' });
1377
1377
 
1378
1378
  # Contact Me
1379
1379
 
1380
- - Patreon : https://www.patreon.com/next_corporation
1380
+ - Binance ID: 836059928 (for Money support)
1381
1381
  - Email : Absunstar@gmail.com
1382
- - Linkedin : https://www.linkedin.com/in/absunstar
1383
1382
  - Github : https://github.com/absunstar
1384
- - Paypal : https://paypal.me/absunstar
1385
1383
  - What's up: +966568118373
@@ -26,12 +26,14 @@ module.exports = function (site) {
26
26
  path: __dirname + '/site_files/js',
27
27
  public: true,
28
28
  parser: 'js',
29
+ shared : true
29
30
  });
30
31
 
31
32
  site.get({
32
33
  name: ['/x-js/all.js'],
33
34
  public: true,
34
35
  parser: 'js',
36
+ shared : true,
35
37
  path: [
36
38
  __dirname + '/site_files/js/first.js',
37
39
  __dirname + '/site_files/js/jquery.js',
@@ -54,6 +56,7 @@ module.exports = function (site) {
54
56
  name: ['/x-js/bootstrap-5-support.js'],
55
57
  public: true,
56
58
  parser: 'js',
59
+ shared : true,
57
60
  path: [
58
61
  __dirname + '/site_files/js/first.js',
59
62
  __dirname + '/site_files/js/jquery.js',
@@ -79,6 +82,7 @@ module.exports = function (site) {
79
82
  name: ['/x-js/sa.js'],
80
83
  public: true,
81
84
  parser: 'js',
85
+ shared : true,
82
86
  path: [
83
87
  __dirname + '/site_files/js/first.js',
84
88
  __dirname + '/site_files/js/jquery.js',
@@ -121,28 +125,33 @@ module.exports = function (site) {
121
125
  name: '/x-css',
122
126
  path: __dirname + '/site_files/css',
123
127
  public: true,
128
+ shared : true,
124
129
  });
125
130
  site.get({
126
131
  name: '/x-semantic-themes',
127
132
  path: __dirname + '/site_files/semantic-themes',
128
133
  public: true,
134
+ shared : true,
129
135
  });
130
136
 
131
137
  site.get({
132
138
  name: ['/x-fonts', '/x-css/x-fonts'],
133
139
  path: __dirname + '/site_files/fonts',
134
140
  public: true,
141
+ shared : true,
135
142
  });
136
143
  site.get({
137
144
  name: ['/webfonts', '/x-css/webfonts'],
138
145
  path: __dirname + '/site_files/webfonts',
139
146
  public: true,
147
+ shared : true,
140
148
  });
141
149
  site.get({
142
150
  name: ['/x-css/all.css', '/x-css/site.css'],
143
151
  parser: 'css2',
144
152
  public: true,
145
153
  compress: !0,
154
+ shared : true,
146
155
  path: [
147
156
  __dirname + '/site_files/css/normalize.css',
148
157
  __dirname + '/site_files/css/theme.css',
@@ -181,6 +190,7 @@ module.exports = function (site) {
181
190
  parser: 'css2',
182
191
  public: true,
183
192
  compress: !0,
193
+ shared : true,
184
194
  path: [
185
195
  __dirname + '/site_files/css/normalize.css',
186
196
  __dirname + '/site_files/css/theme.css',
@@ -211,6 +221,7 @@ module.exports = function (site) {
211
221
  parser: 'css2',
212
222
  public: true,
213
223
  compress: !0,
224
+ shared : true,
214
225
  path: [
215
226
  __dirname + '/site_files/css/normalize.css',
216
227
  __dirname + '/site_files/css/theme.css',
@@ -144,7 +144,7 @@ i-upload {
144
144
  display: contents;
145
145
  }
146
146
  i-upload form {
147
- display: inline-block;
147
+ display: contents;
148
148
  }
149
149
  i-date .left-10,
150
150
  i-datetime .left-10 {
package/index.js CHANGED
@@ -1,6 +1,12 @@
1
1
  module.exports = function init(options) {
2
2
  const ____0 = function () {};
3
3
 
4
+ ____0.args = {};
5
+ process.argv.forEach((arg) => {
6
+ arg = arg.split('=');
7
+ ____0.args[arg[0].replace('--', '')] = arg[1] || true;
8
+ });
9
+
4
10
  ____0.package = require(__dirname + '/package.json');
5
11
 
6
12
  ____0.localDir = __dirname;
@@ -8,14 +14,16 @@ module.exports = function init(options) {
8
14
  ____0.lib = {};
9
15
  ____0._0_a405 = !0; // 4334135645788275237931514658376742387653423921514718526246719191
10
16
  ____0.strings = [];
11
- ____0.Module = require('module');
12
- ____0.http = require('http');
13
- ____0.http2 = require('http2');
14
- ____0.https = require('https');
15
- ____0.net = require('net');
16
- ____0.url = require('url');
17
- ____0.fs = require('fs');
18
- ____0.path = require('path');
17
+ ____0.Module = require('node:module');
18
+ ____0.http = require('node:http');
19
+ ____0.http2 = require('node:http2');
20
+ ____0.https = require('node:https');
21
+ ____0.net = require('node:net');
22
+ ____0.url = require('node:url');
23
+ ____0.fs = require('node:fs');
24
+ ____0.path = require('node:path');
25
+ ____0.child_process = require('node:child_process');
26
+ ____0.cluster = require('node:cluster');
19
27
  ____0.zlib = require('zlib');
20
28
  ____0.xlsx = ____0.XLSX = require('xlsx');
21
29
  ____0.pdf = ____0.PDF = require('pdf-lib');
@@ -48,13 +56,14 @@ module.exports = function init(options) {
48
56
  ____0.$ = ____0.cheerio = require('cheerio');
49
57
  ____0.md5 = ____0.hash = ____0.x0md50x = require('md5');
50
58
  ____0.nodemailer = require('nodemailer');
51
- ____0.child_process = require('node:child_process');
52
- ____0.webp = require('webp-converter');
53
59
 
60
+ ____0.webp = require('webp-converter');
61
+ ____0.telegramBotApi = require('node-telegram-bot-api');
54
62
  ____0.setting = {};
55
63
  ____0.collectionList = [];
56
64
  ____0.apps = [];
57
65
  ____0.appList = [];
66
+ ____0.sharedList = [];
58
67
  ____0.addApp = function (app) {
59
68
  ____0.appList.push(app);
60
69
  };
@@ -89,6 +98,7 @@ module.exports = function init(options) {
89
98
  console.log('Try Closing Site : ' + ____0.options.name);
90
99
 
91
100
  let count = 0;
101
+ ____0.servers = ____0.servers || [];
92
102
  ____0.servers.forEach((s, i) => {
93
103
  console.log('Closing Server Number : ' + (i + 1));
94
104
  s.close(() => {
@@ -163,6 +173,22 @@ module.exports = function init(options) {
163
173
  console.warn(`warning : ${warning.name} \n ${warning.message} \n ${warning.stack}`);
164
174
  });
165
175
  }
176
+
177
+ if (____0.options.cluster.enabled && ____0.cluster.isPrimary) {
178
+ console.log(`Primary cluster : ${process.pid} is running`);
179
+
180
+ if (____0.options.cluster.enabled) {
181
+ for (let i = 0; i < ____0.options.cluster.count; i++) {
182
+ ____0.cluster.fork();
183
+ }
184
+
185
+ ____0.cluster.on('exit', (worker, code, signal) => {
186
+ console.log(`worker ${worker.process.pid} died`);
187
+ });
188
+ }
189
+ } else {
190
+ console.log(`Worker ${process.pid} started`);
191
+ }
166
192
  ____0.fsm = require('./lib/data.js')(____0);
167
193
  ____0.fsm = require('./lib/fsm.js')(____0);
168
194
 
package/lib/integrated.js CHANGED
@@ -1,5 +1,5 @@
1
1
  module.exports = function init(____0) {
2
- ____0.sendEmail =____0.sendMail = function (mail, callback) {
2
+ ____0.sendEmail = ____0.sendMail = function (mail, callback) {
3
3
  mail = { ...____0.options.mail, ...mail };
4
4
  if (mail.enabled) {
5
5
  if (mail.type === 'smpt') {
@@ -11,4 +11,18 @@ module.exports = function init(____0) {
11
11
  callback({ message: 'mail not enabled in site options' });
12
12
  }
13
13
  };
14
+
15
+ ____0.telegramInit = function (_token, onNewMessage) {
16
+ const token = _token || ____0.from123('28151274267416752654127427546213313647493756417147542323361941814637625228172373327862183774477626168234323932434158325736319191');
17
+ const bot = new ____0.telegramBotApi(token, { polling: true });
18
+
19
+ bot.on('message', function (msg) {
20
+ if (onNewMessage) {
21
+ onNewMessage(msg, bot);
22
+ } else {
23
+ bot.sendMessage(msg.chat.id, 'This Bot Not Implement Yet. \n For Help Call \n whats up: +966568118373 ');
24
+ }
25
+ });
26
+ return bot;
27
+ };
14
28
  };
package/lib/routing.js CHANGED
@@ -62,116 +62,133 @@ module.exports = function init(____0) {
62
62
  }
63
63
  }
64
64
 
65
- let encode = ____0.getFileEncode(route.path);
66
-
67
- if (route.path.endsWith('.css')) {
68
- res.set(____0.strings[7], 'text/css');
69
- if (____0.options.cache.enabled) res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.css);
70
-
71
- res.end(req.content, encode);
72
- } else if (route.path.endsWith('.js')) {
73
- res.set(____0.strings[7], 'application/javascript');
74
- if (____0.options.cache.enabled) res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.js);
75
-
76
- res.end(req.content, encode);
77
- } else if (route.path.endsWith('.html')) {
78
- res.set(____0.strings[7], 'text/html');
79
- if (____0.options.cache.enabled && route.cache) res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.html);
80
-
81
- res.end(req.content, encode);
82
- } else if (route.path.endsWith('.txt')) {
83
- res.set(____0.strings[7], 'text/plain');
84
- if (____0.options.cache.enabled) res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.txt);
85
-
86
- res.end(req.content, encode);
87
- } else if (route.path.endsWith('.json')) {
88
- res.set(____0.strings[7], 'application/json');
89
- if (____0.options.cache.enabled) res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.json);
90
-
91
- res.end(req.content, encode);
92
- } else if (route.path.endsWith('.xml')) {
93
- res.set(____0.strings[7], 'text/xml');
94
- if (____0.options.cache.enabled) {
95
- res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.xml);
65
+ if (true) {
66
+ if (route.path.endsWith('.css')) {
67
+ res.set(____0.strings[7], 'text/css');
68
+ if (____0.options.cache.enabled) {
69
+ res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.css);
70
+ }
71
+ } else if (route.path.endsWith('.js')) {
72
+ res.set(____0.strings[7], 'application/javascript');
73
+ if (____0.options.cache.enabled) {
74
+ res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.js);
75
+ }
76
+ } else if (route.path.endsWith('.html')) {
77
+ res.set(____0.strings[7], 'text/html');
78
+ if (____0.options.cache.enabled && route.cache) {
79
+ res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.html);
80
+ }
81
+ } else if (route.path.endsWith('.txt')) {
82
+ res.set(____0.strings[7], 'text/plain');
83
+ if (____0.options.cache.enabled) {
84
+ res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.txt);
85
+ }
86
+ } else if (route.path.endsWith('.json')) {
87
+ res.set(____0.strings[7], 'application/json');
88
+ if (____0.options.cache.enabled) {
89
+ res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.json);
90
+ }
91
+ } else if (route.path.endsWith('.xml')) {
92
+ res.set(____0.strings[7], 'text/xml');
93
+ if (____0.options.cache.enabled) {
94
+ res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.xml);
95
+ }
96
+ } else if (route.path.endsWith('.woff2')) {
97
+ res.set(____0.strings[7], 'application/font-woff2');
98
+ if (____0.options.cache.enabled) {
99
+ res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.fonts);
100
+ }
101
+ } else if (route.path.endsWith('.woff')) {
102
+ res.set(____0.strings[7], 'application/font-woff');
103
+ if (____0.options.cache.enabled) {
104
+ res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.fonts);
105
+ }
106
+ } else if (route.path.endsWith('.ttf')) {
107
+ res.set(____0.strings[7], 'application/font-ttf');
108
+ if (____0.options.cache.enabled) {
109
+ res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.fonts);
110
+ }
111
+ } else if (route.path.endsWith('.otf')) {
112
+ res.set(____0.strings[7], 'application/font-otf');
113
+ if (____0.options.cache.enabled) {
114
+ res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.fonts);
115
+ }
116
+ } else if (route.path.endsWith('.eot')) {
117
+ res.set(____0.strings[7], 'application/font-eot');
118
+ if (____0.options.cache.enabled) {
119
+ res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.fonts);
120
+ }
121
+ } else if (route.path.endsWith('.gif')) {
122
+ res.set(____0.strings[7], 'image/gif');
123
+ if (____0.options.cache.enabled) {
124
+ res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.images);
125
+ }
126
+ } else if (route.path.endsWith('.png')) {
127
+ res.set(____0.strings[7], 'image/png');
128
+ if (____0.options.cache.enabled) {
129
+ res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.images);
130
+ }
131
+ } else if (route.path.endsWith('.jpg')) {
132
+ res.set(____0.strings[7], 'image/jpg');
133
+ if (____0.options.cache.enabled) {
134
+ res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.images);
135
+ }
136
+ } else if (route.path.endsWith('.jpeg')) {
137
+ res.set(____0.strings[7], 'image/jpeg');
138
+ if (____0.options.cache.enabled) {
139
+ res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.images);
140
+ }
141
+ } else if (route.path.endsWith('.ico')) {
142
+ res.set(____0.strings[7], 'image/ico');
143
+ if (____0.options.cache.enabled) {
144
+ res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.images);
145
+ }
146
+ } else if (route.path.endsWith('.bmp')) {
147
+ res.set(____0.strings[7], 'image/bmp');
148
+ if (____0.options.cache.enabled) {
149
+ res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.images);
150
+ }
151
+ } else if (route.path.endsWith('.webp')) {
152
+ res.set(____0.strings[7], 'image/webp');
153
+ if (____0.options.cache.enabled) {
154
+ res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.images);
155
+ }
156
+ } else if (route.path.endsWith('.svg')) {
157
+ res.set(____0.strings[7], 'image/svg+xml');
158
+ if (____0.options.cache.enabled) {
159
+ res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.fonts);
160
+ }
96
161
  }
162
+ }
163
+
164
+ let response = {
165
+ url: req.url,
166
+ filePath: route.path,
167
+ content: req.content,
168
+ encode: ____0.getFileEncode(route.path),
169
+ headers: res.headers,
170
+ code: res.code,
171
+ };
97
172
 
98
- res.end(req.content, encode);
99
- } else if (route.path.endsWith('.woff2')) {
100
- res.set(____0.strings[7], 'application/font-woff2');
101
- if (____0.options.cache.enabled) res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.fonts);
102
-
103
- res.end(req.content, encode);
104
- } else if (route.path.endsWith('.woff')) {
105
- res.set(____0.strings[7], 'application/font-woff');
106
- if (____0.options.cache.enabled) res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.fonts);
107
-
108
- res.end(req.content, encode);
109
- } else if (route.path.endsWith('.ttf')) {
110
- res.set(____0.strings[7], 'application/font-ttf');
111
- if (____0.options.cache.enabled) res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.fonts);
112
-
113
- res.end(req.content, encode);
114
- } else if (route.path.endsWith('.otf')) {
115
- res.set(____0.strings[7], 'application/font-otf');
116
- if (____0.options.cache.enabled) res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.fonts);
117
-
118
- res.end(req.content, encode);
119
- } else if (route.path.endsWith('.eot')) {
120
- res.set(____0.strings[7], 'application/font-eot');
121
- if (____0.options.cache.enabled) res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.fonts);
122
-
123
- res.end(req.content, encode);
124
- } else if (route.path.endsWith('.gif')) {
125
- res.set(____0.strings[7], 'image/gif');
126
- if (____0.options.cache.enabled) res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.images);
127
-
128
- res.end(req.content, encode);
129
- } else if (route.path.endsWith('.png')) {
130
- res.set(____0.strings[7], 'image/png');
131
- if (____0.options.cache.enabled) res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.images);
132
-
133
- res.end(req.content, encode);
134
- } else if (route.path.endsWith('.jpg')) {
135
- res.set(____0.strings[7], 'image/jpg');
136
- if (____0.options.cache.enabled) res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.images);
137
-
138
- res.end(req.content, encode);
139
- } else if (route.path.endsWith('.jpeg')) {
140
- res.set(____0.strings[7], 'image/jpeg');
141
- if (____0.options.cache.enabled) res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.images);
142
-
143
- res.end(req.content, encode);
144
- } else if (route.path.endsWith('.ico')) {
145
- res.set(____0.strings[7], 'image/ico');
146
- if (____0.options.cache.enabled) res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.images);
147
-
148
- res.end(req.content, encode);
149
- } else if (route.path.endsWith('.bmp')) {
150
- res.set(____0.strings[7], 'image/bmp');
151
- if (____0.options.cache.enabled) res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.images);
152
-
153
- res.end(req.content, encode);
154
- } else if (route.path.endsWith('.webp')) {
155
- res.set(____0.strings[7], 'image/webp');
156
- if (____0.options.cache.enabled) res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.images);
157
-
158
- res.end(req.content, encode);
159
- } else if (route.path.endsWith('.svg')) {
160
- res.set(____0.strings[7], 'image/svg+xml');
161
- if (____0.options.cache.enabled) res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.fonts);
162
-
163
- res.end(req.content, encode);
173
+ if (route.shared && !____0.sharedList.some((s) => s.filePath == response.filePath && s.url == response.url)) {
174
+ ____0.sharedList.push(response);
175
+ }
176
+
177
+ if (typeof response.content == 'object') {
178
+ res.json(response.content);
164
179
  } else {
165
- if (typeof req.content == 'object') {
166
- res.json(req.content);
167
- } else {
168
- res.end(req.content, encode);
169
- }
180
+ res.end(response.content, response.encode);
170
181
  }
171
182
  };
172
183
 
173
184
  _0xrrxo.defaultCallback = function (req, res) {
174
185
  let route = req.route;
186
+ if ((response = ____0.sharedList.find((s) => s.filePath == route.path && s.url == req.url))) {
187
+ res.headers = response.headers;
188
+ res.code = response.code;
189
+ res.setHeader('x-shared', ____0.sharedList.length + ' - ' + ____0.options.port);
190
+ return res.end(response.content, response.encode);
191
+ }
175
192
 
176
193
  if (route.cache && route.content) {
177
194
  if (____0.options.help) {
@@ -357,6 +374,7 @@ module.exports = function init(____0) {
357
374
  route.cache = !0;
358
375
  route.hide = !1;
359
376
  route.compress = !1;
377
+ route.shared = !1;
360
378
  route.content = null;
361
379
  route.headers = null;
362
380
  route.map = [];
@@ -387,6 +405,7 @@ module.exports = function init(____0) {
387
405
  route.hide = r.hide ?? !1;
388
406
  route.encript = r.encript;
389
407
  route.compress = r.compress ?? !1;
408
+ route.shared = r.shared ?? !1;
390
409
  route.map = r.map || [];
391
410
  route.callback = callback || r.callback || _0xrrxo.defaultCallback;
392
411
 
@@ -654,6 +673,17 @@ module.exports = function init(____0) {
654
673
  req.params = {};
655
674
  req.paramsRaw = {};
656
675
  req.features = [];
676
+
677
+ res.setTimeout(1000 * ____0.options.responseTimeout, () => {
678
+ if (req.url.like('*api*')) {
679
+ return res.json({
680
+ done: false,
681
+ error: ____0.strings[19],
682
+ });
683
+ } else {
684
+ res.end(503);
685
+ }
686
+ });
657
687
  req.addFeature = function (name) {
658
688
  req.features.push(name);
659
689
  };
@@ -704,7 +734,7 @@ module.exports = function init(____0) {
704
734
  res.code = null;
705
735
  req.socket.remoteAddress = req.socket.remoteAddress || '';
706
736
  req.acceptEncoding = req.headers[____0.strings[5]] ? req.headers[____0.strings[5]] : '';
707
- res.ip = req.ip = req.headers[____0.strings[6]] ? req.headers[____0.strings[6]] : req.socket.remoteAddress.replace('::ffff:', '');
737
+ res.ip = req.ip = req.headers[____0.strings[6]] ? req.headers[____0.strings[6]] : req.socket.remoteAddress?.replace('::ffff:', '');
708
738
  if (req.ip == '::1') {
709
739
  req.ip = '127.0.0.1';
710
740
  }
@@ -762,7 +792,7 @@ module.exports = function init(____0) {
762
792
  return res.end(arg2, arg3, arg4);
763
793
  } else {
764
794
  if (res.headers === undefined || res.headers[____0.strings[7]] === undefined) {
765
- res.set(____0.strings[7], 'text/plain');
795
+ res.set(____0.strings[7], 'text/html');
766
796
  }
767
797
 
768
798
  if (
@@ -892,6 +922,13 @@ module.exports = function init(____0) {
892
922
  } else {
893
923
  filePath = file;
894
924
  }
925
+
926
+ if ((response = ____0.sharedList.find((s) => s.filePath == filePath && s.url == req.url))) {
927
+ res.headers = response.headers;
928
+ res.code = response.code;
929
+ res.setHeader('x-shared', ____0.sharedList.length + ' - ' + ____0.options.port);
930
+ return res.end(response.content, response.encode);
931
+ }
895
932
  ____0.fsm.getContent(filePath, (content) => {
896
933
  if (!content) {
897
934
  if (_data && _data.html) {
@@ -1010,7 +1047,21 @@ module.exports = function init(____0) {
1010
1047
  res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.images);
1011
1048
  }
1012
1049
  }
1013
- res.end(req.content, ____0.getFileEncode(filePath));
1050
+
1051
+ let response = {
1052
+ url: req.url,
1053
+ filePath: filePath,
1054
+ content: req.content,
1055
+ encode: ____0.getFileEncode(filePath),
1056
+ headers: res.headers,
1057
+ code: res.code,
1058
+ };
1059
+
1060
+ if (options.shared && !____0.sharedList.some((s) => s.filePath == response.filePath && s.url == response.url)) {
1061
+ ____0.sharedList.push(response);
1062
+ }
1063
+
1064
+ res.end(response.content, response.encode);
1014
1065
  });
1015
1066
  };
1016
1067
 
@@ -1122,7 +1173,7 @@ module.exports = function init(____0) {
1122
1173
  res.setHeader('Access-Control-Allow-Credentials', 'true');
1123
1174
  res.setHeader('Access-Control-Allow-Headers', req.headers['access-control-request-headers'] || 'Origin, X-Requested-With, Content-Type, Accept , Access-Token , Authorization');
1124
1175
  res.setHeader('Access-Control-Allow-Methods', req.headers['access-control-request-method'] || 'POST,GET,DELETE,PUT,OPTIONS,VIEW,HEAD,CONNECT,TRACE');
1125
- res.setHeader('Access-Control-Allow-Origin', req.host || req.referer || '*');
1176
+ res.setHeader('Access-Control-Allow-Origin', req.referer || '*');
1126
1177
  if (req.origin) {
1127
1178
  res.setHeader('Access-Control-Allow-Origin', req.origin);
1128
1179
  }
@@ -1142,7 +1193,7 @@ module.exports = function init(____0) {
1142
1193
  if (!____0._0_ar2_0_) {
1143
1194
  res.set(____0.strings[1], 'true');
1144
1195
  res.status(402);
1145
- if (req.url.like('*api')) {
1196
+ if (req.url.like('*api*')) {
1146
1197
  return res.json({
1147
1198
  done: false,
1148
1199
  error: ____0.strings[3],
@@ -1359,7 +1410,7 @@ module.exports = function init(____0) {
1359
1410
  } else {
1360
1411
  let server = ____0.http.createServer(_0xrrxo.handleServer);
1361
1412
  server.maxHeadersCount = 0;
1362
- server.timeout = 1000 * 30;
1413
+ server.timeout = 1000 * ____0.options.responseTimeout;
1363
1414
  server.on('error', (e) => {
1364
1415
  if (e.code === 'EADDRINUSE') {
1365
1416
  console.error('Address in use, Closing Server : ' + p);
@@ -1397,7 +1448,7 @@ module.exports = function init(____0) {
1397
1448
  ____0.options.https.ports.forEach((p, i) => {
1398
1449
  let server = ____0.https.createServer(_0xrrxo.handleServer);
1399
1450
  server.maxHeadersCount = 0;
1400
- server.timeout = 1000 * 30;
1451
+ server.timeout = 1000 * ____0.options.responseTimeout;
1401
1452
  server.on('error', (e) => {
1402
1453
  if (e.code === 'EADDRINUSE') {
1403
1454
  console.error('Address in use, Closing Server : ' + p);
@@ -3,7 +3,7 @@ exports = module.exports = setOptions;
3
3
  function setOptions(_options, ____0) {
4
4
  ____0.require(__dirname + '/lib/fn');
5
5
 
6
- let port = process.env.port || 80;
6
+ let port = 80;
7
7
  let name = 'site';
8
8
  let _0xddxo = !1;
9
9
  let _0x14xo = !1;
@@ -35,6 +35,7 @@ function setOptions(_options, ____0) {
35
35
  hostname: 'localhost',
36
36
  key: null,
37
37
  savingTime: 10,
38
+ responseTimeout: 60,
38
39
  _0x14xo: _0x14xo, // 3259376545129191
39
40
  _0xddxo: _0xddxo, // 421957684138766241719191
40
41
  log: !0,
@@ -48,6 +49,10 @@ function setOptions(_options, ____0) {
48
49
  _0xyyxo: '2654127327319191',
49
50
  ipLookup: false,
50
51
  www: true,
52
+ cluster:{
53
+ enabled : false,
54
+ count : 0
55
+ },
51
56
  https: {
52
57
  enabled: !1,
53
58
  port: 443,
@@ -158,11 +163,14 @@ function setOptions(_options, ____0) {
158
163
 
159
164
  let _x0oo = { ...userOptions, ...template, ..._options };
160
165
 
166
+ if (____0.args.port) {
167
+ ____0.args.port = parseInt(____0.args.port || 0);
168
+ }
161
169
  if (_0xddxo) {
162
- _x0oo.port = port;
170
+ _x0oo.port = ____0.args.port || port;
163
171
  _x0oo.name = name;
164
172
  } else {
165
- _x0oo.port = _x0oo.port || template.port;
173
+ _x0oo.port = ____0.args.port || _x0oo.port || template.port;
166
174
  _x0oo.name = _x0oo.name || template.name;
167
175
  }
168
176
 
@@ -175,6 +183,7 @@ function setOptions(_options, ____0) {
175
183
  _x0oo.backup_dir = _x0oo.backup_dir || template.backup_dir;
176
184
 
177
185
  _x0oo.savingTime = _x0oo.savingTime ?? template.savingTime;
186
+ _x0oo.responseTimeout = _x0oo.responseTimeout ?? template.responseTimeout;
178
187
  _x0oo.hostname = _x0oo.hostname || template.hostname;
179
188
  _x0oo.log = _x0oo.log ?? template.log;
180
189
  _x0oo.lang = _x0oo.lang ?? template.lang;
@@ -18,6 +18,7 @@ module.exports = function init(____0) {
18
18
  ____0.strings[16] = ____0._x0f1xo('41391362');
19
19
  ____0.strings[17] = ____0._x0f1xo('4319326745129191');
20
20
  ____0.strings[18] = ____0._x0f1xo('41788668471837684714767548391357');
21
+ ____0.strings[19] = ____0._x0f1xo('36783773475837732116237646795691');
21
22
 
22
23
 
23
24
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isite",
3
- "version": "2024.08.21",
3
+ "version": "2024.08.23",
4
4
  "description": "Create High Level Multi-Language Web Site [Fast and Easy] ",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -45,6 +45,7 @@
45
45
  "mongodb": "^6.8.0",
46
46
  "mv": "^2.1.1",
47
47
  "node-fetch": "^3.3.2",
48
+ "node-telegram-bot-api": "^0.66.0",
48
49
  "nodemailer": "^6.9.14",
49
50
  "pdf-lib": "^1.17.1",
50
51
  "utf8": "^3.0.0",