Comments (7)
from upgit.
=============================================================================
UPGIT 配置
=============================================================================
默认上传器
default_uploader = "github"
上传文件名的格式模板(仅特定上传器适配)
/ 目录分隔符, 作用: 是区分目录
{year} 年份, 例如: 2022
{month} 月份, 例如: 02
{day} 天, 例如: 01
{unix_ts} 时间戳, 例如: 1643617626
{fname} 原始文件名,如 logo (不含后缀名)
{fname_hash} {fname}的 MD5 散列值
{ext} 文件后缀名, 例如.png
下面的例子生成的文件名预览: 2022/01/upgit_20220131_1643617626.png
如果目录不存在将会被程序自动创建
rename = "{year}/{month}/upgit_{year}{month}{day}_{unix_ts}{ext}"
-----------------------------------------------------------------------------
自定义输出格式
-----------------------------------------------------------------------------
{url} 图片文件的网络URL地址
[output_formats]
"bbcode" = "[img]{url}[/img]"
"html" = ''
"markdown-simple" = ""
-----------------------------------------------------------------------------
直链替换规则 RawUrl -[replace]-> Url
-----------------------------------------------------------------------------
如果您的网络访问Github异常或者缓慢,您可以尝试下面的配置以开启CDN加速
[replacements]
"raw.githubusercontent.com" = "cdn.jsdelivr.net/gh"
"/master" = "@master"
=============================================================================
以下为各个上传器的配置示例. 用不到的留空即可
=============================================================================
Github 上传器
[uploaders.github]
保存文件的分支,例如 master 或 main
branch = "main"
您的拥有"repo"权限的 Github 令牌
获取Github Token连接: https://github.com/settings/tokens
pat = "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"
您的公共Github存储库的名称
注意: 为了让您和他人可以访问到图片资源, 您的Github仓库一定要是公开的,
在私有仓库中Github会拦截未授权的请求,你将会得到一个404.
repo = "upgit-demo"
您的 Gtihub 用户名
username = "[email protected]"
SMMS 上传器
[uploaders.smms]
Get token from https://sm.ms/home/apitoken
token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Imgur 上传器
[uploaders.imgur]
Get token from https://api.imgur.com/oauth2/addclient
See your apps in https://imgur.com/account/settings/apps
client_id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Chevereto Uploader
[uploaders.chevereto]
upload_url = "https://chevereto.com/api/v1/upload"
key = "c8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8"
腾讯云 COS
[uploaders.qcloudcos]
host = "xxx.cos.ap-chengdu.myqcloud.com"
secret_id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
secret_key= "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
七牛云存储
[uploaders.qiniu]
Generate Token: http://jsfiddle.net/gh/get/extjs/4.2/icattlecoder/jsfiddle/tree/master/uptoken
token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:xxxxxxxxxxxxxxxxxxxxxxxxxxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=="
prefix = "https://cdn.mydomain.com/"
Gitee
[uploaders.gitee]
username = "[email protected]"
repo = "TestImage"
https://gitee.com/profile/personal_access_tokens/new
access_token = "70496eed0d71d67b826d5c88f70eb297"
[uploaders.cloudinary]
cloud_name = "my_cloud"
upload_preset = "preset_name"
[uploaders.easyimage]
request_url = "https://img.545141.com/api/index.php"
token = "1c17b11693cb5ec63859b0ccccccccccc"
from upgit.
用的是这个配置,直接传github就会404
from upgit.
from upgit.
环境是window
from upgit.
用户名不要写成邮箱。
不要把密码粘出来,赶紧重置 token。
from upgit.
好的,谢谢
from upgit.
Related Issues (20)
- 关于上传非图片文件
- 能不能设置一个option 一直开启rename HOT 4
- unexpected end of json input HOT 4
- 剪贴板能否增强一下 HOT 4
- typora使用smms图床报错 HOT 4
- 便携版 HOT 1
- ubuntu can not upload image in clipboard HOT 1
- Help me fix CI/CD bugs
- Upgrade dependency "github.com/pelletier/go-toml" HOT 1
- upgit :clipboard-file -o clipboard HOT 3
- macos下载之后不可运行,格式为文稿格式 HOT 4
- 配置环境变量后依然无法运行upgit HOT 6
- 有人能帮忙看看配置文件哪里错了么,总是报错 HOT 1
- 限制了5m左右大小?能解除吗? HOT 1
- localpaths is required
- 能支持 s3 的上传么 HOT 2
- typora 報錯401 HOT 1
- 文件名格式模板 增加 文件自身hash值
- 支持传入在线图片URL并上传 HOT 1
- feat request: generate config file, use var log location
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from upgit.