-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hide ftp credentials #105
Comments
Try https://www.npmjs.com/package/dotenv , I've used it myself and worked like a charm. |
When I tried something similar, I created a file called ftp.json and filed credentials for host user and password and saved it on the root of my project, same location as my gulpfile.js and on the top section of my gulp I insert the following:
var ftp_cred = require('ftp.json’) and set up the rest of the vinyl-ftp task in my gulpfile.js and run gulp deploy I get the error,
Error: Cannot find module 'ftp.json'
… 12 jan. 2018 kl. 01:07 skrev KrakerCoke ***@***.***>:
Yikes,
file.json
{
"port": 21,
"host:" 127.0.0.1
}
Javascript
let ftp = require('file.json');
ftp.port / ftp.host in javascript to access the values, and just add the file to .gitignore?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#105 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AGyTLBLHmF8btYiTvVkHoq5rdSt2JLDPks5tJqJGgaJpZM4RaXMF>.
|
let fpt_cred = require('./ftp.json'); notice the ./ as without is recognized as a module. |
aha, thanks..that worked out. My process is after making some code changes, and running my gulp build where alt the content is sent to a dist folder.
and then nothing, it seems to time out after a while. And no changes are visible on the actual site. I get the same respons even though I try to insert the credentials directly in the gulp file too. |
Hi,
Is there a way that I can have the ftp credentials in a separate file and read them in my gulp deploy function for vinyl-ftp and put that file in my .gitignore so I don't expose my ftp credentials when I do git-push.
The text was updated successfully, but these errors were encountered: