Add basic authentication to documentation
- Added .htaccess with Apache basic auth configuration - Created .htpasswd with username 'langmem' and password 'langmem2025' - Added auth.js for JavaScript-based authentication backup - Updated all HTML pages to include authentication script - Added AUTH_INFO.md with access credentials and setup info Credentials: langmem / langmem2025 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
4
docs/.htaccess
Normal file
4
docs/.htaccess
Normal file
@@ -0,0 +1,4 @@
|
||||
AuthType Basic
|
||||
AuthName "LangMem Documentation - Restricted Access"
|
||||
AuthUserFile /home/klas/langmem/docs/.htpasswd
|
||||
Require valid-user
|
||||
1
docs/.htpasswd
Normal file
1
docs/.htpasswd
Normal file
@@ -0,0 +1 @@
|
||||
langmem:$apr1$MHaGZU8y$g4T2jHQLcypx6lJ9pnWY./
|
||||
30
docs/AUTH_INFO.md
Normal file
30
docs/AUTH_INFO.md
Normal file
@@ -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)
|
||||
@@ -6,6 +6,7 @@
|
||||
<title>API Documentation - LangMem Fact-Based Memory System</title>
|
||||
<meta name="description" content="Complete API documentation for LangMem fact-based memory system with individual fact extraction, deduplication, memory updates, and precision search capabilities.">
|
||||
<link rel="stylesheet" href="../assets/css/style.css">
|
||||
<script src="../auth.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-core.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/autoloader/prism-autoloader.min.js"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/themes/prism.css">
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<title>Architecture - LangMem Documentation</title>
|
||||
<meta name="description" content="Detailed architecture documentation for LangMem showing system components, data flow, and integration patterns.">
|
||||
<link rel="stylesheet" href="../assets/css/style.css">
|
||||
<script src="../auth.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
32
docs/auth.js
Normal file
32
docs/auth.js
Normal file
@@ -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 = '<h1>Access Denied</h1><p>Authentication required.</p>';
|
||||
});
|
||||
}
|
||||
})();
|
||||
@@ -6,6 +6,7 @@
|
||||
<title>Implementation Guide - LangMem Documentation</title>
|
||||
<meta name="description" content="Step-by-step implementation guide for building the LangMem long-term memory system with detailed phases and instructions.">
|
||||
<link rel="stylesheet" href="../assets/css/style.css">
|
||||
<script src="../auth.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-core.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/autoloader/prism-autoloader.min.js"></script>
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<title>LangMem - Fact-Based AI Memory System</title>
|
||||
<meta name="description" content="mem0-inspired fact-based memory system with individual fact extraction, deduplication, and AI-powered memory updates using Ollama, Neo4j, and PostgreSQL.">
|
||||
<link rel="stylesheet" href="assets/css/style.css">
|
||||
<script src="auth.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-core.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/autoloader/prism-autoloader.min.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user