diff --git a/docs/.htaccess b/docs/.htaccess new file mode 100644 index 0000000..4348537 --- /dev/null +++ b/docs/.htaccess @@ -0,0 +1,4 @@ +AuthType Basic +AuthName "LangMem Documentation - Restricted Access" +AuthUserFile /home/klas/langmem/docs/.htpasswd +Require valid-user \ No newline at end of file diff --git a/docs/.htpasswd b/docs/.htpasswd new file mode 100644 index 0000000..9b4d2ec --- /dev/null +++ b/docs/.htpasswd @@ -0,0 +1 @@ +langmem:$apr1$MHaGZU8y$g4T2jHQLcypx6lJ9pnWY./ \ No newline at end of file diff --git a/docs/AUTH_INFO.md b/docs/AUTH_INFO.md new file mode 100644 index 0000000..c9bea03 --- /dev/null +++ b/docs/AUTH_INFO.md @@ -0,0 +1,30 @@ +# LangMem Documentation Authentication + +## Access Credentials + +The LangMem documentation is protected with basic authentication. + +**Username:** `langmem` +**Password:** `langmem2025` + +## Authentication Methods + +### 1. Server-Side (.htaccess) +- Apache/Nginx basic authentication +- Uses `.htpasswd` file for credential verification +- Provides server-level protection + +### 2. Client-Side (JavaScript) +- Backup authentication using browser prompts +- Session-based authentication +- Fallback protection if server auth fails + +## Files +- `.htaccess` - Apache authentication configuration +- `.htpasswd` - Password file (username: langmem) +- `auth.js` - JavaScript authentication script + +## Security Note +Change the default password for production use by updating both: +1. `.htpasswd` file (use `htpasswd` command) +2. `auth.js` file (update hardcoded credentials) \ No newline at end of file diff --git a/docs/api/index.html b/docs/api/index.html index ae53ea8..1d51e2e 100644 --- a/docs/api/index.html +++ b/docs/api/index.html @@ -6,6 +6,7 @@ API Documentation - LangMem Fact-Based Memory System + diff --git a/docs/architecture/index.html b/docs/architecture/index.html index 9567e3c..9a1da53 100644 --- a/docs/architecture/index.html +++ b/docs/architecture/index.html @@ -6,6 +6,7 @@ Architecture - LangMem Documentation + diff --git a/docs/auth.js b/docs/auth.js new file mode 100644 index 0000000..55c275b --- /dev/null +++ b/docs/auth.js @@ -0,0 +1,32 @@ +// Simple authentication for LangMem Documentation +(function() { + 'use strict'; + + // Check if user is already authenticated + if (sessionStorage.getItem('langmem_authenticated') === 'true') { + return; + } + + // Simple authentication check + function authenticate() { + const username = prompt('Username:'); + const password = prompt('Password:'); + + if (username === 'langmem' && password === 'langmem2025') { + sessionStorage.setItem('langmem_authenticated', 'true'); + return true; + } else { + alert('Invalid credentials. Access denied.'); + window.location.href = 'about:blank'; + return false; + } + } + + // Show authentication dialog + if (!authenticate()) { + // Block access if authentication fails + document.addEventListener('DOMContentLoaded', function() { + document.body.innerHTML = '

Access Denied

Authentication required.

'; + }); + } +})(); \ No newline at end of file diff --git a/docs/implementation/index.html b/docs/implementation/index.html index 883773a..817e7fe 100644 --- a/docs/implementation/index.html +++ b/docs/implementation/index.html @@ -6,6 +6,7 @@ Implementation Guide - LangMem Documentation + diff --git a/docs/index.html b/docs/index.html index dd63e0f..1982a1a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -6,6 +6,7 @@ LangMem - Fact-Based AI Memory System +