mirror of
https://github.com/Crosstalk-Solutions/project-nomad.git
synced 2026-04-03 07:19:27 +02:00
fix: resolve hardcoded port references for Dozzle and update script
- Add DOZZLE_PORT env var (optional, defaults to 9999) so the admin app knows the actual Dozzle port when it's been remapped - Pass DOZZLE_PORT through compose env → AdonisJS env → Inertia shared props → SettingsLayout sidebar link - Remove hardcoded '9999' from SettingsLayout.tsx - Fix update_nomad.sh success message to read admin port from the existing compose file instead of hardcoding 8080 - Also fixes the update script saying 'installation completed' instead of 'update completed'
This commit is contained in:
parent
be79fa742b
commit
4fadaecd33
|
|
@ -2,6 +2,7 @@ import KVStore from '#models/kv_store'
|
||||||
import { SystemService } from '#services/system_service'
|
import { SystemService } from '#services/system_service'
|
||||||
import { defineConfig } from '@adonisjs/inertia'
|
import { defineConfig } from '@adonisjs/inertia'
|
||||||
import type { InferSharedProps } from '@adonisjs/inertia/types'
|
import type { InferSharedProps } from '@adonisjs/inertia/types'
|
||||||
|
import env from '#start/env'
|
||||||
|
|
||||||
const inertiaConfig = defineConfig({
|
const inertiaConfig = defineConfig({
|
||||||
/**
|
/**
|
||||||
|
|
@ -19,6 +20,7 @@ const inertiaConfig = defineConfig({
|
||||||
const customName = await KVStore.getValue('ai.assistantCustomName')
|
const customName = await KVStore.getValue('ai.assistantCustomName')
|
||||||
return (customName && customName.trim()) ? customName : 'AI Assistant'
|
return (customName && customName.trim()) ? customName : 'AI Assistant'
|
||||||
},
|
},
|
||||||
|
dozzlePort: () => env.get('DOZZLE_PORT', 9999),
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import useServiceInstalledStatus from '~/hooks/useServiceInstalledStatus'
|
||||||
import { SERVICE_NAMES } from '../../constants/service_names'
|
import { SERVICE_NAMES } from '../../constants/service_names'
|
||||||
|
|
||||||
export default function SettingsLayout({ children }: { children: React.ReactNode }) {
|
export default function SettingsLayout({ children }: { children: React.ReactNode }) {
|
||||||
const { aiAssistantName } = usePage<{ aiAssistantName: string }>().props
|
const { aiAssistantName, dozzlePort } = usePage<{ aiAssistantName: string; dozzlePort: number }>().props
|
||||||
const aiAssistantInstallStatus = useServiceInstalledStatus(SERVICE_NAMES.OLLAMA)
|
const aiAssistantInstallStatus = useServiceInstalledStatus(SERVICE_NAMES.OLLAMA)
|
||||||
|
|
||||||
const navigation = [
|
const navigation = [
|
||||||
|
|
@ -29,7 +29,7 @@ export default function SettingsLayout({ children }: { children: React.ReactNode
|
||||||
{ name: 'Maps Manager', href: '/settings/maps', icon: IconMapRoute, current: false },
|
{ name: 'Maps Manager', href: '/settings/maps', icon: IconMapRoute, current: false },
|
||||||
{
|
{
|
||||||
name: 'Service Logs & Metrics',
|
name: 'Service Logs & Metrics',
|
||||||
href: getServiceLink('9999'),
|
href: getServiceLink(String(dozzlePort ?? 9999)),
|
||||||
icon: IconDashboard,
|
icon: IconDashboard,
|
||||||
current: false,
|
current: false,
|
||||||
target: '_blank',
|
target: '_blank',
|
||||||
|
|
|
||||||
|
|
@ -60,4 +60,11 @@ export default await Env.create(new URL('../', import.meta.url), {
|
||||||
|----------------------------------------------------------
|
|----------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
NOMAD_API_URL: Env.schema.string.optional(),
|
NOMAD_API_URL: Env.schema.string.optional(),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|----------------------------------------------------------
|
||||||
|
| Variables for configuring companion service ports
|
||||||
|
|----------------------------------------------------------
|
||||||
|
*/
|
||||||
|
DOZZLE_PORT: Env.schema.number.optional(),
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -594,6 +594,7 @@ download_management_compose_file() {
|
||||||
|
|
||||||
if [[ "$NOMAD_PORT_DOZZLE" != "9999" ]]; then
|
if [[ "$NOMAD_PORT_DOZZLE" != "9999" ]]; then
|
||||||
sed -i 's|"9999:8080"|"'"${NOMAD_PORT_DOZZLE}"':8080"|g' "$compose_file_path"
|
sed -i 's|"9999:8080"|"'"${NOMAD_PORT_DOZZLE}"':8080"|g' "$compose_file_path"
|
||||||
|
sed -i "s|DOZZLE_PORT=9999|DOZZLE_PORT=${NOMAD_PORT_DOZZLE}|g" "$compose_file_path"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$NOMAD_PORT_MYSQL" != "3306" ]]; then
|
if [[ "$NOMAD_PORT_MYSQL" != "3306" ]]; then
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ services:
|
||||||
- DB_SSL=false
|
- DB_SSL=false
|
||||||
- REDIS_HOST=redis
|
- REDIS_HOST=redis
|
||||||
- REDIS_PORT=6379
|
- REDIS_PORT=6379
|
||||||
|
- DOZZLE_PORT=9999
|
||||||
depends_on:
|
depends_on:
|
||||||
mysql:
|
mysql:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
|
||||||
|
|
@ -124,10 +124,17 @@ get_local_ip() {
|
||||||
}
|
}
|
||||||
|
|
||||||
success_message() {
|
success_message() {
|
||||||
echo -e "${GREEN}#${RESET} Project N.O.M.A.D installation completed successfully!\\n"
|
# Read the admin port from the existing compose file (handles remapped ports)
|
||||||
|
local admin_port
|
||||||
|
admin_port=$(grep -A1 'container_name: nomad_admin' /opt/project-nomad/compose.yml | head -1)
|
||||||
|
# Fallback: parse the ports binding for the admin service
|
||||||
|
admin_port=$(awk '/container_name: nomad_admin/{found=1} found && /ports:/{getline; print; exit}' /opt/project-nomad/compose.yml 2>/dev/null | sed -n 's/.*"\([0-9]*\):.*/\1/p')
|
||||||
|
admin_port="${admin_port:-8080}"
|
||||||
|
|
||||||
|
echo -e "${GREEN}#${RESET} Project N.O.M.A.D update completed successfully!\\n"
|
||||||
echo -e "${GREEN}#${RESET} Installation files are located at /opt/project-nomad\\n\n"
|
echo -e "${GREEN}#${RESET} Installation files are located at /opt/project-nomad\\n\n"
|
||||||
echo -e "${GREEN}#${RESET} Project N.O.M.A.D's Command Center should automatically start whenever your device reboots. However, if you need to start it manually, you can always do so by running: ${WHITE_R}${nomad_dir}/start_nomad.sh${RESET}\\n"
|
echo -e "${GREEN}#${RESET} Project N.O.M.A.D's Command Center should automatically start whenever your device reboots. However, if you need to start it manually, you can always do so by running: ${WHITE_R}/opt/project-nomad/start_nomad.sh${RESET}\\n"
|
||||||
echo -e "${GREEN}#${RESET} You can now access the management interface at http://localhost:8080 or http://${local_ip_address}:8080\\n"
|
echo -e "${GREEN}#${RESET} You can now access the management interface at http://localhost:${admin_port} or http://${local_ip_address}:${admin_port}\\n"
|
||||||
echo -e "${GREEN}#${RESET} Thank you for supporting Project N.O.M.A.D!\\n"
|
echo -e "${GREEN}#${RESET} Thank you for supporting Project N.O.M.A.D!\\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user