Fix some small errors & stuff to host it on my home server now

This commit is contained in:
2025-12-18 12:42:09 -06:00
parent 677aab4175
commit 0aba66d3df
6 changed files with 28 additions and 10 deletions

View File

@@ -1,4 +1,7 @@
### Docker Environment Variables ###
DOMAIN="example.com"
### Vite Environment Variables ###
# All environment variables must be prefixed with VITE_ to be seen by client.
# Self-hosted Services URLs. Do not include the trailing slash.
VITE_BANG_URL="https://bang."
@@ -22,5 +25,5 @@ VITE_DEFAULT_BANG="s"
VITE_LLAMA_MODEL="llama3.1" # !llama
VITE_DEEPSEEK_MODEL="deepseek-r1:8b" # !r1
# Remote
VITE_OPENAI_MODEL="gpt-4o-mini" # !openai
VITE_CLAUDE_MODEL="anthropic/claude-3.5-sonnet" # !claude
VITE_OPENAI_MODEL="gpt-5.2"
VITE_CLAUDE_MODEL="anthropic.claude-sonnet-4-5-20250929"

View File

@@ -10,7 +10,7 @@ services:
container_name: bang
env_file: [../.env]
hostname: bang
domainname: ${VITE_BANG_URL}
domainname: bang.${DOMAIN}
networks: [nginx-bridge]
stdin_open: true
tty: true

View File

@@ -11,6 +11,7 @@
},
"devDependencies": {
"@types/node": "^22.19.3",
"dotenv": "^17.2.3",
"ts-node": "^10.9.2",
"typescript": "~5.7.3",
"vite": "^6.4.1"
@@ -18,7 +19,7 @@
"dependencies": {
"vite-plugin-pwa": "^0.21.2"
},
"packageManager": "pnpm@10.10.0+sha512.d615db246fe70f25dcfea6d8d73dee782ce23e2245e3c4f6f888249fb568149318637dca73c2c5c8ef2a4ca0d5657fb9567188bfab47f566d1ee6ce987815c39",
"packageManager": "pnpm@10.26.0+sha512.3b3f6c725ebe712506c0ab1ad4133cf86b1f4b687effce62a9b38b4d72e3954242e643190fc51fa1642949c735f403debd44f5cb0edd657abe63a8b6a7e1e402",
"pnpm": {
"onlyBuiltDependencies": [
"esbuild"

9
pnpm-lock.yaml generated
View File

@@ -15,6 +15,9 @@ importers:
'@types/node':
specifier: ^22.19.3
version: 22.19.3
dotenv:
specifier: ^17.2.3
version: 17.2.3
ts-node:
specifier: ^10.9.2
version: 10.9.2(@types/node@22.19.3)(typescript@5.7.3)
@@ -1048,6 +1051,10 @@ packages:
resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==}
engines: {node: '>=0.3.1'}
dotenv@17.2.3:
resolution: {integrity: sha512-JVUnt+DUIzu87TABbhPmNfVdBDt18BLOWjMUFJMSi/Qqg7NTYtabbvSNJGOJ7afbRuv9D/lngizHtP7QyLQ+9w==}
engines: {node: '>=12'}
dunder-proto@1.0.1:
resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==}
engines: {node: '>= 0.4'}
@@ -2927,6 +2934,8 @@ snapshots:
diff@4.0.2: {}
dotenv@17.2.3: {}
dunder-proto@1.0.1:
dependencies:
call-bind-apply-helpers: 1.0.2

View File

@@ -3,8 +3,8 @@
<ShortName>Bang!</ShortName>
<Description>A better default search engine with bangs</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16" type="image/svg+xml">https://bang.gibbyb.com/bang.svg</Image>
<Url type="text/html" method="get" template="https://bang.gibbyb.com?q={searchTerms}"/>
<Url type="application/opensearchdescription+xml" rel="self" template="https://bang.gibbyb.com/opensearch.xml"/>
<moz:SearchForm xmlns:moz="http://www.mozilla.org/2006/browser/search/">https://bang.gibbyb.com</moz:SearchForm>
<Image width="16" height="16" type="image/svg+xml">https://bang.gbrown.org/bang.svg</Image>
<Url type="text/html" method="get" template="https://bang.gbrown.org?q={searchTerms}"/>
<Url type="application/opensearchdescription+xml" rel="self" template="https://bang.gbrown.org/opensearch.xml"/>
<moz:SearchForm xmlns:moz="http://www.mozilla.org/2006/browser/search/">https://bang.gbrown.org</moz:SearchForm>
</OpenSearchDescription>

View File

@@ -1,13 +1,18 @@
import * as fs from 'node:fs';
import * as path from 'node:path';
import { fileURLToPath } from 'node:url';
import 'dotenv/config';
// Get the current file's directory
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
if (!process.env.VITE_BANG_URL) {
console.error('VITE_BANG_URL environment variable must be set.');
}
// Get the Bang URL from environment or use a default for local development
const bangUrl = process.env.VITE_BANG_URL || 'https://bang.gibbyb.com';
const bangUrl = process.env.VITE_BANG_URL;
// Create the OpenSearch XML content
const openSearchXml = `<?xml version="1.0" encoding="UTF-8"?>