Commit Graph
599 Commits
Author SHA1 Message Date
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
pnoker 989443e99f docs(agentic): document provider configuration 2026-05-11 18:58:19 +08:00
pnoker 285ed9273f feat(agentic): configure fallback provider and profile activation 2026-05-11 18:57:53 +08:00
pnoker d65fc715ff build(deploy): add agentic memory and tool-calling env variables to docker-compose
Expose AGENTIC_MEMORY_ENABLED, AGENTIC_TOOL_CALLING_ENABLED,
AGENTIC_MEMORY_MAX_MESSAGES, and AGENTIC_ATTACHMENT_STORAGE_PATH
in development and production compose files, with defaults in dev.env.

Also mark OpenAI base-url config as deprecated in application-agentic.yml.
2026-05-11 00:44:44 +08:00
Vickey 9d7e238eb1 refactor(config): update default AI model to deepseek-v4-flash and agentic env variables 2026-05-10 21:43:58 +08:00
pnoker 252c55b83d refactor(driver): rename DriverCustomServiceImpl to protocol-specific class names
Rename the generic DriverCustomServiceImpl in each driver module to a
protocol-specific name (e.g., ModbusTcpDriverCustomServiceImpl) so
that static analysis tools can scan every driver module without
filtering duplicate fully-qualified class names. Update
DRIVER-AUTHORING.md to reflect the new convention.
2026-05-10 11:25:55 +08:00
Vickey a0672297e0 docs: update CHANGELOG with recent feature additions and fixes 2026-05-10 01:59:17 +08:00
Vickey 5daaac6900 docs: align markdown tables and wrap long lines 2026-05-10 01:57:19 +08:00
Vickey 0e92643d54 feat(config): add AUTH_HMAC_SECRET to all deployment configurations
The HMAC signing feature was dormant because no deployment config
set the shared secret. Add AUTH_HMAC_SECRET to .env.example, dev
env files, both compose stacks (all 12 services), and document it
in ENVIRONMENT.md.
2026-05-10 01:48:51 +08:00
pnoker f586f0cd1c docs: align markdown tables and wrap long lines 2026-05-09 23:50:58 +08:00
pnoker 1458940c22 docs(release): update generated changelog 2026-05-09 22:51:23 +08:00