pluveto / upgit Goto Github PK
View Code? Open in Web Editor NEWAnother upload hub that supports clipboard. It works well with Typora, Snipaste, VSCode.
License: MIT License
Another upload hub that supports clipboard. It works well with Typora, Snipaste, VSCode.
License: MIT License
=>:upgit 1.png
panic: assignment to entry in nil map
goroutine 1 [running]:
main.main()
/home/runner/work/upgit/upgit/main.go:91 +0x31c
Failed: Put "https://api.github.com/repos/***/****/contents/upgit/2022/02/upgit_20220202_1643738255.png": x509: certificate is valid for *.googlevideo.com, *.a1.googlevideo.com, *.bdn.dev, *.c.doc-0-0-sj.sj.googleusercontent.com, *.c.2mdn.net, *.dai.googlevideo.com, *.googlezip.net, *.gvt1.com, *.offline-maps.gvt1.com, *.snap.gvt1.com, *.gcpcdn.gvt1.com, xn--ngstr-lra8j.com, *.xn--ngstr-lra8j.com, i.ytimg.com, play-lh.googleusercontent.com, not api.github.com
請問:是macOS需要做權限方面的設定嗎?應如何解決?
[18:36:32] jerry ➜ ~/Documents » upgit :clipboard -f markdown-simple
panic: clipboard: cannot use when CGO_ENABLED=0
goroutine 1 [running]:
golang.design/x/clipboard.initialize(...)
/home/runner/go/pkg/mod/golang.design/x/[email protected]/clipboard_nocgo.go:9
golang.design/x/clipboard.Init(...)
/home/runner/go/pkg/mod/golang.design/x/[email protected]/clipboard.go:102
main.loadClipboard(0x12c2fe0?)
/home/runner/work/upgit/upgit/main.go:236 +0x66
main.main()
/home/runner/work/upgit/upgit/main.go:99 +0x41b
[18:40:12] jerry ➜ ~/Documents »
config.toml
以下为文件内容
default_uploader = "github"
branch = "main"
pat = "ghp_TikdmhPW9qeIXgGxxxxxxxxxxxxxxxxxxx" #此处隐藏
rename = "{year}/{month}/upgit_{year}{month}{day}_{unix_ts}{ext}"
repo = "lb8023lyy/Image"
username = "lb8023lyy"
[replacements]
"raw.githubusercontent.com" = "cdn.jsdelivr.net/gh"
"/main" = "@main"
[output-formats]
"markdown-simple" = ""
错误日志:
2022-04-22 00:38:06.977034861 +0800 CST m=+0.000697220[INFO ] Started
2022-04-22 00:38:06.977117796 +0800 CST m=+0.000780054[ERROR] abort: $HOME is not defined
goroutine 1 [running]:
runtime/debug.Stack()
/Users/runner/hostedtoolcache/go/1.18.0-beta1/x64/src/runtime/debug/stack.go:24 +0x65
github.com/pluveto/upgit/lib/xlog.Verbose.Log({0x38?, 0x61?, {0xc0000160f0?, 0xc000091c80?}, 0x40ce47?}, {0x71bc87, 0x8}, {0xc000091ca0?, 0xc000091cc8?}, {0x0, ...})
/Users/runner/work/upgit/upgit/lib/xlog/verbose.go:55 +0x12a
github.com/pluveto/upgit/lib/xlog.Verbose.Error(...)
/Users/runner/work/upgit/upgit/lib/xlog/verbose.go:44
github.com/pluveto/upgit/lib/xlog.AbortErr({0x7a6000?, 0xc000020f80?})
/Users/runner/work/upgit/upgit/lib/xlog/verbose.go:93 +0xf9
main.loadConfig(0x957160)
/Users/runner/work/upgit/upgit/main.go:191 +0x8f
main.mainCommand()
/Users/runner/work/upgit/upgit/main.go:49 +0x35
main.main()
/Users/runner/work/upgit/upgit/main.go:40 +0x7b
版本是当前最新release。
我不知道是由于我哪里出了配置问题,但是在不注释掉全部的方括号行前,我是无法使用的,错误提示如下:
incorrect config: Username: zero value, Repo: zero value, PAT: zero value
疑似 [uploaders.github] 这一行出现问题
TODO
PicGo之前看issue是无望了,每次重装系统都要重新配置。不知这个应用是否支持?
local file path to upload. :clipboard for uploading clipboard image.
看意思是说upgit是无法上传剪贴板中除了图片以外的其他文件,只能用命令行upgit abc.*
方式上传其他格式文件。
问题:有没有更方便一点的方法,比如批处理之类的吧,让人不用每次都要输入一次路径命令。
Hi,
This is not an issue. I've made a video that introducing how to use Obsidian's Shell Commands plugin to integrate with upgit.
Maybe you will be interested:
[Obs#67] upgit- Use GitHub map: Quickly upload file to GitHub and insert url into Obsidian
https://youtu.be/nGII-khqm2o
但是实际剪贴板是有图片的
2022-02-21 16:41:51.043596 +0800 CST m=+0.000626072[INFO ] Started
2022-02-21 16:41:51.050874 +0800 CST m=+0.007904413[ERROR] abort: failed: no image in clipboard or unsupported format
goroutine 1 [running]:
runtime/debug.Stack()
/Users/runner/hostedtoolcache/go/1.18.0-beta1/x64/src/runtime/debug/stack.go:24 +0x65
github.com/pluveto/upgit/lib/xlog.Verbose.Log({0xc0?, 0x63?, {0xc00001e198?, 0xc000079860?}, 0xc000127e40?}, {0x4323438, 0x8}, {0xc000016400?, 0x33?}, {0x0, ...})
/Users/runner/work/upgit/upgit/lib/xlog/verbose.go:55 +0x12a
github.com/pluveto/upgit/lib/xlog.Verbose.Error(...)
/Users/runner/work/upgit/upgit/lib/xlog/verbose.go:44
github.com/pluveto/upgit/lib/xlog.AbortErr({0x43ad4c0?, 0xc00004d0b0?})
/Users/runner/work/upgit/upgit/lib/xlog/verbose.go:93 +0xf9
main.loadClipboard()
/Users/runner/work/upgit/upgit/main.go:360 +0x231
main.mainCommand()
/Users/runner/work/upgit/upgit/main.go:53 +0x85
main.main()
/Users/runner/work/upgit/upgit/main.go:39 +0x7b
很好用。很方便,原先用的picgo-core的打包exe版本,比较繁重
目前用这个上传蛮方便的,就是大小限制了,一开始还以为我ahk脚本弄错了
open C:\Users\zzz\AppData\Roaming\Typora\extensions: The system cannot find the file specified.
这是要自己新建一个文件夹extensions,然后下载代码库里面对应的比如smms.jsonc
放进去?readme里面没写啊。
而且做了以上步骤还是不行,Post "https://sm.ms/api/v2/upload": net/http: TLS handshake timeout
,我猜是被樯了?
smms.jsonc
里面换成smms.app
域名也不行,换成"url": "https://smms.app/api/v2/upload",
,报错Failed: rawUrl path is not valid: for path data.url, key data not found
。
到底该怎么办,整了一下午快自闭了。
注意到这个项目是go语言,之前使用过https://github.com/xlzy520/typora-plugin-bilibili 这个B站图床上传插件,也是go语言,MIT许可,不知道容不容易合并。
开发者你好,使用的windows,系统信息如下
Edition Windows 10 Enterprise LTSC
Version 21H2
Installed on 1/1/2022
OS build 19044.2486
Experience Windows Feature Experience Pack 120.2212.4190.0
下载upgit_win_amd64.exe或 upgit_win_386.exe 到本地E:\download\app\upgit
路径并重命名upgit.exe,已配置config.toml 文件,添加个人环境变量:upgit, 路径为E:\download\app\upgit
或E:\download\app\upgit\upgit.exe
后,使用cmd命令where upgit
均无法找到upgit命令 INFO: Could not find files for the given pattern(s).
,直接使用命令如upgit :clipboard -o clipboard -f bbcode
,提示 'upgit' is not recognized as an internal or external command, operable program or batch file.
请问如何解决?
The system cannot find the file specified
有时候上传的文件经过多次修改,之前的图片文件失去作用而又占据空间,能不能实现清理之前文件的功能?或者能否提供一下实现思路?谢谢!
upgit :clipboard -V
[TRACE] LocalPaths = [':clipboard']
TargetDir = ''
Verbose = true
Wait = false
Clean = false
Raw = false
NoLog = false
Uploader = ''
OutputType = 'stdout'
OutputFormat = 'url'
ApplicationPath = ''
[TRACE] default_uploader = 'github'
rename = '{year}/{month}/upgit_{year}{month}{day}_{unixts}{ext}'
[output_formats]
bbcode = '[img]{url}[/img]'
html = '<img src="{url}" />'
markdown = '![{url_fname}]({url})'
markdown-simple = '![]({url})'
url = '{url}'
panic: clipboard: cannot use when CGO_ENABLED=0
goroutine 1 [running]:
golang.design/x/clipboard.initialize(...)
/home/runner/go/pkg/mod/golang.design/x/[email protected]/clipboard_nocgo.go:9
golang.design/x/clipboard.Init(...)
/home/runner/go/pkg/mod/golang.design/x/[email protected]/clipboard.go:102
main.loadClipboard()
/home/runner/work/upgit/upgit/main.go:343 +0xa4
main.mainCommand()
/home/runner/work/upgit/upgit/main.go:53 +0x9c
main.main()
/home/runner/work/upgit/upgit/main.go:39 +0xb8
This feature will come soon.
能支持 s3 api 的上传么
報錯內容:
fail to parse result image path from: Failed: unexpected status code 401.
response: {"message":"Bad credentials","documentation_url":"https://docs.github.com/rest"}
配置:
default_uploader = "github"
[uploaders.github]
branch = "master"
pat = "ghp_*************************************" //此處隱藏
repo = "picbed"
username = "syuanc19"
--
不知為何總是報錯,查了查都是404,不曉得401是甚麼情況,謝謝
It doesn't build on MacOS agent. We need to rewrite workflow for Github Action. Any volunteer?
upgit 存放地址为 /Users/Username/Library/Upgit/upgit
环境变量中如何配置?
gitee怎么配置
剪贴板只能上传PNG图片,能否也可以上传其他格式文件。上传其他格式不得不用命令行逐条进行,远没有上传图片时,快捷键一键上传来得方便,特麻烦。
gabriel@gabriel-HP-ProDesk-600-G2-SFF:~$ upgit :clipboard
panic: clipboard: cannot use when CGO_ENABLED=0
goroutine 1 [running]:
golang.design/x/clipboard.initialize(...)
/Users/runner/go/pkg/mod/golang.design/x/[email protected]/clipboard_nocgo.go:9
golang.design/x/clipboard.Init(...)
/Users/runner/go/pkg/mod/golang.design/x/[email protected]/clipboard.go:102
main.handleClipboard()
/Users/runner/work/upgit/upgit/main.go:373 +0x46a
main.mainCommand()
/Users/runner/work/upgit/upgit/main.go:59 +0x85
main.main()
/Users/runner/work/upgit/upgit/main.go:45 +0x7b
gabriel@gabriel-HP-ProDesk-600-G2-SFF:~$ go version
go version go1.19.5 linux/amd64
gabriel@gabriel-HP-ProDesk-600-G2-SFF:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy
gabriel@gabriel-HP-ProDesk-600-G2-SFF:~$
I tested uploading image file, it works fine
gabriel@gabriel-HP-ProDesk-600-G2-SFF:~$ upgit Pictures/Screenshots/Screenshot\ from\ 2023-01-24\ 10-40-02.png
https://raw.githubusercontent.com/cbweixin/seleniumdemo/master/2023/01/upgit_20230124_1674585891.png
thanks a lot for your help!
上传时,如果文件名为中文,那么就会失败,弄了半天,不知道乍l回事,原来是不支持中文。希望大佬能解决一下。
^F8:: ;单文件上传
RunWait, "upgit.exe" :clipboard-file
return
^F9:: ;多文件上传
RunWait, "upgit.exe" :clipboard-files
return
检测到 pluveto/upgit 一共引入了47个开源组件,存在2个漏洞
漏洞标题:Go SSH拒绝服务漏洞
缺陷组件:golang.org/x/[email protected]
漏洞编号:CVE-2020-9283
漏洞描述:Go SSH是一个使用go语言开发的极度简洁的ssh工具,用于远程管理linux、unix等机器。
Go SSH存在拒绝服务漏洞,该漏洞源于网络系统或产品未对输入的数据进行正确的验证,攻击者可利用该漏洞导致拒绝服务条件,拒绝向合法用户提供服务。
国家漏洞库信息:https://www.cnvd.org.cn/flaw/show/CNVD-2020-14300
影响范围:(∞, 0.0.0-20200220183623-bac4c82f6975)
最小修复版本:0.0.0-20200220183623-bac4c82f6975
缺陷组件引入路径:github.com/pluveto/upgit@->golang.org/x/[email protected]>golang.org/x/[email protected]>golang.org/x/[email protected]
另外还有2个漏洞,详细报告:https://mofeisec.com/jr?p=ae53d1
Repo github.com/pluveto/upgit
depends on github.com/pelletier/go-toml/[email protected]
.
https://github.com/pluveto/upgit/blob/main/go.mod#L9
However, comparing version v2.0.0-beta.6
of github.com/pelletier/go-toml
from proxy.golang.org and github, there are inconsistencies.
"committer": {
"name": "GitHub",
"email": "[email protected]",
"date": "2022-04-07T23:51:09Z"
}
{"Version":"v2.0.0-beta.6","Time":"2022-01-01T01:03:18Z"}
So the checksum from the code in github does not match the checksum saved in sum.golang.org. The v2.0.0-beta.6
tag of github.com/pelletier/go-toml
might have been retagged after a minor edition on github. I guess you use proxy.golang.org to get dependencies, but that also shows that your project is depending on the copy of github.com/pelletier/[email protected]
before its edition. Depending upon such inconsistent tag version may also result in some unexpected errors as well as build errors due to different proxy settings.
For example, when someone who does not use proxy.golang.org, say GOPROXY=direct
, attempts to get github.com/pelletier/go-toml/[email protected]
, the following error occurs.
go: downloading github.com/pelletier/go-toml/v2 v2.0.0-beta.6
go: github.com/pelletier/go-toml/v2@v2.0.0-beta.6: verifying module: checksum mismatch
downloaded: h1:wURrrr62LqAzIR22w6KSpuDTdzPljPWc5UrtWOsWPfU=
sum.golang.org: h1:JFNqj2afbbhCqTiyN16D7Tudc/aaDzE2FBDk+VlBQnE=
SECURITY ERROR
This download does NOT match the one reported by the checksum server.
The bits may have been replaced on the origin server, or an attacker may
have intercepted the download attempt.
For more information, see 'go help module-auth'.
So, this is a reminder in the hope that you can get rid of this problematic version of project github.com/pelletier/go-toml
.
github.com/pelletier/go-toml
I would recommend bumping the version of github.com/pelletier/go-toml
to a new release to ensure dependency copy in proxy.golang.org and github in sync.
Upgit v0.2.16
用户目录下 .upgit.config.toml
可以正常使用
PS C:\Users\xxx> mv .\.upgit.config.toml .\.config\upgitrc
移动到 .config\upgitrc
后报错
no config file found
scoop 也在用 .config 目录做配置,想把配置文件汇聚到一起。
传不上去,日志如下:
2022-09-14 08:51:07.915924 +0800 CST m=+0.000319876[INFO ] Started
2022-09-14 08:51:07.925968 +0800 CST m=+0.010363584[ERROR] abort: invalid file to upload /var/folders/hc/my4442h94j5983yx1xdkrsk00000gn/T//upgit_tmp_1663116667916137.png: file size is larger than 5242880 bytes
goroutine 1 [running]:
runtime/debug.Stack()
/Users/runner/hostedtoolcache/go/1.18.0-beta1/x64/src/runtime/debug/stack.go:24 +0x68
github.com/pluveto/upgit/lib/xlog.Verbose.Log({0xc8?, 0x5d?, {0x14000156210?, 0x10?}, 0x140001a8000?}, {0x1023575ad, 0x8}, {0x140001aa000?, 0x1023526cc?}, {0x0?, ...})
/Users/runner/work/upgit/upgit/lib/xlog/verbose.go:55 +0xf8
github.com/pluveto/upgit/lib/xlog.Verbose.Error(...)
/Users/runner/work/upgit/upgit/lib/xlog/verbose.go:44
github.com/pluveto/upgit/lib/xlog.AbortErr({0x102458c68?, 0x1400011aee0?})
/Users/runner/work/upgit/upgit/lib/xlog/verbose.go:93 +0xe8
main.validArgs()
/Users/runner/work/upgit/upgit/main.go:182 +0x310
main.mainCommand()
/Users/runner/work/upgit/upgit/main.go:57 +0xa0
main.main()
/Users/runner/work/upgit/upgit/main.go:40 +0xb8
这种情况如何处理呢?支持修改大小上限值吗
哪个是又拍云的上传扩展呀,找了半天没找到
unexpected end of json input
想在使用-t的情况下仍然适用raname rule
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.