chore: import upstream snapshot with attribution
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (actions) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
CI and Release / lint-frontend (push) Has been cancelled
CI and Release / dockerfile-scan (push) Has been cancelled
CI and Release / test-frontend (push) Has been cancelled
CI and Release / lint-verification-agent (push) Has been cancelled
CI and Release / test-verification-agent (push) Has been cancelled
CI and Release / e2e-verification-agent (push) Has been cancelled
CI and Release / test-backend (push) Has been cancelled
CI and Release / build-dev-image (push) Has been cancelled
CI and Release / push-dev-image (push) Has been cancelled
CI and Release / build-image (push) Has been cancelled
CI and Release / build-verification-image (push) Has been cancelled
CI and Release / determine-version (push) Has been cancelled
CI and Release / push-image (push) Has been cancelled
CI and Release / push-verification-image (12) (push) Has been cancelled
CI and Release / lint-backend (push) Has been cancelled
CI and Release / push-verification-image (17) (push) Has been cancelled
CI and Release / push-verification-image (18) (push) Has been cancelled
CI and Release / release (push) Has been cancelled
CI and Release / publish-helm-chart (push) Has been cancelled
CI and Release / push-verification-image (13) (push) Has been cancelled
CI and Release / push-verification-image (14) (push) Has been cancelled
CI and Release / push-verification-image (15) (push) Has been cancelled
CI and Release / push-verification-image (16) (push) Has been cancelled

This commit is contained in:
wehub-resource-sync
2026-07-13 13:11:07 +08:00
commit 75f3dd141c
1285 changed files with 174579 additions and 0 deletions
+56
View File
@@ -0,0 +1,56 @@
FROM golang:1.26-bookworm
ARG NODE_MAJOR=24
ARG PNPM_VERSION=9.15.9
ARG GOOSE_VERSION=v3.27.1
ARG SWAG_VERSION=v1.16.4
ARG GOLANGCI_LINT_VERSION=v2.11.3
ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=1000
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates curl gnupg sudo git \
postgresql-client \
zstd \
python3 python3-pip pre-commit \
libncurses5 libncurses6 libtinfo5 libtinfo6 \
libmariadb3 libgnutls30 \
&& mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \
| gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" \
> /etc/apt/sources.list.d/nodesource.list \
&& curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \
| gpg --dearmor -o /etc/apt/keyrings/githubcli-archive-keyring.gpg \
&& chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" \
> /etc/apt/sources.list.d/github-cli.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends nodejs gh \
&& rm -rf /var/lib/apt/lists/*
RUN corepack enable
RUN groupadd --gid ${USER_GID} ${USERNAME} \
&& useradd --uid ${USER_UID} --gid ${USER_GID} --create-home --shell /bin/bash ${USERNAME} \
&& echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/${USERNAME} \
&& chmod 0440 /etc/sudoers.d/${USERNAME} \
&& mkdir -p /home/${USERNAME}/go /home/${USERNAME}/.cache /home/${USERNAME}/.local/share/pnpm \
&& chown -R ${USERNAME}:${USERNAME} /home/${USERNAME}
ENV GOPATH=/home/${USERNAME}/go
ENV PATH=${GOPATH}/bin:${PATH}
USER ${USERNAME}
RUN corepack prepare pnpm@${PNPM_VERSION} --activate
RUN go install github.com/pressly/goose/v3/cmd/goose@${GOOSE_VERSION} \
&& go install github.com/swaggo/swag/cmd/swag@${SWAG_VERSION}
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
| sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_LINT_VERSION}
USER root
+54
View File
@@ -0,0 +1,54 @@
{
"name": "Databasus",
"build": {
"dockerfile": "Dockerfile",
"context": "."
},
"workspaceFolder": "/workspaces/databasus",
"workspaceMount": "source=databasus-workspace,target=/workspaces/databasus,type=volume",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"version": "latest",
"moby": true,
"dockerDashComposeVersion": "latest"
}
},
"mounts": [
"source=databasus-go-mod-cache,target=/home/vscode/go/pkg/mod,type=volume",
"source=databasus-go-build-cache,target=/home/vscode/.cache/go-build,type=volume",
"source=databasus-golangci-cache,target=/home/vscode/.cache/golangci-lint,type=volume",
"source=databasus-pre-commit-cache,target=/home/vscode/.cache/pre-commit,type=volume",
"source=databasus-pnpm-store,target=/home/vscode/.local/share/pnpm,type=volume"
],
"forwardPorts": [4005, 5173],
"portsAttributes": {
"4005": { "label": "Backend (Gin)" },
"5173": { "label": "Vite dev server", "onAutoForward": "openBrowser" }
},
"containerEnv": {
"GOCACHE": "/home/vscode/.cache/go-build",
"GOMODCACHE": "/home/vscode/go/pkg/mod"
},
"customizations": {
"vscode": {
"extensions": [
"golang.go",
"ms-azuretools.vscode-docker",
"redhat.vscode-yaml",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"bradlc.vscode-tailwindcss"
],
"settings": {
"go.lintTool": "golangci-lint",
"go.useLanguageServer": true,
"go.testTimeout": "15m",
"[go]": { "editor.formatOnSave": true },
"eslint.workingDirectories": [{ "directory": "frontend", "changeProcessCWD": true }]
}
}
},
"postCreateCommand": "bash .devcontainer/post-create.sh",
"containerUser": "root",
"remoteUser": "vscode"
}
+32
View File
@@ -0,0 +1,32 @@
#!/usr/bin/env bash
set -euo pipefail
# The docker-in-docker feature pins iptables to the legacy backend, which needs the
# ip_tables/iptable_nat kernel modules. Hosts running an nft-only firewall stack never
# load them, so dockerd dies initializing the bridge driver. Re-point iptables at the
# nft backend and restart the daemon the entrypoint already gave up on.
if ! docker info >/dev/null 2>&1; then
sudo update-alternatives --set iptables /usr/sbin/iptables-nft
sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-nft
sudo pkill dockerd || true
sudo pkill containerd || true
sudo /usr/local/share/docker-init.sh
fi
sudo chown -R vscode:vscode \
/workspaces/databasus \
/home/vscode/go \
/home/vscode/.cache \
/home/vscode/.local/share/pnpm
cd /workspaces/databasus
cd backend
go mod download
cd ..
cd frontend
pnpm install --frozen-lockfile
cd ..
pre-commit install --install-hooks