-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
> 为了避免部分 npm 包误封、误删,导致生产环境影响,新增 syncDeleteMode 配置,允许自定义同步策略 * 新增 `syncDeleteMode` : 'ignore' | 'block' | 'delete' * delete: 目前默认值,同步删包事件 * ignore: 忽略 upstream 所有删包事件 * block: 不做物理删除,只新增 block 记录,不允许访问,除非管理员手动恢复并更新 `syncPackageBlockList` * `npm-security-holder` 场景也判断为删包事件 * 更新原有删包流程,统一处理,调整部分日志输出 --------------- > New `syncDeleteMode` to allow custom syncing policy to avoid some npm packages being blocked or deleted by mistake. * Add `syncDeleteMode` : 'ignore' | 'block' | 'delete' * delete: by default, sync delete events * ignore: ignore all upstream delete events * block: only add block records, cant access unless the administrator manually restores and update `syncPackageBlockList`. * `npm-security-holder` event is also determined to be a delete event * Update the original packet deletion process, update log output by the way
- Loading branch information
Showing
6 changed files
with
220 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
export const BUG_VERSIONS = 'bug-versions'; | ||
export const LATEST_TAG = 'latest'; | ||
export const GLOBAL_WORKER = 'GLOBAL_WORKER'; | ||
export enum SyncMode { | ||
none = 'none', | ||
exist = 'exist', | ||
all = 'all', | ||
} | ||
export enum SyncDeleteMode { | ||
ignore = 'ignore', | ||
block = 'block', | ||
delete = 'delete', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.