Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
staugur committed Jan 6, 2023
1 parent f10009a commit 2cfff04
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 2 deletions.
8 changes: 8 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 4,14 @@
更新日志
=========

v1.16.0
--------

Released in 2023-1-6

- 优化:upimg_stream_processor钩子支持返回 `suffix` 字段指定新后缀。
- 新增:jpg/png转换为webp内置扩展,默认禁用。

v1.15.0
--------

Expand Down
7 changes: 7 additions & 0 deletions docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 80,10 @@ v1.13.0支持,进入beta,可由后台开启。
数据库,而是内存型,所以是有风险的,一定要开启AOF。

所以备份数据就是备份redis的库,请使用redis相关工具定时导出库中数据即可备份。

9. 添加第三方钩子时提示模块未发现
-----------------------------------

管理员后台安装第三方包后,需要添加第三方钩子方能加载,但发现提交时提示未发现模块。

目前发现此问题,尚不确认原因,如需加载,请重载或重启 `Sapic` 应用。
7 changes: 6 additions & 1 deletion docs/hook.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 108,11 @@
- sendmail
通过3种方式发送邮件

.. versionadded:: 1.16.0

- pic2webp
将JPG/PNG图片转为webp格式

.. _picbed-third-hook:

2. 第三方钩子
Expand Down Expand Up @@ -221,7 226,7 @@ upimg_stream_processor 🍇

.. code-block:: python
dict(code=0, data=dict(stream="新的图片二进制内容"))
dict(code=0, data=dict(stream="新的图片二进制内容", suffix="可选,指定新后缀"))
注意:钩子可以替换原图,多个钩子的处理会累加(处理优先级是按照钩子名排序)。

Expand Down
14 changes: 14 additions & 0 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -390,3 390,17 @@ NO.5 程序升级
`staugur/picbed-up2cos <https://github.com/sapicd/up2cos>`_ 、
`staugur/picbed-up2oss <https://github.com/sapicd/up2oss>`_

- v1.16.0
- 增加了内置模块`pic2webp`,可以手动安装:

.. code-block:: bash
$ pip install -r requirements/pic2webp.txt
或通过命令行自动完成:

.. code-block:: bash
$ cd picbed/src
$ flask sa upgrade --yes 1.16
5 changes: 4 additions & 1 deletion src/utils/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 139,7 @@ def clean(hookloadtime, hookthirds, invalidkey):

@sa_cli.command()
@click.confirmation_option(prompt="确定要升级更新吗?")
@click.argument("v2v", type=click.Choice(["1.6-1.7", "1.7-1.8"]))
@click.argument("v2v", type=click.Choice(["1.6-1.7", "1.7-1.8", "1.16"]))
def upgrade(v2v):
"""版本升级助手"""
#: 处理更新版本时数据迁移、数据结构变更、其他修改
Expand Down Expand Up @@ -211,3 211,6 @@ def upgrade(v2v):
pipe.delete(rsp("image", sha))
pipe.delete(dk)
pipe.execute()

elif v2v == "1.16":
_pip_install("pillow>=9.4.0")

0 comments on commit 2cfff04

Please sign in to comment.