mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-04-09 16:43:46 +00:00
Security: server-side file save roots, image URL SSRF protection, extension allowlist
This commit is contained in:
parent
08ff3f0f90
commit
c8bb2129ba
6 changed files with 60 additions and 21 deletions
|
|
@ -350,13 +350,13 @@ def create_event_handlers():
|
|||
shared.gradio['load_template'].click(chat.handle_load_template_click, gradio('instruction_template'), gradio('instruction_template_str', 'instruction_template'), show_progress=False)
|
||||
shared.gradio['save_template'].click(
|
||||
ui.gather_interface_values, gradio(shared.input_elements), gradio('interface_state')).then(
|
||||
chat.handle_save_template_click, gradio('instruction_template_str'), gradio('save_filename', 'save_root', 'save_contents', 'file_saver'), show_progress=False)
|
||||
chat.handle_save_template_click, gradio('instruction_template_str'), gradio('save_filename', 'save_root', 'save_contents', 'save_root_state', 'file_saver'), show_progress=False)
|
||||
|
||||
shared.gradio['restore_character'].click(
|
||||
ui.gather_interface_values, gradio(shared.input_elements), gradio('interface_state')).then(
|
||||
chat.restore_character_for_ui, gradio('interface_state'), gradio('interface_state', 'name2', 'context', 'greeting', 'character_picture'), show_progress=False)
|
||||
|
||||
shared.gradio['delete_template'].click(chat.handle_delete_template_click, gradio('instruction_template'), gradio('delete_filename', 'delete_root', 'file_deleter'), show_progress=False)
|
||||
shared.gradio['delete_template'].click(chat.handle_delete_template_click, gradio('instruction_template'), gradio('delete_filename', 'delete_root', 'delete_root_state', 'file_deleter'), show_progress=False)
|
||||
shared.gradio['save_chat_history'].click(
|
||||
lambda x: json.dumps(x, indent=4), gradio('history'), gradio('temporary_text')).then(
|
||||
None, gradio('temporary_text', 'character_menu', 'mode'), None, js=f'(hist, char, mode) => {{{ui.save_files_js}; saveHistory(hist, char, mode)}}')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue