Skip to content

Commit 23f2dd9

Browse files
authored
Merge pull request #1 from raiden-staging/master
Clipboard Fix [Disabled host-only]
2 parents 96d9e8a + b232f31 commit 23f2dd9

File tree

10 files changed

+82
-72
lines changed

10 files changed

+82
-72
lines changed

.github/workflows/ghcr.yml

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,38 +19,39 @@ jobs:
1919
needs: build-base
2020
strategy:
2121
# Will build all images even if some fail.
22+
# kernel edit : chromium only now
2223
fail-fast: false
2324
matrix:
2425
include:
25-
- name: firefox
26-
platforms: linux/amd64,linux/arm64,linux/arm/v7
26+
#- name: firefox
27+
# platforms: linux/amd64,linux/arm64,linux/arm/v7
2728
# Temporarily disabled due to Cloudflare blocked download link
2829
#- name: waterfox
2930
# platforms: linux/amd64
3031
- name: chromium
3132
platforms: linux/amd64,linux/arm64,linux/arm/v7
32-
- name: google-chrome
33-
platforms: linux/amd64
34-
- name: ungoogled-chromium
35-
platforms: linux/amd64
36-
- name: microsoft-edge
37-
platforms: linux/amd64
38-
- name: brave
39-
platforms: linux/amd64,linux/arm64
40-
- name: vivaldi
41-
platforms: linux/amd64,linux/arm64,linux/arm/v7
42-
- name: opera
43-
platforms: linux/amd64
44-
- name: tor-browser
45-
platforms: linux/amd64
46-
- name: remmina
47-
platforms: linux/amd64,linux/arm64,linux/arm/v7
48-
- name: vlc
49-
platforms: linux/amd64,linux/arm64,linux/arm/v7
50-
- name: xfce
51-
platforms: linux/amd64,linux/arm64,linux/arm/v7
52-
- name: kde
53-
platforms: linux/amd64,linux/arm64,linux/arm/v7
33+
#- name: google-chrome
34+
# platforms: linux/amd64
35+
#- name: ungoogled-chromium
36+
# platforms: linux/amd64
37+
#- name: microsoft-edge
38+
# platforms: linux/amd64
39+
#- name: brave
40+
# platforms: linux/amd64,linux/arm64
41+
#- name: vivaldi
42+
# platforms: linux/amd64,linux/arm64,linux/arm/v7
43+
#- name: opera
44+
# platforms: linux/amd64
45+
#- name: tor-browser
46+
# platforms: linux/amd64
47+
#- name: remmina
48+
# platforms: linux/amd64,linux/arm64,linux/arm/v7
49+
#- name: vlc
50+
# platforms: linux/amd64,linux/arm64,linux/arm/v7
51+
#- name: xfce
52+
# platforms: linux/amd64,linux/arm64,linux/arm/v7
53+
#- name: kde
54+
# platforms: linux/amd64,linux/arm64,linux/arm/v7
5455
with:
5556
name: ${{ matrix.name }}
5657
platforms: ${{ matrix.platforms }}
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@ jobs:
2424
fail-fast: false
2525
matrix:
2626
include:
27-
- name: firefox
27+
#- name: firefox
2828
# Temporarily disabled due to Cloudflare blocked download link
2929
#- name: waterfox
3030
- name: chromium
31-
- name: google-chrome
32-
- name: ungoogled-chromium
33-
- name: microsoft-edge
34-
- name: brave
35-
- name: vivaldi
36-
- name: opera
37-
- name: tor-browser
38-
- name: remmina
39-
- name: vlc
40-
- name: xfce
41-
- name: kde
31+
#- name: google-chrome
32+
#- name: ungoogled-chromium
33+
#- name: microsoft-edge
34+
#- name: brave
35+
#- name: vivaldi
36+
#- name: opera
37+
#- name: tor-browser
38+
#- name: remmina
39+
#- name: vlc
40+
#- name: xfce
41+
#- name: kde
4242
with:
4343
name: ${{ matrix.name }}
4444
flavor: intel
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ jobs:
2424
fail-fast: false
2525
matrix:
2626
include:
27-
- name: firefox
28-
dockerfile: Dockerfile.nvidia
29-
- name: brave
30-
dockerfile: Dockerfile.nvidia
27+
#- name: firefox
28+
# dockerfile: Dockerfile.nvidia
29+
#- name: brave
30+
# dockerfile: Dockerfile.nvidia
3131
- name: chromium
3232
dockerfile: Dockerfile.nvidia
33-
- name: google-chrome
34-
dockerfile: Dockerfile.nvidia
35-
- name: microsoft-edge
36-
dockerfile: Dockerfile.nvidia
33+
#- name: google-chrome
34+
# dockerfile: Dockerfile.nvidia
35+
#- name: microsoft-edge
36+
# dockerfile: Dockerfile.nvidia
3737
with:
3838
name: ${{ matrix.name }}
3939
flavor: nvidia

.github/workflows/image_base.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
type=semver,pattern={{major}}
6262
type=sha,format=long
6363
64-
- name: Log in to the Container registry
64+
- name: Log in to the Container registry # needs GHCR_ACCESS_TOKEN in repo
6565
uses: docker/login-action@v3
6666
with:
6767
registry: ghcr.io

