72 Commits
Author SHA1 Message Date
Michael Stapelberg 3d571d9ebb cmd/breakglass: fallback to HTTP instead of detecting stripping
This follows gokrazy/tools commit
https://github.com/gokrazy/tools/commit/ba6a8936f4a88ddcf20a3b8f625e323e65664aa6
2025-12-09 17:22:34 +01:00
Michael Stapelberg e8f40f784b cmd/breakglass: use updateflag.Value, add own -insecure flag
related to https://github.com/gokrazy/tools/pull/68
2025-12-05 17:50:59 +01:00
Michael Stapelberg e4167a5b08 cmd/breakglass: remove old -gokrazy_url and -tls flags
These have been deprecated for years.
All users should have switched to the instance-centric config by now.

related to https://github.com/gokrazy/tools/pull/68
2025-12-05 17:34:49 +01:00
Michael Stapelberg adb5ce3ea1 use gokapi package to query build timestamp 2025-02-22 08:12:43 +01:00
Michael Stapelberg 62e5a663a8 GitHub Actions: update to latest versions of actions 2025-02-22 07:23:07 +01:00
Michael Stapelberg 5f675f1989 pull in latest gokrazy package 2025-02-22 07:18:42 +01:00
Michael Stapelberg a233c4f4d4 go.mod: bump language version to 1.24 2025-02-22 07:18:24 +01:00
Michael Stapelberg 86e60e7477 update to latest gokrazy/internal
related to https://github.com/gokrazy/gokrazy/issues/191
2025-01-26 22:46:35 +01:00
Michael Stapelberg c9528b4abb try to install busybox into a tmpfs /bin (with fallback)
This code path requires gokrazy/tools at this commit or newer:
https://github.com/gokrazy/tools/commit/37e2f95c5cfc58554405cc615c5da8e4899b071a

And gokrazy/serial-breakglass at this commit or newer:
https://github.com/gokrazy/serial-busybox/commit/bf9bc192356e3762c3d4e99c037d0e868d50d313

Afterwards, with an ~/.ssh/config entry like this:

    Host scan2drive
        ProxyCommand breakglass -proxy %h

…using Emacs TRAMP should just work:

    emacs /ssh:scan2drive:/perm/keep/index.md
2024-12-31 09:53:25 +01:00
Michael Stapelberg 0327ae332c breakglass: enable -enable_banner by default
The banner is useful and recognizeable.
I think it should be turned on by default.
2024-06-09 22:11:23 +02:00
Michael Stapelberg 44b3fe64f1 remove ssh-rsa warning
bradfitz confirmed ssh-rsa keys work again.

fixes https://github.com/gokrazy/breakglass/issues/11
2024-05-29 19:59:05 +02:00
Michael Stapelberg e771a5894b pull in latest gokrazy/gokrazy for ifaddr change 2023-08-12 11:30:49 +02:00
Michael Stapelberg 158f63b4af go get -u 2023-02-25 16:20:58 +01:00
Michael Stapelberg 3d152bbe1b use config.NewStruct()
related to https://github.com/gokrazy/tools/issues/43
2023-01-17 19:06:35 +01:00
Michael Stapelberg 12997053e4 fix: ensure config.Struct.Update is set in compatibility branch 2023-01-16 18:03:30 +01:00
Michael Stapelberg d90cafaa81 breakglass: leave a TODO for removing -tls and -gokrazy_url
both are obsolete thanks to breakglass reading the instance config
2023-01-15 17:28:26 +01:00
Michael Stapelberg 503c6819b2 breakglass: use httpclient.For() for host-specific fallback 2023-01-15 17:06:07 +01:00
Michael Stapelberg 1b4a9122b5 instance config: fix fallback to host-specific config 2023-01-15 13:46:02 +01:00
Michael Stapelberg 994987ee06 breakglass: read instance config 2023-01-15 13:36:50 +01:00
Michael Stapelberg d886921190 pull in latest github.com/gokrazy/internal 2023-01-15 13:36:42 +01:00
Michael Stapelberg 95ac9a06f8 README: update gokrazy instructions 2023-01-14 10:28:44 +01:00
Michael Stapelberg 2c1eed342d banner: build timestamp: read port from http-port.txt
This fixes the banner on devices that use a non-standard HTTP port
2022-11-08 21:51:53 +01:00
Michael Stapelberg 3d820b07fa ensure $HOME directory exists 2022-09-18 21:18:12 +02:00
Michael Stapelberg de86d50573 go.mod: update to language version go 1.18, tidy 2022-08-07 10:42:48 +02:00
Michael Stapelberg a9de5a1ae9 gofmt with Go 1.19 2022-08-07 10:18:05 +02:00
Michael Stapelberg 1e0db24f0e GitHub Actions: bump to Go 1.19 2022-08-07 10:10:23 +02:00
Michael Stapelberg ccc003f8ea pull in latest gokrazy/internal
related to https://github.com/gokrazy/gokrazy/issues/131
2022-07-09 19:26:39 +02:00
Michael Stapelberg c857ec6218 turn banner (printed before auth) into MOTD (printed after login)
This means the message will be printed only once when using the breakglass
command line tool (which first copies over a tarball, then logs in).

