Is there a Grunt.js plugin for downloading via FTP? - node.js

There are so many plugins available which will help push to a webserver, but are there any that will download?
A Bit of Background
I'd like to automate the process of publishing my CMS-based website. The only issue is that our marketing people regularly blog and make content changes, so I'd like to first download the content files which have changed to my local development environment (.md files, which are not accessible from the web) before I push everything up to the staging server.
Does anything like this exist? I've searched NPM quite thoroughly, as well as this question which unfortunately didn't yield any results.
I did see a pretty robust cURL based plugin, however it doesn't support FTP authentication and since these files are not web-accessible directly, I'll need to leverage FTP.

A quick google search gave me this: https://www.npmjs.com/package/grunt-ftp

Related

Remotely upload a file to Wordpress from nodejs instance

I’m running a node app on Heroku. It gathers a chunk of data and sticks it into a set of JSON files. I want to POST this data to my Wordpress server (right now it’s on siteground, but moving to WP Engine).
I thought the WordPress REST API would provide what I wanted but after reading the docs I’m not not so sure.
Does anyone have any advice on this? It’s not the kind of thing I’ve done before.
Naturally, I could download the generated files and manually upload them in the right place… but I want it to be automated!
Can anyone point me in the right direction?
Looked at WordPress REST API but don’t think that’s the answer.
An option would be to setup a cron job on your Wordpress site to download the already made JSON files. This would let you download the files via http if they're publicly available, or using an api-key, or SFTP even.
You could also go the opposite way and setup a cron job on the server running your node app and use SFTP to deliver the updated files onto your Wordpress site.
If you are really committed to wanting to use the wordpress rest api, I think the closest one that comes to my mind (not an expert in wordpress) would be that you'd upload the json files as media objects: https://developer.wordpress.org/rest-api/reference/media/.

How do I let my Client edit my webpage?

So, I have a client who needs a website. Although he would like to edit the webpage when I put it into the web. So I am wondering how would it be possible for just my client to edit the website, and not any other users. In HTML, CSS, JS of course!
Thanks, Albert
How competent is you client? Here's a few way I can see someone who is decently competent at computers editing a website (I've used them all):
SSH: If the site is running on a server with SSH, your client can directly SSH into the server and edit files. Not highly recommended but this is the "easiest" way (May be able to use their text editor via an SFTP plugin too to edit files on the server).
Git: Attach the web root to a git repository. This way the client can edit whatever they want on a local copy on their machine, test it and then deploy it to production or test by SSHing into the server and updating the repo.
No SSH? Use FTP is download the files, edit them on local machine and then upload new version to server.
All these options assumes the client can use the tools needed (SSH, Git or FTP) and knows webdev.
consider using some CMS, like WordPress or Drupal, so your client can edit almost anything on website without digging into git-flow or other technologies. I guess if he knew how to do it, he wouldn't ask. Another option is to create web site on a platform like Wix (or similar), but in this case customisation will be limited by platform

linux (CLI) download files via shared dropbox (folder`) link without a account

I was thinking to use dropbox to upload my source code of a web-application. For this folder i would create a shared link. This link i like to use to download all the latest source files on my test server (instead of using s/FTP).
Now i know you can use dropbox with linux by installing their version, but it requires to create account. I don't want to use a account, and for sure don't want to use my own account.
Is there anyway to use a shared (folder) link, and download all the files in that folder command-line, without a account (maybe something like wget) ? There is no need for live-syncing, it would be fine to trigger the download with some bash script.
Thanks.
If you're ok with your links being public (which i think is not a good idea) , then you can just create a file with a list of links to your files and then create a bash script to loop over each line of the file get the link with wget
If you want to use authentication, you'll have to register for a Dropbox API key and then create a script (in python,ruby or java etc) to authenticate and get the files.
If you don't have a specific need for dropbox, i'll recommend you use git (or similar). With git you'll just have to create the repository on your server and clone it on your desktop. Then you can just edit your files and push it to the server.... it's so much easier.
Rogier, github has become the norm for hosting code. There are other options (Sourceforge, Google Code, Beanstalk) or you can set up a private git repository on your own computer.
Somewhere deep in my browser history there's an article about how to do that.
However a little googling turned up http://news.ycombinator.com/item?id=1652414. Let me know if you can't find some satisfactory instructions on your own of how to set up a git repo on your computer.

How do I move ExpressionEngine (EE) to another server?

What are the best steps to take to prevent bugs and/or data loss in moving servers?
EDIT: Solved, but I should specify I mean in the typical shared hosting environment e.g. DreamHost or GoDaddy.
Bootstrap config is the smartest method (Newism has a free bootstrap config module). I think it works best on fresh installs myself, but ymmv.
If you've been given an existing EE system and need to move it, there are a few simple tools that can help:
REElocate: all the EE 2.x path and config options, in one place. Swap one URL for another in setup, check what's being set and push the button.
Greenery: Again, one module to rule them all. I've not used this but it's got a good rating.
So install, set permissions, move files and and DB, and then use either free module. If you find that not all the images or CSS instantly comes back online, check your template base paths (in template prefs) and permissions.
I'm also presuming you have access to the old DB. If not, and you can't add something simple like PHPMyAdmin to back it up, try:
Backup Pro(ish): A free backup module for files and db. Easy enough that you should introduce it to the site users (most never consider backups). All done through the EE CP. The zipped output can easily be moved to the new server.
The EE User Guide offers a reasonably extensive guide to Moving ExpressionEngine to Another Server and if you follow all of these steps then you will have everything you need to try again if any bugs or data loss occur.
Verify Server Compatibility
Synchronize Templates
Back-up Database and Files
Prepare the New Database
Copy Files and Folders
Verify File Permissions
Update database.php
Verify index.php and admin.php
Log In and Update Paths
Clear Caches
As suggested by Bitmanic, a dynamic config.php file helps with moving environments tremendously. Check out Leevi Graham's Config Bootstrap for a quick and simple solution. This is helpful for dev/staging/prod environments too!
I'd say the answer is the same as any other system -- export your entire database, and download all of your files (both system and anything uploaded by users - images, etc). Then, mirror this process by importing/uploading to the new server.
Before I run my export, I like to use the Deeploy Helper module to change all of my file paths in EE to the new server's settings.
Preventing data loss primarily revolves around the database and upload directories.
Does your website allow users to interact with the database? If so at some point you'll need to turn off EE to prevent DB changes. If not that you don't have too much to worry about as you can track and changes on the database end between the old and new servers.
Both Philip and Derek offer good advice for migrating EE. I've also found that having a bootstrap config file helps tremendously - especially since you can configure your file upload directories directly via config values now (as of EE2.4, I think).
For related information, please check out the answers to this similar Stack Overflow question.

Is there a way to run Trac offline?

I'd like to download the Trac database so I can view its tickets offline. Is there anyway to achieve this? I.e. if I need to leave the office and bring my laptop with me, how can I bring the tickets with me without having to connect to the company network?
I know that Mylyn can download and sync tickets via it's trac connector but I'd like some stand-alone viewer.
See Simple Defects (SD).
I particularly like the "One-tweet install" idea.
I’m installing #SD (http://syncwith.us)
after reading about it on #StackOverflow
curl fsck.com/sd|perl;
export $PATH=~/sd/bin:$PATH; sd
Note that you can clone Trac (and other bugtrackers) in SD:
sd clone --from trac:https://trac.parrot.org/parrot
Seeing as you don't want to install a server, how about using RSS? IIRC, Trac let lets you get RSS feeds for each person, so you can have a feed of things assigned to you.
All you need do then is get a nice client that will download these tickets. You should be able to access a plaintext version without internet connection.
If that's not flexible enough, you could write a script on the server to publish a feed using the database directly.
And if RSS isn't for you (and your email is available offline), you could mail reports home. Trac also has this built in.
The default Trac installation uses a combination of SQLite to matintain all of the data. Attachements are stored on the file system.
In the folder containing the trac site, find \db\trac.db
This file can be viewed using the SQLite manager Firefox Addon
Happy hunting.
And if RSS or email isn't your notification of choice, there's a trac plugin that will let you receive task notifications on your Remember The Milk todo list.
See: http://1.www.rememberthemilk.com/forums/ideas/3580/?forum=ideas&hl=bs&topic=3580
If your objective is simply to view the tickets offline, how about
Run a report with all the tickets (or all those you're interested in).
Select either the comma-delimited or tab-delimited download link at the bottom of the page.
Import the downloaded file into Excel.
you could install it on a local machine
You can host the trac locally and set up the connectionstring point to your dowloaded database.
Sure. Install a web server locally, install trac, get it set up the same (or similar) way to the way it is on the live version and then script the server to publish db backups and write a local script to download those and restore them over your database.
It's not simple (installing Trac is a battle on its own from my experience of it) but every element is highly googleable =)
The trac client FatBug (http://fat-bug.com/) listed in
https://trac.edgewall.org/wiki/Clients
seems to do the exact what was described by the OP. I bumped into it after I just checked SD. SD seems trival on Linux, but heavy on Windows, it depends on Perl & CPAN.

Resources