only allow access to metrics from prometheus or local adresses and wireguard vpn connection
Build and Push Docker Container / build-and-push (push) Successful in 4m45s
Build and Push Docker Container / build-and-push (push) Successful in 4m45s
This commit is contained in:
+1
-1
Submodule quart_common updated: be555d897e...b2f485908b
@@ -1,3 +1,5 @@
|
|||||||
|
from quart_common.web.decorators import restrict_ip_addresses
|
||||||
|
|
||||||
from quart import Blueprint, jsonify
|
from quart import Blueprint, jsonify
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
@@ -8,6 +10,7 @@ def create_metrics_blueprint(server:'Server') -> Blueprint:
|
|||||||
blueprint = Blueprint('metrics', __name__)
|
blueprint = Blueprint('metrics', __name__)
|
||||||
|
|
||||||
@blueprint.get('/metrics')
|
@blueprint.get('/metrics')
|
||||||
|
@restrict_ip_addresses(allow=['192.168.188.0/24', '192.168.200.0/24'], abort_code=404)
|
||||||
async def metrics():
|
async def metrics():
|
||||||
snapshot = await server.metrics_collector.build_snapshot(
|
snapshot = await server.metrics_collector.build_snapshot(
|
||||||
server.game_runtime.game_last_seen_unix,
|
server.game_runtime.game_last_seen_unix,
|
||||||
@@ -16,6 +19,7 @@ def create_metrics_blueprint(server:'Server') -> Blueprint:
|
|||||||
return jsonify(snapshot)
|
return jsonify(snapshot)
|
||||||
|
|
||||||
@blueprint.get('/metrics/prometheus')
|
@blueprint.get('/metrics/prometheus')
|
||||||
|
@restrict_ip_addresses(allow=['192.168.188.0/24', '192.168.200.0/24'], abort_code=404)
|
||||||
async def metrics_prometheus():
|
async def metrics_prometheus():
|
||||||
snapshot = await server.metrics_collector.build_snapshot(
|
snapshot = await server.metrics_collector.build_snapshot(
|
||||||
server.game_runtime.game_last_seen_unix,
|
server.game_runtime.game_last_seen_unix,
|
||||||
|
|||||||
Reference in New Issue
Block a user