-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When using ports instead of sockets, the Neovim port (both remote and client) are bound to the loopback address, rather than `0.0.0.0`. This should be a little more secure. Ports tunneled via `NvrhTunnelPort` are still bound to `0.0.0.0` on the client machine, that's because I still need to use my phone / tablet to check things out sometimes, and if they were bound to `127.0.0.1` I wouldn't be able to connect. Ideally, this would be configurable at mapping-time, something like `NvrhTunnelPort 3000 interface=all` / `NvrhTunnelPort 3000 interface=loopback` - Clean up local socket - Clean up remote socket - Clean up remote browser script - Use `filepath.Join` instead of `path.Join` - Extract logger setup
- Loading branch information
Showing
4 changed files
with
51 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package logger | ||
|
||
import ( | ||
"log/slog" | ||
"os" | ||
|
||
"github.com/dusted-go/logging/prettylog" | ||
) | ||
|
||
func PrepareLogger(isDebug bool) { | ||
logLevel := slog.LevelInfo | ||
|
||
if isDebug { | ||
logLevel = slog.LevelDebug | ||
} | ||
|
||
log := slog.New(prettylog.New( | ||
&slog.HandlerOptions{ | ||
Level: logLevel, | ||
AddSource: isDebug, | ||
}, | ||
prettylog.WithDestinationWriter(os.Stderr), | ||
prettylog.WithColor(), | ||
)) | ||
|
||
slog.SetDefault(log) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters