This commit is contained in:
Adrian Gunnar Lauterer 2024-09-08 03:36:07 +02:00
parent 0cf96459e7
commit 0765150f6d
Signed by: adriangl
GPG Key ID: D33368A59745C2F0
2 changed files with 29 additions and 29 deletions

View File

@ -134,9 +134,9 @@ packages.x86_64-linux.ozai-webui-run = pkgs.stdenv.mkDerivation rec {
serviceConfig = { serviceConfig = {
#ExecStart = "${self.packages.x86_64-linux.ozai-webui-run}/bin/run ${config.services.ozai-webui.host} ${toString(config.services.ozai-webui.port)} ${self.packages.x86_64-linux.default}/bin"; #ExecStart = "${self.packages.x86_64-linux.ozai-webui-run}/bin/run ${config.services.ozai-webui.host} ${toString(config.services.ozai-webui.port)} ${self.packages.x86_64-linux.default}/bin";
# ExecStart = "${self.packages.x86_64-linux.ozai-webui-run}/bin/run ${config.services.ozai-webui.host} ${toString(config.services.ozai-webui.port)} ${self.packages.x86_64-linux.default}/lib/python3.11/site-packages/"; ExecStart = "${self.packages.x86_64-linux.ozai-webui-run}/bin/run ${config.services.ozai-webui.host} ${toString(config.services.ozai-webui.port)} ${self.packages.x86_64-linux.default}/lib/python3.11/site-packages/";
# ExecStart = "${self.packages.x86_64-linux.ozai-webui}/bin/ozai-webui"; # ExecStart = "${self.packages.x86_64-linux.ozai-webui}/bin/ozai-webui";
ExecStart = "${self.packages.x86_64-linux.default}/bin/ozai_webui"; # ExecStart = "${self.packages.x86_64-linux.default}/bin/ozai_webui";
Restart = "always"; Restart = "always";
}; };
}; };

View File

@ -37,31 +37,31 @@ app = Flask(__name__,template_folder=template_folder,static_folder=static_folder
socketio = SocketIO(app) socketio = SocketIO(app)
app.config['SECRET_KEY'] = "secret" app.config['SECRET_KEY'] = "secret"
#parser = argparse.ArgumentParser(description="Run the Ozai WebUI server") parser = argparse.ArgumentParser(description="Run the Ozai WebUI server")
#
#parser.add_argument('-H', '--host', type=str, default=ozai_webui_host, help='The host to run the server on') parser.add_argument('-H', '--host', type=str, default=ozai_webui_host, help='The host to run the server on')
#parser.add_argument('-P', '--port', type=int, default=ozai_webui_port, help='The port to run the server on') parser.add_argument('-P', '--port', type=int, default=ozai_webui_port, help='The port to run the server on')
#parser.add_argument('-O', '--ozai_url', type=str, default=ozai_url, help='The URL of the Ozai server') parser.add_argument('-O', '--ozai_url', type=str, default=ozai_url, help='The URL of the Ozai server')
#parser.add_argument('-S', '--secret_key', type=str, default=app.config['SECRET_KEY'], help='The secret key for the Flask app') parser.add_argument('-S', '--secret_key', type=str, default=app.config['SECRET_KEY'], help='The secret key for the Flask app')
#parser.add_argument('--static_folder', type=str, default=static_folder, help='The location of the static folder') parser.add_argument('--static_folder', type=str, default=static_folder, help='The location of the static folder')
#parser.add_argument('--template_folder', type=str, default=template_folder, help='The location of the template folder') parser.add_argument('--template_folder', type=str, default=template_folder, help='The location of the template folder')
#
#
#args = parser.parse_args() args = parser.parse_args()
#
#if args.host: if args.host:
# ozai_webui_host = args.host ozai_webui_host = args.host
#if args.port: if args.port:
# ozai_webui_port = args.port ozai_webui_port = args.port
#if args.ozai_url: if args.ozai_url:
# ozai_url = args.ozai_url ozai_url = args.ozai_url
#if args.secret_key: if args.secret_key:
# app.config['SECRET_KEY'] = args.secret_key app.config['SECRET_KEY'] = args.secret_key
#if args.static_folder: if args.static_folder:
# app.static_folder = args.static_folder app.static_folder = args.static_folder
#if args.template_folder: if args.template_folder:
# app.template_folder = args.template_folder app.template_folder = args.template_folder
#
#home page #home page
@app.route('/') @app.route('/')
@ -221,9 +221,9 @@ def ws_message(data):
socketio.emit('move_status', response.text, room=game_id) socketio.emit('move_status', response.text, room=game_id)
def main (): def main ():
# return app.run(host=ozai_webui_host, port=ozai_webui_port) return app.run(host=ozai_webui_host, port=ozai_webui_port)
#return socketio.run(app, debug=False, host=ozai_webui_host, port=ozai_webui_port, allow_unsafe_werkzeug=True) #return socketio.run(app, debug=False, host=ozai_webui_host, port=ozai_webui_port, allow_unsafe_werkzeug=True)
return socketio.run(app, debug=False, host=ozai_webui_host, port=ozai_webui_port) # return socketio.run(app, debug=False, host=ozai_webui_host, port=ozai_webui_port)
if __name__ == '__main__': if __name__ == '__main__':
main() main()