Compare commits

..

7 Commits

14 changed files with 5585 additions and 3926 deletions

View File

@@ -1,6 +0,0 @@
node_modules
dist
.git
.cursor
.DS_Store
npm-debug.log*

View File

@@ -1,39 +0,0 @@
name: Docker Image CI
on:
workflow_dispatch:
push:
branches:
- custom
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: git.abunchofknowitalls.com
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: git.abunchofknowitalls.com/${{ gitea.repository }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View File

@@ -1,19 +1,35 @@
# syntax=docker/dockerfile:1 # Stage 1: Build the Vite application
FROM node:20-alpine as build
FROM node:20-alpine AS build
WORKDIR /app WORKDIR /app
COPY package.json ./ # Copy package.json and package-lock.json (if present) to leverage Docker cache
COPY package.json package-lock.json* ./
# Install dependencies
RUN npm install RUN npm install
# Copy the rest of the application code
COPY . . COPY . .
# Build the Vite application for production
# You might need to adjust 'npm run build' if your build script is different
RUN npm run build RUN npm run build
FROM nginxinc/nginx-unprivileged:stable-alpine AS runtime # Stage 2: Serve the built application with Nginx
FROM nginx:latest
COPY nginx.conf /etc/nginx/conf.d/default.conf # Copy the built Vite application from the build stage to Nginx's web root
COPY --from=build /app/dist /usr/share/nginx/html COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 8080 # Remove the default Nginx configuration file
RUN rm /etc/nginx/conf.d/default.conf
CMD ["nginx", "-g", "daemon off;"] # Copy a custom Nginx configuration file (see example below)
COPY nginx.conf /etc/nginx/conf.d/nginx.conf
# Expose port 80 for web traffic
EXPOSE 80
# Start Nginx when the container launches
CMD ["nginx", "-g", "daemon off;"]

View File

@@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2025 Theo Browne Copyright (c) 2025 Joshua Higgins
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -12,4 +12,4 @@ DuckDuckGo does their redirects server side. Their DNS is...not always great. Re
I solved this by doing all of the work client side. Once you've went to https://unduck.abunchofknowitalls.com once, the JS is all cache'd and will never need to be downloaded again. Your device does the redirects, not me. I solved this by doing all of the work client side. Once you've went to https://unduck.abunchofknowitalls.com once, the JS is all cache'd and will never need to be downloaded again. Your device does the redirects, not me.
Forked from Theo Browne's [Unduck](https://github.com/T3-Content/unduck) Forked from Theo Browne's [Unduck](https://github.com/T3-Content/unduck)

7
docker-compose.yml Normal file
View File

@@ -0,0 +1,7 @@
services:
unduck:
container_name: unduck
ports:
- "4322:80"
restart: unless-stopped
image: git.abunchofknowitalls.com/joshuafhiggins/unduck:latest

View File

@@ -28,8 +28,13 @@
rel="stylesheet" rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
media="print" media="print"
onload="this.media = 'all'" onload="this.media='all'"
/> />
<script
defer
data-domain="unduck.link"
src="https://plausible.io/js/script.js"
></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Unduck</title> <title>Unduck</title>
<meta <meta

View File

@@ -1,17 +1,17 @@
server { server {
listen 8080; listen 80;
server_name _; server_name localhost;
root /usr/share/nginx/html; root /usr/share/nginx/html;
index index.html; index index.html index.htm;
location / { location / {
try_files $uri $uri/ /index.html; try_files $uri $uri/ /index.html;
} }
location = /health { # Optional: Cache control for assets
access_log off; location ~* \.(js|css|png|jpg|jpeg|gif|ico|woff|woff2|ttf|svg|eot)$ {
add_header Content-Type text/plain; expires 1y;
return 200 "ok\n"; add_header Cache-Control "public, no-transform";
} }
} }

5499
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

3789
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
xmlns="http://a9.com/-/spec/opensearch/1.1/" <ShortName>Unduck</ShortName>
xmlns:moz="http://www.mozilla.org/addons/opensearch/"> <Description>A better default search engine (with bangs!)</Description>
<ShortName>Unduck</ShortName> <Tags>unduck bangs</Tags>
<Description>A better default search engine (with bangs!)</Description> <Url rel="results" type="text/html" method="GET" template="https://unduck.abunchofknowitalls.com/?q={searchTerms}"/>
<Tags>unduck bangs</Tags> <Url rel="suggestions" type="application/x-suggestions+json" template="https://unduck.abunchofknowitalls.com/autocompleter?q={searchTerms}"/>
<Url type="text/html" method="GET" template="https://unduck.abunchofknowitalls.com/?q={searchTerms}"/> <Url rel="self" type="application/opensearchdescription+xml" method="GET" template="https://unduck.abunchofknowitalls.com/opensearch.xml" />
<Image height="16" width="16" type="image/svg+xml">https://unduck.abunchofknowitalls.com/search.svg</Image> <Image height="16" width="16" type="image/svg+xml">https://unduck.abunchofknowitalls.com/search.svg</Image>
<InputEncoding>UTF-8</InputEncoding> <InputEncoding>UTF-8</InputEncoding>
<OutputEncoding>UTF-8</OutputEncoding> <OutputEncoding>UTF-8</OutputEncoding>
<Query role="example" searchTerms="!g cats"/> <Query role="example" searchTerms="cats !g"/>
</OpenSearchDescription> </OpenSearchDescription>

View File

@@ -8,7 +8,7 @@ export const bangs = [
s: "T3 Chat", s: "T3 Chat",
sc: "AI", sc: "AI",
t: "t3", t: "t3",
u: "https://t3.chat/new?model=gpt-5.4&q={{{s}}}", u: "https://www.t3.chat/new?q={{{s}}}",
}, },
{ {
c: "AI", c: "AI",
@@ -17,7 +17,7 @@ export const bangs = [
s: "T3 Chat", s: "T3 Chat",
sc: "AI", sc: "AI",
t: "ai", t: "ai",
u: "https://t3.chat/new?model=gpt-5.4&q={{{s}}}", u: "https://t3.chat/new?model=gemini-2.5-flash&q={{{s}}}",
}, },
{ {
c: "SearXNG", c: "SearXNG",

View File

@@ -167,31 +167,6 @@ textarea {
color: #888; color: #888;
} }
.setting {
display: flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
margin-top: 16px;
}
#default-browser-select {
font-size: 14px;
padding: 4px 8px;
border-radius: 4px;
border: 1px solid #ddd;
background: #f5f5f5;
color: #1a1a1a;
}
@media (prefers-color-scheme: dark) {
#default-browser-select {
border-color: #3d3d3d;
background-color: #191919;
color: #fff;
}
}
.footer, .footer,
.footer a { .footer a {
color: #999; color: #999;
@@ -207,6 +182,15 @@ textarea {
color: #fff; color: #fff;
} }
.default-bang {
border-color: #3d3d3d;
background-color: #191919;
color: #fff;
min-width: 100px;
padding: 8px 12px;
border-radius: 4px;
}
.copy-button img { .copy-button img {
filter: invert(1); filter: invert(1);
} }

View File

@@ -19,17 +19,19 @@ function noSearchDefaultPageRender() {
<img src="/clipboard.svg" alt="Copy" /> <img src="/clipboard.svg" alt="Copy" />
</button> </button>
</div> </div>
<div class="setting"> <div style="display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 1rem; margin-top: 1rem;">
<span>Default Browser:</span> <p>Set Default Bang: </p>
<select id="default-browser-select"></select> <select name="default-bang" id="default-bang" class="default-bang">
<option value="g">Google</option>
<option value="ai">T3 Chat</option>
<option value="xng">SearXNG</option>
</select>
</div> </div>
</div> </div>
<footer class="footer"> <footer class="footer">
<a href="https://t3.chat" target="_blank">t3.chat</a> <a href="https://joshuafhiggins.github.io" target="_blank">Joshua Higgins</a>
<a href="https://x.com/theo" target="_blank">theo</a> <a href="https://git.abunchofknowitalls.com/joshuafhiggins/unduck" target="_blank">Git</a>
<a href="https://github.com/t3dotgg/unduck" target="_blank">github</a>
</footer> </footer>
</div> </div>
`; `;
@@ -37,6 +39,7 @@ function noSearchDefaultPageRender() {
const copyButton = app.querySelector<HTMLButtonElement>(".copy-button")!; const copyButton = app.querySelector<HTMLButtonElement>(".copy-button")!;
const copyIcon = copyButton.querySelector("img")!; const copyIcon = copyButton.querySelector("img")!;
const urlInput = app.querySelector<HTMLInputElement>(".url-input")!; const urlInput = app.querySelector<HTMLInputElement>(".url-input")!;
const defaultBangSelect = app.querySelector<HTMLSelectElement>(".default-bang")!;
copyButton.addEventListener("click", async () => { copyButton.addEventListener("click", async () => {
await navigator.clipboard.writeText(urlInput.value); await navigator.clipboard.writeText(urlInput.value);
@@ -47,30 +50,9 @@ function noSearchDefaultPageRender() {
}, 2000); }, 2000);
}); });
// Setup default browser select defaultBangSelect.addEventListener("change", () => {
const defaultBrowserSelect = document.querySelector<HTMLSelectElement>("#default-browser-select")!; localStorage.setItem("default-bang", defaultBangSelect.value);
const defaultBangs = [ console.log("test");
{ name: "Google", bang: "g" },
{ name: "T3 Chat", bang: "t3" },
{ name: "SearXNG", bang: "xng" },
{ name: "DuckDuckGo", bang: "ddg" },
{ name: "Bing", bang: "b" },
{ name: "Yahoo", bang: "y" },
{ name: "Brave", bang: "brave" },
];
for (const bang of defaultBangs) {
const option = document.createElement("option");
option.value = bang.bang;
option.textContent = bang.name;
if (bang.bang === LS_DEFAULT_BANG) {
option.selected = true;
}
defaultBrowserSelect.appendChild(option);
}
defaultBrowserSelect.addEventListener("change", () => {
localStorage.setItem("default-bang", defaultBrowserSelect.value);
}); });
} }