199 lines
5.6 KiB
JavaScript
199 lines
5.6 KiB
JavaScript
import { defineConfig, envField } from "astro/config";
|
||
import tailwindIntegration from "@astrojs/tailwind";
|
||
import alpinejsIntegration from "@astrojs/alpinejs";
|
||
import htaccessIntegration from "astro-htaccess";
|
||
import { AI_BOTS } from "./src/data/ai_bots";
|
||
|
||
// https://astro.build/config
|
||
export default defineConfig({
|
||
site: "https://badmanners.xyz",
|
||
integrations: [
|
||
tailwindIntegration({
|
||
applyBaseStyles: false,
|
||
}),
|
||
alpinejsIntegration(),
|
||
htaccessIntegration({
|
||
generateHtaccessFile: import.meta.env.APACHE_CONFIG === "true",
|
||
customRules: [
|
||
// Block AI bots
|
||
"<IfModule mod_rewrite.c>",
|
||
" RewriteEngine on",
|
||
" RewriteBase /",
|
||
` RewriteCond %{HTTP_USER_AGENT} ${AI_BOTS.map((bot) => `^${bot}$`).join("|")} [NC]`,
|
||
" RewriteRule ^ – [F]",
|
||
"</IfModule>",
|
||
],
|
||
redirects: [
|
||
{
|
||
match: /^\/@\/(aryion|ekas?(portal)?)\b/,
|
||
url: "https://aryion.com/g4/user/BadManners",
|
||
},
|
||
{
|
||
match: /^\/@\/blog\b/,
|
||
url: "https://gallery.badmanners.xyz/blog",
|
||
},
|
||
{
|
||
match: /^\/@\/(blue[_-]?sky|bsky)\b/,
|
||
url: "https://bsky.app/profile/badmanners.xyz",
|
||
},
|
||
{
|
||
match: /^\/@\/(buymeacoffee|buy_me_a_coffee|buy-me-a-coffee|bmac)\b/,
|
||
url: "https://www.buymeacoffee.com/BadMannersXYZ",
|
||
},
|
||
{
|
||
match: /^\/@\/carrd\b/,
|
||
url: "https://badmanners.carrd.co",
|
||
},
|
||
{
|
||
match: /^\/@\/code[_-]?berg\b/,
|
||
url: "https://codeberg.org/BadManners",
|
||
},
|
||
{
|
||
match: /^\/@\/discord\b/,
|
||
url: "/#discord",
|
||
},
|
||
{
|
||
match: /^\/@\/e[_-]?mail\b/,
|
||
url: "/#e-mail",
|
||
},
|
||
{
|
||
match: /^\/@\/(fur[_-]?affinity|fa)\b/,
|
||
url: "https://www.furaffinity.net/user/badmanners",
|
||
},
|
||
{
|
||
match: /^\/@\/(gallery|stor(y|ies)|games?)\b/,
|
||
url: "https://gallery.badmanners.xyz",
|
||
},
|
||
{
|
||
match: /^\/@\/(git[_-]?hub|gh)\b/,
|
||
url: "https://github.com/BadMannersXYZ",
|
||
},
|
||
{
|
||
match: /^\/@\/git[_-]?lab\b/,
|
||
url: "https://gitlab.com/Bad_Manners",
|
||
},
|
||
{
|
||
match: /^\/@\/(git[_-]?gud|sapp?hire)\b/,
|
||
url: "https://gitgud.io/BadMannersXYZ",
|
||
},
|
||
{
|
||
match: /^\/@\/(google|g[_-]?mail)\b/,
|
||
url: "/#google",
|
||
},
|
||
{
|
||
match: /^\/@\/(gpg|pgp)\b/,
|
||
url: "/gpg.pub",
|
||
},
|
||
{
|
||
match: /^\/@\/gum[_-]?road\b/,
|
||
url: "https://badmanners.gumroad.com",
|
||
},
|
||
{
|
||
match: /^\/@\/(ink[_-]?bunny|ib)\b/,
|
||
url: "https://inkbunny.net/BadManners",
|
||
},
|
||
{
|
||
match: /^\/@\/itaku\b/,
|
||
url: "https://itaku.ee/profile/badmanners",
|
||
},
|
||
{
|
||
match: /^\/@\/itch\b/,
|
||
url: "https://bad-manners.itch.io",
|
||
},
|
||
{
|
||
match: /^\/@\/keybase\b/,
|
||
url: "https://keybase.io/badmanners",
|
||
},
|
||
{
|
||
match: /^\/@\/keyoxide\b/,
|
||
url: "https://keyoxide.org/aspe:keyoxide.org:UWYBVFCBFXTVUF2U6FS6AYJHLU",
|
||
},
|
||
{
|
||
match: /^\/@\/ko[._-]?fi\b/,
|
||
url: "https://ko-fi.com/badmanners",
|
||
},
|
||
{
|
||
match: /^\/@\/(mastodon|meow[._-]?social|gulp[._-]?cafe)\b/,
|
||
url: "https://meow.social/@BadManners",
|
||
},
|
||
{
|
||
match: /^\/@\/neo[_-]?cities\b/,
|
||
url: "https://badmanners.neocities.org",
|
||
},
|
||
{
|
||
match: /^\/@\/picarto\b/,
|
||
url: "https://www.picarto.tv/BadManners",
|
||
},
|
||
{
|
||
match: /^\/@\/pillow[_-]?fort\b/,
|
||
url: "https://www.pillowfort.social/BadManners",
|
||
},
|
||
{
|
||
match: /^\/@\/pronouns?\b/,
|
||
url: "https://pronouns.cc/@BadManners",
|
||
},
|
||
{
|
||
match: /^\/@\/redd\.?it\b/,
|
||
url: "https://www.reddit.com/user/BadManners_",
|
||
},
|
||
{
|
||
match: /^\/@\/resetera\b/,
|
||
url: "https://www.resetera.com/members/bad-manners.181209/",
|
||
},
|
||
{
|
||
match: /^\/@\/signal\b/,
|
||
url: "https://signal.me/#eu/ytt_rk0fFmAB2JAW-x2PbUiJyc_H3kYmfL_Pq4QNh5QIDsiFtjdFHaqFRs1D36tB",
|
||
},
|
||
{
|
||
match: /^\/@\/(so[_-]?furry|sf)\b/,
|
||
url: "https://bad-manners.sofurry.com",
|
||
},
|
||
{
|
||
match: /^\/@\/ssh\b/,
|
||
url: "/ssh.pub",
|
||
},
|
||
{
|
||
match: /^\/@\/steam(community|powered)?\b/,
|
||
url: "https://steamcommunity.com/id/badmanners_",
|
||
},
|
||
{
|
||
match: /^\/@\/subscribe[_-]?star\b/,
|
||
url: "https://subscribestar.adult/bad-manners",
|
||
},
|
||
{
|
||
match: /^\/@\/(telegram|t\.me)\b/,
|
||
url: "https://t.me/bad_manners",
|
||
},
|
||
{
|
||
match: /^\/@\/tumblr\b/,
|
||
url: "https://www.tumblr.com/badmannersxyz",
|
||
},
|
||
{
|
||
match: /^\/@\/twitch\b/,
|
||
url: "https://www.twitch.tv/bad__manners",
|
||
},
|
||
{
|
||
match: /^\/@\/weasyl\b/,
|
||
url: "https://www.weasyl.com/~badmanners",
|
||
},
|
||
{
|
||
match: /^\/@\/(you[_-]?tube|youtu\.be|yt)\b/,
|
||
url: "https://www.youtube.com/@BadMannersXYZ",
|
||
},
|
||
],
|
||
}),
|
||
],
|
||
build: {
|
||
assets: "assets",
|
||
},
|
||
outDir: "./dist",
|
||
redirects: {
|
||
"/tos": "/terms_of_service",
|
||
"/contact": "/",
|
||
},
|
||
env: {
|
||
schema: {
|
||
APACHE_CONFIG: envField.boolean({ context: "server", access: "public", default: false }),
|
||
},
|
||
},
|
||
});
|