bugy / script-server

Web UI for your scripts with execution management
Other
1.57k stars 248 forks source link

output_files not working properly #542

Closed Xiaohequ closed 2 years ago

Xiaohequ commented 2 years ago

I'm very intereasted in this projet. I'm so happy to see someone else have the same idea as me. This projet seems very well maintained, great job.

I have seen 3 bugs in latest version 1.17.0

  1. script need pause (read -p) in order to make download link appear
  2. any_path# not working ( * did work)

  3. output_files "type": "inline-image" not show up

script need pause (read -p) for download link to appear

with_pause without_pause

any_path# not working

working: "output_files " : ["/home/ubuntu/tools/script-server/output/download_file/*"] did not working: "output_files " : ["/home/ubuntu/tools/script-server/output/download_file/##any_path#"]

"type": "inline-image" not show up

the link was received on the browser side, but no link or image are show up inline_image_not_show

my config file here config_files.zip

bugy commented 2 years ago

Hi @Xiaohequ , I'm not 100% about your cases, but i believe everything works as expected:

  1. Links are generated after a script is finished. Not during an execution
  2. any_path# (as all other regular expression parsing) is used only for log parsing. I.e. it will find only the files, which were logged by a script during execution

  3. Inline images require image path to be printed to the output log. Because script server replaces this path from the log with the image
Xiaohequ commented 2 years ago

I see. Thank you for the quick response.

Xiaohequ commented 2 years ago

I have a question. Is read -p "Press enter to start writing to the file (~/$filename)" are needed for the download link to works / appear ? because i can't manage to make the sample script (write_file.sh) work without this ligne. Did I miss something ?

modified conf file: write_file_without_read.zip

bugy commented 2 years ago

Yes, exactly. For this sample I'm using a regular expression to parse script output And if there is no pathes in the output, then script server doesn't have anything for downloading

Kevin QUX @.***> schrieb am So., 20. März 2022, 16:41:

I have a question. Is read -p "Press enter to start writing to the file (~/$filename)" are needed for the download link to works / appear ? because i can't manage to make the sample script (write_file.sh) work without this ligne. Did I miss something ?

modified conf file: write_file_without_read.zip https://github.com/bugy/script-server/files/8311568/write_file_without_read.zip

— Reply to this email directly, view it on GitHub https://github.com/bugy/script-server/issues/542#issuecomment-1073277174, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJXPJKHPSQMEDS5PVKTZYDVA5BJXANCNFSM5RFJMPJQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you modified the open/close state.Message ID: @.***>

Xiaohequ commented 2 years ago

Ok. But when I replace it by echo "Press enter to start writing to the file (~/$filename)", it's still not working. Did I do something wrong ?

bugy commented 2 years ago

@Xiaohequ I took your configs, replaced read with echo and it still worked for me image

Xiaohequ commented 2 years ago

Ok. That's odd. I'm going to test this on a different os and with different version of python. I will let you know if i found something. Thank you for looking.

Xiaohequ commented 2 years ago

In passing month, I have tested the script server on other système/hardware (debian, ubuntu with python 3.6). i had the same issue (not prompted to download generated file after multiple execution). But today, when I tested it with docker image. It works great. Then I decide to retry on my previous unsuccessful machine. It works without any issue. Maybe I was unlucky. So it's all good for me. Thanks again. Have a nice day.