Compare commits
223 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bcee2ea01a | ||
|
|
92144c8102 | ||
|
|
f291884921 | ||
|
|
bcc1bc6854 | ||
|
|
7ca2553d17 | ||
|
|
ef99d8c28e | ||
|
|
60d55a83c4 | ||
|
|
10bd56d2b9 | ||
|
|
2e80a1ce7c | ||
|
|
df15f00243 | ||
|
|
ded168dae3 | ||
|
|
f6abfcfa6b | ||
|
|
c20364efcb | ||
|
|
63d2c6f35a | ||
|
|
3b050a33bb | ||
|
|
741e9f56f9 | ||
|
|
88aa8c377a | ||
|
|
7677bb14f8 | ||
|
|
1bd0d46b3d | ||
|
|
432e901087 | ||
|
|
af2553a890 | ||
|
|
19d80d190e | ||
|
|
d62cc0d539 | ||
|
|
6f3218f487 | ||
|
|
753859fbe0 | ||
|
|
20888d3930 | ||
|
|
13e7455f56 | ||
|
|
d17a9ba4c8 | ||
|
|
efb0b9f495 | ||
|
|
064f7e48ca | ||
|
|
28b8f9105d | ||
|
|
9d02978f6e | ||
|
|
9c64275dec | ||
|
|
ae9750e58e | ||
|
|
b7783357fa | ||
|
|
5d3da3340f | ||
|
|
8e3313156e | ||
|
|
6a56140360 | ||
|
|
c25174e8d4 | ||
|
|
73c1fe6ae1 | ||
|
|
132f2c987a | ||
|
|
f1fb4525c6 | ||
|
|
d5681ad1a2 | ||
|
|
62545a9af3 | ||
|
|
e74e922cea | ||
|
|
144f283a25 | ||
|
|
4697daeb1a | ||
|
|
dfc150c442 | ||
|
|
ad3f8a33d1 | ||
|
|
2db7a1ca6b | ||
|
|
12c976dcb2 | ||
|
|
b0abec39d5 | ||
|
|
4915be0301 | ||
|
|
a7d0ed8670 | ||
|
|
9eb863e964 | ||
|
|
01bc6d35dc | ||
|
|
943065b7b3 | ||
|
|
41bb1e60d0 | ||
|
|
b60b750555 | ||
|
|
0f8b055b42 | ||
|
|
142239d2c9 | ||
|
|
de6ed2352a | ||
|
|
d35db99c6f | ||
|
|
9be26e1bd2 | ||
|
|
530b44cf56 | ||
|
|
fe09df66b7 | ||
|
|
59008ae90e | ||
|
|
ec797bc6b8 | ||
|
|
5f7b13df2d | ||
|
|
ba6237b5c0 | ||
|
|
44ede26e67 | ||
|
|
33a5efaf4b | ||
|
|
e43341fdcc | ||
|
|
a757ecfd2b | ||
|
|
40e4f2ec2e | ||
|
|
1ec1eff57e | ||
|
|
321eeeaed7 | ||
|
|
d7e5a76ace | ||
|
|
01d000e570 | ||
|
|
2bb14c55a6 | ||
|
|
6c8007e23b | ||
|
|
4bc5c1357a | ||
|
|
f8957e52bf | ||
|
|
4b4e0e20d4 | ||
|
|
eb36492ba5 | ||
|
|
b660c494bc | ||
|
|
d10dc9cfe1 | ||
|
|
3fd8614a4b | ||
|
|
2c934162d3 | ||
|
|
3b9f4c4356 | ||
|
|
9dd3782f5c | ||
|
|
df66fb23ab | ||
|
|
0b87c13f8d | ||
|
|
47a087c73b | ||
|
|
66f59c8d41 | ||
|
|
6ed051d631 | ||
|
|
05b3911080 | ||
|
|
b78b92d6a0 | ||
|
|
e3789aef49 | ||
|
|
a2251f01eb | ||
|
|
9c403d24e1 | ||
|
|
7cd2855146 | ||
|
|
2af687d1c5 | ||
|
|
efa23a8ad8 | ||
|
|
6940c6379b | ||
|
|
4c4b7120c6 | ||
|
|
a138845fea | ||
|
|
19832a3ed0 | ||
|
|
110c64ba27 | ||
|
|
65c5b163c9 | ||
|
|
354dc12b3b | ||
|
|
9cc79c0fb7 | ||
|
|
8953ac03ec | ||
|
|
886fe4a0c9 | ||
|
|
df5e34615a | ||
|
|
3552032827 | ||
|
|
d507894546 | ||
|
|
9f7cb335c5 | ||
|
|
ee28d7f125 | ||
|
|
5d6fb07066 | ||
|
|
147c8e9115 | ||
|
|
d333e10e64 | ||
|
|
db29894038 | ||
|
|
47c926b0ff | ||
|
|
dffdd81345 | ||
|
|
c87fce5930 | ||
|
|
9e0a2c7a98 | ||
|
|
8b8e2be82d | ||
|
|
fc6be543bd | ||
|
|
00f48dc1e8 | ||
|
|
224abd14e0 | ||
|
|
991577aa17 | ||
|
|
a539761c49 | ||
|
|
dc4a9ee3e1 | ||
|
|
e3aee50cf3 | ||
|
|
2b32f0e80d | ||
|
|
df855adc98 | ||
|
|
512cf535e0 | ||
|
|
a0b00ce4a1 | ||
|
|
c5329d76ba | ||
|
|
46f647d91d | ||
|
|
fdf69b7049 | ||
|
|
faf15072b6 | ||
|
|
4f6d1211ba | ||
|
|
6f408948d3 | ||
|
|
439b18c21f | ||
|
|
2dfd163430 | ||
|
|
80cd902c86 | ||
|
|
40d8a7a581 | ||
|
|
87aa653c7f | ||
|
|
d91935c880 | ||
|
|
a552543f4f | ||
|
|
0a69af4f61 | ||
|
|
1d0fe141dc | ||
|
|
29e801c381 | ||
|
|
22aef9bf53 | ||
|
|
f1190ccf32 | ||
|
|
8c120a5139 | ||
|
|
70b7e7c73a | ||
|
|
8cb0db0051 | ||
|
|
29315f44e7 | ||
|
|
a97a45bf20 | ||
|
|
e088fcbc7b | ||
|
|
5723a3778e | ||
|
|
4a5646c8da | ||
|
|
6a39651ad3 | ||
|
|
9368699b2c | ||
|
|
6eb59464da | ||
|
|
15f062b34a | ||
|
|
d7e68a2d1b | ||
|
|
f51e0f7859 | ||
|
|
710e00ad9e | ||
|
|
4b486ea5f6 | ||
|
|
78d8ca49ec | ||
|
|
37887a175a | ||
|
|
7c77d65d35 | ||
|
|
2d683898c2 | ||
|
|
914ff994f7 | ||
|
|
caaa127dcf | ||
|
|
57b8273002 | ||
|
|
8f966b11ec | ||
|
|
498895a47d | ||
|
|
e5b211a743 | ||
|
|
9848d89d03 | ||
|
|
04bb3d6f15 | ||
|
|
8dd2122817 | ||
|
|
c4ef31d86f | ||
|
|
15ae22bdcf | ||
|
|
4ac49ca90f | ||
|
|
eb1b21baaa | ||
|
|
5aa5cb1941 | ||
|
|
7f5bf35806 | ||
|
|
5e8c824ecc | ||
|
|
a761865724 | ||
|
|
6a054d884b | ||
|
|
b9a889ab69 | ||
|
|
5475a262d4 | ||
|
|
f434c3fab2 | ||
|
|
4a40cf79c3 | ||
|
|
1f96c13f72 | ||
|
|
9fea02f20f | ||
|
|
9db885b5f7 | ||
|
|
7a00a07398 | ||
|
|
3519dd76f0 | ||
|
|
467de76fc1 | ||
|
|
50d8405981 | ||
|
|
2203236e4c | ||
|
|
409204917e | ||
|
|
6f1adcfe67 | ||
|
|
ffbd0ae3a5 | ||
|
|
ed364fa90e | ||
|
|
bbd24f1e98 | ||
|
|
c53c3db96b | ||
|
|
80df3bb8c4 | ||
|
|
9ab76ccaf1 | ||
|
|
4da0499cd7 | ||
|
|
e5347dac8c | ||
|
|
b943069577 | ||
|
|
3b5e6a9f4d | ||
|
|
7bdc9590dd | ||
|
|
0e7d611a80 | ||
|
|
001c13ef43 | ||
|
|
4f5c1eeded |
@@ -1,10 +1,11 @@
|
||||
.git/
|
||||
.pytest_cache/
|
||||
.vscode/
|
||||
.venv/
|
||||
docs/
|
||||
.*
|
||||
**/__pycache__/
|
||||
*.egg-info/
|
||||
documentation/
|
||||
tests/
|
||||
build/
|
||||
dist/
|
||||
scripts/
|
||||
*.egg-info/
|
||||
src/interface/
|
||||
src/telemetry/
|
||||
!src/interface/web
|
||||
|
||||
8
.github/workflows/desktop.yml
vendored
@@ -42,10 +42,10 @@ jobs:
|
||||
run: |
|
||||
npx todesktop build
|
||||
|
||||
- name: 📦 Release Desktop App
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
run: |
|
||||
npx todesktop release --latest --force
|
||||
# - name: 📦 Release Desktop App
|
||||
# if: startsWith(github.ref, 'refs/tags/')
|
||||
# run: |
|
||||
# npx todesktop release --latest --force
|
||||
|
||||
- name: ⤵️ Get Desktop Apps
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
|
||||
76
.github/workflows/dockerize.yml
vendored
@@ -38,13 +38,23 @@ env:
|
||||
jobs:
|
||||
build:
|
||||
name: Publish Khoj Docker Images
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
image:
|
||||
- 'local'
|
||||
- 'cloud'
|
||||
include:
|
||||
- image: 'local'
|
||||
platform: linux/amd64
|
||||
runner: ubuntu-latest
|
||||
- image: 'local'
|
||||
platform: linux/arm64
|
||||
runner: ubuntu-linux-arm64
|
||||
- image: 'cloud'
|
||||
platform: linux/amd64
|
||||
runner: ubuntu-latest
|
||||
- image: 'cloud'
|
||||
platform: linux/arm64
|
||||
runner: ubuntu-linux-arm64
|
||||
runs-on: ${{ matrix.runner }}
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
@@ -52,9 +62,6 @@ jobs:
|
||||
# Get all history to correctly infer Khoj version using hatch
|
||||
fetch-depth: 0
|
||||
|
||||
- name: 🧹 Delete huge unnecessary tools folder
|
||||
run: rm -rf /opt/hostedtoolcache
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
@@ -73,31 +80,70 @@ jobs:
|
||||
run: rm -rf /opt/hostedtoolcache
|
||||
|
||||
- name: 📦 Build and Push Docker Image
|
||||
uses: docker/build-push-action@v2
|
||||
uses: docker/build-push-action@v4
|
||||
if: (matrix.image == 'local' && github.event_name == 'workflow_dispatch') && github.event.inputs.khoj == 'true' || (matrix.image == 'local' && github.event_name == 'push')
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
platforms: linux/amd64, linux/arm64
|
||||
push: true
|
||||
tags: |
|
||||
ghcr.io/${{ github.repository }}:${{ env.DOCKER_IMAGE_TAG }}
|
||||
${{ github.ref_type == 'tag' && format('ghcr.io/{0}:latest', github.repository) || '' }}
|
||||
ghcr.io/${{ github.repository }}:${{ env.DOCKER_IMAGE_TAG }}-${{ matrix.platform == 'linux/amd64' && 'amd64' || 'arm64' }}
|
||||
build-args: |
|
||||
VERSION=${{ steps.hatch.outputs.version }}
|
||||
PORT=42110
|
||||
cache-from: type=gha,scope=${{ matrix.image }}-${{ matrix.platform }}
|
||||
cache-to: type=gha,mode=max,scope=${{ matrix.image }}-${{ matrix.platform}}
|
||||
labels: |
|
||||
org.opencontainers.image.description=Khoj AI - Your second brain powered by LLMs and Neural Search
|
||||
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
|
||||
|
||||
- name: 📦️⛅️ Build and Push Cloud Docker Image
|
||||
uses: docker/build-push-action@v2
|
||||
uses: docker/build-push-action@v4
|
||||
if: (matrix.image == 'cloud' && github.event_name == 'workflow_dispatch') && github.event.inputs.khoj-cloud == 'true' || (matrix.image == 'cloud' && github.event_name == 'push')
|
||||
with:
|
||||
context: .
|
||||
file: prod.Dockerfile
|
||||
platforms: linux/amd64, linux/arm64
|
||||
push: true
|
||||
tags: |
|
||||
ghcr.io/${{ github.repository }}-cloud:${{ env.DOCKER_IMAGE_TAG }}
|
||||
${{ github.ref_type == 'tag' && format('ghcr.io/{0}-cloud:latest', github.repository) || '' }}
|
||||
ghcr.io/${{ github.repository }}-cloud:${{ env.DOCKER_IMAGE_TAG }}-${{ matrix.platform == 'linux/amd64' && 'amd64' || 'arm64' }}
|
||||
build-args: |
|
||||
VERSION=${{ steps.hatch.outputs.version }}
|
||||
PORT=42110
|
||||
cache-from: type=gha,scope=${{ matrix.image }}-${{ matrix.platform }}
|
||||
cache-to: type=gha,mode=max,scope=${{ matrix.image }}-${{ matrix.platform}}
|
||||
labels: |
|
||||
org.opencontainers.image.description=Khoj AI Cloud - Your second brain powered by LLMs and Neural Search
|
||||
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
|
||||
|
||||
manifest:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name != 'pull_request'
|
||||
steps:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.PAT }}
|
||||
|
||||
- name: Create and Push Local Manifest
|
||||
if: github.event.inputs.khoj == 'true' || github.event_name == 'push'
|
||||
run: |
|
||||
docker buildx imagetools create \
|
||||
-t ghcr.io/${{ github.repository }}:${{ env.DOCKER_IMAGE_TAG }} \
|
||||
-t ghcr.io/${{ github.repository }}:${{ github.ref_type == 'tag' && 'latest' || env.DOCKER_IMAGE_TAG }} \
|
||||
ghcr.io/${{ github.repository }}:${{ env.DOCKER_IMAGE_TAG }}-amd64 \
|
||||
ghcr.io/${{ github.repository }}:${{ env.DOCKER_IMAGE_TAG }}-arm64
|
||||
|
||||
- name: Create and Push Cloud Manifest
|
||||
if: github.event.inputs.khoj-cloud == 'true' || github.event_name == 'push'
|
||||
run: |
|
||||
docker buildx imagetools create \
|
||||
-t ghcr.io/${{ github.repository }}-cloud:${{ env.DOCKER_IMAGE_TAG }} \
|
||||
-t ghcr.io/${{ github.repository }}-cloud:${{ github.ref_type == 'tag' && 'latest' || env.DOCKER_IMAGE_TAG }} \
|
||||
ghcr.io/${{ github.repository }}-cloud:${{ env.DOCKER_IMAGE_TAG }}-amd64 \
|
||||
ghcr.io/${{ github.repository }}-cloud:${{ env.DOCKER_IMAGE_TAG }}-arm64
|
||||
|
||||
5
.github/workflows/pypi.yml
vendored
@@ -49,7 +49,7 @@ jobs:
|
||||
- name: 📂 Copy Generated Files
|
||||
run: |
|
||||
mkdir -p src/khoj/interface/compiled
|
||||
cp -r /opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/khoj/interface/compiled/* src/khoj/interface/compiled/
|
||||
cp -r /opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/khoj/interface/compiled/* src/khoj/interface/compiled/
|
||||
|
||||
- name: ⚙️ Build Python Package
|
||||
run: |
|
||||
@@ -75,6 +75,7 @@ jobs:
|
||||
|
||||
- name: 📦 Publish Python Package to PyPI
|
||||
if: startsWith(github.ref, 'refs/tags') || github.ref == 'refs/heads/master'
|
||||
uses: pypa/gh-action-pypi-publish@v1.8.14
|
||||
uses: pypa/gh-action-pypi-publish@release/v1.12
|
||||
with:
|
||||
skip-existing: true
|
||||
print-hash: true
|
||||
|
||||
36
.github/workflows/run_evals.yml
vendored
@@ -1,9 +1,10 @@
|
||||
name: Run Khoj Evals
|
||||
name: eval
|
||||
|
||||
on:
|
||||
# Run on every releases
|
||||
release:
|
||||
types: [published]
|
||||
# Run on every release
|
||||
push:
|
||||
tags:
|
||||
- "*"
|
||||
# Allow manual triggers from GitHub UI
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
@@ -24,6 +25,8 @@ on:
|
||||
options:
|
||||
- frames
|
||||
- simpleqa
|
||||
- gpqa
|
||||
- math500
|
||||
sample_size:
|
||||
description: 'Number of samples to evaluate'
|
||||
required: false
|
||||
@@ -72,27 +75,31 @@ jobs:
|
||||
env:
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
run: |
|
||||
apt update && apt install -y git python3-pip libegl1 sqlite3 libsqlite3-dev libsqlite3-0 ffmpeg libsm6 libxext6
|
||||
apt install -y postgresql postgresql-client && apt install -y postgresql-server-dev-14
|
||||
python -m ensurepip --upgrade
|
||||
python -m pip install --upgrade pip
|
||||
# install postgres and other dependencies
|
||||
sudo apt update && sudo apt install -y git python3-pip libegl1 sqlite3 libsqlite3-dev libsqlite3-0 ffmpeg libsm6 libxext6
|
||||
sudo apt install -y postgresql postgresql-client && sudo apt install -y postgresql-server-dev-14
|
||||
# upgrade pip
|
||||
python -m ensurepip --upgrade && python -m pip install --upgrade pip
|
||||
# install terrarium for code sandbox
|
||||
git clone https://github.com/khoj-ai/terrarium.git && cd terrarium && npm install --legacy-peer-deps && mkdir pyodide_cache
|
||||
|
||||
- name: ⬇️ Install Application
|
||||
run: |
|
||||
sed -i 's/dynamic = \["version"\]/version = "${{ steps.hatch.outputs.version }}"/' pyproject.toml
|
||||
pip install --upgrade .[dev]
|
||||
|
||||
- name: 📝 Run Evals
|
||||
- name: 📝 Run Eval
|
||||
env:
|
||||
KHOJ_MODE: ${{ matrix.khoj_mode }}
|
||||
SAMPLE_SIZE: ${{ inputs.sample_size }}
|
||||
SAMPLE_SIZE: ${{ github.event_name == 'workflow_dispatch' && inputs.sample_size || 200 }}
|
||||
BATCH_SIZE: "20"
|
||||
RANDOMIZE: "True"
|
||||
KHOJ_URL: "http://localhost:42110"
|
||||
KHOJ_LLM_SEED: "42"
|
||||
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
|
||||
SERPER_DEV_API_KEY: ${{ secrets.SERPER_DEV_API_KEY }}
|
||||
OLOSTEP_API_KEY: ${{ secrets.OLOSTEP_API_KEY }}
|
||||
SERPER_DEV_API_KEY: ${{ matrix.dataset != 'math500' && secrets.SERPER_DEV_API_KEY }}
|
||||
OLOSTEP_API_KEY: ${{ matrix.dataset != 'math500' && secrets.OLOSTEP_API_KEY }}
|
||||
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||
KHOJ_ADMIN_EMAIL: khoj
|
||||
KHOJ_ADMIN_PASSWORD: khoj
|
||||
POSTGRES_HOST: localhost
|
||||
@@ -100,12 +107,15 @@ jobs:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: postgres
|
||||
KHOJ_DEBUG: "False" # To disable prompt tracer
|
||||
KHOJ_TELEMETRY_DISABLE: "True" # To disable telemetry for tests
|
||||
run: |
|
||||
# Start Khoj server in background
|
||||
khoj --anonymous-mode --non-interactive &
|
||||
|
||||
# Start code sandbox
|
||||
npm install -g pm2
|
||||
npm run ci --prefix terrarium
|
||||
|
||||
# Wait for server to be ready
|
||||
timeout=120
|
||||
while ! curl -s http://localhost:42110/api/health > /dev/null; do
|
||||
|
||||
11
.github/workflows/test.yml
vendored
@@ -55,15 +55,13 @@ jobs:
|
||||
with:
|
||||
python-version: ${{ matrix.python_version }}
|
||||
|
||||
- name: Install Git
|
||||
run: |
|
||||
apt update && apt install -y git
|
||||
|
||||
- name: ⏬️ Install Dependencies
|
||||
env:
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
run: |
|
||||
apt update && apt install -y libegl1 sqlite3 libsqlite3-dev libsqlite3-0 ffmpeg libsm6 libxext6
|
||||
apt update && apt install -y git libegl1 sqlite3 libsqlite3-dev libsqlite3-0 ffmpeg libsm6 libxext6
|
||||
# required by llama-cpp-python prebuilt wheels
|
||||
apt install -y musl-dev && ln -s /usr/lib/x86_64-linux-musl/libc.so /lib/libc.musl-x86_64.so.1
|
||||
|
||||
- name: ⬇️ Install Postgres
|
||||
env:
|
||||
@@ -78,6 +76,9 @@ jobs:
|
||||
python -m pip install --upgrade pip
|
||||
|
||||
- name: ⬇️ Install Application
|
||||
env:
|
||||
PIP_EXTRA_INDEX_URL: "https://download.pytorch.org/whl/cpu https://abetlen.github.io/llama-cpp-python/whl/cpu"
|
||||
CUDA_VISIBLE_DEVICES: ""
|
||||
run: sed -i 's/dynamic = \["version"\]/version = "0.0.0"/' pyproject.toml && pip install --upgrade .[dev]
|
||||
|
||||
- name: 🧪 Test Application
|
||||
|
||||
10
.gitignore
vendored
@@ -42,3 +42,13 @@ src/interface/obsidian/main.js
|
||||
|
||||
# obsidian
|
||||
data.json
|
||||
|
||||
# Android
|
||||
src/interface/android/.gradle
|
||||
src/interface/android/app/build
|
||||
src/interface/android/build
|
||||
src/interface/android/*.aab
|
||||
src/interface/android/*.apk
|
||||
src/interface/android/*.apk.idsig
|
||||
src/interface/android/*.keystore
|
||||
src/interface/android/local.properties
|
||||
|
||||
@@ -26,7 +26,7 @@ repos:
|
||||
rev: v1.0.0
|
||||
hooks:
|
||||
- id: mypy
|
||||
stages: [push, manual]
|
||||
stages: [pre-push, manual]
|
||||
pass_filenames: false
|
||||
args:
|
||||
- --config-file=pyproject.toml
|
||||
|
||||
49
Dockerfile
@@ -1,5 +1,5 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
FROM ubuntu:jammy
|
||||
FROM ubuntu:jammy AS base
|
||||
LABEL homepage="https://khoj.dev"
|
||||
LABEL repository="https://github.com/khoj-ai/khoj"
|
||||
LABEL org.opencontainers.image.source="https://github.com/khoj-ai/khoj"
|
||||
@@ -13,36 +13,51 @@ RUN apt update -y && apt -y install \
|
||||
# Required by RapidOCR
|
||||
libgl1 \
|
||||
libglx-mesa0 \
|
||||
libglib2.0-0 && \
|
||||
# Required by Next.js Web app
|
||||
curl -sL https://deb.nodesource.com/setup_20.x | bash - && \
|
||||
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
|
||||
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
|
||||
apt update -y && apt -y --no-install-recommends install nodejs yarn && \
|
||||
libglib2.0-0 \
|
||||
# Required by llama-cpp-python pre-built wheels. See #1628
|
||||
musl-dev && \
|
||||
ln -s /usr/lib/x86_64-linux-musl/libc.so /lib/libc.musl-x86_64.so.1 && \
|
||||
# Clean up
|
||||
apt clean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Application
|
||||
# Build Server
|
||||
FROM base AS server-deps
|
||||
WORKDIR /app
|
||||
COPY pyproject.toml .
|
||||
COPY README.md .
|
||||
ARG VERSION=0.0.0
|
||||
# use the pre-built llama-cpp-python, torch cpu wheel
|
||||
ENV PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cpu https://abetlen.github.io/llama-cpp-python/whl/cpu"
|
||||
# avoid downloading unused cuda specific python packages
|
||||
ENV CUDA_VISIBLE_DEVICES=""
|
||||
RUN sed -i "s/dynamic = \\[\"version\"\\]/version = \"$VERSION\"/" pyproject.toml && \
|
||||
pip install --no-cache-dir .
|
||||
|
||||
# Copy Source Code
|
||||
COPY . .
|
||||
|
||||
# Set the PYTHONPATH environment variable in order for it to find the Django app.
|
||||
ENV PYTHONPATH=/app/src:$PYTHONPATH
|
||||
|
||||
# Go to the directory src/interface/web and export the built Next.js assets
|
||||
# Build Web App
|
||||
FROM node:20-alpine AS web-app
|
||||
# Set build optimization env vars
|
||||
ENV NODE_ENV=production
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
WORKDIR /app/src/interface/web
|
||||
RUN bash -c "yarn install --frozen-lockfile && yarn ciexport && yarn cache clean"
|
||||
# Install dependencies first (cache layer)
|
||||
COPY src/interface/web/package.json src/interface/web/yarn.lock ./
|
||||
RUN yarn install --frozen-lockfile
|
||||
# Copy source and build
|
||||
COPY src/interface/web/. ./
|
||||
RUN yarn build
|
||||
|
||||
# Merge the Server and Web App into a Single Image
|
||||
FROM base
|
||||
ENV PYTHONPATH=/app/src
|
||||
WORKDIR /app
|
||||
COPY --from=server-deps /usr/local/lib/python3.10/dist-packages /usr/local/lib/python3.10/dist-packages
|
||||
COPY --from=web-app /app/src/interface/web/out ./src/khoj/interface/built
|
||||
COPY . .
|
||||
RUN cd src && python3 khoj/manage.py collectstatic --noinput
|
||||
|
||||
# Run the Application
|
||||
# There are more arguments required for the application to run,
|
||||
# but these should be passed in through the docker-compose.yml file.
|
||||
# but those should be passed in through the docker-compose.yml file.
|
||||
ARG PORT
|
||||
EXPOSE ${PORT}
|
||||
ENTRYPOINT ["python3", "src/khoj/main.py"]
|
||||
|
||||
13
README.md
@@ -1,4 +1,4 @@
|
||||
<p align="center"><img src="src/khoj/interface/web/assets/icons/khoj-logo-sideways-500.png" width="230" alt="Khoj Logo"></p>
|
||||
<p align="center"><img src="https://assets.khoj.dev/khoj-logo-sideways-1200x540.png" width="230" alt="Khoj Logo"></p>
|
||||
|
||||
<div align="center">
|
||||
|
||||
@@ -29,10 +29,17 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div align="left">
|
||||
***
|
||||
|
||||
### 🎁 New
|
||||
* Start any message with `/research` to try out the experimental research mode with Khoj.
|
||||
* Anyone can now [create custom agents](https://blog.khoj.dev/posts/create-agents-on-khoj/) with tunable personality, tools and knowledge bases.
|
||||
* [Read](https://blog.khoj.dev/posts/evaluate-khoj-quality/) about Khoj's excellent performance on modern retrieval and reasoning benchmarks.
|
||||
|
||||
***
|
||||
|
||||
## Overview
|
||||
|
||||
[Khoj](https://khoj.dev) is a personal AI app to extend your capabilities. It smoothly scales up from an on-device personal AI to a cloud-scale enterprise AI.
|
||||
|
||||
- Chat with any local or online LLM (e.g llama3, qwen, gemma, mistral, gpt, claude, gemini).
|
||||
@@ -47,8 +54,6 @@
|
||||
|
||||
***
|
||||
|
||||
</div>
|
||||
|
||||
## See it in action
|
||||
|
||||

|
||||
|
||||
@@ -18,13 +18,21 @@ services:
|
||||
image: ghcr.io/khoj-ai/terrarium:latest
|
||||
ports:
|
||||
- "8080:8080"
|
||||
search:
|
||||
image: docker.io/searxng/searxng:latest
|
||||
ports:
|
||||
- "42113:8080"
|
||||
volumes:
|
||||
- khoj_search:/etc/searxng
|
||||
environment:
|
||||
- SEARXNG_BASE_URL=http://localhost:42113/
|
||||
server:
|
||||
depends_on:
|
||||
database:
|
||||
condition: service_healthy
|
||||
# Use the following line to use the latest version of khoj. Otherwise, it will build from source.
|
||||
# Use the following line to use the latest version of khoj. Otherwise, it will build from source. Set this to ghcr.io/khoj-ai/khoj-cloud:latest if you want to use the prod image.
|
||||
image: ghcr.io/khoj-ai/khoj:latest
|
||||
# Uncomment the following line to build from source. This will take a few minutes. Comment the next two lines out if you want to use the offiicial image.
|
||||
# Uncomment the following line to build from source. This will take a few minutes. Comment the next two lines out if you want to use the official image.
|
||||
# build:
|
||||
# context: .
|
||||
ports:
|
||||
@@ -49,6 +57,10 @@ services:
|
||||
- KHOJ_DEBUG=False
|
||||
- KHOJ_ADMIN_EMAIL=username@example.com
|
||||
- KHOJ_ADMIN_PASSWORD=password
|
||||
# Default URL of Terrarium, the Python sandbox used by Khoj to run code. Its container is specified above
|
||||
- KHOJ_TERRARIUM_URL=http://host.docker.internal:8080
|
||||
# Default URL of SearxNG, the default web search engine used by Khoj. Its container is specified above
|
||||
- KHOJ_SEARXNG_URL=http://host.docker.internal:42113
|
||||
# Uncomment line below to use with Ollama running on your local machine at localhost:11434.
|
||||
# Change URL to use with other OpenAI API compatible providers like VLLM, LMStudio etc.
|
||||
# - OPENAI_API_BASE=http://host.docker.internal:11434/v1/
|
||||
@@ -64,7 +76,7 @@ services:
|
||||
# Ensure you set your provider specific API keys.
|
||||
# ---
|
||||
# Free, Slower API. Does both web search and webpage read. Get API key from https://jina.ai/
|
||||
# - JINA_API_KEY=you_jina_api_key
|
||||
# - JINA_API_KEY=your_jina_api_key
|
||||
# Paid, Fast API. Only does web search. Get API key from https://serper.dev/
|
||||
# - SERPER_DEV_API_KEY=your_serper_dev_api_key
|
||||
# Paid, Fast, Open API. Only does webpage read. Get API key from https://firecrawl.dev/
|
||||
@@ -83,6 +95,7 @@ services:
|
||||
# Telemetry helps us prioritize feature development and understand how people are using Khoj
|
||||
# Read more at https://docs.khoj.dev/miscellaneous/telemetry
|
||||
# - KHOJ_TELEMETRY_DISABLE=True
|
||||
# Comment out this line when you're using the official ghcr.io/khoj-ai/khoj-cloud:latest prod image.
|
||||
command: --host="0.0.0.0" --port=42110 -vv --anonymous-mode --non-interactive
|
||||
|
||||
|
||||
@@ -90,3 +103,4 @@ volumes:
|
||||
khoj_config:
|
||||
khoj_db:
|
||||
khoj_models:
|
||||
khoj_search:
|
||||
|
||||
BIN
documentation/assets/img/chrome_pwa_alt.png
Normal file
|
After Width: | Height: | Size: 500 KiB |
|
Before Width: | Height: | Size: 298 KiB |
BIN
documentation/assets/img/khoj_documentation.png
Normal file
|
After Width: | Height: | Size: 868 KiB |
|
Before Width: | Height: | Size: 333 KiB |
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 8.4 KiB |
BIN
documentation/assets/img/pwa_install_desktop.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
@@ -38,14 +38,13 @@ To add a server chat setting:
|
||||
- The `Advanced` field doesn't need to be set when self-hosting. When unset, the `Default` chat model is used for all users and the intermediate steps.
|
||||
|
||||
|
||||
### OpenAI Processor Conversation Configs
|
||||
These settings configure chat model providers to be accessed over API.
|
||||
The name of this setting is kind of a misnomer, we know, it'll hopefully be changed at some point.
|
||||
For each chat model provider you [add](http://localhost:42110/server/admin/database/openaiprocessorconversationconfig/add):
|
||||
### AI Model API
|
||||
These settings configure APIs to interact with AI models.
|
||||
For each AI Model API you [add](http://localhost:42110/server/admin/database/aimodelapi/add):
|
||||
- `Api key`: Set to your [OpenAI](https://platform.openai.com/api-keys), [Anthropic](https://console.anthropic.com/account/keys) or [Gemini](https://aistudio.google.com/app/apikey) API keys.
|
||||
- `Name`: Give the configuration any friendly name like `OpenAI`, `Gemini`, `Anthropic`.
|
||||
- `Api base url`: Set the API base URL. This is only relevant to set if you're using another OpenAI-compatible proxy server like [Ollama](/advanced/ollama) or [LMStudio](/advanced/lmstudio).
|
||||

|
||||

|
||||
|
||||
### Search Model Configs
|
||||
Search models are used to generate vector embeddings of your documents for natural language search and chat. You can choose any [embeddings models on HuggingFace](https://huggingface.co/models?pipeline_tag=sentence-similarity) to try, use for your to create vector embeddings of your documents for natural language search and chat.
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
# Authenticate
|
||||
|
||||
:::info
|
||||
This is only helpful for self-hosted users or teams. If you're using [Khoj Cloud](https://app.khoj.dev), both Magic Links and Google OAuth work.
|
||||
:::
|
||||
|
||||
By default, most of the instructions for self-hosting Khoj assume a single user, and so the default configuration is to run in anonymous mode. However, if you want to enable authentication, you can do so either with with [Magic Links](#using-magic-links) or [Google OAuth](#using-google-oauth) as shown below. This can be helpful to make Khoj securely accessible to you and your team.
|
||||
|
||||
:::tip[Note]
|
||||
Remove the `--anonymous-mode` flag from your khoj start up command or docker-compose file to enable authentication.
|
||||
:::
|
||||
|
||||
## Using Magic Links
|
||||
The most secure way to do this is to integrate with [Resend](https://resend.com) by setting up an account and adding an environment variable for `RESEND_API_KEY`. You can get your API key [here](https://resend.com/api-keys). This will allow you to automatically send sign-in links to users who want to log in.
|
||||
|
||||
It's still possible to use the magic links feature without Resend, but you'll need to manually send the magic links to users who want to log in.
|
||||
|
||||
## Manually sending magic links
|
||||
|
||||
1. The user will have to enter their email address in the login form.
|
||||
They'll click `Send Magic Link`. Without the Resend API key, this will just create an unverified account for them in the backend
|
||||
<img src="/img/magic_link.png" alt="Magic link login form" width="400"/>
|
||||
|
||||
2. You can get their magic link using the admin panel
|
||||
Go to the [admin panel](http://localhost:42110/server/admin/database/khojuser/). You'll see a list of users. Search for the user you want to send a magic link to. Tick the checkbox next to their row, and use the action drop down at the top to 'Get email login URL'. This will generate a magic link that you can send to the user, which will appear at the top of the admin interface.
|
||||
|
||||
| Get email login URL | Retrieved login URL |
|
||||
|---------------------|---------------------|
|
||||
| <img src="/img/admin_get_emali_login.png" alt="Get user magic sign in link" width="400" />| <img src="/img/admin_successful_login_url.png" alt="Successfully retrieved a login URL" width="400" />|
|
||||
|
||||
3. Send the magic link to the user. They can click on it to log in.
|
||||
|
||||
Once they click on the link, they'll automatically be logged in. They'll have to repeat this process for every new device they want to log in from, but they shouldn't have to repeat it on the same device.
|
||||
|
||||
A given magic link can only be used once. If the user tries to use it again, they'll be redirected to the login page to get a new magic link.
|
||||
|
||||
## Using Google OAuth
|
||||
|
||||
To set up your self-hosted Khoj with Google Auth, you need to create a project in the Google Cloud Console and enable the Google Auth API.
|
||||
|
||||
To implement this, you'll need to:
|
||||
1. You must use the `python` package or build from source, because you'll need to install additional packages for the google auth libraries (`prod`). The syntax to install the right packages is
|
||||
```
|
||||
pip install khoj[prod]
|
||||
```
|
||||
2. [Create authorization credentials](https://developers.google.com/identity/sign-in/web/sign-in) for your application.
|
||||
3. Open your [Google cloud console](https://console.developers.google.com/apis/credentials) and create a configuration like below for the relevant `OAuth 2.0 Client IDs` project:
|
||||

|
||||
|
||||
4. Configure these environment variables: `GOOGLE_CLIENT_SECRET`, and `GOOGLE_CLIENT_ID`. You can find these values in the Google cloud console, in the same place where you configured the authorized origins and redirect URIs.
|
||||
|
||||
That's it! That should be all you have to do. Now, when you reload Khoj without `--anonymous-mode`, you should be able to use your Google account to sign in.
|
||||
74
documentation/docs/advanced/authentication.mdx
Normal file
@@ -0,0 +1,74 @@
|
||||
# Authenticate (Multi-User Setup)
|
||||
|
||||
```mdx-code-block
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
```
|
||||
|
||||
By default, most of the instructions for self-hosting Khoj assume a single user, and so the default configuration is to run in anonymous mode. However, if you want to enable authentication, you can do so either with with [Magic Links](#using-magic-links) or [Google OAuth](#using-google-oauth) as shown below. This can be helpful to make Khoj securely accessible to you and your team.
|
||||
|
||||
:::tip[Note]
|
||||
Remove the `--anonymous-mode` flag from your khoj start up command or docker-compose file to enable authentication.
|
||||
:::
|
||||
|
||||
## Using Magic Links
|
||||
The most secure way to do this is to integrate with [Resend](https://resend.com).
|
||||
|
||||
1. Setup your account at https://resend.com
|
||||
2. Set an environment variable for `RESEND_API_KEY`. You can get your API key [here](https://resend.com/api-keys).
|
||||
3. Set an environment variable for `RESEND_EMAIL`. This is the email address that will show up in your `from` field when sending magic links.
|
||||
|
||||
This will allow you to automatically send sign-in links to users who want to log in.
|
||||
|
||||
It's still possible to use the magic links feature without Resend, but you'll need to manually send the magic links to users who want to log in.
|
||||
|
||||
## Manually sending magic links
|
||||
|
||||
1. The user will have to enter their email address in the login page at http://localhost:42110/login.
|
||||
|
||||
They'll click `Get Login Link`. Without the Resend API key, this will just create an unverified account for them in the backend
|
||||
<img src="/img/magic_link.png" alt="Magic link login form" width="400"/>
|
||||
|
||||
2. You can get their magic link using the admin panel
|
||||
|
||||
Go to the [admin panel](http://localhost:42110/server/admin/database/khojuser/). You'll see a list of users. Search for the user you want to send a magic link to. Tick the checkbox next to their row, and use the action drop down at the top to 'Get email login URL'. This will generate a magic link that you can send to the user, which will appear at the top of the admin interface.
|
||||
|
||||
| Get email login URL | Retrieved login URL |
|
||||
|---------------------|---------------------|
|
||||
| <img src="/img/admin_get_emali_login.png" alt="Get user magic sign in link" width="400" />| <img src="/img/admin_successful_login_url.png" alt="Successfully retrieved a login URL" width="400" />|
|
||||
|
||||
3. Send the magic link to the user. They can click on it to log in.
|
||||
|
||||
Once they click on the link, they'll automatically be logged in. They'll have to repeat this process for every new device they want to log in from, but they shouldn't have to repeat it on the same device.
|
||||
|
||||
A given magic link can only be used once. If the user tries to use it again, they'll be redirected to the login page to get a new magic link.
|
||||
|
||||
## Using Google OAuth
|
||||
|
||||
For this method, you'll need to use the prod version of the Khoj package. You can install it as below:
|
||||
|
||||
<Tabs groupId="server" queryString>
|
||||
<TabItem value="docker" label="Docker">
|
||||
Update your `docker-compose.yml` to use the prod image
|
||||
```bash
|
||||
image: ghcr.io/khoj-ai/khoj-cloud:latest
|
||||
```
|
||||
</TabItem>
|
||||
|
||||
<TabItem value="pip" label="Pip">
|
||||
```bash
|
||||
pip install khoj[prod]
|
||||
```
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
To set up your self-hosted Khoj with Google Auth, you need to create a project in the Google Cloud Console and enable the Google Auth API.
|
||||
|
||||
To implement this, you'll need to:
|
||||
1. [Create authorization credentials](https://developers.google.com/identity/sign-in/web/sign-in) for your application.
|
||||
2. Open your [Google cloud console](https://console.developers.google.com/apis/credentials) and create a configuration like below for the relevant `OAuth 2.0 Client IDs` project:
|
||||

|
||||
|
||||
3. Configure these environment variables: `GOOGLE_CLIENT_SECRET`, and `GOOGLE_CLIENT_ID`. You can find these values in the Google cloud console, in the same place where you configured the authorized origins and redirect URIs.
|
||||
|
||||
That's it! That should be all you have to do. Now, when you reload Khoj without `--anonymous-mode`, you should be able to use your Google account to sign in.
|
||||
@@ -21,11 +21,11 @@ Using LiteLLM with Khoj makes it possible to turn any LLM behind an API into you
|
||||
export MISTRAL_API_KEY=<MISTRAL_API_KEY>
|
||||
litellm --model mistral/mistral-tiny --drop_params
|
||||
```
|
||||
3. Create a new [OpenAI Processor Conversation Config](http://localhost:42110/server/admin/database/openaiprocessorconversationconfig/add) on your Khoj admin panel
|
||||
3. Create a new [API Model API](http://localhost:42110/server/admin/database/aimodelapi/add) on your Khoj admin panel
|
||||
- Name: `proxy-name`
|
||||
- Api Key: `any string`
|
||||
- Api Base Url: **URL of your Openai Proxy API**
|
||||
4. Create a new [Chat Model Option](http://localhost:42110/server/admin/database/chatmodeloptions/add) on your Khoj admin panel.
|
||||
4. Create a new [Chat Model](http://localhost:42110/server/admin/database/chatmodel/add) on your Khoj admin panel.
|
||||
- Name: `llama3.1` (replace with the name of your local model)
|
||||
- Model Type: `Openai`
|
||||
- Openai Config: `<the proxy config you created in step 3>`
|
||||
|
||||
@@ -18,7 +18,7 @@ LM Studio can expose an [OpenAI API compatible server](https://lmstudio.ai/docs/
|
||||
- Name: `proxy-name`
|
||||
- Api Key: `any string`
|
||||
- Api Base Url: `http://localhost:1234/v1/` (default for LMStudio)
|
||||
4. Create a new [Chat Model Option](http://localhost:42110/server/admin/database/chatmodeloptions/add) on your Khoj admin panel.
|
||||
4. Create a new [Chat Model](http://localhost:42110/server/admin/database/chatmodel/add) on your Khoj admin panel.
|
||||
- Name: `llama3.1` (replace with the name of your local model)
|
||||
- Model Type: `Openai`
|
||||
- Openai Config: `<the proxy config you created in step 3>`
|
||||
|
||||
@@ -46,9 +46,9 @@ Restart your Khoj server after first run or update to the settings below to ensu
|
||||
```bash
|
||||
ollama pull llama3.1
|
||||
```
|
||||
3. Set `OPENAI_API_BASE` environment variable to `http://localhost:11434/v1` in your shell before starting Khoj for the first time
|
||||
3. Set `OPENAI_API_BASE` environment variable to `http://localhost:11434/v1/` in your shell before starting Khoj for the first time
|
||||
```bash
|
||||
export OPENAI_API_BASE="http://localhost:11434/v1"
|
||||
export OPENAI_API_BASE="http://localhost:11434/v1/"
|
||||
khoj --anonymous-mode
|
||||
```
|
||||
</TabItem>
|
||||
@@ -60,11 +60,11 @@ Restart your Khoj server after first run or update to the settings below to ensu
|
||||
```bash
|
||||
ollama pull llama3.1
|
||||
```
|
||||
3. Create a new [OpenAI Processor Conversation Config](http://localhost:42110/server/admin/database/openaiprocessorconversationconfig/add) on your Khoj admin panel
|
||||
3. Create a new [AI Model API](http://localhost:42110/server/admin/database/aimodelapi/add) on your Khoj admin panel
|
||||
- Name: `ollama`
|
||||
- Api Key: `any string`
|
||||
- Api Base Url: `http://localhost:11434/v1/` (default for Ollama)
|
||||
4. Create a new [Chat Model Option](http://localhost:42110/server/admin/database/chatmodeloptions/add) on your Khoj admin panel.
|
||||
4. Create a new [Chat Model](http://localhost:42110/server/admin/database/chatmodel/add) on your Khoj admin panel.
|
||||
- Name: `llama3.1` (replace with the name of your local model)
|
||||
- Model Type: `Openai`
|
||||
- Openai Config: `<the ollama config you created in step 3>`
|
||||
|
||||
39
documentation/docs/advanced/tailscale.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# Tailscale
|
||||
|
||||
:::info
|
||||
This is only helpful for secure cross-device access to **self-hosted** Khoj. You **do not** need this if you're using [Khoj Cloud](https://app.khoj.dev).
|
||||
:::
|
||||
|
||||
[Tailscale](https://tailscale.com) simplifies creating a private VPN using [Wireguard](https://www.wireguard.com/) and OAuth. So you can host and access services on your devices from anywhere.
|
||||
The instructions below are one way to simply and securely access your self-hosted Khoj from your phone, laptop etc.
|
||||
|
||||
### Minimal Setup
|
||||
1. Setup khoj on your preferred machine following the [standard steps](/get-started/setup)
|
||||
2. Sign-up to [Tailscale](https://tailscale.com) and install the app on machines you want to access Khoj from. This usually includes your khoj server, your phone, laptop. Note the tailscale i.p of your khoj server.
|
||||
3. Start khoj on your server by including the flag `--host <your_server_tailscale_ip>`
|
||||
4. Open `http://<your_server_tailscale_ip>:42110` to access khoj from any device on your tailscale network!
|
||||
|
||||
|
||||
### HTTPS Certificate
|
||||
:::info
|
||||
Tailscale uses Wireguard to encrypt and route traffic between your machines. So HTTPS isn't required with Tailscale for secure access. HTTPS with Tailscale is only useful for browsers to not complain about security and block certain features like clipboard access unless HTTPS is enabled.
|
||||
:::
|
||||
|
||||
1. Enable [MagicDNS](https://tailscale.com/kb/1081/magicdns#enabling-magicdns) and [HTTPS](https://tailscale.com/kb/1153/enabling-https) toggle on your tailscale admin console [DNS](https://login.tailscale.com/admin/dns) page. Note your unique tailscale domain name (usually ends with .ts.net)
|
||||
2. Create an https certificate for your Khoj server by running the following command:
|
||||
```bash
|
||||
# Assuming the server is named, `server` and your tailnet is `black-forest.ts.net`
|
||||
# Note path of the .crt and .key files generated
|
||||
|
||||
tailscale cert server.black-forest.ts.net
|
||||
```
|
||||
3. Start khoj to be served via https on standard port
|
||||
```bash
|
||||
sudo KHOJ_DOMAIN=server.black-forest.ts.net \
|
||||
khoj \
|
||||
--sslcert /path/to/your/tailscale.crt \
|
||||
--sslkey path/to/your/tailscale.key \
|
||||
--host=server.black-forest.ts.net \
|
||||
--port 443
|
||||
```
|
||||
4. You should now be able to access khoj on `https://server.black-forest.ts.net` from any device on your private tailscale network!
|
||||
@@ -11,7 +11,7 @@ This is only helpful for self-hosted users. If you're using [Khoj Cloud](https:/
|
||||
Khoj natively supports local LLMs [available on HuggingFace in GGUF format](https://huggingface.co/models?library=gguf). Using an OpenAI API proxy with Khoj maybe useful for ease of setup, trying new models or using commercial LLMs via API.
|
||||
:::
|
||||
|
||||
Khoj can use any OpenAI API compatible server including [Ollama](/advanced/ollama), [LMStudio](/advanced/lmstudio) and [LiteLLM](/advanced/litellm).
|
||||
Khoj can use any OpenAI API compatible server including local providers like [Ollama](/advanced/ollama), [LMStudio](/advanced/lmstudio) and [LiteLLM](/advanced/litellm) and commercial providers like [HuggingFace](https://huggingface.co/docs/api-inference/tasks/chat-completion#using-the-api), [OpenRouter](https://openrouter.ai/docs/quick-start) etc.
|
||||
Configuring this allows you to use non-standard, open or commercial, local or hosted LLM models for Khoj
|
||||
|
||||
Combine them with Khoj can turn your favorite LLM into an AI agent. Allowing you to chat with your docs, find answers from the internet, build custom agents and run automations.
|
||||
@@ -20,12 +20,12 @@ For specific integrations, see our [Ollama](/advanced/ollama), [LMStudio](/advan
|
||||
|
||||
## General Setup
|
||||
|
||||
1. Start your preferred OpenAI API compatible app
|
||||
2. Create a new [OpenAI Processor Conversation Config](http://localhost:42110/server/admin/database/openaiprocessorconversationconfig/add) on your Khoj admin panel
|
||||
1. Start your preferred OpenAI API compatible app locally or get API keys from commercial AI model providers.
|
||||
3. Create a new [API Model API](http://localhost:42110/server/admin/database/aimodelapi/add) on your Khoj admin panel
|
||||
- Name: `any name`
|
||||
- Api Key: `any string`
|
||||
- Api Base Url: **URL of your Openai Proxy API**
|
||||
3. Create a new [Chat Model Option](http://localhost:42110/server/admin/database/chatmodeloptions/add) on your Khoj admin panel.
|
||||
3. Create a new [Chat Model](http://localhost:42110/server/admin/database/chatmodel/add) on your Khoj admin panel.
|
||||
- Name: `llama3` (replace with the name of your local model)
|
||||
- Model Type: `Openai`
|
||||
- Openai Config: `<the proxy config you created in step 2>`
|
||||
|
||||
@@ -4,22 +4,13 @@ sidebar_position: 1
|
||||
|
||||
# Desktop
|
||||
|
||||
> Query your Second Brain from your machine
|
||||
> Upload your knowledge base to Khoj and chat with your whole corpus
|
||||
|
||||
Use the Desktop app to chat and search with Khoj.
|
||||
You can also share your files, folders with Khoj using the app.
|
||||
## Companion App
|
||||
|
||||
Share your files, folders with Khoj using the app.
|
||||
Khoj will keep these files in sync to provide contextual responses when you search or chat.
|
||||
|
||||
## Features
|
||||
- **Chat**
|
||||
- **Faster answers**: Find answers quickly, from your private notes or the public internet
|
||||
- **Assisted creativity**: Smoothly weave across retrieving answers and generating content
|
||||
- **Iterative discovery**: Iteratively explore and re-discover your notes
|
||||
- **Quick access**: Use [Khoj Mini](/features/khoj_mini) on the desktop to quickly pull up a mini chat module for quicker answers
|
||||
- **Search**
|
||||
- **Natural**: Advanced natural language understanding using Transformer based ML Models
|
||||
- **Incremental**: Incremental search for a fast, search-as-you-type experience
|
||||
|
||||
## Setup
|
||||
:::info[Self Hosting]
|
||||
If you are self-hosting the Khoj server, update the *Settings* page on the Khoj Desktop app to:
|
||||
@@ -34,7 +25,20 @@ If you are self-hosting the Khoj server, update the *Settings* page on the Khoj
|
||||
4. [Optional] Add any files, folders you'd like Khoj to be aware of on the *Settings* page and Click *Save*.
|
||||
These files and folders will be automatically kept in sync for you
|
||||
|
||||
## Interface
|
||||
| Chat | Search |
|
||||
|:----:|:------:|
|
||||
|  |  |
|
||||
# Main App
|
||||
|
||||
You can also install the Khoj application on your desktop as a progressive web app.
|
||||
|
||||
1. Open the [Khoj Web App](https://app.khoj.dev) in Chrome.
|
||||
2. Click on the install button in the address bar to install the app. You must be logged into your Chrome browser for this to work.
|
||||
|
||||

|
||||
|
||||
Alternatively, you can also install using this route:
|
||||
|
||||
1. Open the three-dot menu in the top right corner of the browser.
|
||||
2. Go to 'Cast, Save, and Share' option.
|
||||
3. Click on the "Open in Khoj" option.
|
||||
|
||||
|
||||

|
||||
|
||||
@@ -114,7 +114,7 @@ This feature finds entries similar to the one you are currently on.
|
||||
2. Hit `C-c s f` (or `M-x khoj RET f`) to find similar entries
|
||||
|
||||
### Advanced Usage
|
||||
- Add [query filters](https://github.com/khoj-ai/khoj/#query-filters) during search to narrow down results further
|
||||
- Add [query filters](/miscellaneous/advanced#query-filters) during search to narrow down results further
|
||||
e.g. `What is the meaning of life? -"god" +"none" dt>"last week"`
|
||||
|
||||
- Use `C-c C-o 2` to open the current result at cursor in its source org file
|
||||
|
||||
@@ -17,7 +17,7 @@ You have a couple of image generation options.
|
||||
We support most state of the art image generation models, including Ideogram, Flux, and Stable Diffusion. These will run using [Replicate](https://replicate.com). Here's how to set them up:
|
||||
|
||||
1. Get a Replicate API key [here](https://replicate.com/account/api-tokens).
|
||||
1. Create a new [Text to Image Model](https://app.khoj.dev/server/admin/database/texttoimagemodelconfig/). Set the `type` to `Replicate`. Use any of the model names you see [on this list](https://replicate.com/pricing#image-models).
|
||||
1. Create a new [Text to Image Model](http://localhost:42110/server/admin/database/texttoimagemodelconfig/). Set the `type` to `Replicate`. Use any of the model names you see [on this list](https://replicate.com/pricing#image-models).
|
||||
|
||||
### OpenAI
|
||||
|
||||
|
||||
@@ -14,8 +14,18 @@ Try it out yourself! https://app.khoj.dev
|
||||
|
||||
## Self-Hosting
|
||||
|
||||
Online search can work even with self-hosting! Khoj uses [JinaAI's reader API](https://jina.ai/reader/) to search online and read webpages by default. You can get a free API key via https://jina.ai/reader. Set the `JINA_API_KEY` environment variable to your Jina AI reader API key to enable online search.
|
||||
### Search
|
||||
|
||||
To improve online search, set the `SERPER_DEV_API_KEY` environment variable to your [Serper.dev](https://serper.dev/) API key. These search results include additional context like answer box, knowledge graph etc.
|
||||
Online search can work even with self-hosting! You have a few options:
|
||||
|
||||
For advanced webpage reading, set the `OLOSTEP_API_KEY` environment variable to your [Olostep](https://www.olostep.com/) API key. This has a higher success rate at reading webpages than the default webpage reader.
|
||||
- If you're using Docker, online search should work out of the box with [searxng](https://github.com/searxng/searxng) using our standard `docker-compose.yml`.
|
||||
- For a non-local, free solution, you can use [JinaAI's reader API](https://jina.ai/reader/) to search online and read webpages. You can get a free API key via https://jina.ai/reader. Set the `JINA_API_KEY` environment variable to your Jina AI reader API key to enable online search.
|
||||
- To get production-grade, fast online search, set the `SERPER_DEV_API_KEY` environment variable to your [Serper.dev](https://serper.dev/) API key. These search results include additional context like answer box, knowledge graph etc.
|
||||
|
||||
### Webpage Reading
|
||||
|
||||
Out of the box, you **don't have to do anything to enable webpage reading**. Khoj will automatically read webpages by using the `requests` library. To get more distributed and scalable webpage reading, you can use the following options:
|
||||
|
||||
- If you're using Jina AI's reader API for search, it should work automatically for webpage reading as well.
|
||||
- For scalable webpage scraping, you can use [Firecrawl](https://www.firecrawl.dev/). Create a new [Webscraper](http://localhost:42110/server/admin/database/webscraper/add/). Set your Firecrawl API key to the Api Key field, and set the type to Firecrawl.
|
||||
- For advanced webpage reading, you can use [Olostep](https://www.olostep.com/). This has a higher success rate at reading webpages than the default webpage readers. Create a new [Webscraper](http://localhost:42110/server/admin/database/webscraper/add/). Set your Olostep API key to the Api Key field, and set the type to Olostep.
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
---
|
||||
sidebar_position: 0
|
||||
slug: /
|
||||
keywords: ["khoj", "khoj ai", "khoj docs", "khoj documentation", "khoj features", "khoj overview", "khoj quickstart", "khoj chat", "khoj search", "khoj cloud", "khoj self-host", "khoj setup", "open source ai", "local llm", "ai copilot", "second brain", "personal ai", "ai search engine"]
|
||||
keywords: ["khoj", "khoj ai", "khoj docs", "khoj documentation", "khoj features", "khoj overview", "khoj quickstart", "khoj chat", "khoj search", "khoj cloud", "khoj self-host", "khoj setup", "open source ai", "local llm", "ai copilot", "second brain", "personal ai", "ai search engine", "research assistant", "open source llm", "self-host llm", "self-host chatgpt", "ai chatbot", "ai assistant", "ai research assistant", "ai search engine", "ai knowledge base", "ai knowledge graph", "ai personal assistant", "ai second brain", "open source ai assistant"]
|
||||
---
|
||||
|
||||
# Overview
|
||||
|
||||
<p align="center"><img src="/img/khoj-logo-sideways-500.png" width="200" alt="Khoj Logo"></img></p>
|
||||
|
||||
<div align="center">
|
||||
<b>Your Second Brain</b>
|
||||
</div>
|
||||
|
||||
@@ -302,12 +302,12 @@ Setup which chat model you'd want to use. Khoj supports local and online chat mo
|
||||
Using Ollama? See the [Ollama Integration](/advanced/ollama) section for more custom setup instructions.
|
||||
:::
|
||||
|
||||
1. Create a new [OpenAI processor conversation config](http://localhost:42110/server/admin/database/openaiprocessorconversationconfig/add) in the server admin settings. This is kind of a misnomer, we know.
|
||||
1. Create a new [AI Model Api](http://localhost:42110/server/admin/database/aimodelapi/add) in the server admin settings.
|
||||
- Add your [OpenAI API key](https://platform.openai.com/api-keys)
|
||||
- Give the configuration a friendly name like `OpenAI`
|
||||
- (Optional) Set the API base URL. It is only relevant if you're using another OpenAI-compatible proxy server like [Ollama](/advanced/ollama) or [LMStudio](/advanced/lmstudio).<br />
|
||||

|
||||
2. Create a new [chat model options](http://localhost:42110/server/admin/database/chatmodeloptions/add)
|
||||

|
||||
2. Create a new [chat model](http://localhost:42110/server/admin/database/chatmodel/add)
|
||||
- Set the `chat-model` field to an [OpenAI chat model](https://platform.openai.com/docs/models). Example: `gpt-4o`.
|
||||
- Make sure to set the `model-type` field to `OpenAI`.
|
||||
- If your model supports vision, set the `vision enabled` field to `true`. This is currently only supported for OpenAI models with vision capabilities.
|
||||
@@ -315,22 +315,22 @@ Using Ollama? See the [Ollama Integration](/advanced/ollama) section for more cu
|
||||

|
||||
</TabItem>
|
||||
<TabItem value="anthropic" label="Anthropic">
|
||||
1. Create a new [OpenAI processor conversation config](http://localhost:42110/server/admin/database/openaiprocessorconversationconfig/add) in the server admin settings. This is kind of a misnomer, we know.
|
||||
1. Create a new [AI Model API](http://localhost:42110/server/admin/database/aimodelapi/add) in the server admin settings.
|
||||
- Add your [Anthropic API key](https://console.anthropic.com/account/keys)
|
||||
- Give the configuration a friendly name like `Anthropic`. Do not configure the API base url.
|
||||
2. Create a new [chat model options](http://localhost:42110/server/admin/database/chatmodeloptions/add)
|
||||
2. Create a new [chat model](http://localhost:42110/server/admin/database/chatmodel/add)
|
||||
- Set the `chat-model` field to an [Anthropic chat model](https://docs.anthropic.com/en/docs/about-claude/models#model-names). Example: `claude-3-5-sonnet-20240620`.
|
||||
- Set the `model-type` field to `Anthropic`.
|
||||
- Set the `Openai config` field to the OpenAI processor conversation config for Anthropic you created in step 1.
|
||||
- Set the `ai model api` field to the Anthropic AI Model API you created in step 1.
|
||||
</TabItem>
|
||||
<TabItem value="gemini" label="Gemini">
|
||||
1. Create a new [OpenAI processor conversation config](http://localhost:42110/server/admin/database/openaiprocessorconversationconfig/add) in the server admin settings. This is kind of a misnomer, we know.
|
||||
1. Create a new [AI Model API](http://localhost:42110/server/admin/database/aimodelapi/add) in the server admin settings.
|
||||
- Add your [Gemini API key](https://aistudio.google.com/app/apikey)
|
||||
- Give the configuration a friendly name like `Gemini`. Do not configure the API base url.
|
||||
2. Create a new [chat model options](http://localhost:42110/server/admin/database/chatmodeloptions/add)
|
||||
2. Create a new [chat model](http://localhost:42110/server/admin/database/chatmodel/add)
|
||||
- Set the `chat-model` field to a [Google Gemini chat model](https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models#gemini-models). Example: `gemini-1.5-flash`.
|
||||
- Set the `model-type` field to `Gemini`.
|
||||
- Set the `Openai config` field to the OpenAI processor conversation config for Gemini you created in step 1.
|
||||
- Set the `ai model api` field to the Gemini AI Model API you created in step 1.
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="offline" label="Offline">
|
||||
@@ -343,7 +343,7 @@ Offline chat stays completely private and can work without internet using any op
|
||||
:::
|
||||
|
||||
1. Get the name of your preferred chat model from [HuggingFace](https://huggingface.co/models?pipeline_tag=text-generation&library=gguf). *Most GGUF format chat models are supported*.
|
||||
2. Open the [create chat model page](http://localhost:42110/server/admin/database/chatmodeloptions/add/) on the admin panel
|
||||
2. Open the [create chat model page](http://localhost:42110/server/admin/database/chatmodel/add/) on the admin panel
|
||||
3. Set the `chat-model` field to the name of your preferred chat model
|
||||
- Make sure the `model-type` is set to `Offline`
|
||||
4. Set the newly added chat model as your preferred model in your [User chat settings](http://localhost:42110/settings) and [Server chat settings](http://localhost:42110/server/admin/database/serverchatsettings/).
|
||||
|
||||
@@ -37,6 +37,9 @@ const config = {
|
||||
locales: ['en'],
|
||||
},
|
||||
|
||||
// Add a widget for Chatwoot for live chat if users need help
|
||||
clientModules: [require.resolve('./src/components/ChatwootWidget.js')],
|
||||
|
||||
presets: [
|
||||
[
|
||||
'classic',
|
||||
@@ -69,18 +72,17 @@ const config = {
|
||||
}),
|
||||
],
|
||||
],
|
||||
|
||||
themeConfig:
|
||||
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
|
||||
({
|
||||
image: 'img/khoj-logo-sideways-500.png',
|
||||
image: 'img/khoj_documentation.png',
|
||||
metadata: [
|
||||
{name: 'og:title', content: 'Khoj Documentation'},
|
||||
{name: 'og:title', content: 'Docs'},
|
||||
{name: 'og:type', content: 'website'},
|
||||
{name: 'og:site_name', content: 'Khoj Documentation'},
|
||||
{name: 'og:description', content: 'Quickly get started with using or self-hosting Khoj'},
|
||||
{name: 'og:url', content: 'https://docs.khoj.dev'},
|
||||
{name: 'keywords', content: 'khoj, khoj ai, chatgpt, open ai, open source, productivity'}
|
||||
{name: 'keywords', content: 'khoj, khoj ai, chatgpt, open source ai, open source, transparent, accessible, trustworthy, hackable, index notes, rag, productivity'}
|
||||
],
|
||||
navbar: {
|
||||
title: 'Khoj',
|
||||
|
||||
19
documentation/src/components/ChatwootWidget.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment';
|
||||
|
||||
// Only execute on client-side
|
||||
if (ExecutionEnvironment.canUseDOM) {
|
||||
(function (d, t) {
|
||||
var BASE_URL = "https://app.chatwoot.com";
|
||||
var g = d.createElement(t), s = d.getElementsByTagName(t)[0];
|
||||
g.src = BASE_URL + "/packs/js/sdk.js";
|
||||
g.defer = true;
|
||||
g.async = true;
|
||||
s.parentNode.insertBefore(g, s);
|
||||
g.onload = function () {
|
||||
window.chatwootSDK.run({
|
||||
websiteToken: 'cFxvnLSjfE2UF4UUiPCA5NsF',
|
||||
baseUrl: BASE_URL
|
||||
})
|
||||
}
|
||||
})(document, 'script');
|
||||
}
|
||||
@@ -8,13 +8,13 @@
|
||||
|
||||
/* You can override the default Infima variables here. */
|
||||
:root {
|
||||
--ifm-color-primary: #fcc50b;
|
||||
--ifm-color-primary-dark: #fcc50b;
|
||||
--ifm-color-primary-darker: #fcc50b;
|
||||
--ifm-color-primary-darkest: #fcc50b;
|
||||
--ifm-color-primary-light: #fcc50b;
|
||||
--ifm-color-primary-lighter: #fcc50b;
|
||||
--ifm-color-primary-lightest: #fcc50b;
|
||||
--ifm-color-primary: #FFA07A;
|
||||
--ifm-color-primary-dark: #FFA07A;
|
||||
--ifm-color-primary-darker: #FFA07A;
|
||||
--ifm-color-primary-darkest: #FFA07A;
|
||||
--ifm-color-primary-light: #FFA07A;
|
||||
--ifm-color-primary-lighter: #FFA07A;
|
||||
--ifm-color-primary-lightest: #FFA07A;
|
||||
--ifm-code-font-size: 95%;
|
||||
--ifm-heading-font-family: 'Source Sans 3', sans-serif;
|
||||
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
|
||||
@@ -22,13 +22,13 @@
|
||||
|
||||
/* For readability concerns, you should choose a lighter palette in dark mode. */
|
||||
[data-theme='dark'] {
|
||||
--ifm-color-primary: #fcc50b;
|
||||
--ifm-color-primary-dark: #fcc50b;
|
||||
--ifm-color-primary-darker: #fcc50b;
|
||||
--ifm-color-primary-darkest: #fcc50b;
|
||||
--ifm-color-primary-light: #fcc50b;
|
||||
--ifm-color-primary-lighter: #fcc50b;
|
||||
--ifm-color-primary-lightest: #fcc50b;
|
||||
--ifm-color-primary: #FFA07A;
|
||||
--ifm-color-primary-dark: #FFA07A;
|
||||
--ifm-color-primary-darker: #FFA07A;
|
||||
--ifm-color-primary-darkest: #FFA07A;
|
||||
--ifm-color-primary-light: #FFA07A;
|
||||
--ifm-color-primary-lighter: #FFA07A;
|
||||
--ifm-color-primary-lightest: #FFA07A;
|
||||
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "khoj",
|
||||
"name": "Khoj",
|
||||
"version": "1.30.1",
|
||||
"version": "1.32.2",
|
||||
"minAppVersion": "0.15.0",
|
||||
"description": "Your Second Brain",
|
||||
"author": "Khoj Inc.",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
FROM ubuntu:jammy
|
||||
FROM ubuntu:jammy AS base
|
||||
LABEL homepage="https://khoj.dev"
|
||||
LABEL repository="https://github.com/khoj-ai/khoj"
|
||||
LABEL org.opencontainers.image.source="https://github.com/khoj-ai/khoj"
|
||||
@@ -13,36 +13,52 @@ RUN apt update -y && apt -y install \
|
||||
libsm6 \
|
||||
libxext6 \
|
||||
swig \
|
||||
curl && \
|
||||
# Required by Next.js Web app
|
||||
curl -sL https://deb.nodesource.com/setup_20.x | bash - && \
|
||||
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
|
||||
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
|
||||
apt update -y && apt -y --no-install-recommends install nodejs yarn && \
|
||||
curl \
|
||||
# Required by llama-cpp-python pre-built wheels. See #1628
|
||||
musl-dev && \
|
||||
ln -s /usr/lib/x86_64-linux-musl/libc.so /lib/libc.musl-x86_64.so.1 && \
|
||||
# Clean up
|
||||
apt clean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Application
|
||||
# Build Server
|
||||
FROM base AS server-deps
|
||||
WORKDIR /app
|
||||
COPY pyproject.toml .
|
||||
COPY README.md .
|
||||
ARG VERSION=0.0.0
|
||||
# use the pre-built llama-cpp-python, torch cpu wheel
|
||||
ENV PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cpu https://abetlen.github.io/llama-cpp-python/whl/cpu"
|
||||
# avoid downloading unused cuda specific python packages
|
||||
ENV CUDA_VISIBLE_DEVICES=""
|
||||
RUN sed -i "s/dynamic = \\[\"version\"\\]/version = \"$VERSION\"/" pyproject.toml && \
|
||||
pip install --no-cache-dir -e .[prod]
|
||||
|
||||
# Copy Source Code
|
||||
COPY . .
|
||||
|
||||
# Set the PYTHONPATH environment variable in order for it to find the Django app.
|
||||
ENV PYTHONPATH=/app/src:$PYTHONPATH
|
||||
|
||||
# Go to the directory src/interface/web and export the built Next.js assets
|
||||
# Build Web App
|
||||
FROM node:20-alpine AS web-app
|
||||
# Set build optimization env vars
|
||||
ENV NODE_ENV=production
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
WORKDIR /app/src/interface/web
|
||||
RUN bash -c "yarn install --frozen-lockfile --verbose && yarn ciexport && yarn cache clean"
|
||||
# Install dependencies first (cache layer)
|
||||
COPY src/interface/web/package.json src/interface/web/yarn.lock ./
|
||||
RUN yarn install --frozen-lockfile
|
||||
# Copy source and build
|
||||
COPY src/interface/web/. ./
|
||||
RUN yarn build
|
||||
|
||||
# Merge the Server and Web App into a Single Image
|
||||
FROM base
|
||||
ENV PYTHONPATH=/app/src:$PYTHONPATH
|
||||
WORKDIR /app
|
||||
COPY --from=server-deps /usr/local/lib/python3.10/dist-packages /usr/local/lib/python3.10/dist-packages
|
||||
COPY --from=server-deps /usr/local/bin /usr/local/bin
|
||||
COPY --from=web-app /app/src/interface/web/out ./src/khoj/interface/built
|
||||
COPY . .
|
||||
RUN cd src && python3 khoj/manage.py collectstatic --noinput
|
||||
|
||||
# Run the Application
|
||||
# There are more arguments required for the application to run,
|
||||
# but these should be passed in through the docker-compose.yml file.
|
||||
# but those should be passed in through the docker-compose.yml file.
|
||||
ARG PORT
|
||||
EXPOSE ${PORT}
|
||||
ENTRYPOINT ["gunicorn", "-c", "gunicorn-config.py", "src.khoj.main:app"]
|
||||
|
||||
@@ -63,7 +63,8 @@ dependencies = [
|
||||
"tenacity == 8.3.0",
|
||||
"anyio == 3.7.1",
|
||||
"pymupdf == 1.24.11",
|
||||
"django == 5.0.9",
|
||||
"django == 5.0.10",
|
||||
"django-unfold == 0.42.0",
|
||||
"authlib == 1.2.1",
|
||||
"llama-cpp-python == 0.2.88",
|
||||
"itsdangerous == 2.1.2",
|
||||
@@ -88,6 +89,8 @@ dependencies = [
|
||||
"anthropic == 0.26.1",
|
||||
"docx2txt == 0.8",
|
||||
"google-generativeai == 0.8.3",
|
||||
"pyjson5 == 1.6.7",
|
||||
"resend == 1.0.1",
|
||||
]
|
||||
dynamic = ["version"]
|
||||
|
||||
@@ -106,7 +109,6 @@ prod = [
|
||||
"stripe == 7.3.0",
|
||||
"twilio == 8.11",
|
||||
"boto3 >= 1.34.57",
|
||||
"resend == 1.0.1",
|
||||
]
|
||||
dev = [
|
||||
"khoj[prod]",
|
||||
|
||||
211
src/interface/android/app/build.gradle
Normal file
@@ -0,0 +1,211 @@
|
||||
/*
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import groovy.xml.MarkupBuilder
|
||||
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
}
|
||||
|
||||
def twaManifest = [
|
||||
applicationId: 'dev.khoj.app',
|
||||
hostName: 'app.khoj.dev', // The domain being opened in the TWA.
|
||||
launchUrl: '/', // The start path for the TWA. Must be relative to the domain.
|
||||
name: 'Khoj AI', // The application name.
|
||||
launcherName: 'Khoj', // The name shown on the Android Launcher.
|
||||
themeColor: '#FFFFFF', // The color used for the status bar.
|
||||
themeColorDark: '#000000', // The color used for the dark status bar.
|
||||
navigationColor: '#000000', // The color used for the navigation bar.
|
||||
navigationColorDark: '#000000', // The color used for the dark navbar.
|
||||
navigationDividerColor: '#000000', // The navbar divider color.
|
||||
navigationDividerColorDark: '#000000', // The dark navbar divider color.
|
||||
backgroundColor: '#FFFFFF', // The color used for the splash screen background.
|
||||
enableNotifications: true, // Set to true to enable notification delegation.
|
||||
// Every shortcut must include the following fields:
|
||||
// - name: String that will show up in the shortcut.
|
||||
// - short_name: Shorter string used if |name| is too long.
|
||||
// - url: Absolute path of the URL to launch the app with (e.g '/create').
|
||||
// - icon: Name of the resource in the drawable folder to use as an icon.
|
||||
shortcuts: [],
|
||||
// The duration of fade out animation in milliseconds to be played when removing splash screen.
|
||||
splashScreenFadeOutDuration: 300,
|
||||
generatorApp: 'bubblewrap-cli', // Application that generated the Android Project
|
||||
// The fallback strategy for when Trusted Web Activity is not available. Possible values are
|
||||
// 'customtabs' and 'webview'.
|
||||
fallbackType: 'customtabs',
|
||||
enableSiteSettingsShortcut: 'true',
|
||||
orientation: 'natural',
|
||||
]
|
||||
|
||||
android {
|
||||
compileSdkVersion 35
|
||||
namespace "dev.khoj.app"
|
||||
defaultConfig {
|
||||
applicationId "dev.khoj.app"
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 35
|
||||
versionCode 4
|
||||
versionName "4"
|
||||
|
||||
// The name for the application
|
||||
resValue "string", "appName", twaManifest.name
|
||||
|
||||
// The name for the application on the Android Launcher
|
||||
resValue "string", "launcherName", twaManifest.launcherName
|
||||
|
||||
// The URL that will be used when launching the TWA from the Android Launcher
|
||||
def launchUrl = "https://" + twaManifest.hostName + twaManifest.launchUrl
|
||||
resValue "string", "launchUrl", launchUrl
|
||||
|
||||
|
||||
// The URL the Web Manifest for the Progressive Web App that the TWA points to. This
|
||||
// is used by Chrome OS and Meta Quest to open the Web version of the PWA instead of
|
||||
// the TWA, as it will probably give a better user experience for non-mobile devices.
|
||||
resValue "string", "webManifestUrl", 'https://app.khoj.dev/static/khoj.webmanifest'
|
||||
|
||||
|
||||
|
||||
// This is used by Meta Quest.
|
||||
resValue "string", "fullScopeUrl", 'https://app.khoj.dev/'
|
||||
|
||||
|
||||
|
||||
|
||||
// The hostname is used when building the intent-filter, so the TWA is able to
|
||||
// handle Intents to open host url of the application.
|
||||
resValue "string", "hostName", twaManifest.hostName
|
||||
|
||||
// This attribute sets the status bar color for the TWA. It can be either set here or in
|
||||
// `res/values/colors.xml`. Setting in both places is an error and the app will not
|
||||
// compile. If not set, the status bar color defaults to #FFFFFF - white.
|
||||
resValue "color", "colorPrimary", twaManifest.themeColor
|
||||
|
||||
// This attribute sets the dark status bar color for the TWA. It can be either set here or in
|
||||
// `res/values/colors.xml`. Setting in both places is an error and the app will not
|
||||
// compile. If not set, the status bar color defaults to #000000 - white.
|
||||
resValue "color", "colorPrimaryDark", twaManifest.themeColorDark
|
||||
|
||||
// This attribute sets the navigation bar color for the TWA. It can be either set here or
|
||||
// in `res/values/colors.xml`. Setting in both places is an error and the app will not
|
||||
// compile. If not set, the navigation bar color defaults to #FFFFFF - white.
|
||||
resValue "color", "navigationColor", twaManifest.navigationColor
|
||||
|
||||
// This attribute sets the dark navigation bar color for the TWA. It can be either set here
|
||||
// or in `res/values/colors.xml`. Setting in both places is an error and the app will not
|
||||
// compile. If not set, the navigation bar color defaults to #000000 - black.
|
||||
resValue "color", "navigationColorDark", twaManifest.navigationColorDark
|
||||
|
||||
// This attribute sets the navbar divider color for the TWA. It can be either
|
||||
// set here or in `res/values/colors.xml`. Setting in both places is an error and the app
|
||||
// will not compile. If not set, the divider color defaults to #00000000 - transparent.
|
||||
resValue "color", "navigationDividerColor", twaManifest.navigationDividerColor
|
||||
|
||||
// This attribute sets the dark navbar divider color for the TWA. It can be either
|
||||
// set here or in `res/values/colors.xml`. Setting in both places is an error and the
|
||||
//app will not compile. If not set, the divider color defaults to #000000 - black.
|
||||
resValue "color", "navigationDividerColorDark", twaManifest.navigationDividerColorDark
|
||||
|
||||
// Sets the color for the background used for the splash screen when launching the
|
||||
// Trusted Web Activity.
|
||||
resValue "color", "backgroundColor", twaManifest.backgroundColor
|
||||
|
||||
// Defines a provider authority for the Splash Screen
|
||||
resValue "string", "providerAuthority", twaManifest.applicationId + '.fileprovider'
|
||||
|
||||
// The enableNotification resource is used to enable or disable the
|
||||
// TrustedWebActivityService, by changing the android:enabled and android:exported
|
||||
// attributes
|
||||
resValue "bool", "enableNotification", twaManifest.enableNotifications.toString()
|
||||
|
||||
twaManifest.shortcuts.eachWithIndex { shortcut, index ->
|
||||
resValue "string", "shortcut_name_$index", "$shortcut.name"
|
||||
resValue "string", "shortcut_short_name_$index", "$shortcut.short_name"
|
||||
}
|
||||
|
||||
// The splashScreenFadeOutDuration resource is used to set the duration of fade out animation in milliseconds
|
||||
// to be played when removing splash screen. The default is 0 (no animation).
|
||||
resValue "integer", "splashScreenFadeOutDuration", twaManifest.splashScreenFadeOutDuration.toString()
|
||||
|
||||
resValue "string", "generatorApp", twaManifest.generatorApp
|
||||
|
||||
resValue "string", "fallbackType", twaManifest.fallbackType
|
||||
|
||||
resValue "bool", "enableSiteSettingsShortcut", twaManifest.enableSiteSettingsShortcut
|
||||
resValue "string", "orientation", twaManifest.orientation
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled true
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
lintOptions {
|
||||
checkReleaseBuilds false
|
||||
}
|
||||
}
|
||||
|
||||
task generateShorcutsFile {
|
||||
assert twaManifest.shortcuts.size() < 5, "You can have at most 4 shortcuts."
|
||||
twaManifest.shortcuts.eachWithIndex { s, i ->
|
||||
assert s.name != null, 'Missing `name` in shortcut #' + i
|
||||
assert s.short_name != null, 'Missing `short_name` in shortcut #' + i
|
||||
assert s.url != null, 'Missing `icon` in shortcut #' + i
|
||||
assert s.icon != null, 'Missing `url` in shortcut #' + i
|
||||
}
|
||||
|
||||
def shortcutsFile = new File("$projectDir/src/main/res/xml", "shortcuts.xml")
|
||||
|
||||
def xmlWriter = new StringWriter()
|
||||
def xmlMarkup = new MarkupBuilder(new IndentPrinter(xmlWriter, " ", true))
|
||||
|
||||
xmlMarkup
|
||||
.'shortcuts'('xmlns:android': 'http://schemas.android.com/apk/res/android') {
|
||||
twaManifest.shortcuts.eachWithIndex { s, i ->
|
||||
'shortcut'(
|
||||
'android:shortcutId': 'shortcut' + i,
|
||||
'android:enabled': 'true',
|
||||
'android:icon': '@drawable/' + s.icon,
|
||||
'android:shortcutShortLabel': '@string/shortcut_short_name_' + i,
|
||||
'android:shortcutLongLabel': '@string/shortcut_name_' + i) {
|
||||
'intent'(
|
||||
'android:action': 'android.intent.action.MAIN',
|
||||
'android:targetPackage': twaManifest.applicationId,
|
||||
'android:targetClass': twaManifest.applicationId + '.LauncherActivity',
|
||||
'android:data': s.url)
|
||||
'categories'('android:name': 'android.intent.category.LAUNCHER')
|
||||
}
|
||||
}
|
||||
}
|
||||
shortcutsFile.text = xmlWriter.toString() + '\n'
|
||||
}
|
||||
|
||||
preBuild.dependsOn(generateShorcutsFile)
|
||||
|
||||
repositories {
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
|
||||
implementation 'com.google.androidbrowserhelper:locationdelegation:1.1.1'
|
||||
|
||||
implementation 'com.google.androidbrowserhelper:androidbrowserhelper:2.5.0'
|
||||
|
||||
}
|
||||
188
src/interface/android/app/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,188 @@
|
||||
<!--
|
||||
Copyright 2019 Google Inc. All Rights Reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!-- The "package" attribute is rewritten by the Gradle build with the value of applicationId.
|
||||
It is still required here, as it is used to derive paths, for instance when referring
|
||||
to an Activity by ".MyActivity" instead of the full name. If more Activities are added to the
|
||||
application, the package attribute will need to reflect the correct path in order to use
|
||||
the abbreviated format. -->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="dev.khoj.app">
|
||||
|
||||
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<application
|
||||
android:name="Application"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/appName"
|
||||
|
||||
android:manageSpaceActivity="com.google.androidbrowserhelper.trusted.ManageDataLauncherActivity"
|
||||
|
||||
android:supportsRtl="true"
|
||||
android:theme="@android:style/Theme.Translucent.NoTitleBar">
|
||||
|
||||
<meta-data
|
||||
android:name="asset_statements"
|
||||
android:resource="@string/assetStatements" />
|
||||
|
||||
|
||||
<meta-data
|
||||
android:name="web_manifest_url"
|
||||
android:value="@string/webManifestUrl" />
|
||||
|
||||
|
||||
<meta-data
|
||||
android:name="twa_generator"
|
||||
android:value="@string/generatorApp" />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<activity android:name="com.google.androidbrowserhelper.trusted.ManageDataLauncherActivity">
|
||||
<meta-data
|
||||
android:name="android.support.customtabs.trusted.MANAGE_SPACE_URL"
|
||||
android:value="@string/launchUrl" />
|
||||
</activity>
|
||||
|
||||
|
||||
<activity android:name="LauncherActivity"
|
||||
android:alwaysRetainTaskState="true"
|
||||
android:label="@string/launcherName"
|
||||
android:exported="true">
|
||||
<meta-data android:name="android.support.customtabs.trusted.DEFAULT_URL"
|
||||
android:value="@string/launchUrl" />
|
||||
|
||||
<meta-data
|
||||
android:name="android.support.customtabs.trusted.STATUS_BAR_COLOR"
|
||||
android:resource="@color/colorPrimary" />
|
||||
|
||||
<meta-data
|
||||
android:name="android.support.customtabs.trusted.STATUS_BAR_COLOR_DARK"
|
||||
android:resource="@color/colorPrimaryDark" />
|
||||
|
||||
<meta-data
|
||||
android:name="android.support.customtabs.trusted.NAVIGATION_BAR_COLOR"
|
||||
android:resource="@color/navigationColor" />
|
||||
|
||||
<meta-data
|
||||
android:name="android.support.customtabs.trusted.NAVIGATION_BAR_COLOR_DARK"
|
||||
android:resource="@color/navigationColorDark" />
|
||||
|
||||
<meta-data
|
||||
android:name="androix.browser.trusted.NAVIGATION_BAR_DIVIDER_COLOR"
|
||||
android:resource="@color/navigationDividerColor" />
|
||||
|
||||
<meta-data
|
||||
android:name="androix.browser.trusted.NAVIGATION_BAR_DIVIDER_COLOR_DARK"
|
||||
android:resource="@color/navigationDividerColorDark" />
|
||||
|
||||
<meta-data android:name="android.support.customtabs.trusted.SPLASH_IMAGE_DRAWABLE"
|
||||
android:resource="@drawable/splash"/>
|
||||
|
||||
<meta-data android:name="android.support.customtabs.trusted.SPLASH_SCREEN_BACKGROUND_COLOR"
|
||||
android:resource="@color/backgroundColor"/>
|
||||
|
||||
<meta-data android:name="android.support.customtabs.trusted.SPLASH_SCREEN_FADE_OUT_DURATION"
|
||||
android:value="@integer/splashScreenFadeOutDuration"/>
|
||||
|
||||
<meta-data android:name="android.support.customtabs.trusted.FILE_PROVIDER_AUTHORITY"
|
||||
android:value="@string/providerAuthority"/>
|
||||
|
||||
<meta-data android:name="android.app.shortcuts" android:resource="@xml/shortcuts" />
|
||||
|
||||
<meta-data android:name="android.support.customtabs.trusted.FALLBACK_STRATEGY"
|
||||
android:value="@string/fallbackType" />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<meta-data android:name="android.support.customtabs.trusted.SCREEN_ORIENTATION"
|
||||
android:value="@string/orientation"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
|
||||
<intent-filter android:autoVerify="true">
|
||||
<action android:name="android.intent.action.VIEW"/>
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE"/>
|
||||
<data android:scheme="https"
|
||||
android:host="@string/hostName"/>
|
||||
</intent-filter>
|
||||
|
||||
|
||||
</activity>
|
||||
|
||||
<activity android:name="com.google.androidbrowserhelper.trusted.FocusActivity" />
|
||||
|
||||
<activity android:name="com.google.androidbrowserhelper.trusted.WebViewFallbackActivity"
|
||||
android:configChanges="orientation|screenSize" />
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="@string/providerAuthority"
|
||||
android:grantUriPermissions="true"
|
||||
android:exported="false">
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/filepaths" />
|
||||
</provider>
|
||||
|
||||
<service
|
||||
android:name=".DelegationService"
|
||||
android:enabled="@bool/enableNotification"
|
||||
android:exported="@bool/enableNotification">
|
||||
|
||||
|
||||
<meta-data
|
||||
android:name="android.support.customtabs.trusted.SMALL_ICON"
|
||||
android:resource="@drawable/ic_notification_icon" />
|
||||
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.support.customtabs.trusted.TRUSTED_WEB_ACTIVITY_SERVICE"/>
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
|
||||
<activity android:name="com.google.androidbrowserhelper.trusted.NotificationPermissionRequestActivity" />
|
||||
|
||||
|
||||
|
||||
<activity android:name=
|
||||
"com.google.androidbrowserhelper.locationdelegation.PermissionRequestActivity"/>
|
||||
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright 2020 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package dev.khoj.app;
|
||||
|
||||
|
||||
|
||||
public class Application extends android.app.Application {
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package dev.khoj.app;
|
||||
|
||||
|
||||
import com.google.androidbrowserhelper.locationdelegation.LocationDelegationExtraCommandHandler;
|
||||
|
||||
|
||||
public class DelegationService extends
|
||||
com.google.androidbrowserhelper.trusted.DelegationService {
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
|
||||
|
||||
registerExtraCommandHandler(new LocationDelegationExtraCommandHandler());
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright 2020 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package dev.khoj.app;
|
||||
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
|
||||
|
||||
|
||||
public class LauncherActivity
|
||||
extends com.google.androidbrowserhelper.trusted.LauncherActivity {
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
// Setting an orientation crashes the app due to the transparent background on Android 8.0
|
||||
// Oreo and below. We only set the orientation on Oreo and above. This only affects the
|
||||
// splash screen and Chrome will still respect the orientation.
|
||||
// See https://github.com/GoogleChromeLabs/bubblewrap/issues/496 for details.
|
||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.O) {
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
|
||||
} else {
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Uri getLaunchingUrl() {
|
||||
// Get the original launch Url.
|
||||
Uri uri = super.getLaunchingUrl();
|
||||
|
||||
|
||||
|
||||
return uri;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<!--
|
||||
Copyright 2020 Google Inc. All Rights Reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<inset xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:inset="2dp">
|
||||
<aapt:attr name="android:drawable">
|
||||
<shape android:shape="oval">
|
||||
<solid android:color="@color/shortcut_background" />
|
||||
<size android:width="44dp" android:height="44dp" />
|
||||
</shape>
|
||||
</aapt:attr>
|
||||
</inset>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/interface/android/app/src/main/res/drawable-hdpi/splash.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 678 B |
BIN
src/interface/android/app/src/main/res/drawable-mdpi/splash.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
BIN
src/interface/android/app/src/main/res/drawable-xhdpi/splash.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 60 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 8.0 KiB |
|
After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1 @@
|
||||
{"name":"Khoj","short_name":"Khoj","display":"standalone","start_url":"/","description":"The open, personal AI for your digital brain. You can ask Khoj to draft a message, paint your imagination, find information on the internet and even answer questions from your documents.","theme_color":"#ffffff","background_color":"#ffffff","icons":[{"src":"/static/assets/icons/khoj_lantern_128x128.png","sizes":"128x128","type":"image/png"},{"src":"/static/assets/icons/khoj_lantern_256x256.png","sizes":"256x256","type":"image/png"}],"screenshots":[{"src":"/static/assets/samples/phone-remember-plan-sample.png","sizes":"419x900","type":"image/png","form_factor":"narrow","label":"Remember and Plan"},{"src":"/static/assets/samples/phone-browse-draw-sample.png","sizes":"419x900","type":"image/png","form_factor":"narrow","label":"Browse and Draw"},{"src":"/static/assets/samples/desktop-remember-plan-sample.png","sizes":"1260x742","type":"image/png","form_factor":"wide","label":"Remember and Plan"},{"src":"/static/assets/samples/desktop-browse-draw-sample.png","sizes":"1260x742","type":"image/png","form_factor":"wide","label":"Browse and Draw"}]}
|
||||
18
src/interface/android/app/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<!--
|
||||
Copyright 2020 Google Inc. All Rights Reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<resources>
|
||||
<color name="shortcut_background">#F5F5F5</color>
|
||||
</resources>
|
||||
36
src/interface/android/app/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2021 Google Inc. All Rights Reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<resources>
|
||||
|
||||
|
||||
<!--
|
||||
This variable below expresses the relationship between the app and the site,
|
||||
as documented in the TWA documentation at
|
||||
https://developers.google.com/web/updates/2017/10/using-twa#set_up_digital_asset_links_in_an_android_app
|
||||
and is injected into the AndroidManifest.xml
|
||||
-->
|
||||
<string name="assetStatements">
|
||||
[{
|
||||
\"relation\": [\"delegate_permission/common.handle_all_urls\"],
|
||||
\"target\": {
|
||||
\"namespace\": \"web\",
|
||||
\"site\": \"https://app.khoj.dev\"
|
||||
}
|
||||
}]
|
||||
|
||||
</string>
|
||||
</resources>
|
||||
18
src/interface/android/app/src/main/res/xml/filepaths.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<!--
|
||||
Copyright 2019 Google Inc. All Rights Reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<paths>
|
||||
<files-path path="twa_splash/" name="twa_splash" />
|
||||
</paths>
|
||||
1
src/interface/android/app/src/main/res/xml/shortcuts.xml
Normal file
@@ -0,0 +1 @@
|
||||
<shortcuts xmlns:android='http://schemas.android.com/apk/res/android' />
|
||||
42
src/interface/android/build.gradle
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright 2019 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:8.7.2'
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register('clean', Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
14
src/interface/android/gradle.properties
Normal file
@@ -0,0 +1,14 @@
|
||||
# Project-wide Gradle settings.
|
||||
# IDE (e.g. Android Studio) users:
|
||||
# Gradle settings configured through the IDE *will override*
|
||||
# any settings specified in this file.
|
||||
# For more details on how to configure your build environment visit
|
||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||
# Specifies the JVM arguments used for the daemon process.
|
||||
# The setting is particularly useful for tweaking memory settings.
|
||||
org.gradle.jvmargs=-Xmx1536m
|
||||
# When configured, Gradle will run in incubating parallel mode.
|
||||
# This option should only be used with decoupled projects. More details, visit
|
||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||
# org.gradle.parallel=true
|
||||
android.useAndroidX=true
|
||||
BIN
src/interface/android/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
7
src/interface/android/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
249
src/interface/android/gradlew
vendored
Executable file
@@ -0,0 +1,249 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
92
src/interface/android/gradlew.bat
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
1
src/interface/android/manifest-checksum.txt
Normal file
@@ -0,0 +1 @@
|
||||
6ee1711cf4f745dafc80c1cc13c3025342a0f5da
|
||||
1
src/interface/android/settings.gradle
Normal file
@@ -0,0 +1 @@
|
||||
include ':app'
|
||||
BIN
src/interface/android/store_icon.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
55
src/interface/android/twa-manifest.json
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"packageId": "dev.khoj.app",
|
||||
"host": "app.khoj.dev",
|
||||
"name": "Khoj AI",
|
||||
"launcherName": "Khoj",
|
||||
"display": "standalone",
|
||||
"themeColor": "#FFFFFF",
|
||||
"themeColorDark": "#000000",
|
||||
"navigationColor": "#000000",
|
||||
"navigationColorDark": "#000000",
|
||||
"navigationDividerColor": "#000000",
|
||||
"navigationDividerColorDark": "#000000",
|
||||
"backgroundColor": "#FFFFFF",
|
||||
"enableNotifications": true,
|
||||
"startUrl": "/",
|
||||
"iconUrl": "https://assets.khoj.dev/khoj_lantern_1200x1200.png",
|
||||
"splashScreenFadeOutDuration": 300,
|
||||
"signingKey": {
|
||||
"path": "android.keystore",
|
||||
"alias": "android"
|
||||
},
|
||||
"appVersionName": "4",
|
||||
"appVersionCode": 4,
|
||||
"shortcuts": [],
|
||||
"generatorApp": "bubblewrap-cli",
|
||||
"webManifestUrl": "https://app.khoj.dev/static/khoj.webmanifest",
|
||||
"fallbackType": "customtabs",
|
||||
"features": {
|
||||
"locationDelegation": {
|
||||
"enabled": true
|
||||
}
|
||||
},
|
||||
"alphaDependencies": {
|
||||
"enabled": false
|
||||
},
|
||||
"enableSiteSettingsShortcut": true,
|
||||
"isChromeOSOnly": false,
|
||||
"isMetaQuest": false,
|
||||
"fullScopeUrl": "https://app.khoj.dev/",
|
||||
"minSdkVersion": 19,
|
||||
"orientation": "natural",
|
||||
"fingerprints": [
|
||||
{
|
||||
"name": "signing",
|
||||
"value": "CC:98:4A:0A:F1:CC:84:26:AC:02:86:49:AA:69:64:B9:5E:63:A3:EF:18:56:EA:CA:13:C1:3A:15:CA:49:77:46"
|
||||
},
|
||||
{
|
||||
"name": "upload",
|
||||
"value": "D4:5A:6F:6C:18:28:D2:1C:78:27:92:C6:AC:DB:4C:12:C4:52:A1:88:9B:A1:F5:67:D1:22:FE:A0:0F:B1:AE:92"
|
||||
}
|
||||
],
|
||||
"additionalTrustedOrigins": [],
|
||||
"retainedBundles": [],
|
||||
"appVersion": "4"
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="800px"
|
||||
height="800px"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
version="1.1">
|
||||
<path
|
||||
d="m 14.024348,9.8497703 0.04627,1.9750167"
|
||||
stroke="#1c274c"
|
||||
stroke-width="1.77073"
|
||||
stroke-linecap="round" />
|
||||
<path
|
||||
d="m 9.6453624,9.7953624 0.046275,1.9750166"
|
||||
stroke="#1c274c"
|
||||
stroke-width="1.77072"
|
||||
stroke-linecap="round" />
|
||||
<path
|
||||
d="m 11.90538,2.3619994 c -5.4939109,0 -9.6890976,4.0608185 -9.6890976,9.8578926 0,1.477202 0.2658016,2.542848 0.6989332,3.331408 0.433559,0.789293 1.0740097,1.372483 1.9230615,1.798517 1.7362861,0.87132 4.1946007,1.018626 7.0671029,1.018626 0.317997,0 0.593711,0.167879 0.784844,0.458501 0.166463,0.253124 0.238617,0.552748 0.275566,0.787233 0.07263,0.460801 0.05871,1.030165 0.04785,1.474824 v 4.8e-5 l -2.26e-4,0.0091 c -0.0085,0.348246 -0.01538,0.634247 -0.0085,0.861186 0.105589,-0.07971 0.227925,-0.185287 0.36735,-0.31735 0.348613,-0.330307 0.743513,-0.767362 1.176607,-1.246635 l 0.07837,-0.08673 c 0.452675,-0.500762 0.941688,-1.037938 1.41216,-1.473209 0.453774,-0.419787 0.969948,-0.822472 1.476003,-0.953853 1.323661,-0.343655 2.330132,-0.904027 3.005749,-1.76381 0.658957,-0.838568 1.073167,-2.051868 1.073167,-3.898667 0,-5.7970748 -4.195186,-9.8578946 -9.689097,-9.8578946 z M 0.92440678,12.219892 c 0,-7.0067939 5.05909412,-11.47090892 10.98097322,-11.47090892 5.921878,0 10.980972,4.46411502 10.980972,11.47090892 0,2.172259 -0.497596,3.825405 -1.442862,5.028357 -0.928601,1.181693 -2.218843,1.837914 -3.664937,2.213334 -0.211641,0.05502 -0.53529,0.268579 -0.969874,0.670658 -0.417861,0.386604 -0.865628,0.876836 -1.324566,1.384504 l -0.09131,0.101202 c -0.419252,0.464136 -0.849637,0.94059 -1.239338,1.309807 -0.210187,0.199169 -0.425281,0.383422 -0.635348,0.523424 -0.200911,0.133819 -0.449635,0.263369 -0.716376,0.281474 -0.327812,0.02226 -0.61539,-0.149209 -0.804998,-0.457293 -0.157614,-0.255993 -0.217622,-0.557143 -0.246564,-0.778198 -0.0542,-0.414027 -0.04101,-0.933065 -0.03027,-1.355183 l 0.0024,-0.0922 c 0.01099,-0.463865 0.01489,-0.820507 -0.01611,-1.06842 C 8.9434608,19.975238 6.3139711,19.828758 4.356743,18.84659 3.3355029,18.334136 2.4624526,17.578678 1.8500164,16.463713 1.2372016,15.348029 0.92459928,13.943803 0.92459928,12.219967 Z"
|
||||
clip-rule="evenodd"
|
||||
stroke-width="0.360886"
|
||||
fill="#1c274c"
|
||||
fill-rule="evenodd"
|
||||
fill-opacity="1" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.4 KiB |
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M15 12L12 12M12 12L9 12M12 12L12 9M12 12L12 15" stroke="#1C274C" stroke-width="1.5" stroke-linecap="round"/>
|
||||
<path d="M7 3.33782C8.47087 2.48697 10.1786 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 10.1786 2.48697 8.47087 3.33782 7" stroke="#1C274C" stroke-width="1.5" stroke-linecap="round"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 580 B |
1
src/interface/desktop/assets/icons/clock.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><polyline points="128 80 128 128 168 152" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><polyline points="184 104 224 104 224 64" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><path d="M188.4,192a88,88,0,1,1,1.83-126.23C202,77.69,211.72,88.93,224,104" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></svg>
|
||||
|
After Width: | Height: | Size: 573 B |
@@ -1 +0,0 @@
|
||||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 122.88 122.88"><defs><style>.cls-1{fill:#00a912;}.cls-1,.cls-2{fill-rule:evenodd;}.cls-2{fill:#fff;}</style></defs><title>confirm</title><path class="cls-1" d="M61.44,0A61.44,61.44,0,1,1,0,61.44,61.44,61.44,0,0,1,61.44,0Z"/><path class="cls-2" d="M42.37,51.68,53.26,62,79,35.87c2.13-2.16,3.47-3.9,6.1-1.19l8.53,8.74c2.8,2.77,2.66,4.4,0,7L58.14,85.34c-5.58,5.46-4.61,5.79-10.26.19L28,65.77c-1.18-1.28-1.05-2.57.24-3.84l9.9-10.27c1.5-1.58,2.7-1.44,4.22,0Z"/></svg>
|
||||
|
Before Width: | Height: | Size: 549 B |
@@ -1,9 +1 @@
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Transformed by: SVG Repo Mixer Tools -->
|
||||
<svg width="800px" height="800px" viewBox="-2.4 -2.4 28.80 28.80" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
|
||||
<g id="SVGRepo_bgCarrier" stroke-width="0">
|
||||
|
||||
<rect x="-2.4" y="-2.4" width="28.80" height="28.80" rx="14.4" fill="#ffad9f" strokewidth="0"/>
|
||||
|
||||
</g>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><line x1="48" y1="40" x2="208" y2="216" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><path d="M193.89,200.49A79.66,79.66,0,0,1,160,208H72A56,56,0,1,1,85.92,97.74" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><path d="M112.63,63.52A80,80,0,0,1,219.68,181.28" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><path d="M80,128A79.68,79.68,0,0,1,91.07,87.37" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 729 B |
@@ -1,9 +1 @@
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Transformed by: SVG Repo Mixer Tools -->
|
||||
<svg width="800px" height="800px" viewBox="-2.4 -2.4 28.80 28.80" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="#16ba00">
|
||||
|
||||
<g id="SVGRepo_bgCarrier" stroke-width="0">
|
||||
|
||||
<rect x="-2.4" y="-2.4" width="28.80" height="28.80" rx="14.4" fill="#7aff00" strokewidth="0"/>
|
||||
|
||||
</g>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><path d="M80,128a80,80,0,1,1,80,80H72A56,56,0,1,1,85.92,97.74" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><polyline points="120 136 144 160 192 112" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 419 B |
@@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
viewBox="0 0 512 512" xml:space="preserve">
|
||||
<path id="SVGCleanerId_0" style="fill:#FFC36E;" d="M183.295,123.586H55.05c-6.687,0-12.801-3.778-15.791-9.76l-12.776-25.55
|
||||
l12.776-25.55c2.99-5.982,9.103-9.76,15.791-9.76h128.246c6.687,0,12.801,3.778,15.791,9.76l12.775,25.55l-12.776,25.55
|
||||
C196.096,119.808,189.983,123.586,183.295,123.586z"/>
|
||||
<g>
|
||||
<path id="SVGCleanerId_0_1_" style="fill:#FFC36E;" d="M183.295,123.586H55.05c-6.687,0-12.801-3.778-15.791-9.76l-12.776-25.55
|
||||
l12.776-25.55c2.99-5.982,9.103-9.76,15.791-9.76h128.246c6.687,0,12.801,3.778,15.791,9.76l12.775,25.55l-12.776,25.55
|
||||
C196.096,119.808,189.983,123.586,183.295,123.586z"/>
|
||||
</g>
|
||||
<path style="fill:#EFF2FA;" d="M485.517,70.621H26.483c-4.875,0-8.828,3.953-8.828,8.828v44.138h476.69V79.448
|
||||
C494.345,74.573,490.392,70.621,485.517,70.621z"/>
|
||||
<rect x="17.655" y="105.931" style="fill:#E1E6F2;" width="476.69" height="17.655"/>
|
||||
<path style="fill:#FFD782;" d="M494.345,88.276H217.318c-3.343,0-6.4,1.889-7.895,4.879l-10.336,20.671
|
||||
c-2.99,5.982-9.105,9.76-15.791,9.76H55.05c-6.687,0-12.801-3.778-15.791-9.76L28.922,93.155c-1.495-2.99-4.552-4.879-7.895-4.879
|
||||
h-3.372C7.904,88.276,0,96.18,0,105.931v335.448c0,9.751,7.904,17.655,17.655,17.655h476.69c9.751,0,17.655-7.904,17.655-17.655
|
||||
V105.931C512,96.18,504.096,88.276,494.345,88.276z"/>
|
||||
<path style="fill:#FFC36E;" d="M485.517,441.379H26.483c-4.875,0-8.828-3.953-8.828-8.828l0,0c0-4.875,3.953-8.828,8.828-8.828
|
||||
h459.034c4.875,0,8.828,3.953,8.828,8.828l0,0C494.345,437.427,490.392,441.379,485.517,441.379z"/>
|
||||
<path style="fill:#EFF2FA;" d="M326.621,220.69h132.414c4.875,0,8.828-3.953,8.828-8.828v-70.621c0-4.875-3.953-8.828-8.828-8.828
|
||||
H326.621c-4.875,0-8.828,3.953-8.828,8.828v70.621C317.793,216.737,321.746,220.69,326.621,220.69z"/>
|
||||
<path style="fill:#C7CFE2;" d="M441.379,167.724h-97.103c-4.875,0-8.828-3.953-8.828-8.828l0,0c0-4.875,3.953-8.828,8.828-8.828
|
||||
h97.103c4.875,0,8.828,3.953,8.828,8.828l0,0C450.207,163.772,446.254,167.724,441.379,167.724z"/>
|
||||
<path style="fill:#D7DEED;" d="M441.379,203.034h-97.103c-4.875,0-8.828-3.953-8.828-8.828l0,0c0-4.875,3.953-8.828,8.828-8.828
|
||||
h97.103c4.875,0,8.828,3.953,8.828,8.828l0,0C450.207,199.082,446.254,203.034,441.379,203.034z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.4 KiB |
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M22 8.29344C22 11.7692 19.1708 14.5869 15.6807 14.5869C15.0439 14.5869 13.5939 14.4405 12.8885 13.8551L12.0067 14.7333C11.4883 15.2496 11.6283 15.4016 11.8589 15.652C11.9551 15.7565 12.0672 15.8781 12.1537 16.0505C12.1537 16.0505 12.8885 17.075 12.1537 18.0995C11.7128 18.6849 10.4783 19.5045 9.06754 18.0995L8.77362 18.3922C8.77362 18.3922 9.65538 19.4167 8.92058 20.4412C8.4797 21.0267 7.30403 21.6121 6.27531 20.5876L5.2466 21.6121C4.54119 22.3146 3.67905 21.9048 3.33616 21.6121L2.45441 20.7339C1.63143 19.9143 2.1115 19.0264 2.45441 18.6849L10.0963 11.0743C10.0963 11.0743 9.3615 9.90338 9.3615 8.29344C9.3615 4.81767 12.1907 2 15.6807 2C19.1708 2 22 4.81767 22 8.29344ZM15.681 10.4889C16.8984 10.4889 17.8853 9.50601 17.8853 8.29353C17.8853 7.08105 16.8984 6.09814 15.681 6.09814C14.4635 6.09814 13.4766 7.08105 13.4766 8.29353C13.4766 9.50601 14.4635 10.4889 15.681 10.4889Z" fill="#1C274C"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 29 KiB |
BIN
src/interface/desktop/assets/icons/khoj_logo.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M9.16488 17.6505C8.92513 17.8743 8.73958 18.0241 8.54996 18.1336C7.62175 18.6695 6.47816 18.6695 5.54996 18.1336C5.20791 17.9361 4.87912 17.6073 4.22153 16.9498C3.56394 16.2922 3.23514 15.9634 3.03767 15.6213C2.50177 14.6931 2.50177 13.5495 3.03767 12.6213C3.23514 12.2793 3.56394 11.9505 4.22153 11.2929L7.04996 8.46448C7.70755 7.80689 8.03634 7.47809 8.37838 7.28062C9.30659 6.74472 10.4502 6.74472 11.3784 7.28061C11.7204 7.47809 12.0492 7.80689 12.7068 8.46448C13.3644 9.12207 13.6932 9.45086 13.8907 9.7929C14.4266 10.7211 14.4266 11.8647 13.8907 12.7929C13.7812 12.9825 13.6314 13.1681 13.4075 13.4078M10.5919 10.5922C10.368 10.8319 10.2182 11.0175 10.1087 11.2071C9.57284 12.1353 9.57284 13.2789 10.1087 14.2071C10.3062 14.5492 10.635 14.878 11.2926 15.5355C11.9502 16.1931 12.279 16.5219 12.621 16.7194C13.5492 17.2553 14.6928 17.2553 15.621 16.7194C15.9631 16.5219 16.2919 16.1931 16.9495 15.5355L19.7779 12.7071C20.4355 12.0495 20.7643 11.7207 20.9617 11.3787C21.4976 10.4505 21.4976 9.30689 20.9617 8.37869C20.7643 8.03665 20.4355 7.70785 19.7779 7.05026C19.1203 6.39267 18.7915 6.06388 18.4495 5.8664C17.5212 5.3305 16.3777 5.3305 15.4495 5.8664C15.2598 5.97588 15.0743 6.12571 14.8345 6.34955" stroke="#000000" stroke-width="2" stroke-linecap="round"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.4 KiB |
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--! Font Awesome Pro 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M192 0C139 0 96 43 96 96V256c0 53 43 96 96 96s96-43 96-96V96c0-53-43-96-96-96zM64 216c0-13.3-10.7-24-24-24s-24 10.7-24 24v40c0 89.1 66.2 162.7 152 174.4V464H120c-13.3 0-24 10.7-24 24s10.7 24 24 24h72 72c13.3 0 24-10.7 24-24s-10.7-24-24-24H216V430.4c85.8-11.7 152-85.3 152-174.4V216c0-13.3-10.7-24-24-24s-24 10.7-24 24v40c0 70.7-57.3 128-128 128s-128-57.3-128-128V216z"/></svg>
|
||||
|
Before Width: | Height: | Size: 616 B |
1
src/interface/desktop/assets/icons/open-link.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><polyline points="216 104 215.99 40.01 152 40" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="136" y1="120" x2="216" y2="40" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><path d="M184,136v72a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8h72" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></svg>
|
||||
|
After Width: | Height: | Size: 574 B |
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="100px" height="100px"><path fill="#fefdef" d="M29.614,12.307h-1.268c-4.803,0-8.732,3.93-8.732,8.732v61.535c0,4.803,3.93,8.732,8.732,8.732h43.535c4.803,0,8.732-3.93,8.732-8.732v-50.02C72.74,24.68,68.241,20.182,60.367,12.307H41.614"/><path fill="#1f212b" d="M71.882,92.307H28.347c-5.367,0-9.732-4.366-9.732-9.732V21.04c0-5.367,4.366-9.732,9.732-9.732h1.268c0.552,0,1,0.448,1,1s-0.448,1-1,1h-1.268c-4.264,0-7.732,3.469-7.732,7.732v61.535c0,4.264,3.469,7.732,7.732,7.732h43.535c4.264,0,7.732-3.469,7.732-7.732V32.969L59.953,13.307H41.614c-0.552,0-1-0.448-1-1s0.448-1,1-1h18.752c0.265,0,0.52,0.105,0.707,0.293l20.248,20.248c0.188,0.188,0.293,0.442,0.293,0.707v50.02C81.614,87.941,77.248,92.307,71.882,92.307z"/><path fill="#fef6aa" d="M60.114,12.807v10.986c0,4.958,4.057,9.014,9.014,9.014h11.986"/><path fill="#1f212b" d="M81.114 33.307H69.129c-5.247 0-9.515-4.268-9.515-9.515V12.807c0-.276.224-.5.5-.5s.5.224.5.5v10.985c0 4.695 3.82 8.515 8.515 8.515h11.985c.276 0 .5.224.5.5S81.391 33.307 81.114 33.307zM75.114 51.307c-.276 0-.5-.224-.5-.5v-3c0-.276.224-.5.5-.5s.5.224.5.5v3C75.614 51.083 75.391 51.307 75.114 51.307zM75.114 59.307c-.276 0-.5-.224-.5-.5v-6c0-.276.224-.5.5-.5s.5.224.5.5v6C75.614 59.083 75.391 59.307 75.114 59.307zM67.956 86.307H32.272c-4.223 0-7.658-3.45-7.658-7.689V25.955c0-2.549 1.264-4.931 3.382-6.371.228-.156.54-.095.695.132.155.229.096.54-.132.695-1.844 1.254-2.944 3.326-2.944 5.544v52.663c0 3.688 2.987 6.689 6.658 6.689h35.685c3.671 0 6.658-3.001 6.658-6.689V60.807c0-.276.224-.5.5-.5s.5.224.5.5v17.811C75.614 82.857 72.179 86.307 67.956 86.307z"/><path fill="#1f212b" d="M39.802 14.307l-.117 11.834c0 2.21-2.085 3.666-4.036 3.666-1.951 0-4.217-1.439-4.217-3.649l.037-12.58c0-1.307 1.607-2.451 2.801-2.451 1.194 0 2.345 1.149 2.345 2.456l.021 10.829c0 0-.083.667-1.005.645-.507-.012-1.145-.356-1.016-.906v-9.843h-.813l-.021 9.708c0 1.38.54 1.948 1.875 1.948s1.959-.714 1.959-2.094V13.665c0-2.271-1.36-3.5-3.436-3.5s-3.564 1.261-3.564 3.532l.032 12.11c0 3.04 2.123 4.906 4.968 4.906 2.845 0 5-1.71 5-4.75V14.307H39.802zM53.114 52.307h-23c-.276 0-.5-.224-.5-.5s.224-.5.5-.5h23c.276 0 .5.224.5.5S53.391 52.307 53.114 52.307zM44.114 59.307h-14c-.276 0-.5-.224-.5-.5s.224-.5.5-.5h14c.276 0 .5.224.5.5S44.391 59.307 44.114 59.307zM70.114 59.307h-24c-.276 0-.5-.224-.5-.5s.224-.5.5-.5h24c.276 0 .5.224.5.5S70.391 59.307 70.114 59.307zM61.114 66.307h-11c-.276 0-.5-.224-.5-.5s.224-.5.5-.5h11c.276 0 .5.224.5.5S61.391 66.307 61.114 66.307zM71.114 66.307h-8c-.276 0-.5-.224-.5-.5s.224-.5.5-.5h8c.276 0 .5.224.5.5S71.391 66.307 71.114 66.307zM48.114 66.307h-18c-.276 0-.5-.224-.5-.5s.224-.5.5-.5h18c.276 0 .5.224.5.5S48.391 66.307 48.114 66.307zM70.114 73.307h-13c-.276 0-.5-.224-.5-.5s.224-.5.5-.5h13c.276 0 .5.224.5.5S70.391 73.307 70.114 73.307zM54.114 73.307h-24c-.276 0-.5-.224-.5-.5s.224-.5.5-.5h24c.276 0 .5.224.5.5S54.391 73.307 54.114 73.307z"/></svg>
|
||||
|
Before Width: | Height: | Size: 2.9 KiB |
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd" clip-rule="evenodd" viewBox="0 0 512 512"><path fill-rule="nonzero" d="M256 0c70.69 0 134.7 28.66 181.02 74.98C483.34 121.31 512 185.31 512 256c0 70.69-28.66 134.7-74.98 181.02C390.7 483.34 326.69 512 256 512c-70.69 0-134.69-28.66-181.02-74.98C28.66 390.7 0 326.69 0 256c0-70.69 28.66-134.69 74.98-181.02C121.31 28.66 185.31 0 256 0zm-21.49 301.51v-2.03c.16-13.46 1.48-24.12 4.07-32.05 2.54-7.92 6.19-14.37 10.97-19.25 4.77-4.92 10.51-9.39 17.22-13.46 4.31-2.74 8.22-5.78 11.68-9.18 3.45-3.36 6.19-7.27 8.23-11.69 2.02-4.37 3.04-9.24 3.04-14.62 0-6.4-1.52-11.94-4.57-16.66-3-4.68-7.06-8.28-12.04-10.87-5.03-2.54-10.61-3.81-16.76-3.81-5.53 0-10.81 1.11-15.89 3.45-5.03 2.29-9.25 5.89-12.55 10.77-3.3 4.87-5.23 11.12-5.74 18.74h-32.91c.51-12.95 3.81-23.92 9.85-32.91 6.1-8.99 14.13-15.8 24.08-20.42 10.01-4.62 21.08-6.9 33.16-6.9 13.31 0 24.89 2.43 34.84 7.41 9.96 4.93 17.73 11.83 23.27 20.67 5.48 8.84 8.28 19.1 8.28 30.88 0 8.08-1.27 15.34-3.81 21.79-2.54 6.45-6.1 12.24-10.77 17.27-4.68 5.08-10.21 9.54-16.71 13.41-6.15 3.86-11.12 7.82-14.88 11.93-3.81 4.11-6.56 8.99-8.28 14.58-1.73 5.63-2.69 12.59-2.84 20.92v2.03h-30.94zm16.36 65.82c-5.94-.04-11.02-2.13-15.29-6.35-4.26-4.21-6.35-9.34-6.35-15.33 0-5.89 2.09-10.97 6.35-15.19 4.27-4.21 9.35-6.35 15.29-6.35 5.84 0 10.92 2.14 15.18 6.35 4.32 4.22 6.45 9.3 6.45 15.19 0 3.96-1.01 7.62-2.99 10.87-1.98 3.3-4.57 5.94-7.82 7.87-3.25 1.93-6.86 2.9-10.82 2.94zM417.71 94.29C376.33 52.92 319.15 27.32 256 27.32c-63.15 0-120.32 25.6-161.71 66.97C52.92 135.68 27.32 192.85 27.32 256c0 63.15 25.6 120.33 66.97 161.71 41.39 41.37 98.56 66.97 161.71 66.97 63.15 0 120.33-25.6 161.71-66.97 41.37-41.38 66.97-98.56 66.97-161.71 0-63.15-25.6-120.32-66.97-161.71z"/></svg>
|
||||
|
Before Width: | Height: | Size: 1.8 KiB |
@@ -1,25 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="800px"
|
||||
height="800px"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
version="1.1">
|
||||
<path
|
||||
d="m 18.562765,17.147843 c 1.380497,-1.679442 2.307667,-4.013099 2.307667,-6.330999 C 20.870432,5.3951476 16.353958,1 10.782674,1 5.2113555,1 0.69491525,5.3951476 0.69491525,10.816844 c 0,5.421663 4.51644025,9.816844 10.08775875,9.816844 2.381867,0 4.570922,-0.803307 6.296712,-2.14673 0.508475,-0.508475 4.514633,4.192839 4.514633,4.192839 1.036377,1.008544 2.113087,-0.02559 1.07671,-1.034139 z m -7.780091,1.925408 c -4.3394583,0 -8.6708434,-4.033489 -8.6708434,-8.256407 0,-4.2229187 4.3313851,-8.2564401 8.6708434,-8.2564401 4.339458,0 8.670809,4.2369112 8.670809,8.4598301 0,4.222918 -4.331351,8.053017 -8.670809,8.053017 z"
|
||||
fill="#1c274c"
|
||||
fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
fill-opacity="1"
|
||||
stroke-width="1.10519"
|
||||
stroke-dasharray="none" />
|
||||
<path
|
||||
d="m 13.337351,9.3402647 0.05184,2.1532893"
|
||||
stroke="#1c274c"
|
||||
stroke-width="1.95702"
|
||||
stroke-linecap="round" />
|
||||
<path
|
||||
d="M 8.431347,9.2809457 8.483191,11.434235"
|
||||
stroke="#1c274c"
|
||||
stroke-width="1.95701"
|
||||
stroke-linecap="round" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.2 KiB |
@@ -1,37 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
viewBox="0 0 384 512"
|
||||
version="1.1"
|
||||
id="svg1"
|
||||
sodipodi:docname="stop-solid.svg"
|
||||
inkscape:version="1.3 (0e150ed, 2023-07-21)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<defs
|
||||
id="defs1" />
|
||||
<sodipodi:namedview
|
||||
id="namedview1"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#000000"
|
||||
borderopacity="0.25"
|
||||
inkscape:showpageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#d1d1d1"
|
||||
inkscape:zoom="0.4609375"
|
||||
inkscape:cx="192"
|
||||
inkscape:cy="256"
|
||||
inkscape:window-width="1312"
|
||||
inkscape:window-height="449"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="88"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="svg1" />
|
||||
<!--! Font Awesome Pro 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. -->
|
||||
<path
|
||||
d="M0 128C0 92.7 28.7 64 64 64H320c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128z"
|
||||
id="path1"
|
||||
style="fill:#aa0000" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.3 KiB |
@@ -1 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Pro 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M135.2 17.7L128 32H32C14.3 32 0 46.3 0 64S14.3 96 32 96H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H320l-7.2-14.3C307.4 6.8 296.3 0 284.2 0H163.8c-12.1 0-23.2 6.8-28.6 17.7zM416 128H32L53.2 467c1.6 25.3 22.6 45 47.9 45H346.9c25.3 0 46.3-19.7 47.9-45L416 128z"/></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><line x1="216" y1="56" x2="40" y2="56" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="88" y1="24" x2="168" y2="24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><path d="M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 503 B After Width: | Height: | Size: 547 B |
1
src/interface/desktop/assets/icons/upload.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><path d="M176,128h48a8,8,0,0,1,8,8v64a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V136a8,8,0,0,1,8-8H80" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="128" y1="128" x2="128" y2="24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><polyline points="80 72 128 24 176 72" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><circle cx="188" cy="168" r="12"/></svg>
|
||||
|
After Width: | Height: | Size: 618 B |
@@ -8,13 +8,12 @@
|
||||
--primary-hover: #fee285;
|
||||
--primary-focus: rgba(255, 179, 0, 0.125);
|
||||
--primary-inverse: rgba(0, 0, 0, 0.75);
|
||||
--background-color: #f5f4f3;
|
||||
--background-color: #fff;
|
||||
--main-text-color: #475569;
|
||||
--summer-sun: #fcc50b;
|
||||
--water: #44b9da;
|
||||
--leaf: #7b990a;
|
||||
--flower: #d1684e;
|
||||
--font-family: "Noto Sans", "Noto Sans Arabic", sans-serif !important;
|
||||
}
|
||||
|
||||
/* Amber Dark scheme (Auto) */
|
||||
@@ -25,13 +24,12 @@
|
||||
--primary-hover: #fee285;
|
||||
--primary-focus: rgba(255, 179, 0, 0.25);
|
||||
--primary-inverse: rgba(0, 0, 0, 0.75);
|
||||
--background-color: #f5f4f3;
|
||||
--background-color: #fff;
|
||||
--main-text-color: #475569;
|
||||
--summer-sun: #fcc50b;
|
||||
--water: #44b9da;
|
||||
--leaf: #7b990a;
|
||||
--flower: #d1684e;
|
||||
--font-family: "Noto Sans", "Noto Sans Arabic", sans-serif !important;
|
||||
}
|
||||
}
|
||||
/* Amber Dark scheme (Forced) */
|
||||
@@ -41,13 +39,12 @@
|
||||
--primary-hover: #fcc50b;
|
||||
--primary-focus: rgba(255, 179, 0, 0.25);
|
||||
--primary-inverse: rgba(0, 0, 0, 0.75);
|
||||
--background-color: #f5f4f3;
|
||||
--background-color: #fff;
|
||||
--main-text-color: #475569;
|
||||
--summer-sun: #fcc50b;
|
||||
--water: #44b9da;
|
||||
--leaf: #7b990a;
|
||||
--flower: #d1684e;
|
||||
--font-family: "Noto Sans", "Noto Sans Arabic", sans-serif !important;
|
||||
}
|
||||
/* Amber (Common styles) */
|
||||
:root {
|
||||
@@ -90,36 +87,46 @@ nav.khoj-nav {
|
||||
grid-gap: 32px;
|
||||
justify-self: right;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.khoj-status-box {
|
||||
.khoj-status-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 52px;
|
||||
gap: 4px;
|
||||
-webkit-app-region: no-drag;
|
||||
padding: 8px 12px;
|
||||
border-radius: 16px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
background-color: #f5f5f5; /* Neutral background */
|
||||
color: #333; /* Neutral text color */
|
||||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); /* Subtle shadow */
|
||||
transition: background-color 0.3s ease, color 0.3s ease;
|
||||
}
|
||||
|
||||
.khoj-status-box .khoj-status-connected {
|
||||
height: 12px;
|
||||
width: 12px;
|
||||
.khoj-status-connected {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 50%;
|
||||
background-color: rgb(90, 235, 90);
|
||||
}
|
||||
.khoj-status-box .khoj-status-not-connected {
|
||||
height: 12px;
|
||||
width: 12px;
|
||||
border-radius: 50%;
|
||||
background-color: rgb(235, 90, 90);
|
||||
}
|
||||
|
||||
.khoj-status-box .khoj-status-text {
|
||||
display: none;
|
||||
background-color: #4CAF50; /* Green for connected */
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.khoj-status-not-connected {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 50%;
|
||||
background-color: #F44336; /* Red for not connected */
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.khoj-status-text {
|
||||
color: #333; /* Neutral text color */
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.khoj-status-box:hover {
|
||||
background-color: #e0e0e0; /* Slightly darker background on hover */
|
||||
color: #000; /* Darker text on hover */
|
||||
}
|
||||
.khoj-status-box:hover .khoj-status-text {
|
||||
display: block;
|
||||
}
|
||||
|
||||
a.khoj-nav {
|
||||
display: flex;
|
||||
@@ -188,18 +195,18 @@ img.khoj-logo {
|
||||
.khoj-nav-dropdown-content.show {
|
||||
opacity: 1;
|
||||
pointer-events: auto;
|
||||
border-radius: 20px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
.khoj-nav-dropdown-content a {
|
||||
color: black;
|
||||
padding: 12px 16px;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
border-radius: 20px;
|
||||
}
|
||||
.khoj-nav-dropdown-content a:hover {
|
||||
background-color: var(--primary-hover);
|
||||
background-color: hsla(24.6 95% 53.1% / 0.125);
|
||||
}
|
||||
|
||||
.khoj-nav-username {
|
||||
padding: 12px 16px;
|
||||
text-decoration: none;
|
||||
@@ -233,6 +240,17 @@ img.khoj-logo {
|
||||
border: 3px solid var(--primary-hover);
|
||||
}
|
||||
|
||||
.khoj-nav-icon {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
a.khoj-nav-link {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 600px) {
|
||||
.khoj-nav-dropdown-content {
|
||||
display: block;
|
||||
|
||||
@@ -440,7 +440,7 @@ let titleBarStyle = process.platform === 'win32' ? 'default' : 'hidden';
|
||||
const {globalShortcut, clipboard} = require('electron'); // global shortcut and clipboard dependencies for shortcut window
|
||||
const openShortcutWindowKeyBind = 'CommandOrControl+Shift+K'
|
||||
|
||||
const createWindow = (tab = 'chat.html') => {
|
||||
const createWindow = (tab = 'settings.html') => {
|
||||
win = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 800,
|
||||
@@ -602,6 +602,14 @@ app.whenReady().then(() => {
|
||||
});
|
||||
ipcMain.handle('deleteAllFiles', deleteAllFiles);
|
||||
|
||||
ipcMain.handle('openFile', async (_, path) => {
|
||||
try {
|
||||
await shell.openPath(path);
|
||||
} catch (error) {
|
||||
console.error('Error opening file:', error);
|
||||
}
|
||||
});
|
||||
|
||||
const mainWindow = createWindow();
|
||||
|
||||
app.setAboutPanelOptions({
|
||||
@@ -652,7 +660,7 @@ app.whenReady().then(() => {
|
||||
globalShortcut.unregister('Escape');
|
||||
});
|
||||
ipcMain.on('continue-conversation-button-clicked', () => {
|
||||
openWindow('chat.html');
|
||||
openWindow('settings.html');
|
||||
if (shortcutWin && !shortcutWin.isDestroyed()) {
|
||||
shortcutWin.close();
|
||||
}
|
||||
@@ -727,8 +735,6 @@ app.whenReady().then(() => {
|
||||
tray = new Tray(icon)
|
||||
|
||||
const contextMenu = Menu.buildFromTemplate([
|
||||
{ label: 'Chat', type: 'normal', click: () => { openWindow('chat.html'); }},
|
||||
{ label: 'Search', type: 'normal', click: () => { openWindow('search.html') }},
|
||||
{ label: 'Configure', type: 'normal', click: () => { openWindow('settings.html') }},
|
||||
{ type: 'separator' },
|
||||
{ label: 'About Khoj', type: 'normal', click: () => { openAboutWindow(); } },
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "Khoj",
|
||||
"version": "1.30.1",
|
||||
"version": "1.32.2",
|
||||
"description": "Your Second Brain",
|
||||
"author": "Khoj Inc. <team@khoj.dev>",
|
||||
"license": "GPL-3.0-or-later",
|
||||
@@ -16,7 +16,7 @@
|
||||
"start": "yarn electron ."
|
||||
},
|
||||
"dependencies": {
|
||||
"@todesktop/runtime": "^1.6.4",
|
||||
"@todesktop/runtime": "^2.0.0",
|
||||
"axios": "^1.7.4",
|
||||
"cron": "^2.4.3",
|
||||
"electron-store": "^8.1.0"
|
||||
|
||||
@@ -83,4 +83,9 @@ contextBridge.exposeInMainWorld('appInfoAPI', {
|
||||
contextBridge.exposeInMainWorld('navigateAPI', {
|
||||
navigateToSettings: () => ipcRenderer.send('navigate', 'settings.html'),
|
||||
navigateToWebSettings: () => ipcRenderer.send('navigateToWebApp', 'settings'),
|
||||
navigateToWebHome: () => ipcRenderer.send('navigateToWebApp', ''),
|
||||
})
|
||||
|
||||
contextBridge.exposeInMainWorld('openFileAPI', {
|
||||
openFile: (path) => ipcRenderer.invoke('openFile', path)
|
||||
});
|
||||
|
||||