Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(portal): 增加文件上传限制可配置功能 #524

Merged
merged 7 commits into from
Mar 28, 2023

Conversation

tongchong
Copy link
Contributor

@tongchong tongchong commented Mar 22, 2023

用户部署配置:
修改scow-deployment/config.py文件中的网关配置,取消对GATEWAY 的注释,修改UPLOAD_FILE_SIZE_LIMIT的值,如将默认的1G改为50M:

# ------- 网关配置 -------
#
# GATEWAY.UPLOAD_FILE_SIZE_LIMIT:限制整个系统上传(请求)文件的大小,可接受的格式为nginx的client_max_body_size可接受的值,默认为1G
# GATEWAY = {
#   "UPLOAD_FILE_SIZE_LIMIT": "1G",
# }

# ------- 网关配置 -------
#
# GATEWAY.UPLOAD_FILE_SIZE_LIMIT:限制整个系统上传(请求)文件的大小,可接受的格式为nginx的client_max_body_size可接受的值,默认为1G
GATEWAY = {
   "UPLOAD_FILE_SIZE_LIMIT": "50M",
 }

PR合并前测试步骤,用户部署无需关注:
1、与正常流程一样拉取镜像
2、修改scow-deployment 下的config.py文件,参照用户部署配置,可将UPLOAD_FILE_SIZE_LIMIT的值改为其它值,例如5M。
3、PR未被合并前,还需要修改scow-deployment 下的generate.py,增加了对UPLOAD_FILE_SIZE_LIMIT的配置,具体参考此PR对deploy/local/generate.py文件的修改,复制即可。
4、进入文件管理,点击文件上传,展示了文件上传的最大限制。尝试上传1个10M的文件,失败

image

@changeset-bot
Copy link

changeset-bot bot commented Mar 22, 2023

🦋 Changeset detected

Latest commit: 72d33a3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@scow/portal-web Minor
@scow/demo-vagrant Minor
@scow/gateway Minor
@scow/deploy-compose Minor
@scow/auth Minor
@scow/mis-server Minor
@scow/mis-web Minor
@scow/portal-server Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov
Copy link

codecov bot commented Mar 22, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (0eb41fe) 67.03% compared to head (72d33a3) 67.03%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #524   +/-   ##
=======================================
  Coverage   67.03%   67.03%           
=======================================
  Files         115      115           
  Lines        3134     3134           
  Branches      391      391           
=======================================
  Hits         2101     2101           
  Misses        980      980           
  Partials       53       53           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 23, 2023

PR Preview Action v1.3.0
Preview removed because the pull request was closed.
2023-03-28 07:32 UTC

@tongchong tongchong force-pushed the feat-client-body-size branch from e65ee9c to bad5de4 Compare March 23, 2023 05:53
@tongchong tongchong changed the title feat(portal): 增加文件上传限制 feat(portal): 增加文件上传限制可配置功能 Mar 23, 2023
@tongchong tongchong requested a review from ddadaal March 23, 2023 06:26
@tongchong tongchong marked this pull request as ready for review March 23, 2023 06:27
@ddadaal
Copy link
Member

ddadaal commented Mar 24, 2023

PR描述里写清楚如何写这个配置,不要让用户看代码才能知道。

@ddadaal ddadaal requested a review from lyl-available March 24, 2023 06:10
@ddadaal ddadaal merged commit 523b4f8 into master Mar 28, 2023
@ddadaal ddadaal deleted the feat-client-body-size branch March 28, 2023 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants