====== Display File Plugin ====== ---- plugin ---- description: The Display File Plugin displays the content of a specified file on the local system using a displayfile element author : jeckel email : jeckelmail@gmail.com type : syntax lastupdate : 2021-01-28 compatible : Elenor of Tsort, Frusterick Manners, Greebo, Hogfather depends : conflicts : similar : showfile, source, src tags : code, display, file, include, syntaxhighlight downloadurl: https://gitlab.com/JayJeckel/displayfile/-/archive/master/displayfile-master.zip bugtracker : https://gitlab.com/JayJeckel/displayfile/issues sourcerepo : https://gitlab.com/JayJeckel/displayfile/ donationurl: screenshot_img : ---- ===== Installation ===== Search and install the plugin using the [[plugin:extension|Extension Manager]] or install directly using the latest [[https://gitlab.com/JayJeckel/displayfile/-/archive/master/displayfile-master.zip|download url]], otherwise refer to [[:plugins|Plugins]] on how to install plugins manually. ===== Usage ===== The plugin offers a single block element that expands into the content of the specified file. The element is self-closing and should not be used as an open/close pair. ^ Element ^ Note ^ | ''%%<>%%'' | | | ''%%%%'' | DEPRECATED | ^ Argument ^ Required ^ Description ^ | ''LANG'' | yes | The language of the content file. This is used by DokuWiki's built-in syntax highlighting GeSHi library. To disable syntax highlighting, specify a dask (-) character for the ''LANG'' value. The supported ''LANG'' values are the same as those provided by DokuWiki's %%%% and %%%% markup and can be found on the DokuWiki syntax page: [[wiki:syntax#syntax_highlighting|Syntax Highlighting]] | | ''TARGET'' | yes | The specific part of a file path to the desired file on the local file system. This will be appended to the value of the plugin's ''root_path'' configuration option. The ''TARGET'' value can be enclosed in single or double quotes (''%%'%%'' or ''%%"%%''). The ''TARGET'' path part must be enclosed in quotes if it contains spaces. | ===== Configuration Settings ===== The plugin provides several settings that can be modified through the [[config:manager|Configuration Manager]]. ^ Setting ^ Default ^ Description ^ | ''root_path'' | empty | Specifies the root directory displayed file paths will evaluate relative to. An empty value effectively disables the plugin. | | ''deny_extensions'' | 'sh' | Space-separated list of extensions that should be disallowed by the ''displayfile'' element. The deny list supersedes the allow list. An empty list means no extension is explicitly disallowed. | | ''allow_extensions'' | 'txt php js css' | Space-separated list of extensions that should be allowed by the ''displayfile'' element. An empty list means any extension not in the deny list will be allowed. | ===== Future Plans ===== * Fix any bugs that are reported. * Update as necessary for future Dokuwiki versions. * Replace ''root_path'' with ''deny_root_paths'' and ''allow_root_paths''. ===== Security ===== Some level of threat is inherent in the very purpose of this plugin, displaying the contents of files from the local file system. To avoid path traversal attacks, the admin is provided with a configuration option for specifying the root directory path where displayable files are located. Validation is done to ensure that no files outside that root path are displayed and, further more, user-facing error messages have been generalized to remove the chance of ambient data probing. In addition, both allow and deny list configuration options exist to further control what files are and aren't displayable. Any security concerns or suggestions are welcome and should be raised on the [[https://gitlab.com/JayJeckel/displayfile/issues|Issue Tracker]]. ===== Bugs ===== Bugs should be reported through the [[https://gitlab.com/JayJeckel/displayfile/issues|Issue Tracker]]. * There are currently no know bugs. ===== Discussion ===== Discussion should be kept on the [[plugin:displayfile:discussion|Plugin's Discussion Page]].