mirror of https://github.com/jetkvm/kvm.git
Compare commits
3 Commits
f5880070ef
...
3e2e133b51
Author | SHA1 | Date |
---|---|---|
|
3e2e133b51 | |
|
cff3ddad29 | |
|
00ef587eeb |
|
@ -0,0 +1,76 @@
|
|||
---
|
||||
name: Bug report
|
||||
description: 🐛 Let us know about an unexpected error, a crash, or an unexpected behavior.
|
||||
type: 'Bug'
|
||||
labels:
|
||||
- 'type: bug'
|
||||
body:
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Disclaimer
|
||||
description: |
|
||||
For support questions, please use the [discussions][] or [Discord][] instead. Before
|
||||
opening a bug report, ensure you have read the [documentation][],
|
||||
[Troubleshooting][] and [Device FAQs][]. Only use bug reports for actual
|
||||
bugs.
|
||||
|
||||
[documentation]: https://jetkvm.com/docs
|
||||
[Troubleshooting]: https://jetkvm.com/docs/getting-started/troubleshooting
|
||||
[Device FAQs]: https://jetkvm.com/docs/getting-started/faq
|
||||
[discussions]: https://github.com/jetkvm/kvm/discussions
|
||||
[Discord]: https://jetkvm.com/discord
|
||||
options:
|
||||
- label: I have read and understood the disclaimer.
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: Application version
|
||||
description: |
|
||||
Provide the application version (can be found in General settings)
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: System version
|
||||
description: |
|
||||
Provide the system version (can be found in General settings)
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Device model
|
||||
description: Provide the device model
|
||||
options:
|
||||
- JetKVM
|
||||
- JetKVM (POE)
|
||||
validations:
|
||||
required: false
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Extension model
|
||||
description: Provide the extension model (if the bug is related to the extension)
|
||||
options:
|
||||
- ATX Power Control
|
||||
- DC Power Control
|
||||
- Serial Console
|
||||
validations:
|
||||
required: false
|
||||
- type: input
|
||||
attributes:
|
||||
label: Remote device Hardware
|
||||
description: If the bug is related to a remote device, please provide its hardware information e.g. Raspberry Pi 5
|
||||
validations:
|
||||
required: false
|
||||
- type: input
|
||||
attributes:
|
||||
label: Remote device OS
|
||||
description: If the bug is related to a remote device, please provide its OS information as detailed as possible e.g. Debian 12.
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Bug description
|
||||
description: |
|
||||
Provide a description of the problem: steps to reproduce it, what you are expecting and what you got.
|
||||
validations:
|
||||
required: true
|
|
@ -0,0 +1,10 @@
|
|||
blank_issues_enabled: true
|
||||
|
||||
contact_links:
|
||||
- name: Hardware Issues
|
||||
url: https://jetkvm.com/contact
|
||||
about: If your hardware is not powering on or is not working, please contact us.
|
||||
|
||||
- name: Discord
|
||||
url: https://jetkvm.com/discord
|
||||
about: Engage with the JetKVM team and other community members.
|
|
@ -0,0 +1,46 @@
|
|||
name: Feature
|
||||
type: 'Feature'
|
||||
description: 🚀 Request a new feature.
|
||||
labels:
|
||||
- 'type: feature'
|
||||
body:
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: A note for the community
|
||||
value: |
|
||||
> [!NOTE]
|
||||
> Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request.
|
||||
validations:
|
||||
required: true
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Disclaimer
|
||||
description: |
|
||||
Before requesting a feature, check it does not already exist in the [documentation](https://jetkvm.com/docs) or our [roadmap](https://jetkvm.com/roadmap).
|
||||
You are quite welcome opening a feature request before spending time to implement it yourself.
|
||||
options:
|
||||
- label: I have read and understood the disclaimer.
|
||||
required: true
|
||||
- label: I plan to implement the feature myself.
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Subsystem
|
||||
description: Provide the subsystem of the feature you request, you can choose multiple if you think it fits in multiple areas.
|
||||
options:
|
||||
- Hardware
|
||||
- Device Compatibility
|
||||
- Keyboard
|
||||
- Mouse
|
||||
- Power
|
||||
- UI: Screen
|
||||
- UI: Application
|
||||
- UI: Cloud
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Feature description
|
||||
description: |
|
||||
Provide a description of the feature you request.
|
||||
validations:
|
||||
required: true
|
|
@ -48,7 +48,7 @@ type NetworkInterfaceOptions struct {
|
|||
DefaultHostname string
|
||||
OnStateChange func(state *NetworkInterfaceState)
|
||||
OnInitialCheck func(state *NetworkInterfaceState)
|
||||
OnDhcpLeaseChange func(lease *udhcpc.Lease)
|
||||
OnDhcpLeaseChange func(lease *udhcpc.Lease, state *NetworkInterfaceState)
|
||||
OnConfigChange func(config *NetworkConfig)
|
||||
NetworkConfig *NetworkConfig
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ func NewNetworkInterfaceState(opts *NetworkInterfaceOptions) (*NetworkInterfaceS
|
|||
_ = s.updateNtpServersFromLease(lease)
|
||||
_ = s.setHostnameIfNotSame()
|
||||
|
||||
opts.OnDhcpLeaseChange(lease)
|
||||
opts.OnDhcpLeaseChange(lease, s)
|
||||
},
|
||||
})
|
||||
|
||||
|
|
|
@ -9,17 +9,32 @@ import (
|
|||
"github.com/beevik/ntp"
|
||||
)
|
||||
|
||||
var defaultNTPServers = []string{
|
||||
var defaultNTPServerIPs = []string{
|
||||
// These servers are known by static IP and as such don't need DNS lookups
|
||||
// These are from Google and Cloudflare since if they're down, the internet
|
||||
// is broken anyway
|
||||
"162.159.200.1", // time.cloudflare.com IPv4
|
||||
"162.159.200.123", // time.cloudflare.com IPv4
|
||||
"2606:4700:f1::1", // time.cloudflare.com IPv6
|
||||
"2606:4700:f1::123", // time.cloudflare.com IPv6
|
||||
"216.239.35.0", // time.google.com IPv4
|
||||
"216.239.35.4", // time.google.com IPv4
|
||||
"216.239.35.8", // time.google.com IPv4
|
||||
"216.239.35.12", // time.google.com IPv4
|
||||
"2001:4860:4806::", // time.google.com IPv6
|
||||
"2001:4860:4806:4::", // time.google.com IPv6
|
||||
"2001:4860:4806:8::", // time.google.com IPv6
|
||||
"2001:4860:4806:c::", // time.google.com IPv6
|
||||
}
|
||||
|
||||
var defaultNTPServerHostnames = []string{
|
||||
// should use something from https://github.com/jauderho/public-ntp-servers
|
||||
"time.apple.com",
|
||||
"time.aws.com",
|
||||
"time.windows.com",
|
||||
"time.google.com",
|
||||
"162.159.200.123", // time.cloudflare.com IPv4
|
||||
"2606:4700:f1::123", // time.cloudflare.com IPv6
|
||||
"0.pool.ntp.org",
|
||||
"1.pool.ntp.org",
|
||||
"2.pool.ntp.org",
|
||||
"3.pool.ntp.org",
|
||||
"time.cloudflare.com",
|
||||
"pool.ntp.org",
|
||||
}
|
||||
|
||||
func (t *TimeSync) queryNetworkTime(ntpServers []string) (now *time.Time, offset *time.Duration) {
|
||||
|
|
|
@ -188,7 +188,7 @@ Orders:
|
|||
case "ntp":
|
||||
if syncMode.Ntp && syncMode.NtpUseFallback {
|
||||
t.l.Info().Msg("using NTP fallback")
|
||||
now, offset = t.queryNetworkTime(defaultNTPServers)
|
||||
now, offset = t.queryNetworkTime(defaultNTPServerIPs)
|
||||
if now != nil {
|
||||
t.l.Info().Str("source", "NTP fallback").Time("now", *now).Msg("time obtained")
|
||||
break Orders
|
||||
|
|
9
main.go
9
main.go
|
@ -96,16 +96,25 @@ func Main() {
|
|||
if !config.AutoUpdateEnabled {
|
||||
return
|
||||
}
|
||||
|
||||
if isTimeSyncNeeded() || !timeSync.IsSyncSuccess() {
|
||||
logger.Debug().Msg("system time is not synced, will retry in 30 seconds")
|
||||
time.Sleep(30 * time.Second)
|
||||
continue
|
||||
}
|
||||
|
||||
if currentSession != nil {
|
||||
logger.Debug().Msg("skipping update since a session is active")
|
||||
time.Sleep(1 * time.Minute)
|
||||
continue
|
||||
}
|
||||
|
||||
includePreRelease := config.IncludePreRelease
|
||||
err = TryUpdate(context.Background(), GetDeviceID(), includePreRelease)
|
||||
if err != nil {
|
||||
logger.Warn().Err(err).Msg("failed to auto update")
|
||||
}
|
||||
|
||||
time.Sleep(1 * time.Hour)
|
||||
}
|
||||
}()
|
||||
|
|
27
network.go
27
network.go
|
@ -15,7 +15,7 @@ var (
|
|||
networkState *network.NetworkInterfaceState
|
||||
)
|
||||
|
||||
func networkStateChanged() {
|
||||
func networkStateChanged(isOnline bool) {
|
||||
// do not block the main thread
|
||||
go waitCtrlAndRequestDisplayUpdate(true)
|
||||
|
||||
|
@ -37,6 +37,13 @@ func networkStateChanged() {
|
|||
networkState.GetFQDN(),
|
||||
}, true)
|
||||
}
|
||||
|
||||
// if the network is now online, trigger an NTP sync if still needed
|
||||
if isOnline && timeSync != nil && (isTimeSyncNeeded() || !timeSync.IsSyncSuccess()) {
|
||||
if err := timeSync.Sync(); err != nil {
|
||||
logger.Warn().Str("error", err.Error()).Msg("unable to sync time on network state change")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func initNetwork() error {
|
||||
|
@ -48,13 +55,13 @@ func initNetwork() error {
|
|||
NetworkConfig: config.NetworkConfig,
|
||||
Logger: networkLogger,
|
||||
OnStateChange: func(state *network.NetworkInterfaceState) {
|
||||
networkStateChanged()
|
||||
networkStateChanged(state.IsOnline())
|
||||
},
|
||||
OnInitialCheck: func(state *network.NetworkInterfaceState) {
|
||||
networkStateChanged()
|
||||
networkStateChanged(state.IsOnline())
|
||||
},
|
||||
OnDhcpLeaseChange: func(lease *udhcpc.Lease) {
|
||||
networkStateChanged()
|
||||
OnDhcpLeaseChange: func(lease *udhcpc.Lease, state *network.NetworkInterfaceState) {
|
||||
networkStateChanged(state.IsOnline())
|
||||
|
||||
if currentSession == nil {
|
||||
return
|
||||
|
@ -64,7 +71,15 @@ func initNetwork() error {
|
|||
},
|
||||
OnConfigChange: func(networkConfig *network.NetworkConfig) {
|
||||
config.NetworkConfig = networkConfig
|
||||
networkStateChanged()
|
||||
networkStateChanged(false)
|
||||
|
||||
if mDNS != nil {
|
||||
_ = mDNS.SetListenOptions(networkConfig.GetMDNSMode())
|
||||
_ = mDNS.SetLocalNames([]string{
|
||||
networkState.GetHostname(),
|
||||
networkState.GetFQDN(),
|
||||
}, true)
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue