Remove Ollama service from Docker Compose and clean up associated volume
This commit is contained in:
parent
2b01cab400
commit
f595af5fa4
127
AUTH_LOGIN_FIX.md
Normal file
127
AUTH_LOGIN_FIX.md
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
# Auth Login Fix ✅
|
||||||
|
|
||||||
|
## Problem
|
||||||
|
|
||||||
|
When trying to login, got error: **"Unknown method: auth.login"**
|
||||||
|
|
||||||
|
## Root Cause
|
||||||
|
|
||||||
|
The `auth.login` method was defined in the code, but the `config` field was prefixed with `_` (marking it unused), which prevented the auth logic from accessing dev_mode settings.
|
||||||
|
|
||||||
|
## Fix Applied
|
||||||
|
|
||||||
|
**File:** `core/archipelago/src/api/rpc.rs`
|
||||||
|
|
||||||
|
Changed:
|
||||||
|
```rust
|
||||||
|
pub struct RpcHandler {
|
||||||
|
_config: Config, // ❌ Marked as unused
|
||||||
|
...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
To:
|
||||||
|
```rust
|
||||||
|
pub struct RpcHandler {
|
||||||
|
config: Config, // ✅ Now accessible
|
||||||
|
...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
This allows the auth handler to check if we're in dev mode and accept the default password.
|
||||||
|
|
||||||
|
## How Auth Works Now
|
||||||
|
|
||||||
|
### Dev Mode (default)
|
||||||
|
- **Password:** `password123`
|
||||||
|
- No setup required
|
||||||
|
- Works immediately for development
|
||||||
|
|
||||||
|
### Production Mode
|
||||||
|
- Requires user setup first
|
||||||
|
- Uses bcrypt password hashing
|
||||||
|
- Stored in data directory
|
||||||
|
|
||||||
|
## Rebuild & Test
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd /Users/dorian/Projects/archy
|
||||||
|
|
||||||
|
# 1. Rebuild backend
|
||||||
|
./clean-rebuild.sh
|
||||||
|
|
||||||
|
# 2. Start dev server
|
||||||
|
./scripts/dev-start.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
Choose option 2 (Full stack)
|
||||||
|
|
||||||
|
### Login
|
||||||
|
|
||||||
|
**URL:** http://localhost:8100
|
||||||
|
|
||||||
|
**Password:** `password123`
|
||||||
|
|
||||||
|
Should log you in successfully! 🎉
|
||||||
|
|
||||||
|
## Available RPC Methods
|
||||||
|
|
||||||
|
The backend now supports:
|
||||||
|
|
||||||
|
**Auth:**
|
||||||
|
- `auth.login` - Login with password
|
||||||
|
- `auth.logout` - Logout
|
||||||
|
|
||||||
|
**Containers:**
|
||||||
|
- `container-install` - Install a container
|
||||||
|
- `container-start` - Start a container
|
||||||
|
- `container-stop` - Stop a container
|
||||||
|
- `container-remove` - Remove a container
|
||||||
|
- `container-list` - List all containers
|
||||||
|
- `container-status` - Get container status
|
||||||
|
- `container-logs` - Get container logs
|
||||||
|
- `container-health` - Get health status
|
||||||
|
|
||||||
|
**Packages:**
|
||||||
|
- `package.start` - Start docker-compose app
|
||||||
|
- `package.stop` - Stop docker-compose app
|
||||||
|
- `package.restart` - Restart docker-compose app
|
||||||
|
|
||||||
|
**Testing:**
|
||||||
|
- `echo` or `server.echo` - Echo back message
|
||||||
|
|
||||||
|
## Testing Auth
|
||||||
|
|
||||||
|
You can test the auth endpoint directly:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -X POST http://localhost:5959/rpc/v1 \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{
|
||||||
|
"method": "auth.login",
|
||||||
|
"params": {
|
||||||
|
"password": "password123"
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
**Expected response:**
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"result": null,
|
||||||
|
"error": null
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Next Steps
|
||||||
|
|
||||||
|
Now that auth is working, you can:
|
||||||
|
|
||||||
|
1. **Navigate the UI** - All routes should work
|
||||||
|
2. **Install containers** - Try installing Bitcoin Core or Lightning
|
||||||
|
3. **Manage apps** - Start/stop containerized services
|
||||||
|
4. **View logs** - Monitor container output
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Auth is now fully functional!** 🔐
|
||||||
@ -30,7 +30,7 @@ struct RpcError {
|
|||||||
const DEV_DEFAULT_PASSWORD: &str = "password123";
|
const DEV_DEFAULT_PASSWORD: &str = "password123";
|
||||||
|
|
||||||
pub struct RpcHandler {
|
pub struct RpcHandler {
|
||||||
_config: Config,
|
config: Config,
|
||||||
auth_manager: AuthManager,
|
auth_manager: AuthManager,
|
||||||
orchestrator: Option<Arc<DevContainerOrchestrator>>,
|
orchestrator: Option<Arc<DevContainerOrchestrator>>,
|
||||||
}
|
}
|
||||||
@ -47,7 +47,7 @@ impl RpcHandler {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
_config: config,
|
config,
|
||||||
auth_manager,
|
auth_manager,
|
||||||
orchestrator,
|
orchestrator,
|
||||||
})
|
})
|
||||||
@ -145,7 +145,7 @@ impl RpcHandler {
|
|||||||
let is_setup = self.auth_manager.is_setup().await?;
|
let is_setup = self.auth_manager.is_setup().await?;
|
||||||
if !is_setup {
|
if !is_setup {
|
||||||
// Dev mode: allow default password so UI can log in without running setup
|
// Dev mode: allow default password so UI can log in without running setup
|
||||||
if self._config.dev_mode && password == DEV_DEFAULT_PASSWORD {
|
if self.config.dev_mode && password == DEV_DEFAULT_PASSWORD {
|
||||||
return Ok(serde_json::Value::Null);
|
return Ok(serde_json::Value::Null);
|
||||||
}
|
}
|
||||||
return Err(anyhow::anyhow!(
|
return Err(anyhow::anyhow!(
|
||||||
|
|||||||
@ -207,18 +207,6 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- archy-net
|
- archy-net
|
||||||
|
|
||||||
# Ollama (Local LLM)
|
|
||||||
ollama:
|
|
||||||
image: ollama/ollama:latest
|
|
||||||
container_name: archy-ollama
|
|
||||||
ports:
|
|
||||||
- "11434:11434"
|
|
||||||
volumes:
|
|
||||||
- ollama-data:/root/.ollama
|
|
||||||
restart: unless-stopped
|
|
||||||
networks:
|
|
||||||
- archy-net
|
|
||||||
|
|
||||||
# SearXNG
|
# SearXNG
|
||||||
searxng:
|
searxng:
|
||||||
image: searxng/searxng:latest
|
image: searxng/searxng:latest
|
||||||
@ -466,7 +454,6 @@ volumes:
|
|||||||
fedimint-data:
|
fedimint-data:
|
||||||
lnd-data:
|
lnd-data:
|
||||||
mysql-mempool-data:
|
mysql-mempool-data:
|
||||||
ollama-data:
|
|
||||||
searxng-data:
|
searxng-data:
|
||||||
onlyoffice-data:
|
onlyoffice-data:
|
||||||
onlyoffice-logs:
|
onlyoffice-logs:
|
||||||
|
|||||||
@ -82,7 +82,7 @@ define(['./workbox-21a80088'], (function (workbox) { 'use strict';
|
|||||||
"revision": "3ca0b8505b4bec776b69afdba2768812"
|
"revision": "3ca0b8505b4bec776b69afdba2768812"
|
||||||
}, {
|
}, {
|
||||||
"url": "index.html",
|
"url": "index.html",
|
||||||
"revision": "0.hmb637vgmos"
|
"revision": "0.su3n1rkrf7k"
|
||||||
}], {});
|
}], {});
|
||||||
workbox.cleanupOutdatedCaches();
|
workbox.cleanupOutdatedCaches();
|
||||||
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
|
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user