mirror of
https://github.com/CFC-Servers/cfc_cl_http_whitelist.git
synced 2025-03-04 03:03:18 -05:00
only respective configs if starfall or mediaplayer is on the server (#35)
* only respective configs if starfall or mediaplayer is on the server * check for addon existence by entity file
This commit is contained in:
parent
609f7ea083
commit
74f9be20b2
12
lua/cfc_http_restrictions/configs/media_player.lua
Normal file
12
lua/cfc_http_restrictions/configs/media_player.lua
Normal file
@ -0,0 +1,12 @@
|
||||
if not file.Exists("entities/mediaplayer_tv", "LUA") then return end
|
||||
|
||||
AddCSLuaFile()
|
||||
|
||||
local config = {
|
||||
version = "1",
|
||||
addresses = {
|
||||
["samuelmaddock.github.io"] = { allowed = true },
|
||||
}
|
||||
}
|
||||
|
||||
return config
|
12
lua/cfc_http_restrictions/configs/starfallex.lua
Normal file
12
lua/cfc_http_restrictions/configs/starfallex.lua
Normal file
@ -0,0 +1,12 @@
|
||||
if not file.Exists("entities/starfall_processor", "LUA") then return end
|
||||
|
||||
AddCSLuaFile()
|
||||
|
||||
local config = {
|
||||
version = "1",
|
||||
addresses = {
|
||||
["thegrb93.github.io"] = { allowed = true },
|
||||
}
|
||||
}
|
||||
|
||||
return config
|
@ -1,6 +1,6 @@
|
||||
AddCSLuaFile()
|
||||
|
||||
---@alias WhitelistAddressOption { allowed: boolean|nil, noisy: boolean|nil, permanent: boolean|nil }
|
||||
---@alias WhitelistAddressOption { allowed: boolean|nil, noisy: boolean|nil, permanent: boolean|nil, pattern: boolean|nil }
|
||||
|
||||
---@class WhitelistConfig
|
||||
---@field version string
|
||||
@ -34,7 +34,6 @@ local config = {
|
||||
|
||||
["api.github.com"] = { allowed = true },
|
||||
["github.com"] = { allowed = true },
|
||||
["thegrb93.github.io"] = { allowed = true },
|
||||
|
||||
-- dropbox
|
||||
["dl.dropboxusercontent.com"] = { allowed = true },
|
||||
@ -92,9 +91,6 @@ local config = {
|
||||
["(%w+)%.keybase.pub"] = { allowed = true, pattern = true },
|
||||
["tts.cyzon.us"] = { allowed = true },
|
||||
|
||||
-- media player
|
||||
["samuelmaddock.github.io"] = { allowed = true },
|
||||
|
||||
["wiki.garrysmod.com"] = { allowed = true },
|
||||
["en.wikipedia.org"] = { allowed = true },
|
||||
["developer.mozilla.org"] = { allowed = true },
|
||||
|
@ -13,7 +13,9 @@ function CFCHTTP.loadLuaConfigs( dir )
|
||||
local files = file.Find( dir .. "*.lua", "LUA" )
|
||||
for _, fil in pairs( files ) do
|
||||
local newConfig = include( dir .. fil )
|
||||
CFCHTTP.config = CFCHTTP.mergeConfigs( CFCHTTP.config, newConfig )
|
||||
if newConfig then
|
||||
CFCHTTP.config = CFCHTTP.mergeConfigs( CFCHTTP.config, newConfig )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user