7878. PARAMETER SkipProxy
7979 Do not deploy/update the nginx proxy service.
8080
81+ . PARAMETER SkipDocs
82+ Do not deploy/update the MkDocs documentation service (served at /docs/).
83+
8184. PARAMETER SkipLogViewer
8285 Do not deploy/update the OpenObserve log viewer + Vector log shipper services.
8386
@@ -150,6 +153,7 @@ param(
150153 [string ]$ApiPort = ' ' ,
151154 [string ]$AppPort = ' ' ,
152155 [string ]$ProxyPort = ' ' ,
156+ [string ]$DocsPort = ' ' ,
153157 [string ]$LogViewerPort = ' ' ,
154158
155159 [string ]$ServiceUser = ' LocalSystem' ,
@@ -159,6 +163,7 @@ param(
159163 [switch ]$SkipApp ,
160164 [switch ]$SkipImporter ,
161165 [switch ]$SkipProxy ,
166+ [switch ]$SkipDocs ,
162167 [switch ]$SkipLogViewer ,
163168 [switch ]$Uninstall
164169)
@@ -193,6 +198,7 @@ if ([string]::IsNullOrWhiteSpace($EnvFile)) { $EnvFile = Join-Path $InstallD
193198if ([string ]::IsNullOrWhiteSpace($ApiPort )) { $ApiPort = $envProfile.ApiPort }
194199if ([string ]::IsNullOrWhiteSpace($AppPort )) { $AppPort = $envProfile.AppPort }
195200if ([string ]::IsNullOrWhiteSpace($ProxyPort )) { $ProxyPort = $envProfile.ProxyPort }
201+ if ([string ]::IsNullOrWhiteSpace($DocsPort )) { $DocsPort = $envProfile.DocsPort }
196202if ([string ]::IsNullOrWhiteSpace($LogViewerPort )) { $LogViewerPort = $envProfile.LogViewerPort }
197203
198204# The .env file is only required when deploying the API (it carries DB_*).
@@ -214,6 +220,7 @@ if (-not $Uninstall -and -not $SkipImporter) {
214220# never collide on a shared host.
215221$SVC_API = " OpenDateaubase-$tag -API"
216222$SVC_APP = " OpenDateaubase-$tag -App"
223+ $SVC_DOCS = " OpenDateaubase-$tag -Docs"
217224$SVC_PROXY = " OpenDateaubase-$tag -Proxy"
218225$SVC_LOGVIEW = " OpenDateaubase-$tag -LogViewer"
219226$SVC_LOGSHIP = " OpenDateaubase-$tag -LogShip"
@@ -252,6 +259,7 @@ if ($Uninstall) {
252259 Remove-NssmService - NssmExe $nssmExe - ServiceName $SVC_LOGSHIP
253260 Remove-NssmService - NssmExe $nssmExe - ServiceName $SVC_LOGVIEW
254261 Remove-NssmService - NssmExe $nssmExe - ServiceName $SVC_PROXY
262+ Remove-NssmService - NssmExe $nssmExe - ServiceName $SVC_DOCS
255263 Remove-NssmService - NssmExe $nssmExe - ServiceName $SVC_APP
256264 Remove-NssmService - NssmExe $nssmExe - ServiceName $SVC_API
257265 }
@@ -376,6 +384,30 @@ if (-not $SkipApp) {
376384 Write-Step " Streamlit app started (access via http://localhost:$AppPort once proxy is up)." - Success
377385}
378386
387+ # ---------------------------------------------------------------------------
388+ # Step 8b: Deploy MkDocs documentation service
389+ # ---------------------------------------------------------------------------
390+
391+ if (-not $SkipDocs ) {
392+ Write-Step ' Deploying docs service (mkdocs serve)...'
393+
394+ Install-NssmService `
395+ - NssmExe $nssmExe `
396+ - ServiceName $SVC_DOCS `
397+ - Application $uvExe `
398+ - AppParameters " run mkdocs serve --dev-addr 127.0.0.1:$DocsPort " `
399+ - AppDirectory $InstallDir `
400+ - DisplayName " open_datEAUbase Docs ($tag )" `
401+ - Description " MkDocs documentation site for open_datEAUbase ($Environment ; localhost:$DocsPort behind nginx /docs/)" `
402+ - StdoutLog (Join-Path $LogDir ' docs\stdout.log' ) `
403+ - StderrLog (Join-Path $LogDir ' docs\stderr.log' ) `
404+ - ServiceUser $ServiceUser `
405+ - ServicePassword $ServicePassword
406+
407+ Start-ManagedService - NssmExe $nssmExe - ServiceName $SVC_DOCS
408+ Write-Step " Docs service started (access via http://localhost:$ProxyPort /docs/ once proxy is up)." - Success
409+ }
410+
379411# ---------------------------------------------------------------------------
380412# Step 9: Register importer Scheduled Task
381413# ---------------------------------------------------------------------------
@@ -567,6 +599,7 @@ if (-not $SkipProxy) {
567599 - AppPort $AppPort `
568600 - ProxyPort $ProxyPort `
569601 - LogDir $LogDir `
602+ - DocsPort $ (if (-not $SkipDocs ) { $DocsPort } else { ' ' }) `
570603 - LogViewerPort $ (if (-not $SkipLogViewer ) { $LogViewerPort } else { ' ' })
571604
572605 Install-NssmService `
@@ -609,6 +642,10 @@ if (-not $SkipApp) {
609642 $s = Get-Service $SVC_APP - ErrorAction SilentlyContinue
610643 $rows += [pscustomobject ]@ { Component = ' App' ; Type = ' Windows Service' ; Name = $SVC_APP ; Status = ${s} ? .Status; URL = " http://localhost:$AppPort /" }
611644}
645+ if (-not $SkipDocs ) {
646+ $s = Get-Service $SVC_DOCS - ErrorAction SilentlyContinue
647+ $rows += [pscustomobject ]@ { Component = ' Docs' ; Type = ' Windows Service' ; Name = $SVC_DOCS ; Status = ${s} ? .Status; URL = " http://localhost:$ProxyPort /docs/" }
648+ }
612649if (-not $SkipProxy ) {
613650 $s = Get-Service $SVC_PROXY - ErrorAction SilentlyContinue
614651 $rows += [pscustomobject ]@ { Component = ' Proxy' ; Type = ' Windows Service' ; Name = $SVC_PROXY ; Status = ${s} ? .Status; URL = " http://localhost:$ProxyPort /" }
@@ -635,6 +672,9 @@ if (-not $SkipLogViewer) {
635672if (-not $SkipProxy ) {
636673 Write-Host ' '
637674 Write-Host " Open in browser: http://$ ( hostname) /" - ForegroundColor Green
675+ if (-not $SkipDocs ) {
676+ Write-Host " Documentation : http://$ ( hostname) /docs/" - ForegroundColor Green
677+ }
638678 if (-not $SkipLogViewer ) {
639679 Write-Host " Inspect logs : http://$ ( hostname) /logs/" - ForegroundColor Green
640680 }
0 commit comments