Gathering detailed insights and metrics for @serverless/tencent-website
Gathering detailed insights and metrics for @serverless/tencent-website
Gathering detailed insights and metrics for @serverless/tencent-website
Gathering detailed insights and metrics for @serverless/tencent-website
@tencent-serverless/tencent-website-beta
[![Serverless Framework Tencent Cloud Plugin](https://s3.amazonaws.com/assets.general.serverless.com/component_website_tencent/readme-website-tencent-serverless.png)](http://serverless.com)
koot-tencent-website
Tencent Serverless Static Website
@gosls/tencent-website
* 该组件的功能:支持Serverless Framework的指定组件部署 * 该组件对应的官方依赖地址:https://github.com/serverless-components/tencent-website
npm install @serverless/tencent-website
Typescript
Module System
Node Version
NPM Version
40.1
Supply Chain
81.5
Quality
71.4
Maintenance
50
Vulnerability
85
License
JavaScript (95.21%)
HTML (4.79%)
Total Downloads
7,681
Last Day
1
Last Week
3
Last Month
21
Last Year
680
83 Stars
205 Commits
15 Forks
11 Watching
3 Branches
17 Contributors
Latest Version
1.2.24
Package Id
@serverless/tencent-website@1.2.24
Unpacked Size
41.18 kB
Size
13.00 kB
File Count
14
NPM Version
7.7.6
Node Version
15.4.0
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
0%
3
Compared to previous week
Last month
-63.8%
21
Compared to previous month
Last year
-38%
680
Compared to previous year
静态网站应用调用了基础的腾讯云 COS 组件,可以快速部署静态网站页面到对象存储 COS 中,并生成域名供访问。
操作步骤如下:
通过 npm 安装 serverless
1$ npm install -g serverless
本地创建 my-website 文件夹
1$ mkdir my-website 2$ cd my-website
在文件夹中创建对应的 serverless.yml
文件,并将静态页面放在code
目录下,文件目录结构如下:
1$ touch serverless.yml
|- code
|- index.html
|- serverless.yml
code
目录下应该对应 HTML/CSS/JS 资源的文件,或者一个完整的 React 应用。
下载 示例 HTML,将以下代码放在 index.html 文件中:
1<!DOCTYPE html> 2<html lang="en"> 3 <head> 4 <meta charset="UTF-8" /> 5 <title>Hello, Tencent Cloud</title> 6 </head> 7 <body> 8 Hello, Tencent Cloud 9 </body> 10</html>
在 serverless.yml
文件中进行如下配置
1# serverless.yml 2 3myWebsite: 4 component: '@serverless/tencent-website' 5 inputs: 6 code: 7 src: ./code 8 index: index.html 9 error: index.html 10 region: ap-guangzhou 11 bucketName: my-bucket
如您的账号未登陆或注册腾讯云,您可以直接通过微信
扫描命令行中的二维码进行授权登陆和注册。
通过sls
命令进行部署,并可以添加--debug
参数查看部署过程中的信息
1$ sls --debug 2 3 DEBUG ─ Resolving the template's static variables. 4 DEBUG ─ Collecting components from the template. 5 DEBUG ─ Downloading any NPM components found in the template. 6 DEBUG ─ Analyzing the template's components dependencies. 7 DEBUG ─ Creating the template's components graph. 8 DEBUG ─ Syncing template state. 9 DEBUG ─ Executing the template's components graph. 10 DEBUG ─ Starting Website Component. 11 DEBUG ─ Preparing website Tencent COS bucket my-bucket-1300415943. 12 DEBUG ─ Deploying "my-bucket-1300415943" bucket in the "ap-guangzhou" region. 13 DEBUG ─ "my-bucket-1300415943" bucket was successfully deployed to the "ap-guangzhou" region. 14 DEBUG ─ Setting ACL for "my-bucket-1300415943" bucket in the "ap-guangzhou" region. 15 DEBUG ─ Ensuring no CORS are set for "my-bucket-1300415943" bucket in the "ap-guangzhou" region. 16 DEBUG ─ Ensuring no Tags are set for "my-bucket-1300415943" bucket in the "ap-guangzhou" region. 17 DEBUG ─ Configuring bucket my-bucket-1300415943 for website hosting. 18 DEBUG ─ Uploading website files from /Users/dfounderliu/Desktop/temp/code/src to bucket my-bucket-1300415943. 19 DEBUG ─ Starting upload to bucket my-bucket-1300415943 in region ap-guangzhou 20 DEBUG ─ Uploading directory /Users/dfounderliu/Desktop/temp/code/src to bucket my-bucket-1300415943 21 DEBUG ─ Website deployed successfully to URL: https://my-bucket-1300415943.cos-website.ap-guangzhou.myqcloud.com. 22 23 myWebsite: 24 url: https://my-bucket-1300415943.cos-website.ap-guangzhou.myqcloud.com 25 env: 26 27 2s › myWebsite › done 28
通过以下命令移除项目
1sls remove --debug 2 3 DEBUG ─ Flushing template state and removing all components. 4 DEBUG ─ Starting Website Removal. 5 DEBUG ─ Removing Website bucket. 6 DEBUG ─ Removing files from the "my-bucket-1300415943" bucket. 7 DEBUG ─ Removing "my-bucket-1300415943" bucket from the "ap-guangzhou" region. 8 DEBUG ─ "my-bucket-1300415943" bucket was successfully removed from the "ap-guangzhou" region. 9 DEBUG ─ Finished Website Removal. 10 11 3s › myWebsite › done
当前默认支持 CLI 扫描二维码登录,如您希望配置持久的环境变量/秘钥信息,也可以本地创建 .env
文件
1$ touch .env # 腾讯云的配置信息
在 .env
文件中配置腾讯云的 SecretId 和 SecretKey 信息并保存
如果没有腾讯云账号,可以在此注册新账号。
如果已有腾讯云账号,可以在API 密钥管理中获取 SecretId
和SecretKey
.
# .env
TENCENT_SECRET_ID=123
TENCENT_SECRET_KEY=123
可以在 Serverless Components repo 中查询更多组件的信息。
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 5/26 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More