[Bug 33308] New: Add ability to to use sftp with runreport.pl
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33308 Bug ID: 33308 Summary: Add ability to to use sftp with runreport.pl Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Command-line Utilities Assignee: koha-bugs@lists.koha-community.org Reporter: wizzyrea@gmail.com QA Contact: testopia@bugs.koha-community.org CC: robin@catalyst.net.nz It would be very awesome to be able to specify a sftp/ftps target with the cronjob runreport.pl job, to complement the ability currently available to email the report somewhere. Some kind of secure solve for "allowing the koha user to automatically accept the hostkey" on the first connection would also be nice, but not a requirement. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33308 --- Comment #1 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I like the idea, but maybe a workaround: would be using the 'access files' tools and a directory on the Koha server work? It would limit access to Koha staff users with the right permission set. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33308 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Add ability to to use sftp |Add ability to to use SFTP |with runreport.pl |with runreport.pl -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33308 Liz Rea <wizzyrea@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wizzyrea@gmail.com --- Comment #2 from Liz Rea <wizzyrea@gmail.com> --- We do this in some places, but by and large our partners do not like this approach for a few reasons: They often have to send things other places without human intervention, on a schedule. The UX of the access_files is very poor (no directory structures allowed, cannot remove files themselves, among other things.) They have workflows that involve 3rd party vendors who require sftp/ftp deliveries of files. Right now, we generate the files and use other tools to deliver the files, which works but is very labor intensive when you have many of them to administer. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33308 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33308 --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Thx for the reply, Liz, that makes sense. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33308 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |35761 CC| |kyle@bywatersolutions.com Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35761 [Bug 35761] Add an administration editor for FTP and SFTP servers -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33308 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |jake.deery@ptfs-europe.com |ity.org | CC| |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33308 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|35761 |39190 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35761 [Bug 35761] Add an administration editor for FTP and SFTP servers https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39190 [Bug 39190] Rework new (S)FTP classes to be polymorphic classes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33308 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|39190 |38489 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38489 [Bug 38489] EDI should be updated to use the new FTP/SFTP Servers management page https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39190 [Bug 39190] Rework new (S)FTP classes to be polymorphic classes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33308 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33308 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|38489 |40811 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38489 [Bug 38489] EDI should be updated to use the new FTP/SFTP Servers management page https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40811 [Bug 40811] Enhance Koha::File::Transport API -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33308 --- Comment #4 from Jake Deery <jake.deery@openfifth.co.uk> --- Created attachment 189005 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=189005&action=edit Bug 33308: Add S/FTP upload support to runreport.pl This patch adds S/FTP upload support to runreport.pl by adding additional command-line flags that will, when utilised, deposit a report onto the configured S/FTP Server. == TO TEST == a) Goto /cgi-bin/koha/admin/file_transports.pl?op=add_form b) Configure an S/FTP Server *) If one needs an S/FTP Server to utilise, contact me directly c) Configure an SQL report under Reports > Create from SQL *) If you're stuck, you can use `SELECT * FROM items` to select every item in k.t.d to report on == APPLY PATCH == d) Run `./misc/cronjobs/runreport.pl` without arguments *) Notice `--sftp-dest-id` and `--filename` *) `--sftp-dest-id` specifies the ID of the configured server to use, which can be garnered from the URL when editing the server (look for the file_transport_id parameter) *) `--filename` optionally specifies what the file should be called when uploaded, and can be customised with bash variables if necessary e) Run `./misc/cronjons/runreport.pl --sftp-dest-id 1 1` *) Notice the script outputs nothing, indicating success *) On your S/FTP server, notice a report now named report(id)-(date).csv *) Notice that the outputted file contains a CSV-formatted report f) Run `./misc/cronjobs/runreport.pl --format html --sftp-dest-id 1 1` *) Notice the script outputs nothing, indicating success *) On your S/FTP server, notice a report now named report(id)-(date).html *) Notice that the outputted file contains an HTML-formatted report g) Run `./misc/cronjons/runreport.pl --filename custom.csv --sftp-dest-id 1 1` *) Notice the script outputs nothing, indicating success *) On your S/FTP server, notice a report now named custom.csv *) Notice that the outputted file contains a CSV-formatted report h) Run `./misc/cronjons/runreport.pl --format html --filename custom.somehtml --sftp-dest-id 1 1` *) Notice the script outputs nothing, indicating success *) On your S/FTP server, notice a report now named custom.somehtml *) Notice that the outputted file contains an HTML-formatted report == SIGN OFF == -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33308 Jake Deery <jake.deery@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33308 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33308 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #189005|0 |1 is obsolete| | --- Comment #5 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 189230 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=189230&action=edit Bug 33308: Add S/FTP upload support to runreport.pl This patch adds S/FTP upload support to runreport.pl by adding additional command-line flags that will, when utilised, deposit a report onto the configured S/FTP Server. == TO TEST == a) Goto /cgi-bin/koha/admin/file_transports.pl?op=add_form b) Configure an S/FTP Server *) If one needs an S/FTP Server to utilise, contact me directly c) Configure an SQL report under Reports > Create from SQL *) If you're stuck, you can use `SELECT * FROM items` to select every item in k.t.d to report on == APPLY PATCH == d) Run `./misc/cronjobs/runreport.pl` without arguments *) Notice `--sftp-dest-id` and `--filename` *) `--sftp-dest-id` specifies the ID of the configured server to use, which can be garnered from the URL when editing the server (look for the file_transport_id parameter) *) `--filename` optionally specifies what the file should be called when uploaded, and can be customised with bash variables if necessary e) Run `./misc/cronjons/runreport.pl --sftp-dest-id 1 1` *) Notice the script outputs nothing, indicating success *) On your S/FTP server, notice a report now named report(id)-(date).csv *) Notice that the outputted file contains a CSV-formatted report f) Run `./misc/cronjobs/runreport.pl --format html --sftp-dest-id 1 1` *) Notice the script outputs nothing, indicating success *) On your S/FTP server, notice a report now named report(id)-(date).html *) Notice that the outputted file contains an HTML-formatted report g) Run `./misc/cronjons/runreport.pl --filename custom.csv --sftp-dest-id 1 1` *) Notice the script outputs nothing, indicating success *) On your S/FTP server, notice a report now named custom.csv *) Notice that the outputted file contains a CSV-formatted report h) Run `./misc/cronjons/runreport.pl --format html --filename custom.somehtml --sftp-dest-id 1 1` *) Notice the script outputs nothing, indicating success *) On your S/FTP server, notice a report now named custom.somehtml *) Notice that the outputted file contains an HTML-formatted report == SIGN OFF == Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33308 --- Comment #6 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 189909 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=189909&action=edit Bug 33308: Add S/FTP upload support to runreport.pl This patch adds S/FTP upload support to runreport.pl by adding additional command-line flags that will, when utilised, deposit a report onto the configured S/FTP Server. == TO TEST == a) Goto /cgi-bin/koha/admin/file_transports.pl?op=add_form b) Configure an S/FTP Server *) If one needs an S/FTP Server to utilise, contact me directly c) Configure an SQL report under Reports > Create from SQL *) If you're stuck, you can use `SELECT * FROM items` to select every item in k.t.d to report on == APPLY PATCH == d) Run `./misc/cronjobs/runreport.pl` without arguments *) Notice `--sftp-dest-id` and `--filename` *) `--sftp-dest-id` specifies the ID of the configured server to use, which can be garnered from the URL when editing the server (look for the file_transport_id parameter) *) `--filename` optionally specifies what the file should be called when uploaded, and can be customised with bash variables if necessary e) Run `./misc/cronjons/runreport.pl --sftp-dest-id 1 1` *) Notice the script outputs nothing, indicating success *) On your S/FTP server, notice a report now named report(id)-(date).csv *) Notice that the outputted file contains a CSV-formatted report f) Run `./misc/cronjobs/runreport.pl --format html --sftp-dest-id 1 1` *) Notice the script outputs nothing, indicating success *) On your S/FTP server, notice a report now named report(id)-(date).html *) Notice that the outputted file contains an HTML-formatted report g) Run `./misc/cronjons/runreport.pl --filename custom.csv --sftp-dest-id 1 1` *) Notice the script outputs nothing, indicating success *) On your S/FTP server, notice a report now named custom.csv *) Notice that the outputted file contains a CSV-formatted report h) Run `./misc/cronjons/runreport.pl --format html --filename custom.somehtml --sftp-dest-id 1 1` *) Notice the script outputs nothing, indicating success *) On your S/FTP server, notice a report now named custom.somehtml *) Notice that the outputted file contains an HTML-formatted report == SIGN OFF == Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33308 --- Comment #7 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 189910 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=189910&action=edit Bug 33308: (QA follow-up) Use simplified File::Transport API from bug 40811 This follow-up updates runreport.pl to use the newer simplified File::Transport API introduced by bug 40811, which provides: - Automatic connection management (no explicit connect/disconnect) - Simplified directory handling via options hash - Cleaner, more maintainable code The upload functionality now uses a single upload_file() call with a path option instead of requiring separate connect() and change_directory() calls. Also fixes minor inconsistencies in error messages (missing colons and escaped quotes). Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33308 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #189230|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33308 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |tomascohen@gmail.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33308 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33308 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #189909|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33308 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #189910|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33308 --- Comment #8 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 190462 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=190462&action=edit Bug 33308: Add S/FTP upload support to runreport.pl This patch adds S/FTP upload support to runreport.pl by adding additional command-line flags that will, when utilised, deposit a report onto the configured S/FTP Server. == TO TEST == a) Goto /cgi-bin/koha/admin/file_transports.pl?op=add_form b) Configure an S/FTP Server *) If one needs an S/FTP Server to utilise, contact me directly c) Configure an SQL report under Reports > Create from SQL *) If you're stuck, you can use `SELECT * FROM items` to select every item in k.t.d to report on == APPLY PATCH == d) Run `./misc/cronjobs/runreport.pl` without arguments *) Notice `--sftp-dest-id` and `--filename` *) `--sftp-dest-id` specifies the ID of the configured server to use, which can be garnered from the URL when editing the server (look for the file_transport_id parameter) *) `--filename` optionally specifies what the file should be called when uploaded, and can be customised with bash variables if necessary e) Run `./misc/cronjons/runreport.pl --sftp-dest-id 1 1` *) Notice the script outputs nothing, indicating success *) On your S/FTP server, notice a report now named report(id)-(date).csv *) Notice that the outputted file contains a CSV-formatted report f) Run `./misc/cronjobs/runreport.pl --format html --sftp-dest-id 1 1` *) Notice the script outputs nothing, indicating success *) On your S/FTP server, notice a report now named report(id)-(date).html *) Notice that the outputted file contains an HTML-formatted report g) Run `./misc/cronjons/runreport.pl --filename custom.csv --sftp-dest-id 1 1` *) Notice the script outputs nothing, indicating success *) On your S/FTP server, notice a report now named custom.csv *) Notice that the outputted file contains a CSV-formatted report h) Run `./misc/cronjons/runreport.pl --format html --filename custom.somehtml --sftp-dest-id 1 1` *) Notice the script outputs nothing, indicating success *) On your S/FTP server, notice a report now named custom.somehtml *) Notice that the outputted file contains an HTML-formatted report == SIGN OFF == Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33308 --- Comment #9 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 190463 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=190463&action=edit Bug 33308: (QA follow-up) Use simplified File::Transport API from bug 40811 This follow-up updates runreport.pl to use the newer simplified File::Transport API introduced by bug 40811, which provides: - Automatic connection management (no explicit connect/disconnect) - Simplified directory handling via options hash - Cleaner, more maintainable code The upload functionality now uses a single upload_file() call with a path option instead of requiring separate connect() and change_directory() calls. Also fixes minor inconsistencies in error messages (missing colons and escaped quotes). Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33308 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |26.05.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33308 --- Comment #10 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to main for 26.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33308 --- Comment #11 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- please add release notes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33308 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Needs documenting --- Comment #12 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- This bug won't be backported to the 25.11.x branch as it has been deemed an enhancement or new feature. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org