FIX(notifications): configuration for GOTIFY_BASE_PUBLIC_URL
configuration for GOTIFY_BASE_PUBLIC_URL
This commit is contained in:
parent
66862e8d5d
commit
9a010aa97b
5 changed files with 11 additions and 9 deletions
|
|
@ -1,4 +1,4 @@
|
|||
openapi-python-client
|
||||
https://push.gooyal.com/swagger?base=push.gooyal.com
|
||||
https://push.gooyal.ir/swagger?base=push.gooyal.ir
|
||||
|
||||
npm install -g swagger2openapi
|
||||
|
|
@ -236,6 +236,7 @@ JALALI_DATE_DEFAULTS = {
|
|||
}
|
||||
REDIS_BASE_URL = config('REDIS_BASE_URL')
|
||||
GOTIFY_ADMIN_CLIENT_TOKEN = config('GOTIFY_ADMIN_CLIENT_TOKEN')
|
||||
GOTIFY_BASE_PUBLIC_URL = config('GOTIFY_BASE_PUBLIC_URL')
|
||||
|
||||
CACHES = {
|
||||
"default": {
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ from gotify_rest_api_client.api.application import create_app
|
|||
from gotify_rest_api_client.types import Unset
|
||||
|
||||
ADMIN_CLIENT_TOKEN = settings.GOTIFY_ADMIN_CLIENT_TOKEN
|
||||
GOTIFY_BASE_PUBLIC_URL = settings.GOTIFY_BASE_PUBLIC_URL
|
||||
|
||||
|
||||
import logging
|
||||
|
|
@ -44,7 +45,7 @@ def log_response(response):
|
|||
|
||||
|
||||
def get_client(access_token):
|
||||
client = AuthenticatedClient(base_url="https://push.gooyal.com", token=access_token,
|
||||
client = AuthenticatedClient(base_url=GOTIFY_BASE_PUBLIC_URL, token=access_token,
|
||||
httpx_args={"event_hooks": {"request": [log_request], "response": [log_response]}},
|
||||
)
|
||||
return client
|
||||
|
|
@ -54,12 +55,12 @@ def get_basic_client(username, password):
|
|||
auth = httpx.BasicAuth(username=username, password=password)
|
||||
prefix, token = auth._auth_header.split()
|
||||
|
||||
# httpx_client = httpx.Client(auth=auth, base_url="https://push.gooyal.com")
|
||||
client = AuthenticatedClient(base_url="https://push.gooyal.com", token=token, prefix=prefix,
|
||||
# httpx_client = httpx.Client(auth=auth, base_url=GOTIFY_BASE_PUBLIC_URL)
|
||||
client = AuthenticatedClient(base_url=GOTIFY_BASE_PUBLIC_URL, token=token, prefix=prefix,
|
||||
httpx_args={
|
||||
"event_hooks": {"request": [log_request], "response": [log_response]},
|
||||
# "auth": auth,
|
||||
# "base_url": "https://push.gooyal.com"
|
||||
# "base_url": GOTIFY_BASE_PUBLIC_URL
|
||||
}
|
||||
)
|
||||
# client.set_httpx_client(httpx_client)
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
},
|
||||
"version": "2.0.2"
|
||||
},
|
||||
"host": "push.gooyal.com",
|
||||
"host": "push.gooyal.ir",
|
||||
"paths": {
|
||||
"/application": {
|
||||
"get": {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
openapi: 3.0.0
|
||||
x-origin:
|
||||
- url: https://push.gooyal.com/swagger?base=push.gooyal.com%2F
|
||||
- url: https://push.gooyal.ir/swagger?base=push.gooyal.ir%2F
|
||||
format: swagger
|
||||
version: "2.0"
|
||||
converter:
|
||||
|
|
@ -1452,8 +1452,8 @@ paths:
|
|||
schema:
|
||||
$ref: "#/components/schemas/VersionInfo"
|
||||
servers:
|
||||
- url: http://push.gooyal.com/
|
||||
- url: https://push.gooyal.com/
|
||||
- url: http://push.gooyal.ir/
|
||||
- url: https://push.gooyal.ir/
|
||||
components:
|
||||
securitySchemes:
|
||||
appTokenAuthorizationHeader:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue