FIS3 HTTP Push Deploy Plugin
raw JSON →The `fis3-deploy-http-push` package serves as the default deployment plugin for the FIS3 build system, offering functionalities for both local and remote file synchronization via HTTP POST requests. Currently at version 2.0.8, it enables developers to configure custom deployment targets and attach specific data parameters for different file types directly within their FIS3 build configurations. A key characteristic is its deep integration with the FIS3 framework, allowing for sophisticated, programmatic control over the deployment process, including the ability to incorporate interactive elements like token prompts for authentication during a build. However, it is critical to note the explicit and severe security warnings associated with the provided `receiver.php` example script, which is inherently insecure and **must not be deployed in production environments**. This limitation means the plugin is primarily suitable for internal development, staging, or highly trusted network setups. The package's release cadence is not independent but rather follows the lifecycle and maintenance schedule of the broader FIS3 project.
Common errors
error Security vulnerability when using receiver.php in production ↓
error Files are not deploying, or receiver responds with 404/500 ↓
receiver URL is correct and accessible. Ensure the remote server is online and the receiver script (your custom one, not the insecure example) is correctly deployed and functioning. error Deployed files land in wrong directories on the remote server ↓
to option in your fis.plugin('http-push', { to: '...' }) configuration. Also, verify that your custom receiver script correctly reads and utilizes the to parameter to determine the target path on the server. Warnings
breaking The `receiver.php` script provided as an example in the README has severe security vulnerabilities and is explicitly marked as unsafe for production. Deploying it in a live environment will expose your server to significant risks. ↓
gotcha This plugin is tightly coupled with the FIS3 build system. It is not a standalone deployment tool and requires a functioning FIS3 project setup to operate. ↓
gotcha The remote HTTP receiver endpoint (`receiver` option) must be a live server capable of accepting POST requests and handling file uploads. The plugin does not provide this server component itself (beyond the insecure example `receiver.php`). ↓
Install
npm install fis3-deploy-http-push yarn add fis3-deploy-http-push pnpm add fis3-deploy-http-push Imports
- fis3-deploy-http-push (module) wrong
import deployPlugin from 'fis3-deploy-http-push';correctconst deployPlugin = require('fis3-deploy-http-push'); - http-push (plugin string) wrong
fis.plugin(require('fis3-deploy-http-push'), { /* config */ });correctfis.plugin('http-push', { /* config */ });
Quickstart
const fis = require('fis3');
fis.match('*.js', {
deploy: fis.plugin('http-push', {
// If configured, fis will POST files one by one to the receiver endpoint.
receiver: 'http://www.example.com:8080/receiver.php',
// This parameter will be sent along with the POST request.
to: '/home/fis/www',
// Additional parameters, backend accesses via $_POST['xx'].
// If 'data' contains a 'to' key, the above 'to' parameter will override it.
data: {
token : 'abcdefghijk',
user : 'maxming',
uid : 1
}
})
});
// Example of running the build (assuming fis3 CLI is installed)
// fis.project.vcs.query = () => '1.0.0'; // Mock version for a complete example
// fis.match('**', { release: '/$0' }); // Release all files
// fis.log.level = fis.log.L_INFO;
// fis.cli.run(process.argv); // This would trigger a build if run in a FIS3 project context