feat: log /nudes access

This commit is contained in:
alina 🌸 2024-09-23 16:35:47 +03:00
parent 53321427ce
commit e0c4f059e0
Signed by: teidesu
SSH key fingerprint: SHA256:uNeCpw6aTSU4aIObXLvHfLkDa82HWH9EiOj9AXOIRpI
3 changed files with 11 additions and 1 deletions

View file

@ -91,7 +91,11 @@ export function PageMain(props: {
<div> <div>
- -
{' '} {' '}
<Link href={item.link} target="_blank"> <Link
href={item.link}
target="_blank"
data-astro-prefetch={item.noPrefetch ? 'false' : undefined}
>
{item.title} {item.title}
</Link> </Link>
: :

View file

@ -26,6 +26,7 @@ export const SUBLINKS = [
title: 'nudes', title: 'nudes',
subtitle: '( ͡° ͜ʖ ͡°)', subtitle: '( ͡° ͜ʖ ͡°)',
comment: 'a lot of them, actually', comment: 'a lot of them, actually',
noPrefetch: true,
}, },
{ {
link: '/cheerio/index.html', link: '/cheerio/index.html',

View file

@ -1,6 +1,9 @@
import type { APIRoute } from 'astro' import type { APIRoute } from 'astro'
import { html } from '@mtcute/node'
import { isBotUserAgent } from '~/backend/utils/bot' import { isBotUserAgent } from '~/backend/utils/bot'
import { telegramNotify } from '../backend/bot/notify'
import { getRequestIp } from '../backend/utils/request'
const HTML = ` const HTML = `
<html> <html>
@ -23,6 +26,8 @@ export const GET: APIRoute = async (ctx) => {
}) })
} }
telegramNotify(html`someone (ip ${getRequestIp(ctx)}) got rickrolled >:3`)
return new Response(null, { return new Response(null, {
status: 302, status: 302,
headers: { headers: {