This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| baseurl=localhost:9091 | |
| for uri in $(curl -sS $baseurl/api/v1/metrics | jq -r ' | |
| .data[].push_time_seconds.metrics[0] | | |
| select((now - (.value | tonumber)) > 86400) | | |
| (.labels as $labels | ["job", "env", "instance"] | map(.+"/"+$labels[.]) | join("/")) | |
| '); do | |
| echo curl -XDELETE $baseurl/metrics/$uri | |
| curl -XDELETE $baseurl/metrics/$uri | exit | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # requirements.txt | |
| # tencentcloud_sdk_python_hunyuan>=3.0.1153 | |
| import os | |
| import json | |
| import types | |
| import datetime | |
| import traceback | |
| import logging | |
| from flask import Flask, request, make_response, stream_with_context | |
| from typing import Generator |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const express = require("express") | |
| const requestIp = require("request-ip") | |
| const request = require("request") | |
| const app = express() | |
| const port = 9000 | |
| const ipWhiteList = process.env.IP_WHITE_LIST ? process.env.IP_WHITE_LIST.split(",") : [] | |
| app.use(requestIp.mw()) | |
| app.use((req, res, next) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # requirements.txt | |
| # volcengine-python-sdk>=1.0.79 | |
| # httpx>=0.27.0 | |
| # pydantic>=2.7.1 | |
| import os | |
| import json | |
| import datetime | |
| import traceback | |
| import logging | |
| from flask import Flask, request, make_response, stream_with_context |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const express = require("express") | |
| const requestIp = require("request-ip") | |
| const request = require("request") | |
| const app = express() | |
| const port = 9000 | |
| const ipWhiteList = process.env.IP_WHITE_LIST ? process.env.IP_WHITE_LIST.split(",") : [] | |
| app.use(requestIp.mw()) | |
| app.use((req, res, next) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const express = require("express") | |
| const requestIp = require("request-ip") | |
| const request = require("request") | |
| const app = express() | |
| const port = 9000 | |
| const ipWhiteList = process.env.IP_WHITE_LIST ? process.env.IP_WHITE_LIST.split(",") : [] | |
| app.use(requestIp.mw()) | |
| app.use((req, res, next) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default { | |
| async fetch(request) { | |
| // IP addresses which you wish to allow using your service. | |
| const allowedIpAddress = []; | |
| const ipAddress = request.headers.get('cf-connecting-ip'); | |
| if ((allowedIpAddress.length > 0) && !allowedIpAddress.includes(ipAddress)) { | |
| return new Response('Access denied: Your IP address isn\'t allowed by Web Browsing Worker.', { | |
| status: 403 | |
| }); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default { | |
| async fetch(request) { | |
| // IP addresses which you wish to allow using your service. | |
| const allowedIpAddress = []; | |
| const ipAddress = request.headers.get('cf-connecting-ip'); | |
| if ((allowedIpAddress.length > 0) && !allowedIpAddress.includes(ipAddress)) { | |
| return new Response('Access denied: Your IP address isn\'t allowed by Web Browsing Worker.', { | |
| status: 403 | |
| }); | |
| } |