From fae594ccd7dd252059e6fc86f31df10d752307d4 Mon Sep 17 00:00:00 2001 From: funnywolf Date: Sun, 5 Jul 2026 17:29:22 +0800 Subject: [PATCH] Simplify component README files Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- backend/readme.md | 60 +++++++++++---------------------- cli/README.md | 57 ++++++++----------------------- frontend/README.md | 83 ++++++++++------------------------------------ 3 files changed, 51 insertions(+), 149 deletions(-) diff --git a/backend/readme.md b/backend/readme.md index 0fc54ae..75896da 100644 --- a/backend/readme.md +++ b/backend/readme.md @@ -1,58 +1,36 @@ # ASP Backend -## Admin user maintenance +Django backend for Agentic SOC Platform. -ASP admin users are Django superusers. They are created and maintained from the backend command line, not from the web UI. The web UI can assign only `user` or `viewer` roles. +## Development -Run commands from the repository root: +Run commands from the `backend` directory: ```powershell -cd backend +uv sync +.\.venv\Scripts\python.exe manage.py migrate +.\.venv\Scripts\python.exe manage.py runserver ``` -### Create an admin user +For websocket development, also run the ASGI server: -Use Django's `createsuperuser` command: +```powershell +.\.venv\Scripts\python.exe -m uvicorn asp.asgi:application --host 127.0.0.1 --port 8001 +``` + +## Admin user + +ASP admin users are Django superusers and are maintained from the backend command line: ```powershell .\.venv\Scripts\python.exe manage.py createsuperuser -``` - -Follow the prompts to enter username, email, and password. The created account logs in with **Platform** authentication. - -### Reset an existing admin user's password - -If you know the admin username, use: - -```powershell .\.venv\Scripts\python.exe manage.py changepassword ``` -Example: +## Documentation -```powershell -.\.venv\Scripts\python.exe manage.py changepassword admin -``` +Product, deployment, and operations documentation lives in the docs site: -### Find existing admin usernames - -If you do not know the admin username: - -```powershell -.\.venv\Scripts\python.exe manage.py shell -c "from apps.accounts.models import User; print('\n'.join(User.objects.filter(is_superuser=True).values_list('username', flat=True)))" -``` - -## Production processes - -Use Nginx as the external entry point. Route normal Django HTTP/API/Admin traffic to Gunicorn and websocket traffic under `/ws/` to Uvicorn. - -```powershell -gunicorn asp.wsgi:application --bind 127.0.0.1:8000 --workers 2 --threads 4 --access-logfile - --error-logfile - -uvicorn asp.asgi:application --host 127.0.0.1 --port 8001 --access-log -python manage.py run_agentic_playbook_worker -python manage.py run_agentic_case_analysis_worker -python manage.py run_agentic_module_worker -python manage.py run_elk_action_worker -``` - -The production processes keep console logging enabled and write rotating gzip logs under `log`. +- https://asp.viperrtp.com/asp/quick-start/deployment/ +- https://asp.viperrtp.com/asp/quick-start/first-login/ +- https://asp.viperrtp.com/asp/settings/users/ diff --git a/cli/README.md b/cli/README.md index 78fa5a2..0b6e48e 100644 --- a/cli/README.md +++ b/cli/README.md @@ -10,6 +10,18 @@ Command line client for Agentic SOC Platform. pipx install asp-cli ``` +## Upgrade + +```powershell +pipx upgrade asp-cli +``` + +Install a specific version: + +```powershell +pipx install asp-cli==0.5.0 --force +``` + ## Quick start ```powershell @@ -26,47 +38,6 @@ For automation and skills, prefer stable JSON output: asp case list --output json ``` -## Publish to PyPI +## Documentation -The GitHub release workflow publishes `asp-cli` to PyPI automatically when a `v` tag is pushed. The CLI package version does not include the leading `v` and must match the main release version, so update `version` in `pyproject.toml` before creating the tag. - -For example, release tag `v0.1.0` publishes PyPI version `0.1.0`. - -### Automatic publishing - -The workflow uses PyPI Trusted Publishing, so it does not need a PyPI API token in the repository or GitHub Secrets. Configure PyPI once with a trusted publisher: - -- PyPI project: `asp-cli` -- Owner/repository: `FunnyWolf/agentic-soc-platform` -- Workflow: `release.yml` -- Environment: `pypi` - -If the PyPI project does not exist yet, add the same entry under PyPI's pending publishers before the first release. - -Release steps: - -```powershell -# Update cli\pyproject.toml first, for example: version = "0.1.0" -git tag v0.1.0 -git push origin v0.1.0 -``` - -### Manual fallback - -Manual publishing requires a PyPI API token. Keep it local and do not commit it: - -```powershell -cd cli -Remove-Item -Recurse -Force dist -ErrorAction SilentlyContinue -uv build -uvx twine check dist\* -$env:UV_PUBLISH_TOKEN = "pypi-..." -uv publish --token $env:UV_PUBLISH_TOKEN -``` - -After publishing, verify the package can be installed: - -```powershell -pipx install --force asp-cli -asp --version -``` +Full CLI documentation: https://asp.viperrtp.com/asp/integrations/cli/ diff --git a/frontend/README.md b/frontend/README.md index 7dbf7eb..34631cb 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -1,73 +1,26 @@ -# React + TypeScript + Vite +# ASP Frontend -This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. +Vite + React + Ant Design frontend for Agentic SOC Platform. -Currently, two official plugins are available: +## Development -- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs) -- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) - -## React Compiler - -The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation). - -## Expanding the ESLint configuration - -If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules: - -```js -export default defineConfig([ - globalIgnores(['dist']), - { - files: ['**/*.{ts,tsx}'], - extends: [ - // Other configs... - - // Remove tseslint.configs.recommended and replace with this - tseslint.configs.recommendedTypeChecked, - // Alternatively, use this for stricter rules - tseslint.configs.strictTypeChecked, - // Optionally, add this for stylistic rules - tseslint.configs.stylisticTypeChecked, - - // Other configs... - ], - languageOptions: { - parserOptions: { - project: ['./tsconfig.node.json', './tsconfig.app.json'], - tsconfigRootDir: import.meta.dirname, - }, - // other options... - }, - }, -]) +```powershell +pnpm install +pnpm dev ``` -You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules: +The dev server proxies backend API requests under `/api` and websocket requests under `/ws`. -```js -// eslint.config.js -import reactX from 'eslint-plugin-react-x' -import reactDom from 'eslint-plugin-react-dom' +## Checks -export default defineConfig([ - globalIgnores(['dist']), - { - files: ['**/*.{ts,tsx}'], - extends: [ - // Other configs... - // Enable lint rules for React - reactX.configs['recommended-typescript'], - // Enable lint rules for React DOM - reactDom.configs.recommended, - ], - languageOptions: { - parserOptions: { - project: ['./tsconfig.node.json', './tsconfig.app.json'], - tsconfigRootDir: import.meta.dirname, - }, - // other options... - }, - }, -]) +```powershell +pnpm exec eslint . +pnpm exec tsc -b ``` + +## Documentation + +Product and deployment documentation lives in the docs site: + +- https://asp.viperrtp.com/asp/overview/ +- https://asp.viperrtp.com/asp/quick-start/deployment/