Enhance Docker integration and API for container management

- Implemented Docker container scanning and periodic updates in the Server initialization.
- Added new RPC endpoints for managing Docker containers, including start, stop, and restart functionalities.
- Updated the API to handle package management for Docker-based applications.
- Improved environment variable handling for user-specific configurations in Podman and Docker clients.
- Enhanced the development startup script to include Docker container management and provide clearer instructions for full stack setup.
This commit is contained in:
Dorian
2026-01-27 23:21:26 +00:00
parent 3b3f70276f
commit 30ed48ad1b
17 changed files with 2076 additions and 20 deletions
+1 -1
View File
@@ -82,7 +82,7 @@ define(['./workbox-21a80088'], (function (workbox) { 'use strict';
"revision": "3ca0b8505b4bec776b69afdba2768812"
}, {
"url": "index.html",
"revision": "0.25ac9hvq0k4"
"revision": "0.c834l92akjo"
}], {});
workbox.cleanupOutdatedCaches();
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
+405
View File
@@ -0,0 +1,405 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bitcoin Core - Archipelago</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@7.4.47/css/materialdesignicons.min.css">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
min-height: 100vh;
background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 50%, #16213e 100%);
display: flex;
align-items: center;
justify-content: center;
padding: 2rem;
color: white;
}
/* Use Archipelago's glass-card style */
.glass-card {
background-color: rgba(0, 0, 0, 0.65);
backdrop-filter: blur(18px);
-webkit-backdrop-filter: blur(18px);
border: 1px solid rgba(255, 255, 255, 0.18);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
border-radius: 1rem;
max-width: 900px;
width: 100%;
padding: 3rem;
overflow: visible;
}
/* Logo container like onboarding */
.logo-gradient-border {
background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.1) 100%);
padding: 3px;
border-radius: 24px;
display: inline-block;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.logo-gradient-border img {
display: block;
background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%);
border-radius: 22px;
width: 80px;
height: 80px;
padding: 16px;
}
.header {
text-align: center;
margin-bottom: 3rem;
position: relative;
}
.header-logo {
margin-bottom: 1.5rem;
}
.header h1 {
font-size: 2.5rem;
font-weight: 700;
margin-bottom: 0.5rem;
text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.subtitle {
color: rgba(255, 255, 255, 0.7);
font-size: 1.1rem;
margin-bottom: 1rem;
}
.status-badge {
display: inline-block;
padding: 0.5rem 1.5rem;
border-radius: 20px;
font-weight: 600;
font-size: 0.95rem;
background: rgba(0, 0, 0, 0.4);
border: 1px solid rgba(255, 255, 255, 0.2);
margin-top: 1rem;
}
.status-running {
background: rgba(16, 185, 129, 0.15);
border-color: rgba(16, 185, 129, 0.3);
color: #10b981;
}
.status-stopped {
background: rgba(239, 68, 68, 0.15);
border-color: rgba(239, 68, 68, 0.3);
color: #ef4444;
}
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 1.5rem;
margin-bottom: 2.5rem;
}
.stat-card {
background: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 12px;
padding: 1.5rem;
text-align: center;
transition: all 0.3s ease;
}
.stat-card:hover {
background: rgba(255, 255, 255, 0.08);
border-color: rgba(255, 255, 255, 0.2);
transform: translateY(-2px);
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}
.stat-label {
font-size: 0.875rem;
color: rgba(255, 255, 255, 0.6);
margin-bottom: 0.75rem;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.stat-value {
font-size: 1.75rem;
font-weight: 700;
color: #fff;
}
.info-section {
margin-bottom: 2.5rem;
}
.info-section h2 {
font-size: 1.5rem;
margin-bottom: 1rem;
color: #fff;
}
.info-section p {
color: rgba(255, 255, 255, 0.75);
line-height: 1.7;
margin-bottom: 1.5rem;
font-size: 1.05rem;
}
.connection-info {
background: rgba(255, 255, 255, 0.04);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 12px;
padding: 1.75rem;
margin-top: 1.5rem;
}
.connection-info h3 {
font-size: 1.15rem;
margin-bottom: 1.25rem;
color: #fff;
}
.detail-row {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 0;
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.detail-row:last-child {
border-bottom: none;
}
.detail-row .label {
color: rgba(255, 255, 255, 0.65);
font-weight: 500;
font-size: 0.95rem;
}
.detail-row code {
background: rgba(0, 0, 0, 0.4);
padding: 0.5rem 1rem;
border-radius: 8px;
color: #10b981;
font-family: 'Courier New', monospace;
font-size: 0.9rem;
border: 1px solid rgba(16, 185, 129, 0.2);
}
.actions {
display: flex;
gap: 1rem;
flex-wrap: wrap;
}
/* Use Archipelago's glass-button style */
.glass-button {
flex: 1;
min-width: 180px;
padding: 1rem 1.75rem;
background-color: rgba(0, 0, 0, 0.6);
backdrop-filter: blur(18px);
-webkit-backdrop-filter: blur(18px);
border: 1px solid rgba(255, 255, 255, 0.18);
color: rgba(255, 255, 255, 0.9);
border-radius: 12px;
font-weight: 600;
font-size: 1rem;
cursor: pointer;
transition: all 0.3s ease;
display: flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
text-decoration: none;
}
.glass-button:hover {
background-color: rgba(0, 0, 0, 0.7);
border-color: rgba(255, 255, 255, 0.3);
transform: translateY(-2px);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.glass-button.primary {
background: linear-gradient(135deg, rgba(247, 147, 26, 0.3) 0%, rgba(255, 107, 53, 0.3) 100%);
border-color: rgba(247, 147, 26, 0.4);
}
.glass-button.primary:hover {
background: linear-gradient(135deg, rgba(247, 147, 26, 0.4) 0%, rgba(255, 107, 53, 0.4) 100%);
border-color: rgba(247, 147, 26, 0.6);
}
.loading {
text-align: center;
padding: 3rem;
color: rgba(255, 255, 255, 0.6);
font-size: 1.1rem;
}
@media (max-width: 768px) {
body {
padding: 1rem;
}
.glass-card {
padding: 2rem;
}
.header h1 {
font-size: 2rem;
}
.stats-grid {
grid-template-columns: repeat(2, 1fr);
}
.actions {
flex-direction: column;
}
.glass-button {
width: 100%;
min-width: auto;
}
}
</style>
</head>
<body>
<div class="glass-card">
<div id="loading" class="loading">
<p>Loading Bitcoin Core data...</p>
</div>
<div id="content" style="display: none;">
<!-- Header with Logo -->
<div class="header">
<div class="header-logo">
<div class="logo-gradient-border">
<img src="/assets/img/app-icons/bitcoin.svg" alt="Bitcoin Core" />
</div>
</div>
<h1>Bitcoin Core</h1>
<p class="subtitle">Full Bitcoin Node - Regtest Mode</p>
<div class="status-badge status-running" id="statusBadge">
Running
</div>
</div>
<!-- Stats Grid -->
<div class="stats-grid">
<div class="stat-card">
<div class="stat-label">Network</div>
<div class="stat-value">Regtest</div>
</div>
<div class="stat-card">
<div class="stat-label">RPC Port</div>
<div class="stat-value">18443</div>
</div>
<div class="stat-card">
<div class="stat-label">P2P Port</div>
<div class="stat-value">18444</div>
</div>
<div class="stat-card">
<div class="stat-label">Status</div>
<div class="stat-value" id="containerStatus">Running</div>
</div>
</div>
<!-- Info Section -->
<div class="info-section">
<h2>About Bitcoin Core</h2>
<p>
Bitcoin Core is the reference implementation of the Bitcoin protocol. This instance is running in
<strong>regtest mode</strong> for local development and testing without syncing the full blockchain.
</p>
<div class="connection-info">
<h3>Connection Details</h3>
<div class="detail-row">
<span class="label">RPC Endpoint:</span>
<code>http://localhost:18443</code>
</div>
<div class="detail-row">
<span class="label">P2P Endpoint:</span>
<code>localhost:18444</code>
</div>
<div class="detail-row">
<span class="label">Data Directory:</span>
<code>/data/.bitcoin</code>
</div>
</div>
</div>
<!-- Action Buttons -->
<div class="actions">
<a href="https://developer.bitcoin.org/reference/rpc/" target="_blank" class="glass-button primary">
<i class="mdi mdi-book-open-variant"></i>
RPC Documentation
</a>
<button class="glass-button" onclick="alert('Logs viewer coming soon!')">
<i class="mdi mdi-file-document-outline"></i>
View Logs
</button>
<a href="http://localhost:8100/dashboard/apps" class="glass-button">
<i class="mdi mdi-arrow-left"></i>
Back to My Apps
</a>
</div>
</div>
</div>
<script>
// Fetch Bitcoin Core status from backend
async function loadBitcoinStatus() {
try {
const response = await fetch('http://localhost:5959/rpc/v1', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ method: 'db.dump' })
});
const data = await response.json();
const bitcoin = data.result?.['package-data']?.bitcoin;
if (bitcoin) {
const state = bitcoin.state || 'unknown';
const status = bitcoin.installed?.status || 'unknown';
document.getElementById('statusBadge').textContent =
state.charAt(0).toUpperCase() + state.slice(1);
document.getElementById('statusBadge').className =
'status-badge ' + (state === 'running' ? 'status-running' : 'status-stopped');
document.getElementById('containerStatus').textContent =
status.charAt(0).toUpperCase() + status.slice(1);
}
document.getElementById('loading').style.display = 'none';
document.getElementById('content').style.display = 'block';
} catch (error) {
console.error('Failed to load Bitcoin status:', error);
document.getElementById('loading').innerHTML =
'<p>Failed to connect to backend. Is the backend running?</p>';
}
}
// Load on page load
loadBitcoinStatus();
// Refresh every 5 seconds
setInterval(loadBitcoinStatus, 5000);
</script>
</body>
</html>
+5
View File
@@ -97,6 +97,11 @@ const router = createRouter({
name: 'app-details',
component: () => import('../views/AppDetails.vue'),
},
{
path: 'apps/bitcoin-core',
name: 'bitcoin-core',
component: () => import('../views/apps/BitcoinCore.vue'),
},
{
path: 'marketplace',
name: 'marketplace',
+6
View File
@@ -185,6 +185,12 @@ function launchApp(id: string) {
const isDev = import.meta.env.DEV
const pkg = packages.value[id]
// Special handling for Bitcoin Core - open standalone HTML page in new tab
if (id === 'bitcoin') {
window.open('/bitcoin-core.html', '_blank', 'noopener,noreferrer')
return
}
// Get the LAN address from the package manifest
const lanAddress = pkg?.installed?.['interface-addresses']?.main?.['lan-address']
+376
View File
@@ -0,0 +1,376 @@
<template>
<div class="bitcoin-core-container">
<!-- Glassmorphism card -->
<div class="glass-card">
<!-- Header -->
<div class="header">
<div class="header-left">
<img src="/assets/img/app-icons/bitcoin.svg" alt="Bitcoin Core" class="app-icon" />
<div>
<h1>Bitcoin Core</h1>
<p class="subtitle">Full Bitcoin Node - Regtest Mode</p>
</div>
</div>
<div class="status-badge" :class="statusClass">
{{ statusText }}
</div>
</div>
<!-- Stats Grid -->
<div class="stats-grid">
<div class="stat-card">
<div class="stat-label">Network</div>
<div class="stat-value">Regtest</div>
</div>
<div class="stat-card">
<div class="stat-label">RPC Port</div>
<div class="stat-value">18443</div>
</div>
<div class="stat-card">
<div class="stat-label">P2P Port</div>
<div class="stat-value">18444</div>
</div>
<div class="stat-card">
<div class="stat-label">Status</div>
<div class="stat-value">{{ containerStatus }}</div>
</div>
</div>
<!-- Info Section -->
<div class="info-section">
<h2>About Bitcoin Core</h2>
<p>
Bitcoin Core is the reference implementation of the Bitcoin protocol. This instance is running in
<strong>regtest mode</strong> for local development and testing without syncing the full blockchain.
</p>
<div class="connection-info">
<h3>Connection Details</h3>
<div class="detail-row">
<span class="label">RPC Endpoint:</span>
<code>http://localhost:18443</code>
</div>
<div class="detail-row">
<span class="label">P2P Endpoint:</span>
<code>localhost:18444</code>
</div>
<div class="detail-row">
<span class="label">Data Directory:</span>
<code>/data/.bitcoin</code>
</div>
</div>
</div>
<!-- Action Buttons -->
<div class="actions">
<button class="btn btn-primary" @click="openRpcDocs">
<i class="mdi mdi-book-open-variant"></i>
RPC Documentation
</button>
<button class="btn btn-secondary" @click="viewLogs">
<i class="mdi mdi-file-document-outline"></i>
View Logs
</button>
<button class="btn btn-secondary" @click="backToApps">
<i class="mdi mdi-arrow-left"></i>
Back to My Apps
</button>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { computed } from 'vue'
import { useRouter } from 'vue-router'
import { useAppStore } from '../../stores/app'
const router = useRouter()
const store = useAppStore()
const bitcoinPackage = computed(() => store.packages['bitcoin'] || null)
const statusClass = computed(() => {
const state = bitcoinPackage.value?.state
if (state === 'running') return 'status-running'
if (state === 'stopped') return 'status-stopped'
return 'status-unknown'
})
const statusText = computed(() => {
const state = bitcoinPackage.value?.state
if (state === 'running') return 'Running'
if (state === 'stopped') return 'Stopped'
return 'Unknown'
})
const containerStatus = computed(() => {
return bitcoinPackage.value?.installed?.status || 'Unknown'
})
function openRpcDocs() {
window.open('https://developer.bitcoin.org/reference/rpc/', '_blank')
}
function viewLogs() {
// TODO: Implement logs viewer
alert('Logs viewer coming soon!')
}
function backToApps() {
router.push('/dashboard/apps')
}
</script>
<style scoped>
.bitcoin-core-container {
min-height: 100vh;
padding: 2rem;
background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 50%, #16213e 100%);
display: flex;
align-items: center;
justify-content: center;
}
.glass-card {
max-width: 900px;
width: 100%;
background: rgba(255, 255, 255, 0.05);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border-radius: 24px;
border: 1px solid rgba(255, 255, 255, 0.1);
padding: 2.5rem;
box-shadow:
0 8px 32px 0 rgba(31, 38, 135, 0.37),
inset 0 0 80px rgba(255, 255, 255, 0.03);
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 2rem;
padding-bottom: 1.5rem;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.header-left {
display: flex;
align-items: center;
gap: 1.5rem;
}
.app-icon {
width: 64px;
height: 64px;
filter: drop-shadow(0 4px 12px rgba(247, 147, 26, 0.4));
}
.header h1 {
margin: 0;
font-size: 2rem;
font-weight: 700;
color: #fff;
text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.subtitle {
margin: 0.25rem 0 0 0;
color: rgba(255, 255, 255, 0.7);
font-size: 0.95rem;
}
.status-badge {
padding: 0.5rem 1.25rem;
border-radius: 20px;
font-weight: 600;
font-size: 0.9rem;
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.2);
}
.status-running {
background: rgba(16, 185, 129, 0.2);
color: #10b981;
}
.status-stopped {
background: rgba(239, 68, 68, 0.2);
color: #ef4444;
}
.status-unknown {
background: rgba(156, 163, 175, 0.2);
color: #9ca3af;
}
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 1.25rem;
margin-bottom: 2rem;
}
.stat-card {
background: rgba(255, 255, 255, 0.03);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 16px;
padding: 1.25rem;
transition: all 0.3s ease;
}
.stat-card:hover {
background: rgba(255, 255, 255, 0.06);
border-color: rgba(255, 255, 255, 0.15);
transform: translateY(-2px);
}
.stat-label {
font-size: 0.85rem;
color: rgba(255, 255, 255, 0.6);
margin-bottom: 0.5rem;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.stat-value {
font-size: 1.5rem;
font-weight: 700;
color: #fff;
}
.info-section {
margin-bottom: 2rem;
}
.info-section h2 {
color: #fff;
font-size: 1.5rem;
margin-bottom: 1rem;
}
.info-section p {
color: rgba(255, 255, 255, 0.8);
line-height: 1.6;
margin-bottom: 1.5rem;
}
.connection-info {
background: rgba(255, 255, 255, 0.03);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 16px;
padding: 1.5rem;
margin-top: 1.5rem;
}
.connection-info h3 {
color: #fff;
font-size: 1.1rem;
margin-bottom: 1rem;
}
.detail-row {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.75rem 0;
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.detail-row:last-child {
border-bottom: none;
}
.detail-row .label {
color: rgba(255, 255, 255, 0.7);
font-weight: 500;
}
.detail-row code {
background: rgba(0, 0, 0, 0.3);
padding: 0.4rem 0.8rem;
border-radius: 8px;
color: #10b981;
font-family: 'Courier New', monospace;
font-size: 0.9rem;
}
.actions {
display: flex;
gap: 1rem;
flex-wrap: wrap;
}
.btn {
flex: 1;
min-width: 180px;
padding: 0.875rem 1.5rem;
border: none;
border-radius: 12px;
font-weight: 600;
font-size: 0.95rem;
cursor: pointer;
transition: all 0.3s ease;
display: flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
}
.btn:hover {
transform: translateY(-2px);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.btn-primary {
background: linear-gradient(135deg, #f7931a 0%, #ff6b35 100%);
color: white;
border: 1px solid rgba(255, 255, 255, 0.2);
}
.btn-primary:hover {
background: linear-gradient(135deg, #ff6b35 0%, #f7931a 100%);
}
.btn-secondary {
background: rgba(255, 255, 255, 0.08);
color: white;
border: 1px solid rgba(255, 255, 255, 0.15);
}
.btn-secondary:hover {
background: rgba(255, 255, 255, 0.12);
border-color: rgba(255, 255, 255, 0.25);
}
/* Responsive */
@media (max-width: 768px) {
.bitcoin-core-container {
padding: 1rem;
}
.glass-card {
padding: 1.5rem;
}
.header {
flex-direction: column;
align-items: flex-start;
gap: 1rem;
}
.stats-grid {
grid-template-columns: repeat(2, 1fr);
}
.actions {
flex-direction: column;
}
.btn {
width: 100%;
min-width: auto;
}
}
</style>