Skip to content

Commit

Permalink
add neko proxy env variable #107.
Browse files Browse the repository at this point in the history
  • Loading branch information
m1k1o committed Nov 19, 2023
1 parent 4fdf1b9 commit cdd0e4f
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 5 deletions.
2 changes: 2 additions & 0 deletions internal/types/room_api_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ var blacklistedEnvsV2 = []string{
"NEKO_TCPMUX",
"NEKO_NAT1TO1",
"NEKO_ICELITE",
"NEKO_PROXY",
}

func (settings *RoomSettings) toEnvV2(config *config.Room, ports PortSettings) []string {
env := []string{
fmt.Sprintf("NEKO_BIND=:%d", ports.FrontendPort),
"NEKO_ICELITE=true",
"NEKO_PROXY=true",

// from settings
fmt.Sprintf("NEKO_PASSWORD=%s", settings.UserPass),
Expand Down
2 changes: 2 additions & 0 deletions internal/types/room_api_v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ var blacklistedEnvsV3 = []string{

// ignore bunch of envs managed by neko-rooms
"NEKO_SERVER_BIND",
"NEKO_SERVER_PROXY",
"NEKO_SESSION_API_TOKEN",
"NEKO_MEMBER_PROVIDER",
"NEKO_WEBRTC_EPR",
Expand All @@ -41,6 +42,7 @@ func (settings *RoomSettings) toEnvV3(config *config.Room, ports PortSettings) [
env := []string{
fmt.Sprintf("NEKO_SERVER_BIND=:%d", ports.FrontendPort),
"NEKO_WEBRTC_ICELITE=true",
"NEKO_SERVER_PROXY=true",

// from settings
"NEKO_MEMBER_PROVIDER=multiuser",
Expand Down
5 changes: 4 additions & 1 deletion traefik/docker-compose.http.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ services:
- "--providers.docker.network=neko-rooms-traefik"
- "--entrypoints.web.address=:8080"
ports:
- "8080:8080"
- target: 8080
published: 8080
protocol: "tcp"
mode: "host"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
# OPTIONAL: Enable authentication.
Expand Down
12 changes: 9 additions & 3 deletions traefik/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ version: "3.5"

networks:
default:
attachable: "true"
attachable: true
name: "${NEKO_ROOMS_TRAEFIK_NETWORK}"

services:
Expand All @@ -17,8 +17,14 @@ services:
environment:
- "TZ"
ports:
- "80:80"
- "443:443"
- target: 80
published: 80
protocol: "tcp"
mode: "host"
- target: 443
published: 443
protocol: "tcp"
mode: "host"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./traefik.yml:/etc/traefik/traefik.yml:ro"
Expand Down
2 changes: 1 addition & 1 deletion traefik/nginx/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3.5"

networks:
default:
attachable: "true"
attachable: true
name: "neko-rooms-traefik"

services:
Expand Down
5 changes: 5 additions & 0 deletions traefik/traefik.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ entryPoints:
address: ":80"
websecure:
address: ":443"
forwardedHeaders:
trustedIPs:
- "10.0.0.0/8"
- "172.16.0.0/12"
- "192.168.0.0/16"

providers:
file:
Expand Down

0 comments on commit cdd0e4f

Please sign in to comment.