Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
gulp-webdav-sync
Advanced tools
Put files and folders to a WebDAV server. Deploy with gulp.
Nominally, pass a URL string.
var webdav = require( 'gulp-webdav-sync' )
// put index.js to http://localhost:8000/js/index.js
gulp.task( 'deploy', function () {
return gulp.src( 'index.js' )
.pipe( webdav( 'http://localhost:8000/js/' ) )
} )
Extend a URL object.
var webdav = require( 'gulp-webdav-sync' )
// put index.js to http://localhost:8000/js/index.js
// show status codes
// show credentials in urls
gulp.task( 'deploy', function () {
var options = {
protocol: 'http:'
, auth: 'user:pass'
, hostname: 'localhost'
, port: 8000
, pathname: '/js/'
, log: 'info'
, logAuth: true
}
return gulp.src( 'index.js' )
.pipe( webdav( options ) )
} )
Suppose the following directory tree,
and this target .
Use the 'parent'
option to constrain the localpath mapping.
var webdav = require( 'gulp-webdav-sync' )
gulp.task( 'deploy', function () {
var options = {
'log': 'info'
, 'parent': 'dist'
, 'port': 8000
}
return gulp.src( 'dist/**' )
.pipe( webdav( options ) )
} )
Otherwise, the result is this.
browser-sync, npmconf, and .npmrc for a save-sync-reload solution.
npm set dav http://user:pass@localhost:8000/js/
var browserSync = require( 'browser-sync' ).create()
var webdav = require( 'gulp-webdav-sync' )
var npmconf = require( 'npmconf' )
var href
gulp.task( 'default', [ 'deploy' ], function () {
browserSync.init( { proxy: href } )
gulp.watch( [ '*.js', '!gulpfile.js' ], [ 'deploy' ] )
.on( 'change', browserSync.reload )
} )
gulp.task( 'deploy', [ 'load-npmrc' ], function () {
var options = {
'log': 'info'
}
return gulp.src( [ '*.js', '!gulpfile.js' ] )
.pipe( webdav( href, options ) )
} )
gulp.task( 'load-npmrc', function ( cb ) {
npmconf.load( null, function() {
if ( npmconf.loaded.sources.user ) {
href = npmconf.loaded.sources.user.data.dav
}
cb()
} )
} )
With gulp-watch, gulp deploy
re-emits created and modified files for upload.
var watch = require( 'gulp-watch' )
var webdav = require( 'gulp-webdav-sync' )
var href = 'http://localhost'
var paths = {
js: [ '*.js', '!gulpfile.js' ]
}
gulp.task( 'deploy', function () {
return gulp.src( paths.js )
.pipe( watch( paths.js ) )
.pipe( webdav( href ) )
} )
Target is a URL-type parameter whereto files are uploaded. It must specify a directory ( also known as a "collection" ). At a minimum this must be DAV root, but subdirectories may be included ( e.g. project name ). Part-wise definition across multiple arguments is undefined. Use the http:
scheme, not dav:
.
Type: string
Default: undefined
Superset of http.request options parameter, and url.object. If any URL properties are defined, protocol
, hostname
, and pathname
default to http://localhost/
.
Type: Object
.
Default: {}
Logging threshold. Orthogonal to the console
methods.
string | output |
---|---|
'error' | |
'warn' | |
'info' | HTTP Responses |
'log' | Debug |
Type: String
Default: 'error'
Display credentials in logged URLs.
Type: Boolean
Default: false
Relative or absolute path which halves the source path [vinyl.path
] for appending the subsequent to the DAV target URI. Use with glob **
to prevent super-directories from being created on the target. e.g. gulp.src( 'dist/**' )
.
Type: String
Default: process.cwd()
cd gulp-webdav-sync
npm install
npm test
npm set dav http://user:pass@localhost:8000/
gulp
FAQs
Deploy files and folders via WebDAV
The npm package gulp-webdav-sync receives a total of 103 weekly downloads. As such, gulp-webdav-sync popularity was classified as not popular.
We found that gulp-webdav-sync demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.