2017 © Pedro Peláez
 

library server-connector

image

taylornetwork/server-connector

  • Thursday, May 10, 2018
  • by taylornetwork
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

ServerConnector

Do you need to ssh/sftp into servers and get tired of always typing ssh user@some-connection.org? Or worse having to type an IP address?, (*1)

This console application will allow you to define connections you make frequently to connect as easy as connect e, (*2)

Install

Using Composer, (*3)

$ composer global require taylornetwork/server-connector

Config

Config files will be published to ~/ServerConnector/config/, (*4)

Note: if config files are not automatically published run the config:publish command., (*5)

$ server-connector config:publish

defaults.php

Defines the default connection type if omitted., (*6)

// defaults.php

return [
    'type' => 'ssh',
];

connections.php

This is where you define all your server connections., (*7)

By default:, (*8)

// connections.php

return [

    // Name of the connection as the key
    'example' => [

        // Add any short aliases to access this as
       'aliases' => [ 'ex', 'e' ],

       // Add credentials here, or an empty array
       'credentials' => [
            'username' => 'user1',

            // Password is not recommended, ideally omit this and use ssh keys
            'password' => 'password1',
        ],

    // Omit to use default or you can set the path to a private key
        'keyFile' => '~/.ssh/id_rsa',

        // URL or IP address to connect to
        'url' => 'connect.example.com',
    ],
];

Add your connections in the array that will be returned., (*9)

Usage

Once you have defined some connections you can run, (*10)

$ server-connector connect ConnectionNameOrAlias

Which will connect to the connection with the default connection type, (*11)

Alternatively, (*12)

$ server-connector connect sftp ConnectionNameOrAlias

To connect via SFTP if it isn't the default., (*13)

Register BASH Function

To add a function to your ~/.profile to call server-connector you can use, (*14)

$ server-connector register

By default it will register a function connect() in your ~/.profile you can specify the function name by, (*15)

$ server-connector register FunctionName

After running this command you will need to source your ~/.profile or restart your terminal application., (*16)


With the BASH function you can call this application by, (*17)

connect ConnectionNameOrAlias

The Versions

10/05 2018

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sam Taylor

10/05 2018

v1.0

1.0.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sam Taylor