This commit is contained in:
Saifeddine ALOUI 2024-02-04 19:04:00 +01:00
parent 841765df05
commit 82d1b6a652
1 changed files with 5 additions and 4 deletions

View File

@ -52,8 +52,8 @@ def main():
servers = get_config(args.config)
authorized_users = get_authorized_users(args.users_list)
deactivate_security = args.deactivate_security
print("Ollama Proxy server")
print("Author: ParisNeo")
ASCIIColors.red("Ollama Proxy server")
ASCIIColors.red("Author: ParisNeo")
class RequestHandler(BaseHTTPRequestHandler):
def add_access_log_entry(self, event, user, ip_address, access, server, nb_queued_requests_on_server, error=""):
@ -103,6 +103,7 @@ def main():
return False
except:
return False
def proxy(self):
if not deactivate_security and not self._validate_user_and_key():
ASCIIColors.red(f'User is not authorized')