Commit Graph
609 Commits
Author SHA1 Message Date
Henry Zhang d06abff597 chore(docs): move docs site to standalone pnoker/iot-dc3-docs repo (#177)
* chore(docs): move docs site to standalone pnoker/iot-dc3-docs repo

The VitePress docs site now lives in pnoker/iot-dc3-docs and serves docs.dc3.site from there. Remove the in-repo docs/ and all docs-only build/deploy wiring so nothing dangles.

- delete docs/ (source moved to pnoker/iot-dc3-docs)

- delete .github/workflows/docs.yml (deploy owned by iot-dc3-docs)

- drop npm /docs dependabot block; clean codeql/.gitignore docs paths

- remove Makefile docs-* targets

- relocate AI testing policy into dc3-web/tests/ so the required Web guardrail test is self-contained (was reading ../docs/...)

- rewire README image refs (7 READMEs) and in-repo doc links (README.ai.md, AGENTS.md, dc3/doc/README.md) to https://docs.dc3.site / the new repo

dc3/doc/{TITLE,CHANGE,USAGE}.md STAY - release tooling (make changelog, docker-ci) regenerates them; the docs repo snapshots them.

* fix(docs): repair pre-existing broken doc links found during migration

- 8 READMEs: /en|zh/introduction/technology-stack -> /en|zh/development/technology-stack (page lives under development/, not introduction/)

- dc3-web/tests/README.md: ../docs/test-debugging.md (missing) -> https://docs.dc3.site/en/frontend/test-debugging
2026-08-06 14:54:17 +08:00
pnoker 7bf615b3b1 feat(driver): configure driver buffer and mount container volume
28 driver application.yml add dc3.driver.buffer; Dockerfile each stage adds dc3/data dir and VOLUME; docker-compose main/dev add driver_data named volume
2026-07-26 00:13:31 +08:00
pnoker bed0877e08 build(infra): add jaeger tracing backend to optional docker-compose stack
Add jaegertracing/all-in-one with OTLP collector enabled (ports 16686 UI,
4317 gRPC, 4318 HTTP) for distributed trace visualization.
2026-07-23 23:20:18 +08:00
pnokerandClaude Fable 5 6cd05d2c68 refactor(nginx): move SSL certs into nginx/certs directory
The nginx TLS cert lived in a top-level dependencies/conf.crt/ directory,
inconsistent with the per-component layout (grafana, postgres, rabbitmq,
nginx). Move it under dc3/dependencies/nginx/certs/dc3.site/ to sit with
the nginx config it belongs to, mirroring rabbitmq/keys/.

Update dc3-web/Dockerfile to COPY certs from the new path into
/etc/letsencrypt/live/, matching the path nginx.conf references.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 12:38:47 +08:00
pnoker d228f4e252 chore: align license headers to AGPL across maven wrapper, docs and web assets 2026-07-10 00:02:18 +08:00
pnokerandClaude c35708859c feat(observability): add Grafana dashboard and PostgreSQL init scripts
- Add Grafana dashboard for point-value-overview with tenant and driver
  template variables, querying dc3-postgres datasource
- Add Grafana provisioning configs for dashboard and datasource auto-load
- Add PostgreSQL init script (07-iot-dc3-observability.sql) creating
  observability views and functions
- Register grafana and initdb in docker-compose-optional.yml

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-09 12:53:25 +08:00
Henry Zhang 72a5fceac0 chore: consolidate CI, docs, and issue templates (#99)
* ci(dependabot): add cargo ecosystem, groups, and clean up stale docker directories

* docs(ai): add spring-ai-deep-dive cross-references in en and zh indexes

* docs(community): add english FAQ and frontend developer guide

* chore(issue-templates): translate all templates to english

* ci(docker): add 20 missing driver images to Dockerfile, compose, and Makefile

* fix(docs): remove Vue template syntax from panorama SVGs so they render

* docs(ai): add spring-ai-deep-dive pages in en and zh
2026-06-28 23:42:04 +08:00
pnoker ef0185e7e0 chore: remove old dc3/images directory after migration to docs/public/images 2026-06-28 19:57:57 +08:00
pnoker 9d69edd0c9 build: add Maven Wrapper and expand docker-compose with all driver services
- Add Maven Wrapper (mvnw, mvnw.cmd, .mvn/wrapper/) for Maven 3.9.11
- Expand docker-compose.yml from 8 to 24 driver services covering:
  industrial bus (BACnet/IP, FINS, MELSEC, EtherNet/IP),
  SCADA/power (IEC 104, SL651, SNMP, DLMS),
  IoT/wireless (CoAP, LwM2M, HTTP),
  serial/network (Serial, TCP/UDP),
  database bridges (MySQL, PostgreSQL, Oracle, SQL Server)
2026-06-28 19:57:56 +08:00
pnokerandClaude 2198d7fffe chore: merge iot-dc3-web frontend into monorepo
Merge the standalone iot-dc3-web repository into iot-dc3 as dc3-web/,
creating a single monorepo with unified versioning, CI/CD, and release
process.

- subtree-add iot-dc3-web under dc3-web/ with full commit history
- relocate nginx configs and SSL certs to dc3/dependencies/
- merge CI workflows (ci-backend.yml, ci-web.yml, docker-ci-web.yml)
- merge Issue/PR templates and dependabot config
- host frontend docs under docs/zh/frontend/
- share .husky/ hooks via root-level package.json (pnpm)
- unify versioning: single dc3/bin/tag.sh (vYYYY.M.P) for the whole repo
- update Dockerfile, docker-compose.yml, Makefile for new paths
- remove redundant directories from dc3-web/ (.claude, .github, dc3, docs, bin)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-28 14:43:22 +08:00
pnoker e89f4cc1d2 docs: document branch model and semver release flow; align changelog tag pattern 2026-06-26 14:31:34 +08:00
pnoker a32354c602 chore(git): rewrite tag.sh to semver on main with dry-run 2026-06-26 14:26:04 +08:00
pnoker 705286622a feat(seed): add MCP connection/client/tool management menus
Add dc3_menu rows for the MCP Connection / MCP Client / MCP Tool settings pages (codes settingsMcpConnection/Client/Tool under the Integration group), matching the new frontend management views.
2026-06-22 12:08:11 +08:00
pnoker 44547e267c refactor(seed): restructure settings menu into eight groups
Reorganize dc3_menu (and mirrored dc3_resource) under Settings into Identity / Access / Model / Alarm / Event&Command / Audit / Integration / System, matching the frontend settingsNav.ts. Replaces the flat, out-of-order layout and retires the legacy Event/Command group containers.
2026-06-19 21:26:50 +08:00
Vickey 5131b37568 build(deploy): add postgres/rabbitmq dependency assets and regenerate openapi snapshots 2026-06-19 16:49:01 +08:00
pnoker cba2d54780 docs: align Make command references with new compose shortcuts
Update READMEs, guides, USAGE and the stack-test skill to use the
up-<stack>[-<registry>] targets in place of the removed dev-* commands.
2026-06-18 18:42:28 +08:00
pnoker 35d985e2f3 build: add compose shortcut targets and drop commit-msg lint hook
Generate <op>-<stack>[-<registry>] compose shortcuts and test/coverage
targets in the Makefile, remove the install-hooks target and the
.githooks commit-msg linter, and document the design.
2026-06-18 18:42:20 +08:00
pnoker 7dacc47056 docs(auth): document principal and mcp architecture
Update auth, gateway, architecture, quickstart, changelog, and superpowers design documents for the Principal identity model and OAuth-backed MCP server.
2026-06-12 21:20:41 +08:00
pnoker fbccee8f75 feat(mcp): add oauth-backed gateway runtime
Add OAuth metadata, registration, token, revoke, introspect, MCP catalog, connection, whitelist, and audit runtime in auth.

Expose gateway /.well-known OAuth resource metadata and /mcp JSON-RPC initialize, ping, tools/list, and tools/call with principal forwarding and high-risk call safeguards.
2026-06-12 21:19:58 +08:00
pnoker 1811d4f8ff fix: support reactive wildcard permissions 2026-06-12 11:26:23 +08:00
pnoker ec68f0cb7c feat(rabbitmq): expose tls configuration 2026-06-11 18:03:30 +08:00
pnoker 56d85f7ef3 chore(compose): pass rabbitmq initialization env 2026-06-11 16:01:12 +08:00
pnoker 7a2cc9b8fa chore(compose): streamline environment defaults 2026-06-11 15:04:01 +08:00
pnoker cd6dca6881 chore: add .m2/ to gitignore, DC3_SECURITY_KEY, and minor formatting fixes
- Add .m2/ to .gitignore for workspace-local Maven repository
- Add DC3_SECURITY_KEY to dev environment files
- Fix RoleUserBindController parameter formatting
- Fix README.ja.md newline breaks
2026-06-11 09:15:42 +08:00
pnoker c3b7934670 ci(security): audit controller authorization 2026-06-10 20:37:48 +08:00
Vickey 8a2a87f96c docs(openapi): add API documentation guide, export tooling, and conventions
- Add docs/development/api-documentation.md describing the Swagger UI layout,
  per-center grouping, auth headers, and production exposure.
- Add a `make openapi` target + dc3/bin/export_openapi.sh to snapshot each
  center's OpenAPI JSON from a running stack.
- Update AGENTS.md: OpenAPI/Swagger conventions, and correct the enum-suffix
  examples (multi-valued sets use *TypeEnum, not *FlagEnum).
2026-06-09 15:52:46 +08:00
pnoker 7f73b06cf8 docs(readme): add product screenshots and update Chinese README
Replace placeholder comments in README.zh.md with actual product
screenshot entries showing platform overview, device management, and
AI assistant pages.
2026-06-05 22:50:00 +08:00
Vickey 27bcf1383b fix: address code review — security, thread safety, performance, and null safety
Security (CRITICAL):
- KeyUtil: read JWT signing key from DC3_SECURITY_KEY env/property
- UserPasswordServiceImpl: read default password from DC3_SECURITY_DEFAULT_PASSWORD env
- KeyLoader: read OPC-UA keystore password from OPCUA_KEYSTORE_PASSWORD env
- WebFilterConfig: return 401 on malformed X-Auth-User header
- AlgorithmConstant: document deprecated hardcoded constants

Thread safety (HIGH):
- Fix TOCTOU races in 4 driver connectors (computeIfAbsent)
- Fix PlcS7 lock leak, OpcUa connect timeout (5s)
- CoapClientManager: synchronize setURI to prevent URI race
- PointValueJob, MqttScheduleJob: add @DisallowConcurrentExecution
- SystemHealthServiceImpl: preserve interrupt flag
- WindowSampleBuffer: local AtomicInteger → int

Performance (MEDIUM):
- EntityStateExpiryScanner: batch alarm saves (saveBatch)
- ImportDeviceServiceImpl: batch config saves
- ResourceRegistrySyncServiceImpl: batch-load nodes, eliminate N+1 COUNTs
- DriverSenderServiceImpl: debug-gate hot-path logging
- PointServiceImpl: stream().count() → size()

Null safety (LOW):
- RegexUtil: null guards on isName/isPhone/isMail/isPassword/isHost
- HostUtil: null-check getNetworkInterfaces() return
- TimeUtil: log parse failures instead of silent null

Infrastructure:
- Add spring-boot-starter-cache + @EnableCaching CacheConfig
- Replace embedded modbus4j/plc-s7 jars with external Maven dependencies
- Add dc3-driver-modbus-rtu module
2026-05-26 08:40:25 +08:00
Vickey 918b3d5e8e feat: update pom version to 2026.5.22 2026-05-26 00:30:11 +08:00
Vickey dedb03fe74 feat: add command/event attribute configuration system
Introduce CommandAttribute/EventAttribute with config variants:
- REST controllers, MyBatis mappers, services, and DAL managers
- gRPC client/server builders and proto message definitions
- DTOs, BOs, DOs, VOs for type-safe data transfer layer

fix: add explicit ::text casts in json_build_object parameters

PostgreSQL cannot infer parameter types inside json_build_object()
calls. Add ::text casts to #{stateExtType} and #{stateDescription}
to resolve "could not determine data type of parameter $10" errors.

refactor: restructure driver gRPC client and metadata layer

- Rename GrpcStubConfig to DriverClientStubConfig with dedicated DTOs
- Extract attribute builders from inline gRPC conversion logic
- Consolidate driver metadata, register service, and command handling
- Update device state heartbeat and command result event handling

docs: add multilingual architecture diagram and sync READMEs

- Translate architecture SVG into zh, ja, vi variants
- Update README architecture image references per language
- Add missing service-level shortcut sections to ja/vi READMEs
2026-05-25 00:00:00 +08:00
Vickey fd3af64634 feat: add layered architecture diagram and reposition project narrative
- Add IoT DC3 layered architecture diagram (SVG + HTML viewer)
  with Application / Management / Data / Driver layers,
  Security & Load and Platform & System sidebars,
  Data→Driver connection flows, and color-coded sections
- Reposition README descriptions across all languages (en, zh, ja, vi)
  and pom.xml to AI-ready narrative: "Connects devices, collects
  data organized for AI, and orchestrates the closed loop"
- Add README.ai.md with Chinese multi-paragraph AI narrative
  and closed-loop flowchart
- Optimize package.json metadata (name, license, scripts)
2026-05-24 13:35:57 +08:00
pnoker cb423056c7 security(auth): enable HMAC gateway-to-service signing by default
Set AUTH_HMAC_SECRET default to "io.github.pnoker.dc3" across .env
templates, compose files, and Java config properties so that X-Auth-User
header signing is active out of the box without manual configuration.
2026-05-19 23:15:34 +08:00
Vickey 14faabedc7 style: apply consistent formatting across GitHub workflows, docs and common modules 2026-05-19 00:15:07 +08:00
Vickey 9e9c1dc2e8 docs(site): switch documentation framework from MkDocs Material to VitePress
The MkDocs Material site felt visually dated. Switch to VitePress to
get a fresher default theme (the same one Vue, Vite, Pinia and
Element Plus use) and align the docs toolchain with the project's
Node ecosystem.

- Replace mkdocs.yml/requirements-docs.txt with package.json
  (pnpm scripts), pinned vitepress 1.5+, and pnpm-lock.yaml.
- Add docs/.vitepress/config.mts: zh-CN, /iot-dc3/ base, cleanUrls,
  per-section sidebars, local search with Chinese UI strings, edit
  link, light/dark theme labels in Chinese.
- Rewrite docs/index.md as layout: home with hero, six feature
  cards, and platform/architecture/license blocks underneath.
- docs/assets/ -> docs/public/ rename (VitePress static-asset
  convention). This rename was already absorbed by an unrelated
  upstream commit; only the architecture page reference is updated
  to /images/architecture-cn.png.
- Convert MkDocs snippets to VitePress <!--@include:-->:
  - community/{contributing,code-of-conduct,security} pull repo-root
    governance files,
  - development/changelog and guide/usage pull the docker-ci-
    referenced dc3/doc/{CHANGE,USAGE}.md.
- Wrap R<T> in inline code in architecture/modules.md so the Vue
  parser does not treat it as an unclosed HTML tag.
- Rewrite .github/workflows/docs.yml: pnpm/action-setup@v4 +
  setup-node@v4 (pnpm cache) + pnpm install --frozen-lockfile +
  pnpm docs:build + upload-pages-artifact (docs/.vitepress/dist)
  + deploy-pages. Trigger paths include docs/, package.json,
  pnpm-lock.yaml, governance files, and the two dc3/doc/ files
  referenced via include.
- Update .gitignore: drop /site/ and the Python-only venv entries,
  add docs/.vitepress/{cache,dist}/ and a Node/pnpm section.
- Adjust dc3/doc/README.md wording to mention VitePress include
  syntax instead of MkDocs snippets.

Verification: pnpm install + pnpm docs:build pass locally (5.44s);
the include-based pages (community/contributing, development/
changelog, guide/usage) render content from their source files; all
per-section sidebars resolve.
2026-05-18 19:53:58 +08:00
Vickey 317b7ac7b5 docs(release): align TITLE.md with main README description
The release-note source TITLE.md still carried outdated wording
("project development", "device integration and management") and
omitted the "AI-ready" positioning that README.md and the four
localized READMEs (zh/ja/vi) all promote as a core value proposition.
docker-ci.yml inlines this file into the GitHub Release body, so the
inconsistency surfaces every time we cut a release.

Realign the second paragraph with README.md:16-19 while keeping the
${SERVICE_VERSION} placeholder and the relative architecture image
path so docker-ci.yml's perl-based assembly continues to work.
2026-05-18 18:36:11 +08:00
pnoker bca6d7aedc docs(site): scaffold MkDocs Material documentation site with GitHub Pages CI
Set up an end-to-end documentation site so contributors and users have
a unified, searchable, and publishable entry point for project docs.

- Add mkdocs.yml: Chinese-first language, light/dark palette, tabbed
  navigation, indexed sections, glightbox for diagrams, and
  pymdownx.snippets so community pages can pull from root governance
  files (CONTRIBUTING.md, CODE_OF_CONDUCT.md, SECURITY.md) without
  duplicating content.
- Add requirements-docs.txt pinning mkdocs-material and
  mkdocs-glightbox.
- Build the docs/ skeleton: index, quickstart, guide, architecture,
  development, modules, community. Migrate the seven generic manuals
  from dc3/doc/ (QUICKSTART, ENVIRONMENT, LOGGING, TROUBLESHOOTING,
  MODULES, DRIVER-AUTHORING, TESTING) and rewire their cross-doc
  links. CHANGE.md, TITLE.md, and USAGE.md stay in dc3/doc/ because
  docker-ci.yml depends on them; the docs site references them via
  mkdocs snippets to keep a single source of truth.
- Add .github/workflows/docs.yml that builds with --strict on push to
  release and deploys via actions/deploy-pages.
- Rewrite dc3/doc/README.md as a migration pointer to the new site
  and to the three retained release-flow files.

Verification: mkdocs build --strict passes locally; snippets render
correctly; GitHub Pages already enabled in workflow mode via gh api.
2026-05-18 18:36:00 +08:00
pnoker 7f5da1a0f8 chore: bump version to 2026.5.18 across all modules 2026-05-18 00:24:22 +08:00
pnoker 80ec2beab4 docs: update documentation for compose and Makefile changes
Align all READMEs, AGENTS.md, CONTRIBUTING.md and dc3/doc/* with the
new Makefile interface (SERVICES/GROUP selectors, REGISTRY=cn, podman
default) and updated Dockerfile structure.
2026-05-17 22:16:37 +08:00
pnoker 83ee84773a build: refactor Dockerfile, Makefile and compose files
Parametrize JDK/JRE base images via build args in Dockerfile, replace
hardcoded GC/dump env vars with per-service path variables, fix APM
port. Simplify Makefile registry options to global|cn, add SERVICES
and GROUP selectors for targeted compose operations.
2026-05-17 22:16:30 +08:00
pnoker 994ccba991 docs: update READMEs and project documentation
Refresh module READMEs, AGENTS.md, CONTRIBUTING.md, and dc3/doc/
guides to reflect the unified Dockerfile, consolidated compose stacks,
and updated build instructions.
2026-05-17 19:03:21 +08:00
pnoker b9b2a47732 feat(docker): add web frontend and consolidate compose stacks
Add dc3-web frontend service to docker-compose.yml with nginx reverse
proxy as the sole user-facing entry point. Remove backend port mappings
since web now proxies to gateway.

Merge docker-compose-elasticsearch.yml and docker-compose-grafana.yml
into a single docker-compose-optional.yml that includes EMQX, ELK+APM,
and Prometheus+Grafana stacks.
2026-05-17 19:02:52 +08:00
pnoker 4f5aab074c style: format dc3-common and dc3 module code 2026-05-17 01:13:16 +08:00
pnoker 7847bffbd8 fix(agentic): preserve reasoning through tool loop 2026-05-17 00:59:46 +08:00
pnoker 019daf62ce feat: do someting test and code review 2026-05-16 00:56:04 +08:00
pnoker cb457c37cf refactor(driver): rename RValue/WValue and add CalculatedPointValue
Driver SPI used the cryptic RValue/WValue names for read/write payload
envelopes. Rename them to ReadPointValue/WritePointValue so the public
contract reads naturally, add a sibling CalculatedPointValue for values
that need their derived/scaled form to flow alongside the raw sample,
and pull the value-type conversion utility into a dedicated
support/TypedValueConverter helper instead of leaving it inline.

DriverCustomService.read/write signatures and the seven driver
implementations (modbus-tcp, mqtt, opc-da, opc-ua, plcs7, virtual,
listening-virtual) move to the new types in lockstep so every consumer
of the SDK keeps compiling. Tests are renamed and resequenced to match,
and the driver authoring guide reflects the new identifiers.
2026-05-15 16:10:18 +08:00
pnoker 56cfc2231c style: fix minor formatting in dc3 module 2026-05-15 09:44:24 +08:00
pnoker 9123b480f4 test(e2e): stabilize infrastructure harness 2026-05-14 21:29:08 +08:00
Vickey aed2db0ff8 fix: update auth controller login flow, fix test compilation and assertions 2026-05-14 00:09:21 +08:00
Vickey 10e0836026 docs(test): add testing guide and update validation checklist
Introduce dc3/doc/TESTING.md as the canonical reference for the iot-dc3
test pyramid, naming conventions, time/randomness isolation rules,
Testcontainers conventions pinned to the production timescaledb-ha:pg18
image, fixture data strategy, contract base classes shipped by
dc3-common-test, the make commands developers run locally and the
ci.yml/test.yml/e2e.yml workflow contract.

Update AGENTS.md so:

- The Validation Checklist references make test, make test-it,
  make coverage and proto contract tests; coverage regressions over 1%
  block PRs.
- The Documentation Rules section now lists TESTING.md alongside the
  other domain-specific docs to keep the guide current as the harness
  evolves.

This closes the S0 stage of the test build-out: every subsequent stage
(S1..S8) will deliver business test cases under the layout defined here.
2026-05-13 13:10:50 +08:00
pnoker d99e6cb2c1 style: reorder imports and fix doc table alignment 2026-05-12 08:32:14 +08:00