Skip to content

Commit

Permalink
Expose web, desktop settings page under /settings, not /configure
Browse files Browse the repository at this point in the history
  • Loading branch information
debanjum committed Jul 17, 2024
1 parent 19724d2 commit 3abe947
Show file tree
Hide file tree
Showing 25 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion documentation/docs/advanced/ollama.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ Ollama exposes a local [OpenAI API compatible server](https://github.com/ollama/
5. Create a new [Server Chat Setting](http://localhost:42110/server/admin/database/serverchatsettings/add/) on your Khoj admin panel
- Default model: `<name of chat model option you created in step 4>`
- Summarizer model: `<name of chat model option you created in step 4>`
6. Go to [your config](http://localhost:42110/configure) and select the model you just created in the chat model dropdown.
6. Go to [your config](http://localhost:42110/settings) and select the model you just created in the chat model dropdown.

That's it! You should now be able to chat with your Ollama model from Khoj. If you want to add additional models running on Ollama, repeat step 6 for each model.
2 changes: 1 addition & 1 deletion documentation/docs/advanced/use-openai-proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ For specific integrations, see our [Ollama](/advanced/ollama), [LMStudio](/advan
5. Create a new [Server Chat Setting](http://localhost:42110/server/admin/database/serverchatsettings/add/) on your Khoj admin panel
- Default model: `<name of chat model option you created in step 4>`
- Summarizer model: `<name of chat model option you created in step 4>`
6. Go to [your config](http://localhost:42110/configure) and select the model you just created in the chat model dropdown.
6. Go to [your config](http://localhost:42110/settings) and select the model you just created in the chat model dropdown.
2 changes: 1 addition & 1 deletion documentation/docs/clients/desktop.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Khoj will keep these files in sync to provide contextual responses when you sear
## Setup

1. Install the [Khoj Desktop app](https://khoj.dev/downloads) for your OS
2. Generate an API key on the [Khoj Web App](https://app.khoj.dev/configure#clients)
2. Generate an API key on the [Khoj Web App](https://app.khoj.dev/settings#clients)
3. Set your Khoj API Key on the *Settings* page of the Khoj Desktop app
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
Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/clients/emacs.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ sidebar_position: 2
| ![khoj search on emacs](/img/khoj_search_on_emacs.png) | ![khoj chat on emacs](/img/khoj_chat_on_emacs.png) |

## Setup
1. Generate an API key on the [Khoj Web App](https://app.khoj.dev/configure#clients)
1. Generate an API key on the [Khoj Web App](https://app.khoj.dev/settings#clients)
2. Add below snippet to your Emacs config file, usually at `~/.emacs.d/init.el`


Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/clients/obsidian.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ sidebar_position: 3

1. Open [Khoj](https://obsidian.md/plugins?id=khoj) from the *Community plugins* tab in Obsidian settings panel
2. Click *Install*, then *Enable* on the Khoj plugin page in Obsidian
3. Generate an API key on the [Khoj Web App](https://app.khoj.dev/configure#clients)
3. Generate an API key on the [Khoj Web App](https://app.khoj.dev/settings#clients)
4. Set your Khoj API Key in the Khoj plugin settings in Obsidian

See the official [Obsidian Plugin Docs](https://help.obsidian.md/Extending+Obsidian/Community+plugins) for more details on installing Obsidian plugins.
Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/clients/whatsapp.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Text [+1 (848) 800 4242](https://wa.me/18488004242) or scan [this QR code](https

Without any desktop clients, you can start chatting with Khoj on WhatsApp. Bear in mind you do need one of the desktop clients in order to share and sync your data with Khoj. The WhatsApp AI bot will work right away for answering generic queries and using Khoj in default mode.

In order to use Khoj on WhatsApp with your own data, you need to setup a Khoj Cloud account and connect your WhatsApp account to it. This is a one time setup and you can do it from the [Khoj Cloud config page](https://app.khoj.dev/configure).
In order to use Khoj on WhatsApp with your own data, you need to setup a Khoj Cloud account and connect your WhatsApp account to it. This is a one time setup and you can do it from the [Khoj Cloud config page](https://app.khoj.dev/settings).

If you hit usage limits for the WhatsApp bot, upgrade to [a paid plan](https://khoj.dev/pricing) on Khoj Cloud.

Expand Down
4 changes: 2 additions & 2 deletions documentation/docs/data-sources/github_integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ The Github integration allows you to index as many repositories as you want. It'

# Configure your settings

1. Go to [https://app.khoj.dev/configure](https://app.khoj.dev/configure) and enter in settings for the data sources you want to index. You'll have to specify the file paths.
1. Go to [https://app.khoj.dev/settings](https://app.khoj.dev/settings) and enter in settings for the data sources you want to index. You'll have to specify the file paths.

## Use the Github plugin

1. Generate a [classic PAT (personal access token)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) from [Github](https://github.com/settings/tokens) with `repo` and `admin:org` scopes at least.
2. Navigate to [https://app.khoj.dev/configure/content/github](https://app.khoj.dev/configure/content/github) to configure your Github settings. Enter in your PAT, along with details for each repository you want to index.
2. Navigate to [https://app.khoj.dev/settings/content/github](https://app.khoj.dev/settings/content/github) to configure your Github settings. Enter in your PAT, along with details for each repository you want to index.
3. Click `Save`. Go back to the settings page and click `Configure`.
4. Go to [https://app.khoj.dev/](https://app.khoj.dev/) and start searching!
6 changes: 3 additions & 3 deletions documentation/docs/data-sources/notion_integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The Notion integration allows you to search/chat with your Notion workspaces. [Notion](https://notion.so/) is a platform people use for taking notes, especially for collaboration.

Go to https://app.khoj.dev/configure to connect your Notion workspace(s) to Khoj.
Go to https://app.khoj.dev/settings to connect your Notion workspace(s) to Khoj.

![notion_integration](https://assets.khoj.dev/notion_integration.gif)

Expand All @@ -13,7 +13,7 @@ Go to https://app.khoj.dev/configure to connect your Notion workspace(s) to Khoj
![setup_new_integration](https://github.com/khoj-ai/khoj/assets/65192171/b056e057-d4dc-47dc-aad3-57b59a22c68b)
3. Share all the workspaces that you want to integrate with the Khoj integration you just made in the previous step
![enable_workspace](https://github.com/khoj-ai/khoj/assets/65192171/98290303-b5b8-4cb0-b32c-f68c6923a3d0)
4. In the first step, you generated an API key. Use the newly generated API Key in your Khoj settings, by default at http://localhost:42110/configure/content/notion. Click `Save`.
5. Click `Configure` in http://localhost:42110/configure to index your Notion workspace(s).
4. In the first step, you generated an API key. Use the newly generated API Key in your Khoj settings, by default at http://localhost:42110/settings/content/notion. Click `Save`.
5. Click `Configure` in http://localhost:42110/settings to index your Notion workspace(s).

That's it! You should be ready to start searching and chatting. Make sure you've configured your [chat settings](/get-started/setup#2-configure).
2 changes: 1 addition & 1 deletion src/interface/desktop/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ function pushDataToKhoj (regenerate = false) {
console.error(error);
state["completed"] = false;
if (error?.response?.status === 429 && (BrowserWindow.getAllWindows().find(win => win.webContents.getURL().includes('config')))) {
state["error"] = `Looks like you're out of space to sync your files. <a href="https://app.khoj.dev/configure">Upgrade your plan</a> to unlock more space.`;
state["error"] = `Looks like you're out of space to sync your files. <a href="https://app.khoj.dev/settings">Upgrade your plan</a> to unlock more space.`;
const win = BrowserWindow.getAllWindows().find(win => win.webContents.getURL().includes('config'));
if (win) win.webContents.send('needsSubscription', true);
} else if (error?.code === 'ECONNREFUSED') {
Expand Down
2 changes: 1 addition & 1 deletion src/interface/desktop/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ window.updateStateAPI.onUpdateState((event, state) => {
window.needsSubscriptionAPI.onNeedsSubscription((event, needsSubscription) => {
console.log("needs subscription", needsSubscription);
if (needsSubscription) {
window.alert("Looks like you're out of space to sync your files. Upgrade your plan to unlock more space here: https://app.khoj.dev/configure");
window.alert("Looks like you're out of space to sync your files. Upgrade your plan to unlock more space here: https://app.khoj.dev/settings");
needsSubscriptionElement.style.display = 'block';
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/interface/desktop/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
.then(enabled_types => {
// Show warning if no content types are enabled
if (enabled_types.detail) {
document.getElementById("results").innerHTML = "<div id='results-error'>To use Khoj search, setup your content plugins on the Khoj <a class='inline-chat-link' href='/configure'>settings page</a>.</div>";
document.getElementById("results").innerHTML = "<div id='results-error'>To use Khoj search, setup your content plugins on the Khoj <a class='inline-chat-link' href='/settings'>settings page</a>.</div>";
document.getElementById("query").setAttribute("disabled", "disabled");
document.getElementById("query").setAttribute("placeholder", "Configure Khoj to enable search");
return [];
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/interface/desktop/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ async function populateHeaderPane() {
<div id="khoj-nav-menu" class="khoj-nav-dropdown-content">
<div class="khoj-nav-username"> ${username} </div>
<a id="github-nav" class="khoj-nav" href="https://github.com/khoj-ai/khoj">GitHub</a>
<a id="settings-nav" class="khoj-nav" href="./configure.html">⚙️ Settings</a>
<a id="settings-nav" class="khoj-nav" href="./settings.html">⚙️ Settings</a>
</div>
</div>
` : ''}
Expand Down
2 changes: 1 addition & 1 deletion src/interface/emacs/khoj.el
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
:type 'boolean)

(defcustom khoj-api-key nil
"API Key to your Khoj. Default at https://app.khoj.dev/configure#clients."
"API Key to your Khoj. Default at https://app.khoj.dev/settings#clients."
:group 'khoj
:type 'string)

Expand Down
4 changes: 2 additions & 2 deletions src/interface/obsidian/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,12 @@ export function getBackendStatusMessage(
): string {
// Welcome message with default settings. Khoj cloud always expects an API key.
if (!khojApiKey && khojUrl === 'https://app.khoj.dev')
return `🌈 Welcome to Khoj! Get your API key from ${khojUrl}/configure#clients and set it in the Khoj plugin settings on Obsidian`;
return `🌈 Welcome to Khoj! Get your API key from ${khojUrl}/settings#clients and set it in the Khoj plugin settings on Obsidian`;

if (!connectedToServer)
return `❗️Could not connect to Khoj at ${khojUrl}. Ensure your can access it`;
else if (!userEmail)
return `✅ Connected to Khoj. ❗️Get a valid API key from ${khojUrl}/configure#clients to log in`;
return `✅ Connected to Khoj. ❗️Get a valid API key from ${khojUrl}/settings#clients to log in`;
else if (userEmail === 'default@example.com')
// Logged in as default user in anonymous mode
return `✅ Signed in to Khoj`;
Expand Down
6 changes: 3 additions & 3 deletions src/interface/web/app/components/navMenu/navMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export default function NavMenu(props: NavMenuProps) {
<DropdownMenuSeparator />
<DropdownMenuLabel>Profile</DropdownMenuLabel>
<DropdownMenuItem>
<Link href="/configure">Configure</Link>
<Link href="/settings">Settings</Link>
</DropdownMenuItem>
<DropdownMenuItem>
<Link href="https://docs.khoj.dev">Help</Link>
Expand Down Expand Up @@ -172,8 +172,8 @@ export default function NavMenu(props: NavMenuProps) {
{userData &&
<>
<MenubarItem>
<Link href="/configure">
Configure
<Link href="/settings">
Settings
</Link>
</MenubarItem>
<MenubarSeparator />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ function UserProfileComponent(props: UserProfileProps) {

return (
<div className={styles.profile}>
<Link href="/configure" target="_blank" rel="noopener noreferrer">
<Link href="/settings">
<Avatar>
<AvatarImage src={props.userProfile.photo} alt="user profile" />
<AvatarFallback>
Expand Down
4 changes: 2 additions & 2 deletions src/khoj/interface/web/chat.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
- 📚 Understand files you drag & drop here
- 👩🏾‍🚀 Be tuned to your conversation needs via [agents](./agents)
Get the Khoj [Desktop](https://khoj.dev/downloads), [Obsidian](https://docs.khoj.dev/clients/obsidian#setup), [Emacs](https://docs.khoj.dev/clients/emacs#setup) apps to search, chat with your 🖥️ computer docs. You can manage all the files you've shared with me at any time by going to [your settings](/configure/content/computer/).
Get the Khoj [Desktop](https://khoj.dev/downloads), [Obsidian](https://docs.khoj.dev/clients/obsidian#setup), [Emacs](https://docs.khoj.dev/clients/emacs#setup) apps to search, chat with your 🖥️ computer docs. You can manage all the files you've shared with me at any time by going to [your settings](/settings/content/computer/).
To get started, just start typing below. You can also type / to see a list of commands.
`.trim()
Expand Down Expand Up @@ -1333,7 +1333,7 @@
- 📚 Understand files you drag & drop here
- 👩🏾‍🚀 Be tuned to your conversation needs via [agents](./agents)
Get the Khoj [Desktop](https://khoj.dev/downloads), [Obsidian](https://docs.khoj.dev/clients/obsidian#setup), or [Emacs](https://docs.khoj.dev/clients/emacs#setup) app to keep your files in sync. You can manage all the files you've shared with me at any time by going to [your settings](/configure/content/computer/).
Get the Khoj [Desktop](https://khoj.dev/downloads), [Obsidian](https://docs.khoj.dev/clients/obsidian#setup), or [Emacs](https://docs.khoj.dev/clients/emacs#setup) app to keep your files in sync. You can manage all the files you've shared with me at any time by going to [your settings](/settings/content/computer/).
To get started, just start typing below. You can also type / to see a list of commands.
Expand Down
2 changes: 1 addition & 1 deletion src/khoj/interface/web/public_conversation.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
- 📚 Understand files you drag & drop here
- 👩🏾‍🚀 Be tuned to your conversation needs via [agents](./agents)
Get the Khoj [Desktop](https://khoj.dev/downloads), [Obsidian](https://docs.khoj.dev/clients/obsidian#setup), [Emacs](https://docs.khoj.dev/clients/emacs#setup) apps to search, chat with your 🖥️ computer docs. You can manage all the files you've shared with me at any time by going to [your settings](/configure/content/computer/).
Get the Khoj [Desktop](https://khoj.dev/downloads), [Obsidian](https://docs.khoj.dev/clients/obsidian#setup), [Emacs](https://docs.khoj.dev/clients/emacs#setup) apps to search, chat with your 🖥️ computer docs. You can manage all the files you've shared with me at any time by going to [your settings](/settings/content/computer/).
To get started, just start typing below. You can also type / to see a list of commands.
`.trim()
Expand Down
2 changes: 1 addition & 1 deletion src/khoj/interface/web/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
.then(enabled_types => {
// Show warning if no content types are enabled, or just one ("all")
if (enabled_types[0] === "all" && enabled_types.length === 1) {
document.getElementById("results").innerHTML = "<div id='results-error'>To use Khoj search, setup your content plugins on the Khoj <a class='inline-chat-link' href='/configure'>settings page</a>.</div>";
document.getElementById("results").innerHTML = "<div id='results-error'>To use Khoj search, setup your content plugins on the Khoj <a class='inline-chat-link' href='/settings'>settings page</a>.</div>";
document.getElementById("query").setAttribute("disabled", "disabled");
document.getElementById("query").setAttribute("placeholder", "Configure Khoj to enable search");
return [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h3 id="card-title-computer" class="card-title">
<p class="card-description">Manage files from your computer</p>
</div>
<div class="card-action-row">
<a class="card-button" href="/configure/content/computer">
<a class="card-button" href="/settings/content/computer">
{% if enabled_content_source.computer %}
Update
{% else %}
Expand Down Expand Up @@ -76,7 +76,7 @@ <h3 class="card-title">
<p class="card-description">Set repositories to index</p>
</div>
<div class="card-action-row">
<a class="card-button" href="/configure/content/github">
<a class="card-button" href="/settings/content/github">
{% if enabled_content_source.github %}
Update
{% else %}
Expand Down Expand Up @@ -110,7 +110,7 @@ <h3 class="card-title">
</div>
<div class="card-action-row">
{% if enabled_content_source.notion %}
<a class="card-button" href="/configure/content/notion">
<a class="card-button" href="/settings/content/notion">
Update
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14M12 5l7 7-7 7"></path></svg>
</a>
Expand All @@ -120,7 +120,7 @@ <h3 class="card-title">
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14M12 5l7 7-7 7"></path></svg>
</a>
{% else %}
<a class="card-button" href="/configure/content/notion">
<a class="card-button" href="/settings/content/notion">
Setup
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14M12 5l7 7-7 7"></path></svg>
</a>
Expand Down
2 changes: 1 addition & 1 deletion src/khoj/interface/web/utils.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
{% endif %}
<div id="khoj-nav-menu" class="khoj-nav-dropdown-content">
<div class="khoj-nav-username"> {{ username }} </div>
<a id="settings-nav" class="khoj-nav" href="/configure">Settings</a>
<a id="settings-nav" class="khoj-nav" href="/settings">Settings</a>
<a id="github-nav" class="khoj-nav" href="https://github.com/khoj-ai/khoj">GitHub</a>
<a id="help-nav" class="khoj-nav" href="https://docs.khoj.dev" target="_blank">Help</a>
<a class="khoj-nav" href="/auth/logout">Logout</a>
Expand Down
2 changes: 1 addition & 1 deletion src/khoj/routers/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def update(
):
user = request.user.object
if not state.config:
error_msg = f"🚨 Khoj is not configured.\nConfigure it via http://localhost:42110/configure, plugins or by editing {state.config_file}."
error_msg = f"🚨 Khoj is not configured.\nConfigure it via http://localhost:42110/settings, plugins or by editing {state.config_file}."
logger.warning(error_msg)
raise HTTPException(status_code=500, detail=error_msg)
try:
Expand Down
Loading

0 comments on commit 3abe947

Please sign in to comment.