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
+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>