This commit is contained in:
2025-12-06 18:48:46 +08:00
parent d614cf12d1
commit fe7863fbb8
9 changed files with 316 additions and 45 deletions

View File

@@ -16,6 +16,9 @@ export const bannedUserNames = [
"backup", // 备份相关
"backups", // 备份相关
"tmp", // 临时相关
"var", // 变量相关
"www", // 网站相关
"app", // 应用相关
]
/**
@@ -40,5 +43,20 @@ export const appIsBanned = (appname: string): boolean => {
if (appname.endsWith('.')) {
return true;
}
return false;
}
export const userPathIsBanned = (appname: string): boolean => {
if (appname.startsWith('.')) {
return true;
}
if (appname.endsWith('.')) {
return true;
}
const bans = ['.php', '.json', '.yml', '.db', '.env', '.backup', 'database.sql', 'db.sql', 'backup.zip',];
if (bans.some(ban => appname.includes(ban))) {
return true;
}
return false;
}