-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.ps1
More file actions
34 lines (27 loc) · 1.35 KB
/
setup.ps1
File metadata and controls
34 lines (27 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Quick Setup Script for NetDocAI
# This script helps you set up the .env file with a generated encryption key
Write-Host "NetDocAI Quick Setup" -ForegroundColor Green
Write-Host "===================" -ForegroundColor Green
Write-Host ""
# Generate encryption key
Write-Host "Generating encryption key..." -ForegroundColor Yellow
$key = python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
if ($LASTEXITCODE -eq 0) {
Write-Host "✓ Encryption key generated successfully" -ForegroundColor Green
Write-Host ""
# Update .env file
Write-Host "Updating .env file..." -ForegroundColor Yellow
$envContent = Get-Content .env.example -Raw
$envContent = $envContent -replace 'your-generated-encryption-key-here', $key
$envContent | Set-Content .env
Write-Host "✓ .env file updated with encryption key" -ForegroundColor Green
Write-Host ""
Write-Host "Setup complete!" -ForegroundColor Green
Write-Host ""
Write-Host "You can now use NetDocAI:" -ForegroundColor Cyan
Write-Host " netdocai discover --subnet 10.0.20.70/32 --username mina --password mina" -ForegroundColor White
Write-Host ""
} else {
Write-Host "✗ Failed to generate encryption key" -ForegroundColor Red
Write-Host "Please ensure Python and cryptography package are installed" -ForegroundColor Red
}