Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@fleekhq/fleek-cli
Advanced tools
Fleek CLI is a new release that will give you access to all of Fleek's tools directly from your terminal. Currently it allows you to log in and generate API keys that you can use with Fleek Storage; and interact with our hosting tools to initialize and deploy sites. Since Fleek Storage provides a S3 interface, you can use any S3 compatible SDK to access it from anywhere by providing the generated API keys.
npm install -g @fleekhq/fleek-cli
Run the following command:
fleek login
It should open a browser window prompting you to log in. If you are already logged in, it will automatically close the browser window and generate the keys.
Next, run the command
fleek whoami
Take note of the fields apiKey and apiSecret which will be needed in the next step.
You can use the Fleek CLI to link your local sites static
To initialize a fleek site in your local directory run the command:
fleek site:init
Follow the prompts to either create a new site or link an existing site you have on fleek.
To deploy changes in your publish directory, run:
fleek site:deploy
This would package content in your configured public directory and deploy it to the linked site.
In this example we are going to use AWS SDK for Node.JS. Note that AWS SDK is available for multiple other languages such as JavaScript, Go, C++, Python and Ruby, so this example should be adaptable to most existing applications.
First, make sure that you install the dependencies in your package.json file. You can do this by running:
npm init
npm install --save aws-sdk
Then, the following script outlines how to list your Fleek Storage buckets (replacing [[apiKey]] and [[apiSecret]] with the values obtained in the previous step).
const AWS = require('aws-sdk');
const s3 = new AWS.S3({
apiVersion: '2006-03-01',
accessKeyId: '[[apiKey]]',
secretAccessKey: '[[apiSecret]]',
endpoint: 'https://storageapi.fleek.co',
region: 'us-east-1',
s3ForcePathStyle: true
});
s3.listBuckets(function (err, data) {
if (err) {
console.log("Error when listing buckets", err);
} else {
console.log("Success when listing buckets", data);
}
});
Once you have your bucket name, you can fetch its contents using the following script:
const params = {
Bucket: "my-bucket",
MaxKeys: 20
};
s3.listObjectsV2(params, function (err, data) {
if (err) {
console.log("Error when listing objects", err);
} else {
console.log("Success when listing objects", data);
}
});
Please read AWS SDK documentation for a full reference about other operations you can do on an S3 compatible API.
AWS also has tools for interacting with S3 from the terminal using AWS CLI. To do this, first install AWS CLI from https://aws.amazon.com/cli/
Then, configure the AWS CLI to point to Fleek Storage endpoint (again, replacing [[apiKey]] and [[apiSecret]] with the values obtained in the previous step).:
aws configure AWS Access Key ID [None]: [[apiKey]] AWS Secret Access Key [None]: [[apiSecret]] Default region name [None]: us-east-1 Default output format [None]: ENTER
To list your buckets, run the following command:
aws --endpoint-url https://storageapi.fleek.co s3 ls
To list objects within a bucket, run:
aws --endpoint-url https://storageapi.fleek.co s3 ls s3://my-bucket
FAQs
Fleek command line utilities
We found that @fleekhq/fleek-cli demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.