Skip to content

Commit 74aa271

Browse files
Massive update (#17)
1 parent d3514c6 commit 74aa271

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+3365
-771
lines changed

.claude/settings.local.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"model": "opus",
3+
"cleanupPeriodDays": 30,
4+
"dangerously-skip-permissions": true,
5+
"permissions": {
6+
"defaultMode": "bypassPermissions",
7+
"allow": ["*"],
8+
"deny": [
9+
"Bash(rm -rf /)",
10+
"Bash(sudo rm:*)",
11+
"Write(/etc/**)",
12+
"Edit(/etc/**)"
13+
]
14+
},
15+
"env": {
16+
"CLAUDE_CODE_ENABLE_TELEMETRY": "0",
17+
"DISABLE_COST_WARNINGS": "0",
18+
"DISABLE_AUTOUPDATER": "1",
19+
"BASH_DEFAULT_TIMEOUT_MS": "300000",
20+
"BASH_MAX_TIMEOUT_MS": "1200000",
21+
"SHELL": "/usr/bin/pwsh"
22+
}
23+
}

.devcontainer/.dockerignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.git
2+
node_modules
3+
**/__pycache__
4+
.vscode
5+
*.adoc
6+
*.md
7+
*.log
8+
*.bak

.devcontainer/.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
OPENAI_API_KEY=sk-fake12345FAKE67890APIKEY12345

