diff --git a/.gitignore b/.gitignore index a0d77b1..168e754 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,7 @@ sijapi/data/*.pbf sijapi/data/geonames.txt sijapi/data/img/images/ sijapi/config/*.yaml -sijapi/config/O365/ +sijapi/config/MS365/ sijapi/local_only/ sijapi/testbed/ khoj/ diff --git a/Extras/Caddyfile.example b/Extras/Caddyfile.example index 024c061..a2f6cb3 100644 --- a/Extras/Caddyfile.example +++ b/Extras/Caddyfile.example @@ -36,7 +36,7 @@ !{!{ YOUR SIJAPI SUBDOMAIN }!}! { import cors @public { - path /img/* /oauth /oauth/* /o365 /o365/* /ip /health /health* /health/* /id /identity + path /img/* /oauth /oauth/* /MS365 /MS365/* /ip /health /health* /health/* /id /identity } @apiKeyAuthHeader { header Authorization "Bearer !{!{ YOUR GLOBAL_API_KEY }!}!" diff --git a/sijapi/config/.env-example b/sijapi/config/.env-example index 38a50b5..3d3fdda 100644 --- a/sijapi/config/.env-example +++ b/sijapi/config/.env-example @@ -291,7 +291,7 @@ MS365_SECRET=¿SECRET? # <--- enter your app secret (found in Azure MS365_SCOPE='basic,calendar_all,Calendars.Read,Calendars.ReadWrite,offline_access' MS365_TOKEN_FILE=oauth_token.txt MS365_LOGIN_URL='https://login.microsoftonline.com' -MS365_REDIRECT_PATH=¿SECRET? # <--- e.g. http://localhost:4444/o365/oauth_redirect +MS365_REDIRECT_PATH=¿SECRET? # <--- e.g. http://localhost:4444/MS365/oauth_redirect #─── notes: ─────────────────────────────────────────────────────────────────────────────── # # # MS365_CLIENT_ID, _TENANT_ID, _SECRET, AND _SCOPES must be obtained from Microsoft diff --git a/sijapi/config/asr.yaml-example b/sijapi/config/asr.yaml-example new file mode 100644 index 0000000..1838988 --- /dev/null +++ b/sijapi/config/asr.yaml-example @@ -0,0 +1,11 @@ +DIR: '{{ DIR.HOME }}/whisper.cpp' +MODELS: + - small + - base + - base-en + - tiny + - medium + - medium-en + - large + - large-v2 + - large-v3 \ No newline at end of file diff --git a/sijapi/config/cal.yaml-example b/sijapi/config/cal.yaml-example new file mode 100644 index 0000000..e2fa1b9 --- /dev/null +++ b/sijapi/config/cal.yaml-example @@ -0,0 +1,19 @@ +MS365: + STATUS: OFF + AUTH: + TENANT: bad78048-a6e0-47b1-a24b-403c444aa349 + CLIENT_ID: ce8cbd24-f146-4dc7-8ee7-51d9b69dec59 + LOGIN: 'https://login.microsoftonline.com' + REDIRECT: 'https://api.sij.ai/MS365/oauth_redirect' + SCOPES: + - basic + - calendar_all + - Calendars.Read + - Calendars.ReadWrite + - offline_access + SECRET: '{{ SECRET.MS365_SECRET }}' + TOKEN_FILE: '{{ DIR.CONFIG }}/ms365/oauth_token.txt' +ICAL: + STATUS: ON + CALENDARS: + - '' \ No newline at end of file diff --git a/sijapi/config/courtlistener.yaml-example b/sijapi/config/courtlistener.yaml-example new file mode 100644 index 0000000..b5b6c16 --- /dev/null +++ b/sijapi/config/courtlistener.yaml-example @@ -0,0 +1,6 @@ +url: + base: 'https://www.courtlistener.com' + dockets: '{{ url.base }}/api/rest/v3/dockets/' +API_KEY: '{{ SECRET.COURTLISTENER_API_KEY }}' +DOCKETS: '{{ DIR.DATA }}/cl/dockets' +SEARCHES: '{{ DIR.DATA }}/cl/searches' \ No newline at end of file diff --git a/sijapi/config/dirs.yaml-example b/sijapi/config/dirs.yaml-example deleted file mode 100644 index d9a58d1..0000000 --- a/sijapi/config/dirs.yaml-example +++ /dev/null @@ -1,6 +0,0 @@ -HOME: ~ -BASE: '{{ HOME }}/sijapi' -SIJAPI: '{{ BASE }}/sijapi' -CONFIG: '{{ SIJAPI }}/config' -DATA: '{{ SIJAPI }}/data' -LOGS: '{{ SIJAPI }}/logs' \ No newline at end of file diff --git a/sijapi/config/llm.yaml-example b/sijapi/config/llm.yaml-example new file mode 100644 index 0000000..5a51a35 --- /dev/null +++ b/sijapi/config/llm.yaml-example @@ -0,0 +1,17 @@ +url: http://localhost:11434 +sys: 'You are a helpful AI assistant.' +tpw: 1.3s +chat: + model: dolphin-mistral +vision: + model: llava-llama3 +summary: + model: dolphin-llama3:8b-256k + chunk-size: 16384 + chunk-overlap: 256 + length-ratio: 4 + min-length: 64 + token-limit: 16384 + instruct: 'You are an AI assistant that provides accurate summaries of text -- nothing more and nothing less. You must not include ANY extraneous text other than the sumary. Do not include comments apart from the summary, do not preface the summary, and do not provide any form of postscript. Do not add paragraph breaks. Do not add any kind of formatting. Your response should begin with, consist of, and end with an accurate plaintext summary.' +functions: + model: 'command-r' \ No newline at end of file diff --git a/sijapi/config/named-locations.yaml-example b/sijapi/config/locations.yaml-example similarity index 100% rename from sijapi/config/named-locations.yaml-example rename to sijapi/config/locations.yaml-example diff --git a/sijapi/config/obsidian.yaml-example b/sijapi/config/obsidian.yaml-example new file mode 100644 index 0000000..fd158f4 --- /dev/null +++ b/sijapi/config/obsidian.yaml-example @@ -0,0 +1,6 @@ +DAILY_NOTE: + YEAR: '%Y' + MONTH: '%Y-%m %B' + DAY: '%Y-%m-%d %A' + DAY_SHORT: '%Y-%m-%d' +DIR: '{{ HOME_DIR }}/Nextcloud/notes' # you can specify the absolute path or use '{{ HOME_DIR }}' followed by a relative path diff --git a/sijapi/config/tailscale.yaml-example b/sijapi/config/tailscale.yaml-example new file mode 100644 index 0000000..bbac9ae --- /dev/null +++ b/sijapi/config/tailscale.yaml-example @@ -0,0 +1,6 @@ +ID: sij-mbp16 +IP: 100.64.64.20 +SUBNET: 100.64.64.0/24 +MDNS: starling-sailfin.ts.net +API_KEY: '{{ SECRET.TAILSCALE_API_KEY }}' +ADDRESS: 'http://{{ ID }}.{{ MDNS }}' \ No newline at end of file diff --git a/sijapi/routers/cf.py b/sijapi/routers/cf.py index 97b1934..6cd40bf 100644 --- a/sijapi/routers/cf.py +++ b/sijapi/routers/cf.py @@ -131,12 +131,10 @@ async def add_config(record: DNSRecordRequest): raise HTTPException(status_code=400, detail=f"Failed to create A record: {error_message} (Code: {error_code})") # Update Caddyfile - await update_caddyfile(full_domain, caddy_ip, port) - + await update_caddyfile(full_domain, caddy_ip, port) return {"message": "Configuration added successfully"} - @cf.get("/cf/list_zones") async def list_zones_endpoint(): domains = await list_zones() diff --git a/sijapi/routers/img.py b/sijapi/routers/img.py index a58c5f0..06ff3ae 100644 --- a/sijapi/routers/img.py +++ b/sijapi/routers/img.py @@ -405,7 +405,7 @@ async def load_workflow(workflow_path: str, workflow:str): return json.load(file) -async def update_prompt_and_get_key(workflow: dict, post: dict, positive: str): +async def update_prompt_and_get_key(workf0ow: dict, post: dict, positive: str): ''' Recurses through the workflow searching for and substituting the dynamic values for API_PrePrompt, API_StylePrompt, API_NegativePrompt, width, height, and seed (random integer). Even more important, it finds and returns the key to the filepath where the file is saved, which we need to decipher status when generation is complete. diff --git a/sijapi/routers/loc.py b/sijapi/routers/loc.py index 78684c4..09316bb 100644 --- a/sijapi/routers/loc.py +++ b/sijapi/routers/loc.py @@ -13,7 +13,7 @@ from zoneinfo import ZoneInfo from dateutil.parser import parse as dateutil_parse from typing import Optional, List, Union from datetime import datetime -from sijapi import L, DB, TZ, NAMED_LOCATIONS, GEO +from sijapi import L, DB, TZ, GEO from sijapi.classes import Location from sijapi.utilities import haversine diff --git a/sijapi/routers/news.py b/sijapi/routers/news.py index 0881e2a..cf5d167 100644 --- a/sijapi/routers/news.py +++ b/sijapi/routers/news.py @@ -26,8 +26,6 @@ from fastapi.responses import JSONResponse from pydantic import BaseModel from pathlib import Path - -from sijapi.classes import Configuration from sijapi import API, L, Dir, News, OBSIDIAN_VAULT_DIR, OBSIDIAN_RESOURCES_DIR, OBSIDIAN_BANNER_SCENE, DEFAULT_11L_VOICE, DEFAULT_VOICE, GEO from sijapi.utilities import sanitize_filename, assemble_journal_path, assemble_archive_path from sijapi.routers import llm, tts, asr, loc