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
|
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
|
npm install -g swagger2openapi
|
||||||
|
|
@ -236,6 +236,7 @@ JALALI_DATE_DEFAULTS = {
|
||||||
}
|
}
|
||||||
REDIS_BASE_URL = config('REDIS_BASE_URL')
|
REDIS_BASE_URL = config('REDIS_BASE_URL')
|
||||||
GOTIFY_ADMIN_CLIENT_TOKEN = config('GOTIFY_ADMIN_CLIENT_TOKEN')
|
GOTIFY_ADMIN_CLIENT_TOKEN = config('GOTIFY_ADMIN_CLIENT_TOKEN')
|
||||||
|
GOTIFY_BASE_PUBLIC_URL = config('GOTIFY_BASE_PUBLIC_URL')
|
||||||
|
|
||||||
CACHES = {
|
CACHES = {
|
||||||
"default": {
|
"default": {
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ from gotify_rest_api_client.api.application import create_app
|
||||||
from gotify_rest_api_client.types import Unset
|
from gotify_rest_api_client.types import Unset
|
||||||
|
|
||||||
ADMIN_CLIENT_TOKEN = settings.GOTIFY_ADMIN_CLIENT_TOKEN
|
ADMIN_CLIENT_TOKEN = settings.GOTIFY_ADMIN_CLIENT_TOKEN
|
||||||
|
GOTIFY_BASE_PUBLIC_URL = settings.GOTIFY_BASE_PUBLIC_URL
|
||||||
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
@ -44,7 +45,7 @@ def log_response(response):
|
||||||
|
|
||||||
|
|
||||||
def get_client(access_token):
|
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]}},
|
httpx_args={"event_hooks": {"request": [log_request], "response": [log_response]}},
|
||||||
)
|
)
|
||||||
return client
|
return client
|
||||||
|
|
@ -54,12 +55,12 @@ def get_basic_client(username, password):
|
||||||
auth = httpx.BasicAuth(username=username, password=password)
|
auth = httpx.BasicAuth(username=username, password=password)
|
||||||
prefix, token = auth._auth_header.split()
|
prefix, token = auth._auth_header.split()
|
||||||
|
|
||||||
# httpx_client = httpx.Client(auth=auth, base_url="https://push.gooyal.com")
|
# httpx_client = httpx.Client(auth=auth, base_url=GOTIFY_BASE_PUBLIC_URL)
|
||||||
client = AuthenticatedClient(base_url="https://push.gooyal.com", token=token, prefix=prefix,
|
client = AuthenticatedClient(base_url=GOTIFY_BASE_PUBLIC_URL, token=token, prefix=prefix,
|
||||||
httpx_args={
|
httpx_args={
|
||||||
"event_hooks": {"request": [log_request], "response": [log_response]},
|
"event_hooks": {"request": [log_request], "response": [log_response]},
|
||||||
# "auth": auth,
|
# "auth": auth,
|
||||||
# "base_url": "https://push.gooyal.com"
|
# "base_url": GOTIFY_BASE_PUBLIC_URL
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
# client.set_httpx_client(httpx_client)
|
# client.set_httpx_client(httpx_client)
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
},
|
},
|
||||||
"version": "2.0.2"
|
"version": "2.0.2"
|
||||||
},
|
},
|
||||||
"host": "push.gooyal.com",
|
"host": "push.gooyal.ir",
|
||||||
"paths": {
|
"paths": {
|
||||||
"/application": {
|
"/application": {
|
||||||
"get": {
|
"get": {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
openapi: 3.0.0
|
openapi: 3.0.0
|
||||||
x-origin:
|
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
|
format: swagger
|
||||||
version: "2.0"
|
version: "2.0"
|
||||||
converter:
|
converter:
|
||||||
|
|
@ -1452,8 +1452,8 @@ paths:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/VersionInfo"
|
$ref: "#/components/schemas/VersionInfo"
|
||||||
servers:
|
servers:
|
||||||
- url: http://push.gooyal.com/
|
- url: http://push.gooyal.ir/
|
||||||
- url: https://push.gooyal.com/
|
- url: https://push.gooyal.ir/
|
||||||
components:
|
components:
|
||||||
securitySchemes:
|
securitySchemes:
|
||||||
appTokenAuthorizationHeader:
|
appTokenAuthorizationHeader:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue