Code Monkey home page Code Monkey logo

hexo-deployer-cos's Introduction

hexo-deployer-cos

Tencent Cloud Object Storage (COS) plugin of Hexo

Introduce

COS is one of the best static blog hosting platforms, you can enable CDN and configure Https.

hexo-deployer-cos allows you to publish your Hexo blog directly using commands hexo d.

Installation

$ npm install hexo-deployer-cos --save

Options

You can configure in _config.yml as follows:

deploy:
  type: cos
  secretId: yourSecretId
  secretKey: yourSecretKey
  bucket: yourBucket
  region: yourRegion

For projects that use pipelines, you may not want to expose COS properties in the project file, so we support getting them through environment variables.

COS_SECRET_ID=yourSecretId
COS_SECRET_KEY=yourSecretKey
COS_BUCKET=yourBucket
COS_REGION=yourRegion

Environment variables have lower priority than _config.xml configuration

You can get this information from your Tencent Cloud Console.

Go to the COS Object Storage Console Create a bucket and get the Bucket (Bucket Name) and Region (Region Name). Go to Key Management Console Get your project SecretId and SecretKey.

Release Notes

  1. Support for obtaining COS parameters from environment variables

Opinions & Suggestions

You can commit your opinions and suggestions to Issues, or send mail to [email protected].

License

MIT

hexo-deployer-cos's People

Contributors

ldsink avatar sdlzhd avatar

Stargazers

zysicyj avatar landv avatar 浪子 avatar lofivo avatar  avatar QXYang686 avatar Wenzeng Sheng avatar NeKo7inA avatar Jae Jin avatar WeiYuan avatar Feiyang Lee avatar Cee avatar kk avatar Hao Wang avatar Hays Chan avatar Principle avatar Dar1in9 avatar sink avatar  avatar  avatar Tony avatar  avatar Natividad Connelly avatar KE avatar 李小龙 avatar Zhihao Chen avatar Abel Su avatar juejian avatar  avatar lomot avatar Trim21 avatar Bill Zhuang avatar  avatar 周思伟 avatar khan avatar Geek Cho avatar wjch avatar  avatar iyohei avatar yusheng avatar  avatar 老实敦厚的彦祖 avatar cloudflyz avatar Lamia avatar Haoyun Xia avatar J3n5en avatar  avatar

Watchers

James Cloos avatar wanghaoxi3000 avatar  avatar

hexo-deployer-cos's Issues

希望可以增加排除列表

蟹蟹你的开源项目!在使用中遇到如下问题希望可以实现:
当前的项目会删除COS上所有用户自建但本地没有的文件夹。希望可以在配置中加入忽略列表,在忽略列表中的文件或文件夹不会进行修改。
另外一个就是希望可以配置deploy的路径。当前是把所有内容deploy到bucket的根目录下了。如果在配置中可以指定deploy的路径就更好了。

腾讯cos升级了

[root@VM_8_233_centos blog]# hexo d
INFO Deploying: cos
warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g: "test-1250000000")

使用hexo d -g,文件上传过程中卡死

console输出:

:\PTS\toutendo-blog> npm install hexo-deployer-cos --save
npm WARN deprecated [email protected]: request has been deprecated, see request/request#3142
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\hexo-deployer-cos\node_modules\chokidar\node_modules\fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

  • [email protected]
    added 199 packages from 205 contributors and audited 389 packages in 11.105s

18 packages are looking for funding
run npm fund for details

found 0 vulnerabilities

PS F:\PTS\toutendo-blog> hexo clean
INFO Validating config
INFO Deleted database.
INFO Deleted public folder.
PS F:\PTS\toutendo-blog> hexo d -g
INFO Validating config
INFO Start processing
INFO Files loaded in 250 ms
INFO Generated: categories/index.html
INFO Generated: tags/index.html
INFO Generated: archives/index.html
INFO Generated: categories/日记/index.html
INFO Generated: guides/oos.html
INFO Generated: tags/常见问题/index.html
INFO Generated: categories/常见问题/index.html
INFO Generated: categories/角色攻略/index.html
INFO Generated: tags/报名相关/index.html
INFO Generated: tags/开黑啦/index.html
INFO Generated: tags/smash-gg/index.html
INFO Generated: guides/index.html
INFO Generated: tags/体术角色/index.html
INFO Generated: 404.html
INFO Generated: tags/道具角色/index.html
INFO Generated: index.html
INFO Generated: diary/first/index.html
INFO Generated: archives/2020/10/index.html
INFO Generated: faq/register/index.html
INFO Generated: archives/2020/08/index.html
INFO Generated: js/aplayer.js
INFO Generated: archives/2020/index.html
INFO Generated: guide/char/rob/index.html
INFO Generated: js/issues.js
INFO Generated: js/app.js
INFO Generated: js/search.js
INFO Generated: css/style.css
INFO Generated: js/valine.js
INFO 28 files generated in 766 ms
INFO Deploying: cos
INFO Uploading files to COS...
INFO Deploy done: cos
INFO Upload: 404.html
INFO Upload: archives\2020\08\index.html
INFO Upload: archives\index.html
INFO Upload: archives\2020\10\index.html
INFO Upload: archives\2020\index.html
INFO Upload: categories\index.html
INFO Upload: categories\常见问题\index.html
INFO Upload: categories\日记\index.html
INFO Upload: categories\角色攻略\index.html
INFO Upload: diary\first\index.html
INFO Upload: faq\register\index.html
INFO Upload: guide\char\rob\index.html
INFO Upload: guides\index.html
INFO Upload: guides\oos.html
INFO Upload: index.html
INFO Upload: js\aplayer.js
INFO Upload: js\app.js
INFO Upload: js\issues.js
INFO Upload: js\search.js
INFO Upload: tags\index.html
INFO Upload: tags\smash-gg\index.html
INFO Upload: tags\体术角色\index.html
INFO Upload: tags\常见问题\index.html
INFO Upload: tags\开黑啦\index.html
INFO Upload: tags\道具角色\index.html
INFO Upload: tags\报名相关\index.html
INFO Upload: css\style.css
INFO Upload: js\valine.js
(node:7584) UnhandledPromiseRejectionWarning: #
(node:7584) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:7584) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
INFO Good bye

npm包下载的不是最新版代码

根据GitHub仓库中的代码来看,上传文件前会对比MD5来判断是否需要上传,但是npm下载的代码显然不是这样。

hexo d 完之后,文件没有传到cos上

$ hexo d
INFO Deploying: cos
INFO Deploy done: cos

虽然已经出现了信息,但是cos仍旧是空空如也。

经过了尝试,并不是appId之类的有问题,因为发现要是这些有问题会报错。

cos相关配置:
image

image

一个作为图床的提议

很多时候只是利用cos作为图床, 而不是把博客部署到cos上面;
七牛云有一个图片自动上传的功能, 请问作者有没有写一个类似插件的想法呢

希望部署过程能删除bucket中不再需要的对象

例如前一次部署后,bucket中有图片img/a.jpg
修改博客后img/a.jpg不再需要,于是我在本地将其删除
希望部署后bucket中img/a.jpg也能对应删除

如果没有类似的操作,bucket中不能被覆盖的废弃文件会越来越多,只能手动清空bucket来清理这些没有用的文件

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.