Skip to content

Commit 2c5713d

Browse files
committed
Whitelist improvements & Add moonbase alpha tts
* Added tts.cyzon.us to the whitelist * Allow www. as a prefix to all urls
1 parent 00e0b42 commit 2c5713d

2 files changed

Lines changed: 26 additions & 18 deletions

File tree

WHITELIST.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ This is the default whitelist that webaudio will abide by unless a ``webaudio_wh
2828
| Gitlab | ✔️ | gitlab.com | Gitlab content | 🚧 |
2929
| Onedrive || onedrive.live.com | Onedrive content | 🚧 |
3030
| Mattjeanes ytdl || youtubedl.mattjeanes.com | Ytdl host by mattjeanes https://github.com/MattJeanes/YouTubeDL | 🚧 |
31-
| MyInstants | ✔️ | myinstants.com | Sound effects | https://myinstants.com/media/sounds/taco-bell-bong-sfx.mp3 |
31+
| MyInstants | ✔️ | myinstants.com | Sound effects | https://myinstants.com/media/sounds/taco-bell-bong-sfx.mp3 |
32+
| Moonbase Alpha TTS | ✔️ | tts.cyzon.us | TTS almost identical to moonbase alpha's | https://tts.cyzon.us/tts?text=bruh |

lua/autorun/webaudio.lua

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -412,21 +412,24 @@ local function pattern(str) return { str, true } end
412412
local function simple(str) return { string.PatternSafe(str), false } end
413413
local registers = { ["pattern"] = pattern, ["simple"] = simple }
414414

415-
-- Inspired / Taken from StarfallEx & Metastruct/gurl
416-
-- No blacklist for now, just don't whitelist anything that has weird other routes.
417-
418-
--- Note #1 (For PR Help)
419-
-- Sites cannot track users / do any scummy shit with your data unless they're a massive corporation that you really can't avoid anyways.
420-
-- So don't think about PRing your own website
421-
-- Also these have to do with audio since this is an audio based addon.
422-
423-
--- Note #2
424-
-- Create a file called webaudio_whitelist.txt in your data folder to overwrite this, works on the server box or on your client.
425-
-- Example file might look like this:
426-
-- ```
427-
-- pattern %w+%.sndcdn%.com
428-
-- simple translate.google.com
429-
-- ```
415+
--[[
416+
Inspired / Taken from StarfallEx & Metastruct/gurl
417+
No blacklist for now, just don't whitelist anything that has any possible redir routes.
418+
419+
## Guidelines
420+
Sites cannot track users / do any scummy shit with your data unless they're a massive corporation that you really can't avoid anyways.
421+
So don't think about PRing your own website
422+
Also these have to do with audio since this is an audio based addon.
423+
424+
## Custom whitelist
425+
Create a file called webaudio_whitelist.txt in your data folder to overwrite this, works on the server box or on your client.
426+
Example file might look like this:
427+
```
428+
pattern %w+%.sndcdn%.com
429+
simple translate.google.com
430+
```
431+
]]--
432+
430433
local Whitelist = {
431434
-- Soundcloud
432435
pattern [[%w+%.sndcdn%.com/.+]],
@@ -471,7 +474,10 @@ local Whitelist = {
471474
simple [[youtubedl.mattjeanes.com]],
472475

473476
-- MyInstants
474-
simple [[myinstants.com]]
477+
simple [[myinstants.com]],
478+
479+
-- TTS like moonbase alpha's
480+
simple [[tts.cyzon.us]]
475481
}
476482

477483
local OriginalWhitelist = table.Copy(Whitelist)
@@ -561,8 +567,9 @@ end
561567

562568
local function isWhitelistedURL(url)
563569
if not isstring(url) then return false end
570+
url = url:Trim()
564571

565-
local relative = url:match("^https?://(.*)")
572+
local relative = url:match("^https?://www%.(.*)") or url:match("^https?://(.*)")
566573
if not relative then return false end
567574

568575
if CLIENT and CustomWhitelist then

0 commit comments

Comments
 (0)