mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2026-02-04 23:01:32 -08:00
Merge pull request #29 from Moonlite-Media/adding-listen-on-run
Adding listen on run
This commit is contained in:
commit
c132e19c15
3 changed files with 3 additions and 5 deletions
|
|
@ -56,4 +56,4 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|||
RUN pip install --no-cache-dir python-dotenv insightface
|
||||
|
||||
# Run the application
|
||||
CMD ["python", "launch.py", "--nowebui", "--deforum-api", "--api", "--port", "7861"]
|
||||
CMD ["python", "launch.py", "--nowebui", "--deforum-api", "--listen", "--api", "--port", "7861"]
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ class BasicAuthMiddleware(BaseHTTPMiddleware):
|
|||
|
||||
async def dispatch(self, request, call_next):
|
||||
# Extract the Authorization header
|
||||
logger.warning(f"{request.headers}")
|
||||
auth_header = request.headers.get("Authorization") or request.headers.get("authorization")
|
||||
if not auth_header or not auth_header.startswith("Basic "):
|
||||
return self._unauthorized_response()
|
||||
|
|
@ -24,7 +23,6 @@ class BasicAuthMiddleware(BaseHTTPMiddleware):
|
|||
# We should add a step to santize the input here
|
||||
decoded_credentials = base64.b64decode(encoded_credentials).decode("utf-8")
|
||||
provided_username, provided_password = decoded_credentials.split(":")
|
||||
logger.warning(f"provided_username: {provided_username}: provided_password: {provided_password}")
|
||||
|
||||
# Check credentials
|
||||
if provided_username == self.username and provided_password == self.password:
|
||||
|
|
|
|||
4
webui.py
4
webui.py
|
|
@ -40,8 +40,8 @@ def api_only():
|
|||
from basic_auth_middleware import BasicAuthMiddleware
|
||||
USERNAME = os.getenv('SDAPI_USERNAME')
|
||||
PASSWORD = os.getenv('SDAPI_PASSWORD')
|
||||
logger.warning(f"{USERNAME}:{PASSWORD}")
|
||||
app.add_middleware(BasicAuthMiddleware, username="administrator", password="vY0WFuGCpL3lILb74ZzMCbSAL10x5V")
|
||||
|
||||
app.add_middleware(BasicAuthMiddleware, username=USERNAME, password=PASSWORD)
|
||||
|
||||
initialize_util.setup_middleware(app)
|
||||
api = create_api(app)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue