Chore: minor changes
Some checks failed
Build / Build (push) Has been cancelled
Build / Diff output (push) Has been cancelled
Build / Deploy to Cloudflare Pages (3.114.12) (push) Has been cancelled
Build / Deploy to GitHub and GitLab (push) Has been cancelled

This commit is contained in:
SukkaW 2025-09-30 08:02:57 +08:00
parent 527aa4c533
commit 69e9a73b4b
2 changed files with 20 additions and 17 deletions

View File

@ -12,6 +12,7 @@ import type { VoidOrVoidArray } from './lib/misc';
import picocolors from 'picocolors';
import { tagged as html } from 'foxts/tagged';
import { compareAndWriteFile } from './lib/create-file';
import { appendArrayInPlace } from 'foxts/append-array-in-place';
const priorityOrder: Record<'default' | string & {}, number> = {
LICENSE: 0,
@ -71,14 +72,15 @@ export const buildPublic = task(require.main === module, __filename)(async (span
await Promise.all([
compareAndWriteFile(
span,
[
'/*',
' cache-control: public, max-age=240, stale-while-revalidate=60, stale-if-error=15',
'https://:project.pages.dev/*',
' X-Robots-Tag: noindex',
...Object.keys(priorityOrder)
.map((name) => `/${name}/*\n content-type: text/plain; charset=utf-8\n X-Robots-Tag: noindex`)
],
appendArrayInPlace(
[
'/*',
' cache-control: public, max-age=300, stale-while-revalidate=30, stale-if-error=60',
'https://:project.pages.dev/*',
' X-Robots-Tag: noindex'
],
Object.keys(priorityOrder).map((name) => `/${name}/*\n content-type: text/plain; charset=utf-8\n X-Robots-Tag: noindex`)
),
path.join(PUBLIC_DIR, '_headers')
),
compareAndWriteFile(

View File

@ -5,15 +5,16 @@ import crypto from 'node:crypto';
import { Api, extensions as TgExtensions } from 'telegram';
import { bigint2ip } from 'fast-cidr-tools';
const mtptoto_public_rsa = '-----BEGIN RSA PUBLIC KEY-----\n'
+ 'MIIBCgKCAQEAyr+18Rex2ohtVy8sroGP\n'
+ 'BwXD3DOoKCSpjDqYoXgCqB7ioln4eDCFfOBUlfXUEvM/fnKCpF46VkAftlb4VuPD\n'
+ 'eQSS/ZxZYEGqHaywlroVnXHIjgqoxiAd192xRGreuXIaUKmkwlM9JID9WS2jUsTp\n'
+ 'zQ91L8MEPLJ/4zrBwZua8W5fECwCCh2c9G5IzzBm+otMS/YKwmR1olzRCyEkyAEj\n'
+ 'XWqBI9Ftv5eG8m0VkBzOG655WIYdyV0HfDK/NWcvGqa0w/nriMD6mDjKOryamw0O\n'
+ 'P9QuYgMN0C9xMW9y8SmP4h92OAWodTYgY1hZCxdv6cs5UnW9+PWvS+WIbkh+GaWY\n'
+ 'xwIDAQAB\n'
+ '-----END RSA PUBLIC KEY-----\n';
const mtptoto_public_rsa = `-----BEGIN RSA PUBLIC KEY-----
MIIBCgKCAQEAyr+18Rex2ohtVy8sroGP
BwXD3DOoKCSpjDqYoXgCqB7ioln4eDCFfOBUlfXUEvM/fnKCpF46VkAftlb4VuPD
eQSS/ZxZYEGqHaywlroVnXHIjgqoxiAd192xRGreuXIaUKmkwlM9JID9WS2jUsTp
zQ91L8MEPLJ/4zrBwZua8W5fECwCCh2c9G5IzzBm+otMS/YKwmR1olzRCyEkyAEj
XWqBI9Ftv5eG8m0VkBzOG655WIYdyV0HfDK/NWcvGqa0w/nriMD6mDjKOryamw0O
P9QuYgMN0C9xMW9y8SmP4h92OAWodTYgY1hZCxdv6cs5UnW9+PWvS+WIbkh+GaWY
xwIDAQAB
-----END RSA PUBLIC KEY-----
`;
export function getTelegramBackupIPFromBase64(base64: string) {
// 1. Check base64 size