django-octo 0.1.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- django_octo-0.1.7/.github/workflows/release.yml +73 -0
- django_octo-0.1.7/.gitignore +13 -0
- django_octo-0.1.7/.python-version +1 -0
- django_octo-0.1.7/CHANGELOG.md +6 -0
- django_octo-0.1.7/LICENSE +21 -0
- django_octo-0.1.7/PKG-INFO +15 -0
- django_octo-0.1.7/README.md +2 -0
- django_octo-0.1.7/pyproject.toml +25 -0
- django_octo-0.1.7/requirements-dev.lock +36 -0
- django_octo-0.1.7/requirements.lock +27 -0
- django_octo-0.1.7/scripts/sync_version.py +72 -0
- django_octo-0.1.7/src/django_octo/__init__.py +17 -0
- django_octo-0.1.7/src/django_octo/apps.py +7 -0
- django_octo-0.1.7/src/django_octo/registry.py +58 -0
- django_octo-0.1.7/src/django_octo/templates/django_octo/hub.html +123 -0
- django_octo-0.1.7/src/django_octo/urls.py +13 -0
- django_octo-0.1.7/src/django_octo/views.py +8 -0
- django_octo-0.1.7/tests/test_orchestrator.py +45 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
name: Ecosystem Sync & PyPI Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
repository_dispatch:
|
|
5
|
+
types: [octo-module-released]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
inputs:
|
|
8
|
+
module:
|
|
9
|
+
description: "Updated module name"
|
|
10
|
+
required: false
|
|
11
|
+
default: "manual-sync"
|
|
12
|
+
version:
|
|
13
|
+
description: "Updated module version"
|
|
14
|
+
required: false
|
|
15
|
+
default: "latest"
|
|
16
|
+
summary:
|
|
17
|
+
description: "Release summary"
|
|
18
|
+
required: false
|
|
19
|
+
default: "Manual ecosystem orchestration sync"
|
|
20
|
+
|
|
21
|
+
permissions:
|
|
22
|
+
contents: write
|
|
23
|
+
id-token: write
|
|
24
|
+
|
|
25
|
+
jobs:
|
|
26
|
+
orchestrate-release:
|
|
27
|
+
runs-on: ubuntu-latest
|
|
28
|
+
environment:
|
|
29
|
+
name: pypi
|
|
30
|
+
url: https://pypi.org
|
|
31
|
+
steps:
|
|
32
|
+
- name: Checkout repository
|
|
33
|
+
uses: actions/checkout@v4
|
|
34
|
+
|
|
35
|
+
- name: Setup Rye
|
|
36
|
+
uses: eifinger/setup-rye@v4
|
|
37
|
+
|
|
38
|
+
- name: Calculate Cumulative Version & Update Changelog
|
|
39
|
+
id: sync
|
|
40
|
+
env:
|
|
41
|
+
DISPATCH_MODULE: ${{ github.event.client_payload.module || github.event.inputs.module }}
|
|
42
|
+
DISPATCH_VERSION: ${{ github.event.client_payload.version || github.event.inputs.version }}
|
|
43
|
+
DISPATCH_SUMMARY: ${{ github.event.client_payload.summary || github.event.inputs.summary }}
|
|
44
|
+
run: |
|
|
45
|
+
OUTPUT=$(python3 scripts/sync_version.py)
|
|
46
|
+
echo "$OUTPUT"
|
|
47
|
+
echo "$OUTPUT" >> $GITHUB_OUTPUT
|
|
48
|
+
|
|
49
|
+
- name: Synchronize Dependencies & Run Integration Tests
|
|
50
|
+
run: |
|
|
51
|
+
rye sync
|
|
52
|
+
rye test
|
|
53
|
+
|
|
54
|
+
- name: Commit Version Bump & Tag
|
|
55
|
+
run: |
|
|
56
|
+
git config user.name "github-actions[bot]"
|
|
57
|
+
git config user.email "github-actions[bot]@://github.com"
|
|
58
|
+
git add pyproject.toml src/django_octo/__init__.py CHANGELOG.md
|
|
59
|
+
git commit -m "chore(release): bump django-octo to v${{ steps.sync.outputs.NEW_VERSION }}"
|
|
60
|
+
git tag "v${{ steps.sync.outputs.NEW_VERSION }}"
|
|
61
|
+
git push origin main --tags
|
|
62
|
+
|
|
63
|
+
- name: Build Package
|
|
64
|
+
run: rye build
|
|
65
|
+
|
|
66
|
+
- name: Publish to PyPI (Trusted Publisher)
|
|
67
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
68
|
+
|
|
69
|
+
- name: Create GitHub Release
|
|
70
|
+
env:
|
|
71
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
72
|
+
run: |
|
|
73
|
+
gh release create "v${{ steps.sync.outputs.NEW_VERSION }}" --generate-notes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12.9
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jean Carlos
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: django-octo
|
|
3
|
+
Version: 0.1.7
|
|
4
|
+
Summary: Enterprise Django-Octo Core Orchestrator unifying SEO, Security, and Dual-Channel runtime modules.
|
|
5
|
+
Author-email: Jean Carlos <jeanpmodev@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Python: >=3.12
|
|
9
|
+
Requires-Dist: django-octo-security>=0.1.0
|
|
10
|
+
Requires-Dist: django-octo-seo>=0.1.6
|
|
11
|
+
Requires-Dist: django>=6.1.2
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
|
|
14
|
+
# django_octo
|
|
15
|
+
Modular Django-Octo Core Orchestrator for decoupled runtime modules, automated environment discovery, and event-driven cumulative versioning.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "django-octo"
|
|
3
|
+
version = "0.1.7"
|
|
4
|
+
description = "Enterprise Django-Octo Core Orchestrator unifying SEO, Security, and Dual-Channel runtime modules."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.12"
|
|
7
|
+
license = { text = "MIT" }
|
|
8
|
+
authors = [{ name = "Jean Carlos", email = "jeanpmodev@gmail.com" }]
|
|
9
|
+
dependencies = [
|
|
10
|
+
"django>=6.1.2",
|
|
11
|
+
"django-octo-seo>=0.1.6",
|
|
12
|
+
"django-octo-security>=0.1.0",
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
[build-system]
|
|
16
|
+
requires = ["hatchling"]
|
|
17
|
+
build-backend = "hatchling.build"
|
|
18
|
+
|
|
19
|
+
[tool.hatch.build.targets.wheel]
|
|
20
|
+
packages = ["src/django_octo"]
|
|
21
|
+
|
|
22
|
+
[tool.rye]
|
|
23
|
+
dev-dependencies = [
|
|
24
|
+
"pytest>=9.2.0",
|
|
25
|
+
]
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# generated by rye
|
|
2
|
+
# use `rye lock` or `rye sync` to update this lockfile
|
|
3
|
+
#
|
|
4
|
+
# last locked with the following flags:
|
|
5
|
+
# pre: false
|
|
6
|
+
# features: []
|
|
7
|
+
# all-features: false
|
|
8
|
+
# with-sources: false
|
|
9
|
+
# generate-hashes: false
|
|
10
|
+
# universal: false
|
|
11
|
+
|
|
12
|
+
-e file:.
|
|
13
|
+
asgiref==3.13.0
|
|
14
|
+
# via django
|
|
15
|
+
django==6.1.3
|
|
16
|
+
# via django-octo
|
|
17
|
+
# via django-octo-security
|
|
18
|
+
# via django-octo-seo
|
|
19
|
+
django-octo-security==0.1.0
|
|
20
|
+
# via django-octo
|
|
21
|
+
django-octo-seo==0.1.6
|
|
22
|
+
# via django-octo
|
|
23
|
+
iniconfig==2.3.1
|
|
24
|
+
# via pytest
|
|
25
|
+
packaging==26.3
|
|
26
|
+
# via pytest
|
|
27
|
+
pluggy==1.7.0
|
|
28
|
+
# via pytest
|
|
29
|
+
pygments==2.21.0
|
|
30
|
+
# via pytest
|
|
31
|
+
pytest==9.2.0
|
|
32
|
+
python-dotenv==1.2.4
|
|
33
|
+
# via django-octo-security
|
|
34
|
+
# via django-octo-seo
|
|
35
|
+
sqlparse==0.6.1
|
|
36
|
+
# via django
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# generated by rye
|
|
2
|
+
# use `rye lock` or `rye sync` to update this lockfile
|
|
3
|
+
#
|
|
4
|
+
# last locked with the following flags:
|
|
5
|
+
# pre: false
|
|
6
|
+
# features: []
|
|
7
|
+
# all-features: false
|
|
8
|
+
# with-sources: false
|
|
9
|
+
# generate-hashes: false
|
|
10
|
+
# universal: false
|
|
11
|
+
|
|
12
|
+
-e file:.
|
|
13
|
+
asgiref==3.13.0
|
|
14
|
+
# via django
|
|
15
|
+
django==6.1.3
|
|
16
|
+
# via django-octo
|
|
17
|
+
# via django-octo-security
|
|
18
|
+
# via django-octo-seo
|
|
19
|
+
django-octo-security==0.1.0
|
|
20
|
+
# via django-octo
|
|
21
|
+
django-octo-seo==0.1.6
|
|
22
|
+
# via django-octo
|
|
23
|
+
python-dotenv==1.2.4
|
|
24
|
+
# via django-octo-security
|
|
25
|
+
# via django-octo-seo
|
|
26
|
+
sqlparse==0.6.1
|
|
27
|
+
# via django
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import os
|
|
3
|
+
import re
|
|
4
|
+
import urllib.parse
|
|
5
|
+
import urllib.request
|
|
6
|
+
from datetime import datetime, timezone
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
9
|
+
SATELLITES = ["django-octo-seo", "django-octo-security"]
|
|
10
|
+
BASE_MINOR = "0.1"
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def get_pypi_release_count(package: str) -> tuple[str, int]:
|
|
14
|
+
host = ".".join(["pypi", "org"])
|
|
15
|
+
url = urllib.parse.urlunparse(("https", host, f"/pypi/{package}/json", "", "", ""))
|
|
16
|
+
req = urllib.request.Request(url, headers={"User-Agent": "django-octo-orchestrator/1.0"})
|
|
17
|
+
with urllib.request.urlopen(req, timeout=15) as response:
|
|
18
|
+
data = json.loads(response.read().decode("utf-8"))
|
|
19
|
+
latest_version = data["info"]["version"]
|
|
20
|
+
release_count = len(data.get("releases", {}))
|
|
21
|
+
return latest_version, release_count
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def main() -> None:
|
|
25
|
+
total_releases = 0
|
|
26
|
+
versions_map = {}
|
|
27
|
+
|
|
28
|
+
for pkg in SATELLITES:
|
|
29
|
+
latest, count = get_pypi_release_count(pkg)
|
|
30
|
+
versions_map[pkg] = latest
|
|
31
|
+
total_releases += count
|
|
32
|
+
|
|
33
|
+
new_version = f"{BASE_MINOR}.{total_releases}"
|
|
34
|
+
|
|
35
|
+
# Update pyproject.toml
|
|
36
|
+
pyproject_path = Path("pyproject.toml")
|
|
37
|
+
content = pyproject_path.read_text(encoding="utf-8")
|
|
38
|
+
content = re.sub(r'version = "[^"]+"', f'version = "{new_version}"', content, count=1)
|
|
39
|
+
for pkg, ver in versions_map.items():
|
|
40
|
+
content = re.sub(rf'"{pkg}>=[^"]+"', f'"{pkg}>={ver}"', content)
|
|
41
|
+
pyproject_path.write_text(content, encoding="utf-8")
|
|
42
|
+
|
|
43
|
+
# Update __init__.py
|
|
44
|
+
init_path = Path("src/django_octo/__init__.py")
|
|
45
|
+
init_content = init_path.read_text(encoding="utf-8")
|
|
46
|
+
init_content = re.sub(r'__version__ = "[^"]+"', f'__version__ = "{new_version}"', init_content, count=1)
|
|
47
|
+
init_path.write_text(init_content, encoding="utf-8")
|
|
48
|
+
|
|
49
|
+
# Append automated release entry to CHANGELOG.md
|
|
50
|
+
module_changed = os.getenv("DISPATCH_MODULE", "ecosystem-sync")
|
|
51
|
+
module_version = os.getenv("DISPATCH_VERSION", "latest")
|
|
52
|
+
change_summary = os.getenv("DISPATCH_SUMMARY", "Automated cumulative ecosystem synchronization.")
|
|
53
|
+
date_str = datetime.now(timezone.utc).strftime("%Y-%m-%d")
|
|
54
|
+
|
|
55
|
+
changelog_path = Path("CHANGELOG.md")
|
|
56
|
+
entry = (
|
|
57
|
+
f"## [{new_version}] - {date_str}\n"
|
|
58
|
+
f"- **Updated Module:** `{module_changed}` (`v{module_version}`)\n"
|
|
59
|
+
f"- **Summary:** {change_summary}\n\n"
|
|
60
|
+
)
|
|
61
|
+
existing = changelog_path.read_text(encoding="utf-8") if changelog_path.exists() else "# Changelog\n\n"
|
|
62
|
+
if "# Changelog" in existing:
|
|
63
|
+
updated_changelog = existing.replace("# Changelog\n\n", f"# Changelog\n\n{entry}", 1)
|
|
64
|
+
else:
|
|
65
|
+
updated_changelog = f"# Changelog\n\n{entry}{existing}"
|
|
66
|
+
changelog_path.write_text(updated_changelog, encoding="utf-8")
|
|
67
|
+
|
|
68
|
+
print(f"NEW_VERSION={new_version}")
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
if __name__ == "__main__":
|
|
72
|
+
main()
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import importlib.util
|
|
2
|
+
|
|
3
|
+
__version__ = "0.1.7"
|
|
4
|
+
|
|
5
|
+
OCTO_MODULES = [
|
|
6
|
+
"django_octo_seo",
|
|
7
|
+
"django_octo_security",
|
|
8
|
+
]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def get_installed_octo_apps() -> list[str]:
|
|
12
|
+
"""Auto-discovers installed Django-Octo satellite modules at build/runtime."""
|
|
13
|
+
available = ["django_octo"]
|
|
14
|
+
for module in OCTO_MODULES:
|
|
15
|
+
if importlib.util.find_spec(module) is not None:
|
|
16
|
+
available.append(module)
|
|
17
|
+
return available
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import importlib.metadata
|
|
2
|
+
import importlib.util
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
MODULE_CATALOG = [
|
|
6
|
+
{
|
|
7
|
+
"package": "django-octo-seo",
|
|
8
|
+
"module": "django_octo_seo",
|
|
9
|
+
"title": "Semantic & SEO Injection Engine",
|
|
10
|
+
"layer": "8-Layer Metadata & Single-Block JSON-LD",
|
|
11
|
+
"description": "High-performance single-query SEO runtime engine optimizing crawlers, Open Graph, and generative AI indexers.",
|
|
12
|
+
"public_url": "/seo-demo/",
|
|
13
|
+
"admin_url": "/admin/",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"package": "django-octo-security",
|
|
17
|
+
"module": "django_octo_security",
|
|
18
|
+
"title": "Runtime Security & CVE Audit Engine",
|
|
19
|
+
"layer": "Zero-Dependency OSV.dev & HTTP Posture",
|
|
20
|
+
"description": "Non-intrusive Dual-Channel security posture enforcer and real-time virtual environment CVE auditor.",
|
|
21
|
+
"public_url": "/security-audit/",
|
|
22
|
+
"admin_url": "/admin/",
|
|
23
|
+
},
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def discover_octo_ecosystem() -> dict[str, Any]:
|
|
28
|
+
"""Inspects the active runtime environment and builds live module telemetry."""
|
|
29
|
+
try:
|
|
30
|
+
core_version = importlib.metadata.version("django-octo")
|
|
31
|
+
except importlib.metadata.PackageNotFoundError:
|
|
32
|
+
core_version = "0.1.8-dev"
|
|
33
|
+
|
|
34
|
+
modules_status = []
|
|
35
|
+
active_count = 0
|
|
36
|
+
|
|
37
|
+
for item in MODULE_CATALOG:
|
|
38
|
+
is_installed = importlib.util.find_spec(item["module"]) is not None
|
|
39
|
+
version = None
|
|
40
|
+
if is_installed:
|
|
41
|
+
active_count += 1
|
|
42
|
+
try:
|
|
43
|
+
version = importlib.metadata.version(item["package"])
|
|
44
|
+
except importlib.metadata.PackageNotFoundError:
|
|
45
|
+
version = "local-editable"
|
|
46
|
+
|
|
47
|
+
modules_status.append({
|
|
48
|
+
**item,
|
|
49
|
+
"installed": is_installed,
|
|
50
|
+
"version": version,
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
return {
|
|
54
|
+
"core_version": core_version,
|
|
55
|
+
"active_count": active_count,
|
|
56
|
+
"total_catalog": len(MODULE_CATALOG),
|
|
57
|
+
"modules": modules_status,
|
|
58
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Django-Octo | Core Control Hub</title>
|
|
7
|
+
<style>
|
|
8
|
+
:root {
|
|
9
|
+
--bg: #0b1110;
|
|
10
|
+
--surface: #121c1a;
|
|
11
|
+
--border: #1f332e;
|
|
12
|
+
--accent: #10b981;
|
|
13
|
+
--text: #e2e8f0;
|
|
14
|
+
--muted: #94a3b8;
|
|
15
|
+
}
|
|
16
|
+
body {
|
|
17
|
+
font-family: system-ui, -apple-system, sans-serif;
|
|
18
|
+
background-color: var(--bg);
|
|
19
|
+
color: var(--text);
|
|
20
|
+
margin: 0;
|
|
21
|
+
padding: 2rem;
|
|
22
|
+
line-height: 1.6;
|
|
23
|
+
}
|
|
24
|
+
.container { max-width: 960px; margin: 0 auto; }
|
|
25
|
+
header {
|
|
26
|
+
border-bottom: 1px solid var(--border);
|
|
27
|
+
padding-bottom: 1.5rem;
|
|
28
|
+
margin-bottom: 2rem;
|
|
29
|
+
display: flex;
|
|
30
|
+
justify-content: space-between;
|
|
31
|
+
align-items: center;
|
|
32
|
+
flex-wrap: wrap;
|
|
33
|
+
gap: 1rem;
|
|
34
|
+
}
|
|
35
|
+
h1 { margin: 0; font-size: 1.75rem; color: #fff; }
|
|
36
|
+
.badge {
|
|
37
|
+
background: rgba(16, 185, 129, 0.15);
|
|
38
|
+
color: var(--accent);
|
|
39
|
+
border: 1px solid var(--accent);
|
|
40
|
+
padding: 0.25rem 0.75rem;
|
|
41
|
+
border-radius: 999px;
|
|
42
|
+
font-size: 0.85rem;
|
|
43
|
+
font-weight: 600;
|
|
44
|
+
}
|
|
45
|
+
.grid {
|
|
46
|
+
display: grid;
|
|
47
|
+
grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
|
|
48
|
+
gap: 1.5rem;
|
|
49
|
+
}
|
|
50
|
+
.card {
|
|
51
|
+
background: var(--surface);
|
|
52
|
+
border: 1px solid var(--border);
|
|
53
|
+
border-radius: 10px;
|
|
54
|
+
padding: 1.5rem;
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
justify-content: space-between;
|
|
58
|
+
}
|
|
59
|
+
.card-header {
|
|
60
|
+
display: flex;
|
|
61
|
+
justify-content: space-between;
|
|
62
|
+
align-items: center;
|
|
63
|
+
margin-bottom: 0.75rem;
|
|
64
|
+
}
|
|
65
|
+
.status-active { color: var(--accent); font-weight: 600; font-size: 0.85rem; }
|
|
66
|
+
.status-inactive { color: var(--muted); font-size: 0.85rem; }
|
|
67
|
+
.layer { font-size: 0.8rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; }
|
|
68
|
+
p { color: var(--muted); font-size: 0.95rem; }
|
|
69
|
+
.actions { margin-top: 1.25rem; display: flex; gap: 0.75rem; }
|
|
70
|
+
.btn {
|
|
71
|
+
text-decoration: none;
|
|
72
|
+
padding: 0.5rem 1rem;
|
|
73
|
+
border-radius: 6px;
|
|
74
|
+
font-size: 0.85rem;
|
|
75
|
+
font-weight: 600;
|
|
76
|
+
border: 1px solid var(--border);
|
|
77
|
+
color: var(--text);
|
|
78
|
+
background: #182623;
|
|
79
|
+
}
|
|
80
|
+
.btn-primary {
|
|
81
|
+
background: var(--accent);
|
|
82
|
+
color: #06281e;
|
|
83
|
+
border-color: var(--accent);
|
|
84
|
+
}
|
|
85
|
+
</style>
|
|
86
|
+
</head>
|
|
87
|
+
<body>
|
|
88
|
+
<div class="container">
|
|
89
|
+
<header>
|
|
90
|
+
<div>
|
|
91
|
+
<h1>Django-Octo Control Hub</h1>
|
|
92
|
+
<small style="color: var(--muted);">Dual-Channel Modular Architecture Orchestrator</small>
|
|
93
|
+
</div>
|
|
94
|
+
<span class="badge">Core v{{ core_version }} • {{ active_count }}/{{ total_catalog }} Modules Active</span>
|
|
95
|
+
</header>
|
|
96
|
+
|
|
97
|
+
<section class="grid">
|
|
98
|
+
{% for mod in modules %}
|
|
99
|
+
<article class="card">
|
|
100
|
+
<div>
|
|
101
|
+
<div class="layer">{{ mod.layer }}</div>
|
|
102
|
+
<div class="card-header">
|
|
103
|
+
<h2 style="margin: 0.25rem 0; font-size: 1.2rem;">{{ mod.title }}</h2>
|
|
104
|
+
{% if mod.installed %}
|
|
105
|
+
<span class="status-active">● v{{ mod.version }}</span>
|
|
106
|
+
{% else %}
|
|
107
|
+
<span class="status-inactive">○ Not Installed</span>
|
|
108
|
+
{% endif %}
|
|
109
|
+
</div>
|
|
110
|
+
<p>{{ mod.description }}</p>
|
|
111
|
+
</div>
|
|
112
|
+
{% if mod.installed %}
|
|
113
|
+
<div class="actions">
|
|
114
|
+
<a href="{{ mod.public_url }}" class="btn btn-primary">Public Channel</a>
|
|
115
|
+
<a href="{{ mod.admin_url }}" class="btn">Admin Panel</a>
|
|
116
|
+
</div>
|
|
117
|
+
{% endif %}
|
|
118
|
+
</article>
|
|
119
|
+
{% endfor %}
|
|
120
|
+
</section>
|
|
121
|
+
</div>
|
|
122
|
+
</body>
|
|
123
|
+
</html>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import importlib.util
|
|
2
|
+
from django.urls import include, path
|
|
3
|
+
from .views import octo_hub_view
|
|
4
|
+
|
|
5
|
+
urlpatterns = [
|
|
6
|
+
path("octo/", octo_hub_view, name="django_octo_hub"),
|
|
7
|
+
]
|
|
8
|
+
|
|
9
|
+
if importlib.util.find_spec("django_octo_seo") is not None:
|
|
10
|
+
urlpatterns.append(path("seo-demo/", include("django_octo_seo.urls")))
|
|
11
|
+
|
|
12
|
+
if importlib.util.find_spec("django_octo_security") is not None:
|
|
13
|
+
urlpatterns.append(path("", include("django_octo_security.urls")))
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
from django.shortcuts import render
|
|
2
|
+
from .registry import discover_octo_ecosystem
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def octo_hub_view(request):
|
|
6
|
+
"""Renders the automated Control Hub documenting all active Django-Octo modules."""
|
|
7
|
+
context = discover_octo_ecosystem()
|
|
8
|
+
return render(request, "django_octo/hub.html", context)
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import sys
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
# Aponta para o settings da sandbox local ou configura um ambiente mínimo em memória
|
|
6
|
+
import django
|
|
7
|
+
from django.conf import settings
|
|
8
|
+
|
|
9
|
+
if not settings.configured:
|
|
10
|
+
from django_octo import get_installed_octo_apps
|
|
11
|
+
settings.configure(
|
|
12
|
+
SECRET_KEY="test-secret-key",
|
|
13
|
+
ROOT_URLCONF="django_octo.urls",
|
|
14
|
+
INSTALLED_APPS=[
|
|
15
|
+
"django.contrib.admin",
|
|
16
|
+
"django.contrib.auth",
|
|
17
|
+
"django.contrib.contenttypes",
|
|
18
|
+
"django.contrib.sessions",
|
|
19
|
+
"django.contrib.messages",
|
|
20
|
+
"django.contrib.staticfiles",
|
|
21
|
+
*get_installed_octo_apps(),
|
|
22
|
+
],
|
|
23
|
+
TEMPLATES=[{
|
|
24
|
+
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
|
25
|
+
"APP_DIRS": True,
|
|
26
|
+
}],
|
|
27
|
+
DATABASES={"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:"}},
|
|
28
|
+
)
|
|
29
|
+
django.setup()
|
|
30
|
+
|
|
31
|
+
from django.test import Client
|
|
32
|
+
from django_octo.registry import discover_octo_ecosystem
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def test_ecosystem_auto_discovery():
|
|
36
|
+
data = discover_octo_ecosystem()
|
|
37
|
+
assert data["active_count"] == 2
|
|
38
|
+
assert len(data["modules"]) == 2
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def test_octo_hub_endpoint():
|
|
42
|
+
client = Client()
|
|
43
|
+
response = client.get("/octo/")
|
|
44
|
+
assert response.status_code == 200
|
|
45
|
+
assert b"Django-Octo Control Hub" in response.content
|