Enable recipe proxy tunnel and slash routes
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
GEMINI_PROXY_URL=http://95.179.252.111:8768/gemini
|
||||
GEMINI_PROXY_URL=http://127.0.0.1:8768/gemini
|
||||
GEMINI_GENERATION_CONFIG={"temperature":0,"maxOutputTokens":300,"thinkingConfig":{"thinkingLevel":"minimal"}}
|
||||
RECIPE_API_TOKEN=replace-with-random-token
|
||||
@@ -8,7 +8,7 @@ from flask import Flask, jsonify, request
|
||||
app = Flask(__name__)
|
||||
MAX_IMAGE_BYTES = 10 * 1024 * 1024
|
||||
ALLOWED_TYPES = {"image/jpeg", "image/png", "image/webp"}
|
||||
PROXY_URL = "http://95.179.252.111:8768/gemini"
|
||||
PROXY_URL = "http://127.0.0.1:8768/gemini"
|
||||
|
||||
|
||||
def settings() -> dict:
|
||||
@@ -33,6 +33,7 @@ def health():
|
||||
|
||||
|
||||
@app.post("/recipe")
|
||||
@app.post("/recipe/")
|
||||
def recipe():
|
||||
if not authorized():
|
||||
return jsonify(error="unauthorized"), 401
|
||||
|
||||
@@ -12,7 +12,7 @@ location = /recipe {
|
||||
}
|
||||
|
||||
location /recipe/ {
|
||||
proxy_pass http://127.0.0.1:8770/;
|
||||
proxy_pass http://127.0.0.1:8770/recipe/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
Description=Minimal recipe Gemini proxy
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
Requires=gemini-tunnel.service
|
||||
After=gemini-tunnel.service
|
||||
|
||||
[Service]
|
||||
User=recipe
|
||||
|
||||
Reference in New Issue
Block a user