.devcontainer/Dockerfile

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
FROM mcr.microsoft.com/dotnet/sdk:9.0
2+
3+
USER root
4+
5+
# Create non-root vscode user
6+
RUN adduser --disabled-password --gecos "" vscode
7+
8+
# Install minimal dependencies and PowerShell from Microsoft repo
9+
RUN apt-get update && \
10+
apt-get install -y --no-install-recommends \
11+
curl \
12+
git \
13+
ca-certificates && \
14+
curl -sSL https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb -o packages-microsoft-prod.deb && \
15+
dpkg -i packages-microsoft-prod.deb && \
16+
apt-get update && \
17+
apt-get install -y --no-install-recommends powershell && \
18+
rm -rf /var/lib/apt/lists/*
19+
20+
# Install Node.js 20 and Claude Code
21+
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
22+
apt-get update && \
23+
apt-get install -y --no-install-recommends nodejs && \
24+
rm -rf /var/lib/apt/lists/*
25+
26+
# Set up PowerShell profiles
27+
COPY ./scripts/*.ps1 /home/vscode/
28+
RUN mkdir -p /home/vscode/.config/powershell && \
29+
cp /home/vscode/profile.ps1 /home/vscode/.config/powershell/Microsoft.PowerShell_profile.ps1 && \
30+
cp /home/vscode/profile.ps1 /home/vscode/.config/powershell/Microsoft.dotnet-interactive_profile.ps1 && \
31+
cp /home/vscode/profile.ps1 /home/vscode/.config/powershell/Microsoft.VSCode_profile.ps1 && \
32+
chmod +x /home/vscode/*.ps1 && \
33+
chown -R vscode:vscode /home/vscode
34+
35+
# stfu about my multi workspace project
36+
RUN git config --system --add safe.directory '*'
37+
38+
# Switch to non-root user for local install
39+
USER vscode
40+
WORKDIR /home/vscode
41+
42+
# Local Claude install
43+
RUN npm install @anthropic-ai/claude-code && \
44+
npm install ccusage && \
45+
npm install @modelcontextprotocol/server-brave-search
46+
47+
# Add local node_modules/.bin to PATH
48+
ENV PATH="/home/vscode/node_modules/.bin:$PATH"
49+
50+
CMD ["sleep", "infinity"]

.devcontainer/devcontainer.json

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"name": "devcontainer",
3+
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
4+
"dockerComposeFile": [
5+
"docker-compose.yml"
6+
],
7+
"service": "default",
8+
"portsAttributes": {
9+
"1433": {
10+
"label": "MSSQL"
11+
}
12+
},
13+
"secrets": {
14+
"OPENAI_API_KEY": {
15+
"description": "This is your OpenAI key for the openai.com API.",
16+
"documentationUrl": "https://platform.openai.com/api-keys"
17+
},
18+
"GITHUB_PAT": {
19+
"description": "This is your GitHub Personal Access Token for the GitHub API.",
20+
"documentationUrl": "https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens"
21+
},
22+
"AZURE_API_KEY": {
23+
"description": "This is your Azure key for the Azure AI API.",
24+
"documentationUrl": "https://learn.microsoft.com/en-us/azure/api-management/api-management-authenticate-authorize-azure-openai"
25+
},
26+
"AZURE_API_BASE": {
27+
"description": "This is your Azure base URL for the Azure AI API.",
28+
"documentationUrl": "https://learn.microsoft.com/en-us/azure/api-management/api-management-authenticate-authorize-azure-openai"
29+
},
30+
"OLLAMA_HOST": {
31+
"description": "This is the host for the Ollama API.",
32+
"documentationUrl": "https://ollama.com/docs/api"
33+
},
34+
"BRAVE_API_KEY": {
35+
"description": "This is your Brave Search API key.",
36+
"documentationUrl": "https://search.brave.com/api"
37+
}
38+
},
39+
"customizations": {
40+
"vscode": {
41+
"settings": {
42+
"terminal.integrated.shellIntegration.enabled": false,
43+
"terminal.integrated.cwd": "/workspaces/${localWorkspaceFolderBasename}",
44+
"powershell.powerShellAdditionalExePaths": {
45+
"PowerShell": "/usr/bin/pwsh"
46+
},
47+
"powershell.powerShellDefaultVersion": "PowerShell",
48+
"terminal.integrated.profiles.linux": {
49+
"pwsh": {
50+
"path": "/usr/bin/pwsh",
51+
"icon": "terminal-powershell"
52+
}
53+
},
54+
"terminal.integrated.shell.linux": "pwsh",
55+
"terminal.integrated.defaultProfile.linux": "pwsh"
56+
},
57+
"extensions": [
58+
"ms-vscode.powershell",
59+
"dbatools.search",
60+
"ms-windows-ai-studio.windows-ai-studio",
61+
"ms-dotnettools.dotnet-interactive-vscode",
62+
"rooveterinaryinc.roo-cline",
63+
"github.copilot-chat",
64+
"github.copilot",
65+
"bedirt.gpt-token-counter-live"
66+
]
67+
}
68+
},
69+
"postStartCommand": "pwsh -noprofile /home/vscode/setup.ps1",
70+
"remoteUser": "vscode"
71+
}

.devcontainer/docker-compose.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
services:
2+
default:
3+
environment:
4+
# Default environment variables with fallback values
5+
- ACCEPT_EULA=${ACCEPT_EULA:-Y}
6+
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
7+
- GITHUB_PAT=${GITHUB_PAT:-}
8+
- AZURE_API_KEY=${AZURE_API_KEY:-}
9+
- AZURE_API_BASE=${AZURE_API_BASE:-}
10+
- OLLAMA_HOST=${OLLAMA_HOST:-http://host.docker.internal:11434}
11+
- BRAVE_API_KEY=${BRAVE_API_KEY:-}
12+
build:
13+
context: .
14+
dockerfile: Dockerfile
15+
volumes:
16+
- ../..:/workspaces

.devcontainer/scripts/profile.ps1

Whitespace-only changes.

.devcontainer/scripts/setup.ps1

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
$PSDefaultParameterValues["*:Confirm"] = $false
2+
$PSDefaultParameterValues["*:Force"] = $true
3+
4+
# Check if modules are already installed
5+
if (-not (Get-Module -ListAvailable -Name dbatools)) {
6+
Write-Output "Installing PowerShell dependencies..."
7+
Set-PSRepository PSGallery -InstallationPolicy Trusted
8+
Install-Module Pester, aitoolkit, psopenai
9+
}
10+
11+
# Fix PSOpenAI ApiBase bug
12+
$psopenaiModule = Get-Module -ListAvailable -Name PSOpenAI | Select-Object -First 1
13+
if ($psopenaiModule) {
14+
$parameterPath = Join-Path $psopenaiModule.ModuleBase "Private/Get-OpenAIAPIParameter.ps1"
15+
$content = Get-Content $parameterPath
16+
$content = $content -replace '\$OpenAIParameter\.ApiBase = \$null', '#$OpenAIParameter.ApiBase = $null'
17+
Set-Content $parameterPath $content
18+
}
19+
20+
# set claude, these seem to stick better in config
21+
claude config set autoUpdates false --global
22+
23+
# Reload profile with some settings we need
24+
. $profile

.gitconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[safe]
2+
directory = /workspaces/dbatools
3+
directory = /workspaces/dbatools.library

0 commit comments

Comments
 (0)