GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - fastapi-practices/oss: FastAPI Best Architecture oss plugin

BranchesTags
Open more actions menu

Latest commit

 

History

21 Commits
21 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
api
api
 
 
utils
utils
 
 
.env.example
.env.example
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
__init__.py
__init__.py
 
 
plugin.toml
plugin.toml
 
 
requirements.txt
requirements.txt
 
 

Repository files navigation

OSS

阿里云 OSS 文件上传插件,支持文件上传、删除和访问地址生成

插件类型

  • 应用级插件

配置说明

在 backend/.env 中添加以下内容:

# [ Plugin ] oss
OSS_ACCESS_KEY=''
OSS_SECRET_KEY=''

插件目录下 plugin.toml 的 [settings] 中包含以下内容:

[settings]
OSS_BUCKET_NAME = 'fba-test'
OSS_ENDPOINT = 'https://oss-cn-hangzhou.aliyuncs.com'
OSS_USE_SIGNED_URL = true
OSS_SIGNED_URL_EXPIRE_SECONDS = 300

在 backend/core/conf.py 中添加以下内容:

##################################################
# [ Plugin ] oss
##################################################
# .env
OSS_ACCESS_KEY: str = ''
OSS_SECRET_KEY: str = ''

# 基础配置(in plugin.toml)
OSS_BUCKET_NAME: str
OSS_ENDPOINT: str
OSS_USE_SIGNED_URL: bool
OSS_SIGNED_URL_EXPIRE_SECONDS: int

配置项说明

  • OSS_BUCKET_NAME:存储文件使用的 Bucket 名称
  • OSS_ENDPOINT:阿里云 OSS 服务端地址
  • OSS_USE_SIGNED_URL:是否生成带有效期的签名访问地址
  • OSS_SIGNED_URL_EXPIRE_SECONDS:签名访问地址的有效期秒数

使用方式

  1. 安装并启用插件后,重启后端服务
  2. 配置阿里云 OSS AccessKey、SecretKey、Bucket 和 Endpoint
  3. 通过文件接口上传或删除文件
  4. 启用签名地址后,文件访问 URL 会带有过期时间

卸载说明

  • 卸载插件后,建议同步移除 OSS 相关环境变量和插件基础配置
  • 如业务中保存了 OSS 文件引用,请按业务需要清理远端文件或引用数据

联系方式

  • 作者:wu-clan
  • 反馈方式:提交 Issue 或 PR

About

FastAPI Best Architecture oss plugin

Topics

fbafba-pluginossplugin

Resources

Readme
Activity
Custom properties

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

Generated from fastapi-practices/fba_plugin_template
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.