• last updated 20 hours ago
Constraints: committers
Constraints: files
Constraints: dates
download-archive reform

File-Storage used to generate downloaded archives in tgz format, to then switch to zip, more user-friendly, in particular outside the Linux world (See https://openacs.org/forums/message-view?message_id=557561). To ease the transition, a couple of parameters and relative API were introduced that would allow to choose the preferred command one should use. During this reform however, default parameter values in the tcl code became inconsistent with those in the info file. Furthermore, the chosen defaults were set as absolute paths to the executable, which is not friendly to non-linux environments, or other scenarios where the "typical" Linux filesystem structure cannot be assumed (e.g. containers, MacOS...).

The only usage of this parameters/api was in fact in the download-archive vuh. In upstream codebase, no package references this file, not even the file-storage itself. Upon review, one could see that the file would also allow to specify a custom download filename via the path, which could be considered questionable. It would also execute the command in a way that once again assumes some form of Linux environment (e.g. invoking bash).

Save for the ability to customize the archive format and the anti-feature of being able to manipulate the archive filename via the path, the script largely relplicates www/download-zip, in a better shape after a few reforms hinted by e.g. penetration tools.

Given the aformentioned considerations, I have decided to make download-archive a simple redirect to download-zip. Specifying the object_id via the path will keep working, while URLs out there expecting the name to change will not fail, but the name will not be modified. The archive format will from now on be assumed to be zip.

  1. … 4 more files in changeset.
Fix english

Deprecate fs::get_folder_contents

Avoid using get_folder_contents, doing a lot more stuff, and get the info from the db directly

Retrieve only the necessary information

Replace ad_tmpnam

Make fs::get_folder_contents private: this api is only used internally to the file-storage over the codebase and its documentation suggests that it should be used with caution

Deprecate trivial fs::get_archive_extension and inline its only upstream occurrence

  1. … 1 more file in changeset.
Prevent usage of fs::get_archive_command outside a file-storage connection context, as in this case the parameter value will be uspecified

  1. … 1 more file in changeset.
Deprecate fs::item_editable_info and fs::item_editable_p, probably unfinished work towards some kind of inline editing feature

Deprecate fs::add_created_version

This api was nowhere used in upstream code, however, allowed to create a new file object revision by text content, different from fs::add_version, which would only allow to create a revision from a file.

As the two apis were otherwise identical, I have ported the behavior of fs::add_created_version info fs::add_version.

The new fs::add_version will also take many defaults for unspecified parameters from the existing content item.

Make service contract implementation private

Commit remaining files

  1. … 3 more files in changeset.
Make use of new API "ad_mktmpdir" and "ad_opentmpfile" instead of "ad_tmpnam"

  1. … 6 more files in changeset.
Fixes for Oracle 19c: more fixes of handling of Boolean values

ad_conn provides since a long time a fallback when the package_id is queried outside of a connection context, hence no need for these concerning catches

Make fs::get_file_package_id more robust to cases where the package_id is not set on the object itself: climb up the hierarchy

  1. … 1 more file in changeset.
fix typo

allow to specify max upload size in configuration file in KB or MB

Fix typo

Make oacs-dav only a weak dependency for file-storage, if the package is not there, just treat it as if the parameter was disabled

  1. … 2 more files in changeset.
Refactor query to go over the fs hierachy, rather than the permission one, add remarks

Recover logic went missing after refactoring (with some remarks)

break overlong lines

stick to content-repository API instead of duplicating code here.

  1. … 3 more files in changeset.
new function: ::content::revision::export_to_filesystem

This change moves functionality from file-storage to acs-content-repository.

all application packages should be free of internals, such as the storage

type. Storage_type should be handeled in the content-repository package.

We are not yet done, there is still more to do in this respect in

the file-storage package.

  1. … 7 more files in changeset.
break overlong lines

improve spelling

  1. … 5 more files in changeset.
whitespace changes

  1. … 2 more files in changeset.
Mark 'fs::max_upload_size' as public, as it is used in 'attachments'