Skip to content

Releases: mjpclab/go-http-file-server

Version 1.11.1

12 Apr 16:46
Compare
Choose a tag to compare

Main changes

  • feat(archive): add API for archive selected paths(see API doc for detail)
  • fix(archive): skip archive unexpected directory files when in "empty root" mode
  • fix(archive): aliased directory should also follow hide rule(by --show, --hide, etc)
  • fix(delete): cannot delete files from the build for Windows 2000 platform

主要变更

  • 特性(打包):提供API来打包特定目录(详见API文档)
  • 修复(打包):如果使用空虚拟根目录,不要打包非预期的额外文件
  • 修复(打包):别名也应受显示/隐藏规则约束(通过--show,--hide等)
  • 修复(删除):用于Windows 2000的构建无法删除文件

Version 1.11.0

21 Mar 08:31
Compare
Choose a tag to compare

Main changes

Breaking change: add theme support

Before

To specify a custom html template for file list page, use --template
to specify that file.

After

The template file, together with assets like CSS or JS, are archived
into a zip file as theme file. Use --theme to specify that theme file.

  • use --theme to specify theme(zip) file
  • remove --template to specify page template
  • template file is now inside theme file
--theme <file>
    Specify a zip archive file as custom theme for rendering page and assets, instead of builtin ones.
    Theme contents are cached in memory at runtime.
--theme-dir <directory>
    Specify a directory which contains theme files.
    Theme contents will be evaluated for each request.
    It is convenient for developing themes.

    Notes for theme options:
        --theme and --theme-dir are mutually exclusive.
        --theme-dir is prior.
        Page template filename is always "index.html".
        Use "?asset=<asset-path>" to reference an asset in theme.

Improvements

  • feat(serverHandler/page): compress file list page if possible

Output gzip/deflate compressed content for file list page if client supports.

  • feat(tpl): add translation support

Detect acceptable language from client and render proper language.
Suported languages are en-US, zh-CN, zh-TW and zh-HK.

  • feat(json): add isVirtual field to item for aliased directory
  • fix(json): output subItems for empty-root mode

主要变更

破坏性变更:添加主题支持

之前

要为文件列表页指定自定义模板,使用--template指定该文件。

之后

模板文件,以及其他静态资源如CSS和JS,将被一起打包进一个zip文件,作为主题文件。
使用--theme指定该文件。

  • 使用--theme指定主题(zip)文件
  • 移除用于指定模板的--template
  • 模板文件现在位于主题文件中
--theme <主题文件>
    指定用于渲染页面和静态资源的自定义主题zip压缩文件,代替内建主题。
    主题的内容在运行时一直缓存在内存中。
--theme-dir <主题目录>
    指定主题文件所在的目录。
    每次请求时主题内容都会重新计算。
    这为开发主题提供了便利。

    主题选项注意事项:
        --theme和--theme-dir是互斥的。
        --theme-dir更为优先。
        页面模板文件名固定为“index.html”。
        使用“?asset=<asset-path>”格式来引用主题中的静态资源。

改进

  • feat(serverHandler/page): 如果可能,文件列表页启用压缩

如果客户端支持,为文件列表页输出用gzip/deflate压缩过的内容

  • feat(tpl): 添加翻译支持

检测客户端可接受的语言并渲染正确的语言。
支持的语言为en-USzh-CNzh-TWzh-HK

  • feat(json): 添加isVirtual字段用来表示别名目录
  • fix(json): 修复为空虚拟根目录输出子项

Version 1.10.14

13 Mar 11:17
Compare
Choose a tag to compare

Main changes

  • use form submission for file deleting, to avoid browser plugins to scan the deleting link url. #5
  • fix: skip upload if paste content into text input

主要变更

  • 使用表单提交方式删除文件,避免浏览器插件直接扫描删除链接。#5
  • 修复:粘贴内容至文本框时不上传其内容

Version 1.10.13

08 Mar 15:10
Compare
Choose a tag to compare

Bug fix: escape % char in filename in URL.
#4

修复bug:文件名中的%在链接中需要转义。
#4

Version 1.10.12

15 Feb 10:11
Compare
Choose a tag to compare

Main improvements

use Option key to focus first/last item on Mac platform

On Mac platform, Cmd+ArrowLeft and Cmd+ArrowRight shotcut key is
used by browser to navigate page backward and forward. So for moving to
first/last item, change the shortcut key from Cmd to Opt.

Support uploading pasted image or text

When uploading is enabled for a directory, pasting image or text content will upload that content as a file.

add download param for directory list page

If param download exists in URL parameter when rendering a directory
list page, render a download tool friendly page:

  • hide path list
  • hide sortable header
  • hide parent directory link

That's convenient for tools like "wget" to download files recursively. e.g.

wget --recursive -nc -nH -np http://localhost/dir/?download

fix: escape special chars in filename in URL

Escape chars like ?, &, # and = to avoid being treated as meta characters.


主要改进

Mac平台使用Option键来移动到首/末项

在Mac平台,Cmd+左方向键和Cmd+右方向键已被浏览器用来前进和后退。因此使用Opt键代替Cmd键。

上传粘贴的图像和文本

当某个目录启用上传后,粘贴图像或文本会将此内容上传为文件。

为目录列表页添加download参数

如果URL参数中出现download,显示一个对下载工具友好的页面:

  • 隐藏路径列表
  • 隐藏可排序表头
  • 隐藏上级目录链接

这为“wget”之类的工具递归下载提供了方便。例如:

wget --recursive -nc -nH -np http://localhost/dir/?download

修复:对URL中文件名中的特殊字符转义

对字符?&#=转义以避免被识别为元字符。

Version 1.10.9

09 Jan 09:28
Compare
Choose a tag to compare

There is no behavior change since v1.10.8.
The reason to create this version is to support new branch main-go1.2, which targets to build executable binaries for legacy Windows 2000 platform.


与1.10.8版相比没有任何行为变更。
创建此版本是为了支撑新分支main-go1.2,它用于为老旧的Windows 2000平台构建可执行二进制文件。

Version 1.10.8

06 Jan 15:43
Compare
Choose a tag to compare

Minor fixes and improvements.

功能和稳定性改进。

Version 1.10.7

30 Dec 11:45
Compare
Choose a tag to compare

Main changes

  • fix(serverHandler): prevent mutation from parent directory
  • feat(tpl): support drag drop directories for uploading

主要变更

  • 修复:防止服务端变更接受上级目录
  • 新增:支持拖放方式上传目录

Version 1.10.4

24 Dec 14:19
Compare
Choose a tag to compare

Main changes

  • Add upload progress bar
  • Auto upload after selecting files

主要变更

  • 添加上传进度条
  • 选择上传文件后自动上传

Version 1.10.3

08 Dec 16:33
Compare
Choose a tag to compare

Main changes

Can upload a whole directory recursively

Relates to #2

The upload area:

  • "Dir" mode: upload the directory itself
  • "Dir contents" mode: upload all contents inside the directory

This feature is enabled on browsers that supports webkitdirectory on HTML file input:
https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/webkitdirectory#Browser_compatibility


主要变更

支持递归上传单个目录

在上传区域中:

  • "Dir" 模式:上传目录自身
  • "Dir contents" 模式:上传目录下的所有内容

支持的浏览器:

该特性在支持HTML文件选择框的webkitdirectory属性的浏览器中启用:
https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/webkitdirectory#Browser_compatibility