5const BLOB_KEY = "seen_cves";
6
7async function checkNewVulnerabilities() {
8 const response = await fetch(KEV_URL);
9 const data = await response.json();
30}
31
32export default async function kevCron() {
33 return await checkNewVulnerabilities();
34}
1export default async function server(request: Request): Promise<Response> {
2 try {
3 const response = await fetch("https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json");
3const RSS_FEED_URL = "https://hrbrmstr-cisakevtorss.web.val.run"; // Update this to your actual RSS feed URL
4
5function escapeXML(str: string): string {
6 return str.replace(/&/g, "&")
7 .replace(/</g, "<")
11}
12
13function removeInvalidXMLChars(str: string): string {
14 return str
15 .replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g, "") // Control characters
19}
20
21function generateRSS(data: any): string {
22 const { title, catalogVersion, dateReleased, vulnerabilities } = data;
23
68}
69
70export async function handler(req: Request): Promise<Response> {
71 try {
72 const response = await fetch(CISA_JSON_URL);
12 * The email address(es) to send the email to. Only available to Val Town Pro subscribers.
13 * Can be a single string, IAddress object, or an array of strings/IAddress objects.
14 * @default the email of the logged user calling this function.
15 */
16 to?: (IAddress | string)[] | IAddress | string;
5import { refs } from "https://esm.town/v/stevekrouse/refs?v=11";
6
7type CronFunction = (interval: Interval) => Promise<void>;
8
9export const cronEvalLogger = (cron: CronFunction): CronFunction => {
10 let interval: Interval;
11 const cronProxy = new Proxy(cron, {
9});
10
11export default async function handler(request: Request) {
12 if (request.method !== "POST") {
13 return html(`
4import { DateTime } from "npm:luxon";
5
6async function getLatestCommit(ghUser: string, ghRepo: string, branch: string, client: Octokit)
7{
8 const { data: refData } = await client.rest.git.getRef({
15}
16
17async function createNewTree(
18 ghUser: string,
19 ghRepo: string,
40}
41
42async function createNewCommit(
43 ghUser: string,
44 ghRepo: string,
60}
61
62async function updateBranchRef(
63 owner: string,
64 repo: string,
92 */
93
94export async function valToGH(
95 repo: string, // owner/repo
96 val: string | string[], // user/val
2import { sqlite } from "https://esm.town/v/std/sqlite";
3
4function generateInsertStatements(
5 tableName: string,
6 columns: string[],
20}
21
22export async function sqliteDump(
23 tables?: string[],
24 callback?: (result: string) => string | void | Promise<void>,
56};
57
58export default async function(req: Request): Promise<Response> {
59 const JSDOM = jsdom.JSDOM;
60 const url = new URL(req.url);
77
78 <script>
79 document.getElementById('nameForm').onsubmit = function(event) {
80 event.preventDefault();
81 const targetURL = document.getElementById("name").value
1import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
2
3export async function listSqliteTables() {
4 return (await sqlite.execute(
5 `select name from sqlite_schema where type='table' and name != 'libsql_wasm_func_table' and name != 'sqlite_sequence'`,