shell-mirror 1.5.50 → 1.5.52
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/package.json +1 -1
- package/public/app/.htaccess +15 -0
- package/public/php-backend/.htaccess +15 -0
- package/server.js +7 -1
package/package.json
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Disable directory browsing
|
|
2
|
+
Options -Indexes
|
|
3
|
+
|
|
4
|
+
# Require authentication for sensitive app files
|
|
5
|
+
<RequireAll>
|
|
6
|
+
Require valid-user
|
|
7
|
+
</RequireAll>
|
|
8
|
+
|
|
9
|
+
# Security headers
|
|
10
|
+
<IfModule mod_headers.c>
|
|
11
|
+
Header always set X-Content-Type-Options nosniff
|
|
12
|
+
Header always set X-Frame-Options SAMEORIGIN
|
|
13
|
+
Header always set X-XSS-Protection "1; mode=block"
|
|
14
|
+
Header always set Referrer-Policy "strict-origin-when-cross-origin"
|
|
15
|
+
</IfModule>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Disable directory browsing
|
|
2
|
+
Options -Indexes
|
|
3
|
+
|
|
4
|
+
# Prevent access to sensitive files
|
|
5
|
+
<FilesMatch "\.(log|txt|bak|sql|ini|conf)$">
|
|
6
|
+
Order deny,allow
|
|
7
|
+
Deny from all
|
|
8
|
+
</FilesMatch>
|
|
9
|
+
|
|
10
|
+
# Security headers
|
|
11
|
+
<IfModule mod_headers.c>
|
|
12
|
+
Header always set X-Content-Type-Options nosniff
|
|
13
|
+
Header always set X-Frame-Options DENY
|
|
14
|
+
Header always set X-XSS-Protection "1; mode=block"
|
|
15
|
+
</IfModule>
|
package/server.js
CHANGED
|
@@ -28,11 +28,17 @@ const server = http.createServer(app);
|
|
|
28
28
|
const wss = new WebSocket.Server({ server });
|
|
29
29
|
|
|
30
30
|
// --- Session Management ---
|
|
31
|
+
const sessionLifetime = isProduction ? (30 * 24 * 60 * 60 * 1000) : (7 * 24 * 60 * 60 * 1000); // 30 days production, 7 days development
|
|
31
32
|
const sessionParser = session({
|
|
32
33
|
secret: process.env.SESSION_SECRET,
|
|
33
34
|
resave: false,
|
|
34
35
|
saveUninitialized: false,
|
|
35
|
-
cookie: {
|
|
36
|
+
cookie: {
|
|
37
|
+
secure: isProduction,
|
|
38
|
+
maxAge: sessionLifetime,
|
|
39
|
+
httpOnly: true,
|
|
40
|
+
sameSite: 'lax'
|
|
41
|
+
}
|
|
36
42
|
});
|
|
37
43
|
app.use(sessionParser);
|
|
38
44
|
app.use(passport.initialize());
|