Skip to content

Upgrade from v1 to v2

Googleplex edited this page Feb 22, 2022 · 6 revisions

Upgrade from v1 to v2

Features

Ignore items in image caption

You can set the bot to omit some fields when generating image captions.

Usage:

Set CAPTION_IGNORE in environment variables, e.g.: CAPTION_IGNORE=bookmarked

Default is none.

Make the bot completely public

Set IS_PUBLIC=true to share your bot with everyone, default to false.

API Server & Enhanced Desktop Experience

See Nazurin Extension.

Ugoira support

To support Pixiv ugoira GIF preview (sent as MP4) in Telegram, you should have ffmpeg installed.

For more information, refer to https://ffmpeg.org/, make sure libx264 encoder is installed.

On Heroku, add a buildpack to your application:

heroku buildpacks:add --index 1 https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git

Docker Installation (Beta)

You can now deploy Nazurin with docker-compose using docker-compose up -d --build.

Changes

Authorization

  • Add ALLOW_ID to replace ADMIN_ID

    Set IDs of users with whom you want to share, separated by commas.

    e.g.: ALLOW_ID=12345,23456,34567

    Default is none.

  • Add ADMIN_USERNAME to replace ALLOW_USERNAME

    Set usernames of users with whom you want to share, without @, separated by commas.

    e.g.: ALLOW_USERNAME=user1,user2,user3

    Default is none.

  • ALLOW_GROUP is renamed to GROUP_ID

    Set IDs of groups in which all members have access to this bot, separated by commas.

    e.g.: ALLOW_GROUP=-12345,-23456

  • ADMIN_ID

    You still need ADMIN_ID in order to receive error reports and have access to some restricted commands.

  • User IDs & usernames both works now

    While v1 supports either user ID or username, you may use both in v2.

Storage

  • Configurable option STORAGE is now a string seperated by commas(,).

    e.g.:

    # v1
    STORAGE = ['Mega', 'GoogleDrive']
    
    # v2
    STORAGE = Mega,GoogleDrive
    
  • Local storage is now an independent storage

    To use local storage, append Local to STORAGE, e.g.: STORAGE=Local,Mega

    Instead of using TEMP_DIR, local storage now share STORAGE_DIR configuration with remote storage.

  • Telegram album channel is now a type of storage

    Besides setting ALBUM_ID, append Telegram to STORAGE, e.g.:

    ALBUM_ID=-100123456
    STORAGE=Telegram,Mega
    
  • Local storage destination changed

    Local data including collection (STORAGE_DIR) and temporary files (TEMP_DIR) are moved to data folder at application root.

    Please create a folder named data in the main folder, and move STORAGE_DIR (Default is Picutres), TEMP_DIR (Default is temp) into the folder.

Database

  • Local storage destination changed

    Local database files are moved to data folder at application root.

    Please create a folder named data in the main folder, and move database files like nazurin.json and pixiv.json into the folder.


v2 版本升级指南

新功能

隐藏图片说明中的项目

可设置在生成图片说明时需要忽略的项目。

用法:

在环境变量中设置 CAPTION_IGNORE,如: CAPTION_IGNORE=bookmarked

默认为空。

使 Bot 完全公开

通过设置 IS_PUBLIC=true 可与所有人共享,默认为 false。

API 服务器 & 桌面端体验优化

参见 Nazurin Extension

Pixiv 动图支持

为了支持 Pixiv 动图(在 Telegram 中以 MP4 格式发送),需要安装 ffmpeg

更多信息参见 https://ffmpeg.org/,需要安装 libx264 编码器。

如在 Heroku 上使用,需要添加 Buildpack: heroku buildpacks:add --index 1 https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git

Docker 安装

现可使用 docker-compose up -d --build 进行部署。

更改

授权

  • 添加 ALLOW_ID 替代原有的 ADMIN_ID

    设置希望与其共享的用户 ID,以逗号分隔。

    如:ALLOW_ID=12345,23456,34567

    默认为空。

  • 添加 ALLOW_USERNAME 替代原有的 ADMIN_USERNAME

    设置希望与其共享的用户名,不含 @,以逗号分隔。

    如:ALLOW_USERNAME=user1,user2,user3

    默认为空。

  • ALLOW_GROUP 已更名为 GROUP_ID

    设置一些群组 ID,这些群组内的所有成员都可使用此 Bot,以逗号分隔。

    如:ALLOW_GROUP=-12345,-23456

  • ADMIN_ID

    您仍然需要设置 ADMIN_ID 以便接收错误反馈以及使用特权命令。

  • 同时支持用户 ID 和用户名

    v1 只支持用户 ID 和用户名中其一,v2 同时支持两者。

存储

  • 配置项 STORAGE 已更改为以逗号分隔的字符串

    如:

    # v1
    STORAGE = ['Mega', 'GoogleDrive']
    
    # v2
    STORAGE = Mega,GoogleDrive
    
  • 本地存储(Local)已成为一种新的存储类型

    要使用本地存储,在 STORAGE 中添加 Local,如:STORAGE=Local,Mega

    本地存储像远程存储一样遵循 STORAGE_DIR 配置而非使用 TEMP_DIR

  • Telegram 已成为一种存储类型

    除了设置 ALBUM_ID,还需在 STORAGE 中添加 Telegram,如:

    ALBUM_ID=-100123456
    STORAGE=Telegram,Mega
    
  • 本地数据目录变更

    本地数据,包括收藏的图片(STORAGE_DIR)和临时文件(TEMP_DIR)已移动至应用根目录下的 data 目录。

    请在应用目录中创建一个名为 data 的新目录,并将 STORAGE_DIR(默认为 Picutres)和 TEMP_DIR(默认为 temp)移动至该目录。

数据库

  • 本地数据目录变更

    数据库本地文件已移动至应用根目录下的 data 目录。

    请在应用目录中创建一个名为 data 的新目录,并将 nazurin.jsonpixiv.json 之类的数据库文件移动至该目录。