Also switch to fancy ASCII art while we’re at it :)
2022-07-09 18:38:32 +02:00
Michael Stapelberg c21964dfd8 breakglass: support -tls flag, use -update logic for -gokrazy_url
fixes https://github.com/gokrazy/breakglass/issues/13
2022-04-30 21:27:18 +02:00
Michael Stapelberg 48c5124500 unpack tar files copied via sftp subsystem, too (not just older scp)
For compatibility with OpenSSH ≥ 9
2022-04-17 15:32:45 +02:00
Michael Stapelberg 7dbbe9b4b3 fix subsystem invocation: send exit code afterwards
This fixes scp(1) with OpenSSH ≥ 9.
2022-04-17 15:23:09 +02:00
Michael Stapelberg 097a6f87d6 pull in latest github.com/pkg/sftp 2022-04-17 15:23:03 +02:00
Michael Stapelberg ef69007a43 use renameio to avoid “text file busy” errors
Before this commit, extracting a breakglass would fail when /tmp/breakglass*/sh
was busy because it was being run in a separate connection.
2022-04-09 00:11:47 +02:00
Michael Stapelberg 564a0eceaf explicitly set TMPDIR
programs such as podman will otherwise default to /var/tmp
(see https://github.com/containers/podman/pull/5412/files)

related to https://github.com/gokrazy/gokrazy/issues/124
2022-04-03 23:05:12 +02:00
Michael Stapelberg 5a97592967 include /usr/local/bin in $PATH
related to https://github.com/gokrazy/gokrazy/issues/124
2022-04-03 23:05:02 +02:00
Michael Stapelberg 629a19f92d breakglass command: add -proxy flag for easier ProxyCommand usage
Now you can use the following in your ~/.ssh/config for example:

Host scan2drive-backup
	Hostname scan2drive.lan
	IdentityFile ~/.ssh/id_ed25519_scan2drivebackup
	ProxyCommand breakglass -proxy scan2drive.lan
2022-03-31 19:52:53 +02:00
Michael Stapelberg 087335e682 PATH: add /user so that programs installed with gokrazy are found 2022-03-31 19:36:56 +02:00
Michael Stapelberg 0a14bc7f0c set HOME=/perm/home for persistent configs in interactive usage
As a welcome side effect, this enables persistent shell history by default!
2022-03-31 19:36:44 +02:00
Michael Stapelberg 0ee50d0171 breakglass: read host-specific http-port.txt 2022-03-26 19:42:52 +01:00
Michael Stapelberg 7131bc5abe GitHub Actions: bump to Go 1.18 2022-03-20 16:01:31 +01:00
Michael Stapelberg 9d823f94f0 README: explicitly mention both packages 2022-01-03 11:40:57 +01:00
Michael Stapelberg ae8e20729e README: line-wrap 2022-01-03 11:40:21 +01:00
Michael Stapelberg 77705dbe49 update README to use package config for authorized keys
Now that the host key is created automatically, this allows using breakglass
without ever creating or modifying a permanent partition.
2022-01-03 11:39:01 +01:00
Michael Stapelberg 339c9ce56c GitHub Actions: trigger on all branches 2021-11-28 16:00:38 +01:00
Michael Stapelberg 83d59cddd7 recommend ed25519 host keys
Newer OpenSSH versions seem to have problems with (some?) older ssh-rsa keys,
so I figured we could switch to ed25519 and avoid any confusion regarding
ssh-rsa support.
2021-11-28 15:58:55 +01:00
Michael Stapelberg 21a04c8c8b pull in latest golang.org/x/crypto 2021-11-28 12:03:48 +01:00
Michael Stapelberg d06342049c add GitHub Actions config 2021-10-24 18:19:34 +02:00
Michael Stapelberg 0c9f029ca2 upgrade to latest gokrazy/... packages 2021-10-24 18:19:06 +02:00
Michael Stapelberg 33834ea6fa allow overwriting the gokrazy URL prefix
The special syntax :1080 means “use the default, but force port to 1080”,
which is useful when you are running the gokrazy web interface on a different
port because you need port 80 for your web appliance.
2021-10-24 18:10:37 +02:00
Michael Stapelberg 9eab5f8b0d add -prepare and -ssh_config flags for usage in SSH ProxyCommand
E.g.:

Host router7
	ProxyCommand /bin/sh -c 'breakglass -prepare_only -ssh_config=/dev/null -debug_tarball_pattern=$HOME/gokrazy/debug-\${GOARCH}.tar %h; /usr/bin/nc %h %p'
2021-09-19 19:12:47 +02:00
Michael Stapelberg b54c2f919e SSH: wire up SFTP subsystem 2021-06-06 13:54:30 +02:00
Michael Stapelberg efff2172ee breakglass: use internal/config to read HTTP password 2020-05-27 18:38:58 +02:00
Michael Stapelberg 942ef7f559 README: update to use breakglass tool 2020-05-25 09:45:45 +02:00
Michael Stapelberg 8157f8ee60 add breakglass SSH wrapper tool (for convenience) 2020-05-25 09:31:54 +02:00
Michael Stapelberg 6a8318bdb5 pick up shell from github.com/gokrazy/serial-busybox if present
This allows users to use breakglass without having to upload their own shell (as
a fallback).
2020-05-25 08:58:37 +02:00
Michael Stapelberg 00ea9a7166 link to README section “installation” when keys are missing 2020-04-08 14:29:10 +02:00
Michael Stapelberg 3bc0b09635 README: ssh: any type works 2019-09-28 11:07:43 +02:00
Michael Stapelberg f51c367b88 README: ssh: use a clearer example in the installation instructions 2019-09-28 11:07:07 +02:00
Michael Stapelberg ae96dda1f3 declare a Go module 2019-03-21 09:37:16 +01:00
Michael Stapelberg 1cd81ed58b parse SSH keys line-wise, skip empty/comments
fixes #3
2019-03-21 09:36:40 +01:00
Michael Stapelberg d3f89caa0a README: use sdx to prevent mistakes 2019-02-07 14:41:23 +01:00
Michael Stapelberg 05fda29dea scp: don’t error out on directories in the tarball 2018-12-15 14:47:34 +01:00
Michael Stapelberg c11ed6a015 use ssh.Unmarshal
Thanks to Merovius for the hint.
2018-10-29 18:42:56 +01:00
Michael Stapelberg a1fd5f6920 ensure processes are killed when client disconnects 2018-07-22 23:04:18 +02:00
Michael Stapelberg 05c84e7002 ssh: run commands through sh -c if sh is present 2018-06-23 16:14:33 +02:00
Michael Stapelberg b99b39b334 include the breakglass mountpoint in $PATH
That way, users don’t need to use the ./ prefix all the time.
2018-06-23 15:45:50 +02:00
Michael Stapelberg a8f85f5027 ssh: default to starting "sh" on shell requests instead of erroring
This may still result in an error if sh is not present, but in case sh *is*
present, it results in the user just getting a shell without having to use
e.g. ssh -t gokrazy ./busybox sh
2018-06-23 15:44:41 +02:00
Michael Stapelberg 0d8462cfe7 ssh: send exit-status request for successful commands
The crypto/ssh client library requires this.
2018-06-23 15:42:41 +02:00
Michael Stapelberg 6184621747 exec: answer request once command is running 2018-06-11 23:18:11 +02:00
Michael Stapelberg ae93fa3cab exec: write stderr to SSH stderr channel, not stdout 2018-06-11 23:17:46 +02:00
Michael Stapelberg 8eb60e64b7 use Fatalf 2018-06-11 21:42:45 +02:00
Michael Stapelberg 448a389515 Initial commit 2017-03-04 11:09:10 +01:00