You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-6Lines changed: 10 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,13 +6,13 @@ Access a service on a remote host, via an SSH Tunnel! For example, people have b
6
6
-[Connect to a mysql database via SSH through PHP](http://stackoverflow.com/questions/18069658/connect-to-a-mysql-database-via-ssh-through-php)
7
7
-[Connect to remote MySQL database with PHP using SSH](http://stackoverflow.com/questions/4927056/connect-to-remote-mysql-database-with-php-using-ssh)
8
8
-[Laravel MySql DB Connection with SSH](http://stackoverflow.com/questions/25495364/laravel-mysql-db-connection-with-ssh)
9
-
9
+
10
10
We had a similar challenge, specifically accessing a MySQL database over an SSH Tunnel and all of the Questions and Answers were helpful in finding a solution. However, we wanted something that would just plug and play with our Laravel applications and Lumen Services.
11
11
12
12
So we wrote this package. We hope you enjoy it!
13
13
14
14
## Requirements
15
-
This package has been tested against Laravel/Lumen versions 5.2. 5.3, and 5.4.
15
+
This package has been tested against Laravel/Lumen versions 5.2. 5.3, and 5.4.
16
16
17
17
We do not support version <=5.1.
18
18
@@ -37,6 +37,10 @@ TUNNELER_SSH_PATH=/usr/bin/ssh
37
37
; Path to the nohup executable
38
38
TUNNELER_NOHUP_PATH=/usr/bin/nohup
39
39
40
+
; Log messages for troubleshooting
41
+
SSH_VERBOSITY=
42
+
NOHUP_LOG=/dev/null
43
+
40
44
; The identity file you want to use for ssh auth
41
45
TUNNELER_IDENTITY_FILE=/home/user/.ssh/id_rsa
42
46
@@ -62,7 +66,7 @@ TUNNELER_ON_BOOT=false
62
66
```
63
67
64
68
## Quickstart
65
-
The simplest way to use the Tunneler is to set `TUNNELER_ON_BOOT=true` in your `.env` file. This will ensure the tunnel is in place everytime the framework bootstraps.
69
+
The simplest way to use the Tunneler is to set `TUNNELER_ON_BOOT=true` in your `.env` file. This will ensure the tunnel is in place everytime the framework bootstraps.
66
70
67
71
However, there is minimal performance impact because the tunnel will get reused. You only have to bear the connection costs when the tunnel has been disconnected for some reason.
68
72
@@ -90,7 +94,7 @@ And there you have it. Go set up your Eloquent models now.
90
94
php artisan tunneler:activate
91
95
```
92
96
93
-
This artisan command will either verify the connection is up, or will create the connection. This probably isn't of great benefit for running manually, apart for testing your configuration.
97
+
This artisan command will either verify the connection is up, or will create the connection. This probably isn't of great benefit for running manually, apart for testing your configuration.
94
98
95
99
However, if you would like to ensure that the tunnel is available all the time, and not do the work on bootstrap, you can use the [Laravel Scheduler](https://laravel.com/docs/5.3/scheduling) to schedule the artisan command to run at whatever interval you think is best to maintain your connection. In your `App\Console\Kernel` for example:
96
100
@@ -109,11 +113,11 @@ Perhaps your application rarely needs to do this, but when it does, you'd like t
109
113
```php
110
114
$app->get('/mysql_tunnel', function () use ($app) {
0 commit comments