splent-feature-nginx 1.0.0__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.
@@ -0,0 +1,5 @@
1
+ # Jinja templates (feature views + hook fragments)
2
+ recursive-include src/splent_io/splent_feature_nginx/templates *.html
3
+
4
+ # Alembic migration config and scripts
5
+ recursive-include src/splent_io/splent_feature_nginx/migrations *.py *.ini *.mako
@@ -0,0 +1,5 @@
1
+ Metadata-Version: 2.4
2
+ Name: splent_feature_nginx
3
+ Version: 1.0.0
4
+ Requires-Python: >=3.13
5
+ Description-Content-Type: text/markdown
@@ -0,0 +1,60 @@
1
+ [build-system]
2
+ requires = ["setuptools>=80.3.1", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "splent_feature_nginx"
7
+ version = "1.0.0"
8
+ readme = "README.md"
9
+ requires-python = ">=3.13"
10
+ dependencies = []
11
+
12
+ [tool.setuptools]
13
+ package-dir = { "" = "src" }
14
+ include-package-data = true
15
+
16
+ [tool.setuptools.packages.find]
17
+ where = ["src"]
18
+ exclude = ["*.tests", "*.tests.*"]
19
+
20
+ [tool.splent]
21
+ cli_version = "1.4.5"
22
+
23
+ # ── Feature Contract (auto-generated) ────────────────────────────────────────
24
+ # Do not edit manually — re-run `splent feature:contract --write` to refresh.
25
+ [tool.splent.contract]
26
+ description = "Nginx reverse proxy — routes traffic to the product web service"
27
+
28
+ [tool.splent.contract.provides]
29
+ routes = []
30
+ blueprints = []
31
+ models = []
32
+ commands = []
33
+ hooks = ["layout.authenticated_sidebar"]
34
+ services = []
35
+ signals = []
36
+ translations = []
37
+ docker = ["docker-compose.dev.yml", "docker-compose.prod.yml"]
38
+
39
+ [tool.splent.contract.requires]
40
+ features = []
41
+ env_vars = ["NGINX_HTTPS_HOST_PORT", "NGINX_HTTP_HOST_PORT", "NGINX_SERVER_NAME"]
42
+ signals = []
43
+
44
+ [tool.splent.contract.extensible]
45
+ services = []
46
+ templates = []
47
+ models = []
48
+ hooks = ["layout.authenticated_sidebar"]
49
+ routes = false
50
+
51
+ [tool.splent.contract.docker]
52
+ services = ["splent_feature_nginx"]
53
+ ports = ["${NGINX_HTTPS_HOST_PORT}:443", "${NGINX_HTTP_HOST_PORT}:80"]
54
+ volumes = ["certbot_webroot", "letsencrypt"]
55
+ networks = ["splent_network"]
56
+ build = false
57
+ healthcheck = false
58
+
59
+ [tool.splent.contract.docker.depends_on]
60
+ services = []
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,5 @@
1
+ Metadata-Version: 2.4
2
+ Name: splent_feature_nginx
3
+ Version: 1.0.0
4
+ Requires-Python: >=3.13
5
+ Description-Content-Type: text/markdown
@@ -0,0 +1,9 @@
1
+ MANIFEST.in
2
+ pyproject.toml
3
+ src/splent_feature_nginx.egg-info/PKG-INFO
4
+ src/splent_feature_nginx.egg-info/SOURCES.txt
5
+ src/splent_feature_nginx.egg-info/dependency_links.txt
6
+ src/splent_feature_nginx.egg-info/top_level.txt
7
+ src/splent_io/splent_feature_nginx/__init__.py
8
+ src/splent_io/splent_feature_nginx/config.py
9
+ src/splent_io/splent_feature_nginx/hooks.py
@@ -0,0 +1,11 @@
1
+ from splent_framework.blueprints.base_blueprint import create_blueprint
2
+
3
+ nginx_bp = create_blueprint(__name__)
4
+
5
+
6
+ def init_feature(app):
7
+ pass
8
+
9
+
10
+ def inject_context_vars(app):
11
+ return {}
@@ -0,0 +1,18 @@
1
+ """
2
+ Nginx reverse proxy configuration.
3
+
4
+ Exposes proxy-related settings so hooks and other features
5
+ can reference the configured ports and server name.
6
+ """
7
+
8
+ import os
9
+
10
+
11
+ def inject_config(app):
12
+ app.config.update(
13
+ {
14
+ "NGINX_HTTP_HOST_PORT": os.getenv("NGINX_HTTP_HOST_PORT", "80"),
15
+ "NGINX_HTTPS_HOST_PORT": os.getenv("NGINX_HTTPS_HOST_PORT", "443"),
16
+ "NGINX_SERVER_NAME": os.getenv("NGINX_SERVER_NAME", "localhost"),
17
+ }
18
+ )
@@ -0,0 +1,17 @@
1
+ from splent_framework.hooks.template_hooks import register_template_hook
2
+ from flask import current_app
3
+
4
+
5
+ def nginx_sidebar_link():
6
+ port = current_app.config.get("NGINX_HTTP_HOST_PORT", "80")
7
+ return (
8
+ '<li class="sidebar-item">'
9
+ f'<a class="sidebar-link" href="http://localhost:{port}" target="_blank">'
10
+ '<i class="align-middle" data-feather="globe"></i> '
11
+ '<span class="align-middle">Nginx</span>'
12
+ "</a>"
13
+ "</li>"
14
+ )
15
+
16
+
17
+ register_template_hook("layout.authenticated_sidebar", nginx_sidebar_link)