server/internal/api/room/control.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ func (h *RoomHandler) controlRequest(w http.ResponseWriter, r *http.Request) err
6161

6262
func (h *RoomHandler) controlRelease(w http.ResponseWriter, r *http.Request) error {
6363
session, _ := auth.GetSession(r)
64-
if !session.IsHost() {
65-
return utils.HttpUnprocessableEntity("session is not the host")
66-
}
64+
// if !session.IsHost() {
65+
// return utils.HttpUnprocessableEntity("session is not the host")
66+
// }
6767

6868
h.desktop.ResetKeys()
6969
session.ClearHost()

server/internal/config/session.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func (Session) Init(cmd *cobra.Command) error {
7575
return err
7676
}
7777

78-
cmd.PersistentFlags().Int("session.heartbeat_interval", 120, "interval in seconds for sending heartbeat messages")
78+
cmd.PersistentFlags().Int("session.heartbeat_interval", 10, "interval in seconds for sending heartbeat messages")
7979
if err := viper.BindPFlag("session.heartbeat_interval", cmd.PersistentFlags().Lookup("session.heartbeat_interval")); err != nil {
8080
return err
8181
}
@@ -140,7 +140,7 @@ func (Session) InitV2(cmd *cobra.Command) error {
140140
return err
141141
}
142142

143-
cmd.PersistentFlags().Int("heartbeat_interval", 120, "V2: heartbeat interval in seconds")
143+
cmd.PersistentFlags().Int("heartbeat_interval", 10, "V2: heartbeat interval in seconds")
144144
if err := viper.BindPFlag("heartbeat_interval", cmd.PersistentFlags().Lookup("heartbeat_interval")); err != nil {
145145
return err
146146
}

server/internal/websocket/handler/clipboard.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
package handler
22

33
import (
4-
"errors"
4+
// "errors"
55

66
"github.com/m1k1o/neko/server/pkg/types"
77
"github.com/m1k1o/neko/server/pkg/types/message"
88
)
99

1010
func (h *MessageHandlerCtx) clipboardSet(session types.Session, payload *message.ClipboardData) error {
11-
if !session.Profile().CanAccessClipboard {
12-
return errors.New("cannot access clipboard")
13-
}
11+
// Disabled: profile check
12+
// if !session.Profile().CanAccessClipboard {
13+
// return errors.New("cannot access clipboard")
14+
// }
1415

15-
if !session.IsHost() {
16-
return errors.New("is not the host")
17-
}
16+
// Disabled: is host check
17+
// if !session.IsHost() {
18+
// return errors.New("is not the host")
19+
// }
1820

1921
return h.desktop.ClipboardSetText(types.ClipboardText{
2022
Text: payload.Text,

server/internal/websocket/handler/control.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ var (
1717
)
1818

1919
func (h *MessageHandlerCtx) controlRelease(session types.Session) error {
20-
if !session.Profile().CanHost || session.PrivateModeEnabled() {
21-
return ErrIsNotAllowedToHost
22-
}
23-
24-
if !session.IsHost() {
25-
return ErrIsNotTheHost
26-
}
20+
// Disabled: profile check
21+
// if !session.Profile().CanHost || session.PrivateModeEnabled() {
22+
// return ErrIsNotAllowedToHost
23+
// }
24+
25+
// Disabled: is host check
26+
// if !session.IsHost() {
27+
// return ErrIsNotTheHost
28+
// }
2729

2830
h.desktop.ResetKeys()
2931
session.ClearHost()

server/internal/websocket/handler/handler.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package handler
22

33
import (
4+
"time"
45
"github.com/rs/zerolog"
56
"github.com/rs/zerolog/log"
67

@@ -38,7 +39,9 @@ func (h *MessageHandlerCtx) Message(session types.Session, data types.WebSocketM
3839
switch data.Event {
3940
// Client Events
4041
case event.CLIENT_HEARTBEAT:
41-
// do nothing
42+
session.Send("system/heartbeat", map[string]any{
43+
"timestamp": time.Now(),
44+
})
4245

4346
// System Events
4447
case event.SYSTEM_LOGS:

server/internal/websocket/handler/keyboard.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
package handler
22

33
import (
4-
"errors"
4+
// "errors"
55

66
"github.com/m1k1o/neko/server/pkg/types"
77
"github.com/m1k1o/neko/server/pkg/types/message"
88
)
99

1010
func (h *MessageHandlerCtx) keyboardMap(session types.Session, payload *message.KeyboardMap) error {
11-
if !session.IsHost() {
12-
return errors.New("is not the host")
13-
}
11+
// Disabled: is host check
12+
// if !session.IsHost() {
13+
// return errors.New("is not the host")
14+
// }
1415

1516
return h.desktop.SetKeyboardMap(payload.KeyboardMap)
1617
}
1718

1819
func (h *MessageHandlerCtx) keyboardModifiers(session types.Session, payload *message.KeyboardModifiers) error {
19-
if !session.IsHost() {
20-
return errors.New("is not the host")
21-
}
20+
// Disabled: is host check
21+
// if !session.IsHost() {
22+
// return errors.New("is not the host")
23+
// }
2224

2325
h.desktop.SetKeyboardModifiers(payload.KeyboardModifiers)
2426
return nil

0 commit comments

Comments
 (0)