Giter Club home page Giter Club logo

sshpublisher's Introduction

SshPublisher

A small utility which helps me deploy files to a web server quickly with using just SSH(SCP).

This is a cmd utility for uploading files via SSH using the SCP protocol with the main purpose to be used as a Windows Explorer context menu shortcut to make publishing files to the web quicker.

Only key-based SSH authentication is implemented. The .pem file must be password protected.

Instructions

  1. Create App.config from App.config.sample cp SshPublisher/App.config.sample SshPublisher/App.config

  2. Modify App.config according to your needs (an example is also provided below)

  3. Build the solution

  4. Copy the resulting \bin\Release or \bin\Debug directory to a permanent location (I recommend C:\Program Files (x86)\SshPublisher) cp -R SshPublisher/bin/Release "/c/Program Files (x86)/SshPublisher"

  5. Now you can upload files by calling the utility with file-to-be-uploaded as parameter "c:\Program Files (x86)\SshPublisher\SshPublisher.exe" c:\Users\pingec\Desktop\photo.jpeg

Making it useful

The real purpose of this utility is so that I can quickly call it from the Windows Explorer context menu in order to publish files to the web via SSH. To enable this, simply run "\SshPublisher\utils\add explorer context menu shortcut for all files.reg" to make the appropriate changes to the registry.

right click shortcut demo

App.config example

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
	<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
<appSettings>
	<add key="RemoteHost" value="example.server.com" />
	<add key="Username" value="YourUserName" />
	<add key="PrivateKeyPath" value="C:\Path\To\Your\Private\Key\MyPrivateKey.pem" />
	<add key="PrivateKeyPassphrase" value="MyPrivateKeyPassword" />
	<add key="RemoteHostDestinationPath" value="/var/www/public_stuff" />
	<add key="ClipboardUrlPrefix" value="http://example.server.com/public" />
</appSettings>
</configuration>

ClipboardUrlPrefix is optional. If it is set, the clipboard will be manipulated. A string comprised of ClipboardUrlPrefix + uploaded file will be added to clipboard. For example with above config settings, when uploading a "myphoto.jpeg" file, "http://example.server.com/public/myphoto.jpeg" will be added to the clipboard.

sshpublisher's People

Contributors

pingec avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.