Skip to content

Commit fe94655

Browse files
authored
chore: disable link creation (#34)
2 parents 5cdb9cb + 6e57b78 commit fe94655

File tree

6 files changed

+48
-38
lines changed

6 files changed

+48
-38
lines changed

src/routes/api/v2/link.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { LinkStatus } from "@prisma/client"
22
import { Static, Type } from "@sinclair/typebox"
33
import { FastifyInstance } from "fastify"
4-
import { NotFound, Unauthorized } from "http-errors"
4+
import { MethodNotAllowed, NotFound, Unauthorized } from "http-errors"
55

66
import env from "@/config/env"
77
import prisma from "@/config/prisma"
@@ -48,13 +48,16 @@ async function link (fastify: FastifyInstance): Promise<void> {
4848
body: GenerateOptions
4949
}
5050
}, async request => {
51+
throw new MethodNotAllowed("Link generation has been disabled.")
52+
/*
5153
const options = request.body
5254
const dbResponse = await shorten(options)
5355
5456
// Report the link creation, discard any errors
5557
void makeLinkReport(dbResponse, request.headers["user-agent"])
5658
5759
return dbResponse
60+
*/
5861
})
5962

6063
// GET request to /link/:link, return information on the provided link

src/routes/index.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ async function routes (fastify: FastifyInstance): Promise<void> {
6565

6666
if (bot) {
6767
switch (linkData.metadata) {
68-
// case MetadataHandling.OWOIFY: {
69-
// const owoified = await owoifyMetadata(linkData.destination)
70-
// if (owoified != null) {
71-
// reply.type("text/html")
72-
// return owoified
73-
// }
74-
// break
75-
// }
68+
case MetadataHandling.OWOIFY: {
69+
const owoified = await owoifyMetadata(linkData.destination)
70+
if (owoified != null) {
71+
reply.type("text/html")
72+
return owoified
73+
}
74+
break
75+
}
7676
case MetadataHandling.IGNORE: {
7777
reply.status(204)
7878
return

src/util/owoifier.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export async function owoifyMetadata (url: string): Promise<string | null> {
7171
const result = `<html><head>${cheerio.html(metaTags)}</head><body></body></html>`
7272

7373
// Cache the result for future use
74-
await redis.set(`metacache:${url}`, result, "EX", 10 * 60) // Expire after ten minutes
74+
await redis.set(`metacache:${url}`, result, "EX", 60 * 60 * 24 * 7) // Expire after a week
7575

7676
return result
7777
}

static/api.html

+8
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@
1313
<h1 id="header"><a href="/">owo</a></h1>
1414
<h2 id="subtitle">API Docs</h2>
1515
<div class="documentation">
16+
<h3>Notice</h3>
17+
<p>
18+
The owo.vc link generation API has been disabled until further notice due
19+
to abuse and overwhelming amounts of spam. It became no longer feasible to
20+
continue running the service for the small amount of legitimate users that
21+
exist. The original API documentation exists below.
22+
</p>
23+
<hr>
1624
<p>
1725
The owo.vc API is allowed for programmatic use to anyone free of charge.
1826
Abuse of the API can and will lead to access being revoked. It is

static/changelog.html

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
<h1 id="header"><a href="/">owo</a></h1>
1414
<h2 id="subtitle">Changelog</h2>
1515
<div class="documentation">
16+
<h3 id="2025-03-23">2025-03-23</h3>
17+
<p>
18+
Due to abuse, the link generation API has been disabled indefinitely.
19+
</p>
1620
<h3 id="2023-11-12">2023-11-12</h3>
1721
<p>
1822
The <code>/generate</code> and <code>/info</code> endpoints have been removed after several extensions were made to

static/index.html

+23-28
Original file line numberDiff line numberDiff line change
@@ -12,37 +12,32 @@
1212
<body>
1313
<h1 id="header"><a href="/">owo</a></h1>
1414
<h2 id="subtitle">A simple link obfuscator</h2>
15-
<div class="link-form">
16-
<select name="generator" id="generator">
17-
<option value="owo">owo</option>
18-
<option value="gay">gay</option>
19-
<option value="zws">zws</option>
20-
<option value="sketchy">sketchy</option>
21-
</select>
22-
<div id="input-wrapper">
23-
<button type="button" id="input-copy-btn" aria-label="Copy">
24-
<svg role="img" aria-hidden="true" viewBox="0 0 40 40">
25-
<path fill="currentColor"
26-
d="M 7.5 36.625 C 6.832031 36.625 6.25 36.375 5.75 35.875 C 5.25 35.375 5 34.792969 5 34.125 L 5 9 L 7.5 9 L 7.5 34.125 L 27.25 34.125 L 27.25 36.625 Z M 12.5 31.625 C 11.832031 31.625 11.25 31.375 10.75 30.875 C 10.25 30.375 10 29.792969 10 29.125 L 10 5.792969 C 10 5.125 10.25 4.542969 10.75 4.042969 C 11.25 3.542969 11.832031 3.292969 12.5 3.292969 L 30.832031 3.292969 C 31.5 3.292969 32.082031 3.542969 32.582031 4.042969 C 33.082031 4.542969 33.332031 5.125 33.332031 5.792969 L 33.332031 29.125 C 33.332031 29.792969 33.082031 30.375 32.582031 30.875 C 32.082031 31.375 31.5 31.625 30.832031 31.625 Z M 12.5 29.125 L 30.832031 29.125 L 30.832031 5.792969 L 12.5 5.792969 Z M 12.5 29.125 L 12.5 5.792969 Z M 12.5 29.125 "/>
27-
</svg>
28-
</button>
29-
<input id="input" type="text" placeholder="Link to shorten...">
30-
</div>
31-
<select name="metadata" id="metadata">
32-
<option value="OWOIFY">Owoify metadata</option>
33-
<option value="PROXY">Proxy metadata</option>
34-
<option value="IGNORE">Ignore metadata</option>
35-
</select>
36-
<button id="submit">owo-ify</button>
37-
</div>
38-
<br>
3915
<hr>
4016
<div class="documentation">
41-
<h3>Notice:</h3>
17+
<h3>Notice</h3>
18+
<p>
19+
<span style="font-weight: bold">As of 2025-03-23, owo.vc is end of life.</span>
20+
</p>
21+
<p>
22+
Due to abuse and overwhelming amounts of spam. It became no longer feasible
23+
to continue running the service for the small amount of legitimate users
24+
that exist. Unfortunately, several parties have been persistently attacking
25+
and abusing the provided service, making it impractical and impossible
26+
to properly moderate and monitor the normal usage of owo.vc.
27+
</p>
28+
<p>
29+
Effective immediately, links will no longer be able to be shortened via
30+
owo.vc. This is not a choice that has been made lightly, but it is one
31+
that will prevent additional abuse. Existing links will not be impacted,
32+
and will continue to function as intended for the foreseeable future.
33+
</p>
34+
<p>
35+
If there are any questions or concerns, feel free to open an issue on the
36+
project's GitHub repository.
37+
</p>
4238
<p>
43-
owo.vc's original version 1 API endpoints will be deprecated on August 1, 2023. If you are a developer, please make
44-
sure you update your applications to use the latest API version. For more information, check the
45-
<a href="https://owo.vc/changelog.html#2023-04-01">changelog</a>.
39+
Thank you to all those who enjoyed using owo.vc. I appreciate seeing the
40+
different ways that it has been used over the last several years.
4641
</p>
4742
</div>
4843
<hr>

0 commit comments

Comments
 (0)