mirror of
https://github.com/m1k1o/neko.git
synced 2025-04-29 18:36:22 +02:00
Compare commits
80 commits
v3.0.0-bet
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
0765352abd | ||
|
f145bd58c9 | ||
|
23820f6255 | ||
|
33ce337cd3 | ||
|
11cef143a3 | ||
|
73e61de52e | ||
|
01112c5e8f | ||
|
fc3b3a4dc6 | ||
|
a8cc365e0f | ||
|
c9ca4e7144 | ||
|
c1ccae4ac4 | ||
|
a46cb0536b | ||
|
b2219396dd | ||
|
2ec35d9d0c | ||
|
4eec843ed2 | ||
|
46e9b19e09 | ||
|
007b55a32b | ||
|
3c787baa40 | ||
|
b8bfcaf4bf | ||
|
6c5cd1260d | ||
|
b783a9adbe | ||
|
81c259cdc9 | ||
|
972d16031e | ||
|
3a8a5c30ef | ||
|
0e3bcedcd4 | ||
|
e3a1929f7f | ||
|
936794da31 | ||
|
1e91dcd7d9 | ||
|
a032c9f42e | ||
|
8b49fb7ca9 | ||
|
da35b05c9c | ||
|
4d6ad8e17d | ||
|
a75424d2f3 | ||
|
1c63b56b94 | ||
|
9eb4c36596 | ||
|
1f7d12b388 | ||
|
68e23fa8e7 | ||
|
ec44bf0e04 | ||
|
b383e1e24d | ||
|
0d62acfe04 | ||
|
d7e2e73945 | ||
|
a2ba96632c | ||
|
551a217c3f | ||
|
e566095cda | ||
|
fe94c999c6 | ||
|
dd412dd37f | ||
|
8061d5b182 | ||
|
31714f8448 | ||
|
295bbfde44 | ||
|
231238d21c | ||
|
f3c4e53450 | ||
|
3918f8f1e2 | ||
|
4aecc87852 | ||
|
bed6e3b675 | ||
|
b6742c92ce | ||
|
bfb917bbea | ||
|
2ee23a7de3 | ||
|
7d323f7a63 | ||
|
a9b8ef94a2 | ||
|
3d48850197 | ||
|
3de71dc038 | ||
|
9e9cd6f486 | ||
|
bd7f8a5126 | ||
|
5ce4820ef8 | ||
|
cab1e14b2b | ||
|
2a714aa1ec | ||
|
eba9821614 | ||
|
8b1bf1e6b1 | ||
|
0933235060 | ||
|
49015a81c4 | ||
|
518f41f9ff | ||
|
409a5f1426 | ||
|
3e8169f9dc | ||
|
060b868826 | ||
|
a5f06de65c | ||
|
2231b7a5a6 | ||
|
92ccd2d2d1 | ||
|
40db8f6602 | ||
|
dfc2e5505c | ||
|
212bf8a607 |
163 changed files with 2310 additions and 1106 deletions
6
.github/workflows/client_build.yml
vendored
6
.github/workflows/client_build.yml
vendored
|
@ -1,4 +1,4 @@
|
|||
name: Build and Publish Client Artifacts
|
||||
name: Build Client
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
@ -14,8 +14,8 @@ on:
|
|||
the artifacts.
|
||||
|
||||
jobs:
|
||||
client_build:
|
||||
name: Build and Publish Client Artifacts
|
||||
build-client:
|
||||
name: Build Client
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
|
|
6
.github/workflows/client_test.yml
vendored
6
.github/workflows/client_test.yml
vendored
|
@ -1,4 +1,4 @@
|
|||
name: Test Client Build
|
||||
name: Test Client
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
@ -10,8 +10,8 @@ on:
|
|||
- .github/workflows/client_test.yml
|
||||
|
||||
jobs:
|
||||
client_test:
|
||||
name: Test Client Build
|
||||
test-client:
|
||||
name: Test Client
|
||||
uses: ./.github/workflows/client_build.yml
|
||||
with:
|
||||
# Do not upload artifacts for test builds
|
||||
|
|
130
.github/workflows/dockerhub.yml
vendored
130
.github/workflows/dockerhub.yml
vendored
|
@ -1,8 +1,11 @@
|
|||
name: "build and push amd64 images to Docker Hub"
|
||||
name: Build and Push to Docker Hub
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches:
|
||||
- master
|
||||
paths-ignore:
|
||||
- 'webpage/**'
|
||||
#
|
||||
# Run this action periodically to keep browsers up-to-date
|
||||
# even if there is no activity in this repo.
|
||||
|
@ -10,34 +13,61 @@ on:
|
|||
schedule:
|
||||
- cron: "43 2 * * 1"
|
||||
|
||||
# allow only one workflow to run at a time
|
||||
# and cancel in-progress jobs if a new one is triggered
|
||||
concurrency:
|
||||
group: "dockerhub"
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
DOCKER_IMAGE: m1k1o/neko
|
||||
|
||||
jobs:
|
||||
build-base:
|
||||
name: Base Image
|
||||
runs-on: ubuntu-latest
|
||||
#
|
||||
# do not run on forks
|
||||
#
|
||||
if: github.repository_owner == 'm1k1o'
|
||||
steps:
|
||||
- name: Check Out Repo
|
||||
uses: actions/checkout@v2
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
uses: docker/metadata-action@v5
|
||||
id: meta
|
||||
with:
|
||||
images: ${{ env.DOCKER_IMAGE }}
|
||||
tags: |
|
||||
type=raw,value=base
|
||||
|
||||
- name: Login to Docker Hub
|
||||
run: |
|
||||
docker login --username "${DOCKER_USERNAME}" --password-stdin "${DOCKER_REGISTRY}" <<< "${DOCKER_TOKEN}"
|
||||
env:
|
||||
DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }}
|
||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.DOCKER_TOKEN }}
|
||||
|
||||
- name: Build base
|
||||
run: |
|
||||
./build -b ${DOCKER_IMAGE}:base
|
||||
docker push ${DOCKER_IMAGE}:base
|
||||
- name: Generate base Dockerfile
|
||||
run: go run utils/docker/main.go -i Dockerfile.tmpl -o Dockerfile
|
||||
|
||||
build:
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ./
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
build-app:
|
||||
name: App Image
|
||||
runs-on: ubuntu-latest
|
||||
#
|
||||
# do not run on forks
|
||||
|
@ -48,30 +78,54 @@ jobs:
|
|||
# Will build all images even if some fail.
|
||||
fail-fast: false
|
||||
matrix:
|
||||
tags: [ firefox, waterfox, chromium, google-chrome, ungoogled-chromium, microsoft-edge, brave, vivaldi, opera, tor-browser, remmina, vlc, xfce, kde ]
|
||||
env:
|
||||
DOCKER_TAG: ${{ matrix.tags }}
|
||||
tag:
|
||||
- firefox
|
||||
# Temporarily disabled due to Cloudflare blocked download link
|
||||
#- waterfox
|
||||
- chromium
|
||||
- google-chrome
|
||||
- ungoogled-chromium
|
||||
- microsoft-edge
|
||||
- brave
|
||||
- vivaldi
|
||||
- opera
|
||||
- tor-browser
|
||||
- remmina
|
||||
- vlc
|
||||
- xfce
|
||||
- kde
|
||||
steps:
|
||||
- name: Check Out Repo
|
||||
uses: actions/checkout@v2
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
uses: docker/metadata-action@v5
|
||||
id: meta
|
||||
with:
|
||||
images: ${{ env.DOCKER_IMAGE }}
|
||||
tags: |
|
||||
type=raw,value=latest,enable=${{ matrix.tag == 'firefox' }}
|
||||
type=raw,value=${{ matrix.tag }}
|
||||
|
||||
- name: Login to Docker Hub
|
||||
run: |
|
||||
docker login --username "${DOCKER_USERNAME}" --password-stdin "${DOCKER_REGISTRY}" <<< "${DOCKER_TOKEN}"
|
||||
env:
|
||||
DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }}
|
||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.DOCKER_TOKEN }}
|
||||
|
||||
- name: Build container
|
||||
run: |
|
||||
./build -b ${DOCKER_IMAGE}:base -i ${DOCKER_IMAGE}
|
||||
docker tag ${DOCKER_IMAGE}/${DOCKER_TAG} ${DOCKER_IMAGE}:${DOCKER_TAG}
|
||||
docker push ${DOCKER_IMAGE}:${DOCKER_TAG}
|
||||
|
||||
- name: Push latest tag
|
||||
if: ${{ matrix.tags == 'firefox' }}
|
||||
run: |
|
||||
docker pull ${DOCKER_IMAGE}:${DOCKER_TAG}
|
||||
docker tag ${DOCKER_IMAGE}:${DOCKER_TAG} ${DOCKER_IMAGE}:latest
|
||||
docker push ${DOCKER_IMAGE}:latest
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: apps/${{ matrix.tag }}
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: |
|
||||
BASE_IMAGE=${{ env.DOCKER_IMAGE }}:base
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
|
19
.github/workflows/ghcr.yml
vendored
19
.github/workflows/ghcr.yml
vendored
|
@ -7,14 +7,14 @@ on:
|
|||
|
||||
jobs:
|
||||
build-base:
|
||||
name: Build Base Image
|
||||
name: Base Image
|
||||
uses: ./.github/workflows/image_base.yml
|
||||
with:
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||
secrets: inherit
|
||||
|
||||
build-apps:
|
||||
name: Build Apps Image
|
||||
build-app:
|
||||
name: App Image
|
||||
uses: ./.github/workflows/image_app.yml
|
||||
needs: build-base
|
||||
strategy:
|
||||
|
@ -24,8 +24,9 @@ jobs:
|
|||
include:
|
||||
- name: firefox
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||
- name: waterfox
|
||||
platforms: linux/amd64
|
||||
# Temporarily disabled due to Cloudflare blocked download link
|
||||
#- name: waterfox
|
||||
# platforms: linux/amd64
|
||||
- name: chromium
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||
- name: google-chrome
|
||||
|
@ -35,21 +36,21 @@ jobs:
|
|||
- name: microsoft-edge
|
||||
platforms: linux/amd64
|
||||
- name: brave
|
||||
platforms: linux/amd64
|
||||
platforms: linux/amd64,linux/arm64
|
||||
- name: vivaldi
|
||||
platforms: linux/amd64
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||
- name: opera
|
||||
platforms: linux/amd64
|
||||
- name: tor-browser
|
||||
platforms: linux/amd64
|
||||
- name: remmina
|
||||
platforms: linux/amd64
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||
- name: vlc
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||
- name: xfce
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||
- name: kde
|
||||
platforms: linux/amd64
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||
with:
|
||||
name: ${{ matrix.name }}
|
||||
platforms: ${{ matrix.platforms }}
|
||||
|
|
11
.github/workflows/ghcr_intel.yml
vendored
11
.github/workflows/ghcr_intel.yml
vendored
|
@ -7,7 +7,7 @@ on:
|
|||
|
||||
jobs:
|
||||
build-base:
|
||||
name: Build Base Image
|
||||
name: Base Image
|
||||
uses: ./.github/workflows/image_base.yml
|
||||
with:
|
||||
flavor: intel
|
||||
|
@ -15,8 +15,8 @@ jobs:
|
|||
dockerfile: Dockerfile.intel
|
||||
secrets: inherit
|
||||
|
||||
build-apps:
|
||||
name: Build Apps Image
|
||||
build-app:
|
||||
name: App Image
|
||||
uses: ./.github/workflows/image_app.yml
|
||||
needs: build-base
|
||||
strategy:
|
||||
|
@ -25,7 +25,8 @@ jobs:
|
|||
matrix:
|
||||
include:
|
||||
- name: firefox
|
||||
- name: waterfox
|
||||
# Temporarily disabled due to Cloudflare blocked download link
|
||||
#- name: waterfox
|
||||
- name: chromium
|
||||
- name: google-chrome
|
||||
- name: ungoogled-chromium
|
||||
|
@ -41,6 +42,6 @@ jobs:
|
|||
with:
|
||||
name: ${{ matrix.name }}
|
||||
flavor: intel
|
||||
platforms: linux/amd64
|
||||
platforms: ${{ matrix.platforms }}
|
||||
dockerfile: ${{ matrix.dockerfile }}
|
||||
secrets: inherit
|
||||
|
|
8
.github/workflows/ghcr_nvidia.yml
vendored
8
.github/workflows/ghcr_nvidia.yml
vendored
|
@ -7,7 +7,7 @@ on:
|
|||
|
||||
jobs:
|
||||
build-base:
|
||||
name: Build Base Image
|
||||
name: Base Image
|
||||
uses: ./.github/workflows/image_base.yml
|
||||
with:
|
||||
flavor: nvidia
|
||||
|
@ -15,8 +15,8 @@ jobs:
|
|||
dockerfile: Dockerfile.nvidia
|
||||
secrets: inherit
|
||||
|
||||
build-apps:
|
||||
name: Build Apps Image
|
||||
build-app:
|
||||
name: App Image
|
||||
uses: ./.github/workflows/image_app.yml
|
||||
needs: build-base
|
||||
strategy:
|
||||
|
@ -37,6 +37,6 @@ jobs:
|
|||
with:
|
||||
name: ${{ matrix.name }}
|
||||
flavor: nvidia
|
||||
platforms: linux/amd64
|
||||
platforms: ${{ matrix.platforms }}
|
||||
dockerfile: ${{ matrix.dockerfile }}
|
||||
secrets: inherit
|
||||
|
|
9
.github/workflows/image_app.yml
vendored
9
.github/workflows/image_app.yml
vendored
|
@ -1,4 +1,4 @@
|
|||
name: Build and Publish Application Image
|
||||
name: Build App Image
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
@ -6,7 +6,7 @@ on:
|
|||
name:
|
||||
required: true
|
||||
type: string
|
||||
description: "The name of the application to build."
|
||||
description: "The name of the app to build."
|
||||
flavor:
|
||||
required: false
|
||||
type: string
|
||||
|
@ -28,7 +28,7 @@ env:
|
|||
|
||||
jobs:
|
||||
build-app:
|
||||
name: Build and Publish Application Image
|
||||
name: Build App Image
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
@ -48,6 +48,7 @@ jobs:
|
|||
with:
|
||||
images: ghcr.io/${{ github.repository }}/${{ env.FLAVOR_PREFIX }}${{ inputs.name }}
|
||||
tags: |
|
||||
type=edge,branch=master
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
|
@ -71,3 +72,5 @@ jobs:
|
|||
build-args: |
|
||||
BASE_IMAGE=ghcr.io/${{ github.repository }}/${{ env.FLAVOR_PREFIX }}base:sha-${{ github.sha }}
|
||||
platforms: ${{ inputs.platforms || 'linux/amd64' }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
|
10
.github/workflows/image_base.yml
vendored
10
.github/workflows/image_base.yml
vendored
|
@ -1,4 +1,4 @@
|
|||
name: Build and Publish Base Image
|
||||
name: Build Base Image
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
@ -24,10 +24,11 @@ env:
|
|||
|
||||
jobs:
|
||||
build-client:
|
||||
name: Build Client Artifacts
|
||||
uses: ./.github/workflows/client_build.yml
|
||||
|
||||
build-base:
|
||||
name: Build and Publish Base Image
|
||||
name: Build Base Image
|
||||
runs-on: ubuntu-latest
|
||||
needs: build-client
|
||||
steps:
|
||||
|
@ -54,6 +55,7 @@ jobs:
|
|||
with:
|
||||
images: ghcr.io/${{ github.repository }}/${{ env.FLAVOR_PREFIX }}base
|
||||
tags: |
|
||||
type=edge,branch=master
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
|
@ -69,7 +71,7 @@ jobs:
|
|||
- name: Generate base Dockerfile
|
||||
env:
|
||||
RUNTIME_DOCKERFILE: ${{ inputs.dockerfile || 'Dockerfile' }}
|
||||
run: go run docker/main.go -i Dockerfile.tmpl -o Dockerfile -client client/dist
|
||||
run: go run utils/docker/main.go -i Dockerfile.tmpl -o Dockerfile -client client/dist
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
|
@ -79,3 +81,5 @@ jobs:
|
|||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
platforms: ${{ inputs.platforms || 'linux/amd64' }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
|
10
.github/workflows/server_test.yml
vendored
10
.github/workflows/server_test.yml
vendored
|
@ -1,4 +1,4 @@
|
|||
name: Test Server Build
|
||||
name: Test Server
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
@ -9,8 +9,8 @@ on:
|
|||
- .github/workflows/server_test.yml
|
||||
|
||||
jobs:
|
||||
server-test-amd64:
|
||||
name: Test Server Build AMD64
|
||||
build-amd64:
|
||||
name: Build amd64
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
|
@ -26,8 +26,8 @@ jobs:
|
|||
context: ./server
|
||||
platforms: linux/amd64
|
||||
|
||||
server-test-arm64:
|
||||
name: Test Server Build ARM64
|
||||
build-arm64:
|
||||
name: Build arm64
|
||||
runs-on: ubuntu-24.04-arm
|
||||
permissions:
|
||||
contents: read
|
||||
|
|
6
.github/workflows/webpage_build.yml
vendored
6
.github/workflows/webpage_build.yml
vendored
|
@ -1,4 +1,4 @@
|
|||
name: Build and Publish Webpage Artifacts
|
||||
name: Build Webpage
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
@ -14,8 +14,8 @@ on:
|
|||
the artifacts.
|
||||
|
||||
jobs:
|
||||
webpage-build:
|
||||
name: Build and Publish Webpage Artifacts
|
||||
build-webpage:
|
||||
name: Build Webpage
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
|
|
29
.github/workflows/webpage_deploy.yml
vendored
29
.github/workflows/webpage_deploy.yml
vendored
|
@ -1,6 +1,7 @@
|
|||
name: Build and Deploy Webpage to GitHub Pages
|
||||
|
||||
on:
|
||||
# Runs on pushes targeting the default branch
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
@ -9,20 +10,30 @@ on:
|
|||
- .github/workflows/webpage_build.yml
|
||||
- .github/workflows/webpage_deploy.yml
|
||||
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
|
||||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
|
||||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
|
||||
concurrency:
|
||||
group: "pages"
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
webpage-build:
|
||||
name: Build Webpage Artifacts
|
||||
build-webpage:
|
||||
name: Build Webpage
|
||||
uses: ./.github/workflows/webpage_build.yml
|
||||
secrets: inherit
|
||||
|
||||
webpage-deploy:
|
||||
deploy-webpage:
|
||||
name: Deploy to GitHub Pages
|
||||
needs: webpage-build
|
||||
|
||||
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
|
||||
permissions:
|
||||
pages: write # to deploy to Pages
|
||||
id-token: write # to verify the deployment originates from an appropriate source
|
||||
needs: build-webpage
|
||||
|
||||
# Deploy to the github-pages environment
|
||||
environment:
|
||||
|
|
6
.github/workflows/webpage_test.yml
vendored
6
.github/workflows/webpage_test.yml
vendored
|
@ -1,4 +1,4 @@
|
|||
name: Test Webpage Build
|
||||
name: Test Webpage
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
@ -10,8 +10,8 @@ on:
|
|||
- .github/workflows/webpage_test.yml
|
||||
|
||||
jobs:
|
||||
webpage-test:
|
||||
name: Test Webpage Build
|
||||
test-webpage:
|
||||
name: Test Webpage
|
||||
uses: ./.github/workflows/webpage_build.yml
|
||||
with:
|
||||
# Do not upload artifacts for test builds
|
||||
|
|
|
@ -1,14 +1,17 @@
|
|||
# This Dockerfile is pre-processed by the ./docker script, it is not meant to be used directly.
|
||||
# This Dockerfile is pre-processed by the ./utils/docker script, it is not meant to be used directly.
|
||||
|
||||
FROM ./runtime/xorg-deps/ AS xorg-deps
|
||||
FROM ./server/ AS server
|
||||
FROM ./client/ AS client
|
||||
FROM ./utils/xorg-deps/ AS xorg-deps
|
||||
FROM ./runtime/$RUNTIME_DOCKERFILE AS runtime
|
||||
|
||||
COPY --from=xorg-deps /usr/local/lib/xorg/modules/drivers/dummy_drv.so /usr/lib/xorg/modules/drivers/dummy_drv.so
|
||||
COPY --from=xorg-deps /usr/local/lib/xorg/modules/input/neko_drv.so /usr/lib/xorg/modules/input/neko_drv.so
|
||||
# tells neko-rooms which version of the API to use
|
||||
LABEL net.m1k1o.neko.api-version=3
|
||||
|
||||
COPY --from=server /src/bin/plugins/ /etc/neko/plugins/
|
||||
COPY --from=server /src/bin/neko /usr/bin/neko
|
||||
COPY --from=client /src/dist/ /var/www
|
||||
COPY --from=xorg-deps /usr/local/lib/xorg/modules/drivers/dummy_drv.so /usr/lib/xorg/modules/drivers/dummy_drv.so
|
||||
COPY --from=xorg-deps /usr/local/lib/xorg/modules/input/neko_drv.so /usr/lib/xorg/modules/input/neko_drv.so
|
||||
|
||||
COPY config.yml /etc/neko/neko.yaml
|
||||
|
|
118
README.md
118
README.md
|
@ -1,6 +1,6 @@
|
|||
<div align="center">
|
||||
<a href="https://github.com/m1k1o/neko" title="Neko's Github repository.">
|
||||
<img src="https://raw.githubusercontent.com/m1k1o/neko/master/docs/_media/logo.png" width="400" height="auto"/>
|
||||
<img src="https://neko.m1k1o.net/img/logo.png" width="400" height="auto"/>
|
||||
</a>
|
||||
<p align="center">
|
||||
<a href="https://github.com/m1k1o/neko/releases">
|
||||
|
@ -21,11 +21,14 @@
|
|||
<a href="https://discord.gg/3U6hWpC">
|
||||
<img src="https://discordapp.com/api/guilds/665851821906067466/widget.png" alt="Chat on discord">
|
||||
</a>
|
||||
<a href="https://hellogithub.com/repository/4536d4546af24196af3f08a023dfa007" target="_blank">
|
||||
<img src="https://abroad.hellogithub.com/v1/widgets/recommend.svg?rid=4536d4546af24196af3f08a023dfa007&claim_uid=0x19e4dJwD83aW2&theme=small" alt="Featured|HelloGitHub" />
|
||||
</a>
|
||||
<a href="https://github.com/m1k1o/neko/actions">
|
||||
<img src="https://github.com/m1k1o/neko/actions/workflows/ghcr-amd.yml/badge.svg" alt="build">
|
||||
<img src="https://github.com/m1k1o/neko/actions/workflows/ghcr.yml/badge.svg" alt="build">
|
||||
</a>
|
||||
</p>
|
||||
<img src="https://raw.githubusercontent.com/m1k1o/neko/master/docs/_media/intro.gif" width="650" height="auto"/>
|
||||
<img src="https://neko.m1k1o.net/img/intro.gif" width="650" height="auto"/>
|
||||
</div>
|
||||
|
||||
# n.eko
|
||||
|
@ -83,47 +86,60 @@ Compared to clientless remote desktop gateway (e.g. [Apache Guacamole](https://g
|
|||
### Supported browsers
|
||||
|
||||
<div align="center">
|
||||
<img src="https://raw.githubusercontent.com/m1k1o/neko/master/docs/_media/icons/firefox.svg" title="m1k1o/neko:firefox" width="60" height="auto"/>
|
||||
<img src="https://raw.githubusercontent.com/m1k1o/neko/master/docs/_media/icons/google-chrome.svg" title="m1k1o/neko:google-chrome" width="60" height="auto"/>
|
||||
<img src="https://raw.githubusercontent.com/m1k1o/neko/master/docs/_media/icons/chromium.svg" title="m1k1o/neko:chromium" width="60" height="auto"/>
|
||||
<img src="https://raw.githubusercontent.com/m1k1o/neko/master/docs/_media/icons/microsoft-edge.svg" title="m1k1o/neko:microsoft-edge" width="60" height="auto"/>
|
||||
<img src="https://raw.githubusercontent.com/m1k1o/neko/master/docs/_media/icons/brave.svg" title="m1k1o/neko:brave" width="60" height="auto"/>
|
||||
<img src="https://raw.githubusercontent.com/m1k1o/neko/master/docs/_media/icons/vivaldi.svg" title="m1k1o/neko:vivaldi" width="60" height="auto"/>
|
||||
<img src="https://raw.githubusercontent.com/m1k1o/neko/master/docs/_media/icons/opera.svg" title="m1k1o/neko:opera" width="60" height="auto"/>
|
||||
<img src="https://raw.githubusercontent.com/m1k1o/neko/master/docs/_media/icons/tor-browser.svg" title="m1k1o/neko:tor-browser" width="60" height="auto"/>
|
||||
<a href="https://neko.m1k1o.net/docs/v3/installation/docker-images#firefox">
|
||||
<img src="https://neko.m1k1o.net/img/icons/firefox.svg" title="ghcr.io/m1k1o/neko/firefox" width="60" height="auto"/>
|
||||
</a>
|
||||
<a href="https://neko.m1k1o.net/docs/v3/installation/docker-images#tor-browser">
|
||||
<img src="https://neko.m1k1o.net/img/icons/tor-browser.svg" title="ghcr.io/m1k1o/neko/tor-browser" width="60" height="auto"/>
|
||||
</a>
|
||||
<a href="https://neko.m1k1o.net/docs/v3/installation/docker-images#waterfox">
|
||||
<img src="https://neko.m1k1o.net/img/icons/waterfox.svg" title="ghcr.io/m1k1o/neko/waterfox" width="60" height="auto"/>
|
||||
</a>
|
||||
<a href="https://neko.m1k1o.net/docs/v3/installation/docker-images#chromium">
|
||||
<img src="https://neko.m1k1o.net/img/icons/chromium.svg" title="ghcr.io/m1k1o/neko/chromium" width="60" height="auto"/>
|
||||
</a>
|
||||
<a href="https://neko.m1k1o.net/docs/v3/installation/docker-images#google-chrome">
|
||||
<img src="https://neko.m1k1o.net/img/icons/google-chrome.svg" title="ghcr.io/m1k1o/neko/google-chrome" width="60" height="auto"/>
|
||||
</a>
|
||||
<a href="https://neko.m1k1o.net/docs/v3/installation/docker-images#ungoogled-chromium">
|
||||
<img src="https://neko.m1k1o.net/img/icons/ungoogled-chromium.svg" title="ghcr.io/m1k1o/neko/google-chrome" width="60" height="auto"/>
|
||||
</a>
|
||||
<a href="https://neko.m1k1o.net/docs/v3/installation/docker-images#microsoft-edge">
|
||||
<img src="https://neko.m1k1o.net/img/icons/microsoft-edge.svg" title="ghcr.io/m1k1o/neko/microsoft-edge" width="60" height="auto"/>
|
||||
</a>
|
||||
<a href="https://neko.m1k1o.net/docs/v3/installation/docker-images#brave">
|
||||
<img src="https://neko.m1k1o.net/img/icons/brave.svg" title="ghcr.io/m1k1o/neko/brave" width="60" height="auto"/>
|
||||
</a>
|
||||
<a href="https://neko.m1k1o.net/docs/v3/installation/docker-images#vivaldi">
|
||||
<img src="https://neko.m1k1o.net/img/icons/vivaldi.svg" title="ghcr.io/m1k1o/neko/vivaldi" width="60" height="auto"/>
|
||||
</a>
|
||||
<a href="https://neko.m1k1o.net/docs/v3/installation/docker-images#opera">
|
||||
<img src="https://neko.m1k1o.net/img/icons/opera.svg" title="ghcr.io/m1k1o/neko/opera" width="60" height="auto"/>
|
||||
</a>
|
||||
|
||||
... see [all available images](https://neko.m1k1o.net/docs/v3/installation/docker-images)
|
||||
</div>
|
||||
|
||||
### Other programs
|
||||
### Other applications
|
||||
|
||||
<div align="center">
|
||||
<img src="https://raw.githubusercontent.com/m1k1o/neko/master/docs/_media/icons/remmina.png" title="m1k1o/neko:remmina" width="60" height="auto"/>
|
||||
<img src="https://raw.githubusercontent.com/m1k1o/neko/master/docs/_media/icons/vlc.svg" title="m1k1o/neko:vlc" width="60" height="auto"/>
|
||||
<img src="https://raw.githubusercontent.com/m1k1o/neko/master/docs/_media/icons/xfce.svg" title="m1k1o/neko:xfce" width="60" height="auto"/>
|
||||
<img src="https://raw.githubusercontent.com/m1k1o/neko/master/docs/_media/icons/kde.svg" title="m1k1o/neko:kde" width="60" height="auto"/>
|
||||
<a href="https://neko.m1k1o.net/docs/v3/installation/docker-images#xfce">
|
||||
<img src="https://neko.m1k1o.net/img/icons/xfce.svg" title="ghcr.io/m1k1o/neko/xfce" width="60" height="auto"/>
|
||||
</a>
|
||||
<a href="https://neko.m1k1o.net/docs/v3/installation/docker-images#kde">
|
||||
<img src="https://neko.m1k1o.net/img/icons/kde.svg" title="ghcr.io/m1k1o/neko/kde" width="60" height="auto"/>
|
||||
</a>
|
||||
<a href="https://neko.m1k1o.net/docs/v3/installation/docker-images#remmina">
|
||||
<img src="https://neko.m1k1o.net/img/icons/remmina.svg" title="ghcr.io/m1k1o/neko/remmina" width="60" height="auto"/>
|
||||
</a>
|
||||
<a href="https://neko.m1k1o.net/docs/v3/installation/docker-images#vlc">
|
||||
<img src="https://neko.m1k1o.net/img/icons/vlc.svg" title="ghcr.io/m1k1o/neko/vlc" width="60" height="auto"/>
|
||||
</a>
|
||||
|
||||
... others in <a href="https://github.com/m1k1o/neko-apps">m1k1o/neko-apps</a>
|
||||
</div>
|
||||
|
||||
### Features
|
||||
|
||||
* Text Chat (With basic markdown support, discord flavor)
|
||||
* Admin users (Kick, Ban & Force Give/Release Controls, Lock room)
|
||||
* Clipboard synchronization (on [supported browsers](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/readText))
|
||||
* Emote overlay
|
||||
* Ignore user (chat and emotes)
|
||||
* Persistent settings
|
||||
* Automatic Login with custom url args. (add `?usr=<your-user-name>&pwd=<room-pass>` to the url.)
|
||||
* Broadcasting room content using RTMP (to e.g. twitch or youtube...)
|
||||
* Bidirectional file transfer (if enabled)
|
||||
|
||||
<div align="center">
|
||||
|
||||
With `NEKO_FILE_TRANSFER_ENABLED=true`:
|
||||
|
||||
<img src="https://raw.githubusercontent.com/m1k1o/neko/master/docs/_media/file-transfer.gif" width="650" height="auto"/>
|
||||
</div>
|
||||
|
||||
### Why n.eko?
|
||||
### Why neko?
|
||||
|
||||
I like cats 🐱 (`Neko` is the Japanese word for cat), I'm a weeb/nerd.
|
||||
|
||||
|
@ -131,28 +147,26 @@ I like cats 🐱 (`Neko` is the Japanese word for cat), I'm a weeb/nerd.
|
|||
|
||||
## Multiple rooms
|
||||
|
||||
For n.eko room management software, visit [neko-rooms](https://github.com/m1k1o/neko-rooms).
|
||||
For neko room management software, visit [neko-rooms](https://github.com/m1k1o/neko-rooms).
|
||||
|
||||
It also offers zero-knowledge [installation script (with HTTPS and Traefik)](https://github.com/m1k1o/neko-rooms/#zero-knowledge-installation-with-https-and-traefik).
|
||||
It also offers [Zero-knowledge installation (with HTTPS)](https://github.com/m1k1o/neko-rooms/?tab=readme-ov-file#zero-knowledge-installation-with-https).
|
||||
|
||||
## Documentation
|
||||
|
||||
* [Getting Started](https://neko.m1k1o.net/#/getting-started/)
|
||||
* [Quick Start](https://neko.m1k1o.net/#/getting-started/quick-start)
|
||||
* [Examples](https://neko.m1k1o.net/#/getting-started/examples)
|
||||
* [Reverse Proxy](https://neko.m1k1o.net/#/getting-started/reverse-proxy)
|
||||
* [Configuration](https://neko.m1k1o.net/#/getting-started/configuration)
|
||||
* [Troubleshooting](https://neko.m1k1o.net/#/getting-started/troubleshooting)
|
||||
* [Mobile Support](https://neko.m1k1o.net/#/mobile-support)
|
||||
* [Contributing](https://neko.m1k1o.net/#/contributing)
|
||||
* [Non Goals](https://neko.m1k1o.net/#/non-goals)
|
||||
* [Technologies](https://neko.m1k1o.net/#/technologies)
|
||||
* [Changelog](https://neko.m1k1o.net/#/changelog)
|
||||
Full documentation is available at [neko.m1k1o.net](https://neko.m1k1o.net/). Key sections include:
|
||||
|
||||
## How to contribute? How to build?
|
||||
- [Migration from V2](https://neko.m1k1o.net/docs/v3/migration-from-v2)
|
||||
- [Getting Started](https://neko.m1k1o.net/docs/v3/quick-start)
|
||||
- [Installation](https://neko.m1k1o.net/docs/v3/installation)
|
||||
- [Examples](https://neko.m1k1o.net/docs/v3/installation/examples)
|
||||
- [Configuration](https://neko.m1k1o.net/docs/v3/configuration)
|
||||
- [Frequently Asked Questions](https://neko.m1k1o.net/docs/v3/faq)
|
||||
- [Troubleshooting](https://neko.m1k1o.net/docs/v3/troubleshooting)
|
||||
|
||||
Navigate to [.docker](.docker) folder for further information.
|
||||
## How to Contribute
|
||||
|
||||
Contributions are welcome! Check the [Contributing Guide](https://neko.m1k1o.net/contributing) for details.
|
||||
|
||||
## Support
|
||||
|
||||
If you want to support this project, you can do it [here](https://github.com/sponsors/m1k1o).
|
||||
If you find Neko useful, consider supporting the project via [GitHub Sponsors](https://github.com/sponsors/m1k1o).
|
||||
|
|
19
SECURITY.md
Normal file
19
SECURITY.md
Normal file
|
@ -0,0 +1,19 @@
|
|||
# Security Policy
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
If there are any vulnerabilities in **m1k1o/neko**, don't hesitate to _report them_.
|
||||
|
||||
1. Send an email to `security@m1k1o.net`.
|
||||
|
||||
2. Describe the vulnerability.
|
||||
|
||||
If you have a fix, that is most welcome -- please attach or summarize it in your message!
|
||||
|
||||
3. We will evaluate the vulnerability and, if necessary, release a fix or mitigating steps to address it. We will contact you to let you know the outcome, and will credit you in the report.
|
||||
|
||||
Please **do not disclose the vulnerability publicly** until a fix is released!
|
||||
|
||||
4. Once we have either a) published a fix, or b) declined to address the vulnerability for whatever reason, you are free to publicly disclose it.
|
||||
|
||||
We appreciate your help in keeping Neko secure.
|
|
@ -1,12 +1,13 @@
|
|||
ARG BASE_IMAGE=m1k1o/neko:base
|
||||
ARG BASE_IMAGE=ghcr.io/m1k1o/neko/base:latest
|
||||
FROM $BASE_IMAGE
|
||||
|
||||
RUN set -eux; apt-get update; \
|
||||
apt-get install -y --no-install-recommends apt-transport-https curl openbox; \
|
||||
#
|
||||
# install brave browser
|
||||
ARCH=$(dpkg --print-architecture); \
|
||||
curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg; \
|
||||
echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main" \
|
||||
echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=${ARCH}] https://brave-browser-apt-release.s3.brave.com/ stable main" \
|
||||
| tee /etc/apt/sources.list.d/brave-browser-release.list; \
|
||||
apt-get update; \
|
||||
apt-get install -y --no-install-recommends brave-browser; \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
ARG BASE_IMAGE=m1k1o/neko:nvidia-base
|
||||
ARG BASE_IMAGE=ghcr.io/m1k1o/neko/nvidia-base:latest
|
||||
FROM $BASE_IMAGE
|
||||
|
||||
RUN set -eux; apt-get update; \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
ARG BASE_IMAGE=m1k1o/neko:base
|
||||
ARG BASE_IMAGE=ghcr.io/m1k1o/neko/base:latest
|
||||
FROM $BASE_IMAGE
|
||||
|
||||
#
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
ARG BASE_IMAGE=m1k1o/neko:base
|
||||
ARG BASE_IMAGE=ghcr.io/m1k1o/neko/nvidia-base:latest
|
||||
FROM $BASE_IMAGE
|
||||
|
||||
#
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
ARG BASE_IMAGE=m1k1o/neko:base
|
||||
ARG BASE_IMAGE=ghcr.io/m1k1o/neko/base:latest
|
||||
FROM $BASE_IMAGE
|
||||
|
||||
#
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
ARG BASE_IMAGE=m1k1o/neko:base
|
||||
ARG BASE_IMAGE=ghcr.io/m1k1o/neko/nvidia-base:latest
|
||||
FROM $BASE_IMAGE
|
||||
|
||||
ARG SRC_URL="https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=en-US"
|
||||
|
|
|
@ -15,8 +15,8 @@ lockPref("plugins.hide_infobar_for_missing_plugin", true);
|
|||
lockPref("profile.allow_automigration", false);
|
||||
lockPref("signon.prefillForms", false);
|
||||
lockPref("signon.rememberSignons", false);
|
||||
lockPref("xpinstall.enabled", false);
|
||||
lockPref("xpinstall.whitelist.required", true);
|
||||
//lockPref("xpinstall.enabled", false);
|
||||
//lockPref("xpinstall.whitelist.required", true);
|
||||
lockPref("browser.download.manager.retention", 0);
|
||||
lockPref("browser.download.folderList", 2);
|
||||
lockPref("browser.download.forbid_open_with", true);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
ARG BASE_IMAGE=m1k1o/neko:base
|
||||
ARG BASE_IMAGE=ghcr.io/m1k1o/neko/base:latest
|
||||
FROM $BASE_IMAGE
|
||||
|
||||
ARG SRC_URL="https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
ARG BASE_IMAGE=m1k1o/neko:nvidia-base
|
||||
ARG BASE_IMAGE=ghcr.io/m1k1o/neko/nvidia-base:latest
|
||||
FROM $BASE_IMAGE
|
||||
|
||||
# latest working version with EGL: 111.0.5563.146, revert when resolved
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
ARG BASE_IMAGE=m1k1o/neko:base
|
||||
ARG BASE_IMAGE=ghcr.io/m1k1o/neko/base:latest
|
||||
FROM $BASE_IMAGE
|
||||
|
||||
#
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
ARG BASE_IMAGE=m1k1o/neko:base
|
||||
ARG BASE_IMAGE=ghcr.io/m1k1o/neko/base:latest
|
||||
FROM $BASE_IMAGE
|
||||
|
||||
ARG API_URL="https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
ARG BASE_IMAGE=m1k1o/neko:base
|
||||
ARG BASE_IMAGE=ghcr.io/m1k1o/neko/base:latest
|
||||
FROM $BASE_IMAGE
|
||||
|
||||
ARG API_URL="https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
ARG BASE_IMAGE=m1k1o/neko:base
|
||||
ARG BASE_IMAGE=ghcr.io/m1k1o/neko/base:latest
|
||||
FROM $BASE_IMAGE
|
||||
|
||||
ARG API_URL="https://download5.operacdn.com/pub/opera/desktop/"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
ARG BASE_IMAGE=m1k1o/neko:base
|
||||
ARG BASE_IMAGE=ghcr.io/m1k1o/neko/base:latest
|
||||
FROM $BASE_IMAGE
|
||||
|
||||
# install remmina
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#!/bin/bash
|
||||
set -u
|
||||
|
||||
err() {
|
||||
echo "ERROR: $*" >&2
|
||||
|
@ -16,23 +15,28 @@ if [[ -n "$REMMINA_PROFILE" ]]; then
|
|||
exec remmina -c "$profile"
|
||||
fi
|
||||
|
||||
[[ -z "$REMMINA_URL" ]] && err "Neither 'REMMINA_PROFILE' nor 'REMMINA_URL' found in env vars"
|
||||
if [[ ! -z "$REMMINA_URL" ]]; then
|
||||
readarray -t arr < <( echo -n "$REMMINA_URL" | perl -pe 's|^(\w+)\:\/\/(?:([^:]+)(?::([^@]+))?@)?(.*)$|\1\n\2\n\3\n\4|' )
|
||||
proto="${arr[0]}"
|
||||
user="${arr[1]}"
|
||||
pw="${arr[2]}"
|
||||
host="${arr[3]}"
|
||||
echo "Parsed url in 'REMMINA_URL': proto:$proto username:$user host:$host"
|
||||
|
||||
readarray -t arr < <( echo -n "$REMMINA_URL" | perl -pe 's|^(\w+)\:\/\/(?:([^:]+)(?::([^@]+))?@)?(.*)$|\1\n\2\n\3\n\4|' )
|
||||
proto="${arr[0]}"
|
||||
user="${arr[1]}"
|
||||
pw="${arr[2]}"
|
||||
host="${arr[3]}"
|
||||
echo "Parsed url in 'REMMINA_URL': proto:$proto username:$user host:$host"
|
||||
[[ "$proto" != "vnc" && "$proto" != "rdp" && "$proto" != "spice" ]] && err "Unsupported protocol $proto in connection url 'REMMINA_URL'"
|
||||
|
||||
[[ "$proto" != "vnc" && "$proto" != "rdp" && "$proto" != "spice" ]] && err "Unsupported protocol $proto in connection url 'REMMINA_URL'"
|
||||
profile="$profile_dir"/"$proto".remmina
|
||||
remmina --set-option username="$user" --update-profile "$profile"
|
||||
remmina --set-option password="$pw" --update-profile "$profile"
|
||||
remmina --set-option server="$host" --update-profile "$profile"
|
||||
|
||||
profile="$profile_dir"/"$proto".remmina
|
||||
remmina --set-option username="$user" --update-profile "$profile"
|
||||
remmina --set-option password="$pw" --update-profile "$profile"
|
||||
remmina --set-option server="$host" --update-profile "$profile"
|
||||
# remmina --set-option window_maximize=1 --update-profile "$profile"
|
||||
# remmina --set-option scale=1 --update-profile "$profile"
|
||||
|
||||
# remmina --set-option window_maximize=1 --update-profile "$profile"
|
||||
# remmina --set-option scale=1 --update-profile "$profile"
|
||||
echo "Running remmina with URL $REMMINA_URL"
|
||||
exec remmina -c "$profile"
|
||||
fi
|
||||
|
||||
exec remmina -c "$profile"
|
||||
|
||||
echo "Running remmina without connection profile"
|
||||
exec remmina
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
ARG BASE_IMAGE=m1k1o/neko:base
|
||||
ARG BASE_IMAGE=ghcr.io/m1k1o/neko/base:latest
|
||||
FROM $BASE_IMAGE
|
||||
|
||||
#
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
ARG BASE_IMAGE=m1k1o/neko:base
|
||||
ARG BASE_IMAGE=ghcr.io/m1k1o/neko/base:latest
|
||||
FROM $BASE_IMAGE
|
||||
|
||||
ARG API_URL="https://api.github.com/repos/macchrome/linchrome/releases/latest"
|
||||
|
|
|
@ -1,17 +1,13 @@
|
|||
ARG BASE_IMAGE=m1k1o/neko:base
|
||||
ARG BASE_IMAGE=ghcr.io/m1k1o/neko/base:latest
|
||||
FROM $BASE_IMAGE
|
||||
|
||||
ARG VIVALDI_VERSION="5.3.2679.34-1"
|
||||
# TODO: Get chromium version from vivaldi
|
||||
ARG CHROMIUM_VERSION="102.0.5005.72"
|
||||
|
||||
#
|
||||
# install vivaldi
|
||||
SHELL ["/bin/bash", "-c"]
|
||||
RUN set -eux; apt-get update; \
|
||||
wget -O /tmp/vivaldi.deb "https://downloads.vivaldi.com/stable/vivaldi-stable_${VIVALDI_VERSION}_amd64.deb"; \
|
||||
ARCH=$(dpkg --print-architecture); \
|
||||
wget -O /tmp/vivaldi.deb "https://downloads.vivaldi.com/stable/vivaldi-stable_${ARCH}.deb"; \
|
||||
apt-get install -y --no-install-recommends wget unzip xz-utils jq openbox /tmp/vivaldi.deb; \
|
||||
/opt/vivaldi/update-ffmpeg; \
|
||||
#
|
||||
# install latest version of uBlock Origin and SponsorBlock for YouTube
|
||||
EXTENSIONS_DIR="/usr/share/chromium/extensions"; \
|
||||
|
@ -22,7 +18,7 @@ RUN set -eux; apt-get update; \
|
|||
mkdir -p "${EXTENSIONS_DIR}"; \
|
||||
for EXT_ID in "${EXTENSIONS[@]}"; \
|
||||
do \
|
||||
EXT_URL="https://clients2.google.com/service/update2/crx?response=redirect&nacl_arch=x86-64&prodversion=${CHROMIUM_VERSION}&acceptformat=crx2,crx3&x=id%3D${EXT_ID}%26installsource%3Dondemand%26uc"; \
|
||||
EXT_URL="https://clients2.google.com/service/update2/crx?response=redirect&prodversion=100&acceptformat=crx2,crx3&x=id%3D${EXT_ID}%26installsource%3Dondemand%26uc"; \
|
||||
EXT_PATH="${EXTENSIONS_DIR}/${EXT_ID}.crx"; \
|
||||
wget -O "${EXT_PATH}" "${EXT_URL}"; \
|
||||
EXT_VERSION="$(unzip -p "${EXT_PATH}" manifest.json 2>/dev/null | jq -r ".version")"; \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
ARG BASE_IMAGE=m1k1o/neko:base
|
||||
ARG BASE_IMAGE=ghcr.io/m1k1o/neko/base:latest
|
||||
FROM $BASE_IMAGE
|
||||
|
||||
#
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
ARG BASE_IMAGE=m1k1o/neko:base
|
||||
ARG BASE_IMAGE=ghcr.io/m1k1o/neko/base:latest
|
||||
FROM $BASE_IMAGE
|
||||
|
||||
ARG SRC_URL="https://cdn1.waterfox.net/waterfox/releases/latest/linux"
|
||||
|
@ -10,7 +10,7 @@ RUN set -eux; apt-get update; \
|
|||
xz-utils bzip2 libgtk-3-0 libdbus-glib-1-2; \
|
||||
#
|
||||
# fetch latest release
|
||||
wget -O /tmp/waterfox-setup.tar.bz2 "${SRC_URL}"; \
|
||||
wget --user-agent="Mozilla/5.0" -O /tmp/waterfox-setup.tar.bz2 "${SRC_URL}"; \
|
||||
mkdir /usr/lib/waterfox; \
|
||||
tar -xjf /tmp/waterfox-setup.tar.bz2 -C /usr/lib; \
|
||||
rm -f /tmp/waterfox-setup.tar.bz2; \
|
||||
|
|
|
@ -15,8 +15,8 @@ lockPref("plugins.hide_infobar_for_missing_plugin", true);
|
|||
lockPref("profile.allow_automigration", false);
|
||||
lockPref("signon.prefillForms", false);
|
||||
lockPref("signon.rememberSignons", false);
|
||||
lockPref("xpinstall.enabled", false);
|
||||
lockPref("xpinstall.whitelist.required", true);
|
||||
//lockPref("xpinstall.enabled", false);
|
||||
//lockPref("xpinstall.whitelist.required", true);
|
||||
lockPref("browser.download.manager.retention", 0);
|
||||
lockPref("browser.download.folderList", 2);
|
||||
lockPref("browser.download.forbid_open_with", true);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
ARG BASE_IMAGE=m1k1o/neko:base
|
||||
ARG BASE_IMAGE=ghcr.io/m1k1o/neko/base:latest
|
||||
FROM $BASE_IMAGE
|
||||
|
||||
#
|
||||
|
|
98
build
98
build
|
@ -2,39 +2,57 @@
|
|||
set -e
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
#
|
||||
# This script builds the neko base image and all the applications
|
||||
#
|
||||
|
||||
# disable buildx because of https://github.com/docker/buildx/issues/847
|
||||
# if you want to use buildx, set USE_BUILDX=1
|
||||
if [ -z "$USE_BUILDX" ]; then
|
||||
USE_BUILDX=0
|
||||
fi
|
||||
|
||||
# check if docker buildx is available, its not docker-buildx command but rather subcommand of docker
|
||||
if [ -z "$USE_BUILDX" ] && [ -x "$(command -v docker)" ]; then
|
||||
if docker buildx version >/dev/null 2>&1; then
|
||||
USE_BUILDX=1
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# This script builds the neko base image and all the applications
|
||||
#
|
||||
#if [ -z "$USE_BUILDX" ] && [ -x "$(command -v docker)" ]; then
|
||||
# if docker buildx version >/dev/null 2>&1; then
|
||||
# USE_BUILDX=1
|
||||
# fi
|
||||
#fi
|
||||
|
||||
function log() {
|
||||
echo "$(date +'%Y-%m-%d %H:%M:%S') - [NEKO] - $1" > /dev/stderr
|
||||
}
|
||||
|
||||
function help() {
|
||||
echo "Usage: $0"
|
||||
echo " -p, --platform : The platform (default: linux/amd64)"
|
||||
echo " -r, --repository : The repository prefix (default: ghcr.io/m1k1o/neko)"
|
||||
echo " -t, --tag : The image tag, can be specified multiple times, if not specified"
|
||||
echo " uses 'latest' and if available, current git semver tag (v*.*.*)"
|
||||
echo " -f, --flavor : The flavor, if not specified, builds without flavor"
|
||||
echo " -b, --base : The base image name (default: <repository>[<flavor>-]base:<tag>)"
|
||||
echo " -a, --app : The app to build, if not specified, builds the base image"
|
||||
echo " -y, --yes : Skip confirmation prompts"
|
||||
echo " --no-cache : Build without docker cache"
|
||||
echo " --push : Push the image to the registry after building"
|
||||
echo " -h, --help : Show this help message"
|
||||
echo "Usage: $0 [options] [image]"
|
||||
echo
|
||||
echo "Options:"
|
||||
echo " -p, --platform : The platform (default: system architecture)"
|
||||
echo " -r, --repository : The repository prefix (default: ghcr.io/m1k1o/neko)"
|
||||
echo " -t, --tag : The image tag, can be specified multiple times, if not specified"
|
||||
echo " uses 'latest' and if available, current git semver tag (v*.*.*)"
|
||||
echo " -f, --flavor : The flavor, if not specified, builds without flavor"
|
||||
echo " -b, --base_image : The base image name (default: <repository>[<flavor>-]base:<tag>)"
|
||||
echo " -a, --application : The app to build, if not specified, builds the base image"
|
||||
echo " -y, --yes : Skip confirmation prompts"
|
||||
echo " --no-cache : Build without docker cache"
|
||||
echo " --push : Push the image to the registry after building"
|
||||
echo " -h, --help : Show this help message"
|
||||
echo
|
||||
echo "Positional arguments:"
|
||||
echo " <image> : The image name, if not specified, uses the full image name"
|
||||
echo " in the format <repository>/<flavor>-<application>:<tag>"
|
||||
echo " Example: ghcr.io/m1k1o/neko/nvidia-firefox:latest"
|
||||
echo " You can override any of the above options by specifying them"
|
||||
echo " after the image name."
|
||||
echo
|
||||
echo "Environment variables:"
|
||||
echo " USE_BUILDX : Set to 1 to use docker buildx instead of docker build"
|
||||
echo " (default: 0)"
|
||||
echo " CLIENT_DIST : The client dist file to use, if not specified, builds them"
|
||||
echo " from the source code."
|
||||
echo " (options) : Options can be specified as environment variables, for example:"
|
||||
echo " PLATFORM=linux/arm64 $0 --repository ghcr.io/m1k1o/neko"
|
||||
}
|
||||
|
||||
FULL_IMAGE=""
|
||||
|
@ -44,8 +62,8 @@ while [[ "$#" -gt 0 ]]; do
|
|||
--repository|-r) REPOSITORY="$2"; shift ;;
|
||||
--tag|-t) TAGS+=("$2"); TAG="$2"; shift ;;
|
||||
--flavor|-f) FLAVOR="$2"; shift ;;
|
||||
--base|-b) BASE_IMAGE="$2"; shift ;;
|
||||
--app|-a) APPLICATION="$2"; shift ;;
|
||||
--base_image|-b) BASE_IMAGE="$2"; shift ;;
|
||||
--application|-a) APPLICATION="$2"; shift ;;
|
||||
--yes|-y) YES=1 ;;
|
||||
--no-cache) NO_CACHE="--no-cache" log "Building without cache" ;;
|
||||
--push) PUSH=1 ;;
|
||||
|
@ -131,17 +149,12 @@ function build_image() {
|
|||
local APPLICATION_IMAGE="$1"
|
||||
shift
|
||||
|
||||
# get list of tags in full format: <image>:<tag>
|
||||
local IMAGE_NO_TAG="${APPLICATION_IMAGE%:*}"
|
||||
local FULL_TAGS=()
|
||||
# if the image name starts with local/, just use the tag as is
|
||||
if [[ "$APPLICATION_IMAGE" == *"local/"* ]]; then
|
||||
FULL_TAGS=("$APPLICATION_IMAGE")
|
||||
else
|
||||
# get list of tags in full format: <image>:<tag>
|
||||
local IMAGE_NO_TAG="${APPLICATION_IMAGE%:*}"
|
||||
for T in "${TAGS[@]}"; do
|
||||
FULL_TAGS+=("$IMAGE_NO_TAG:$T")
|
||||
done
|
||||
fi
|
||||
for T in "${TAGS[@]}"; do
|
||||
FULL_TAGS+=("$IMAGE_NO_TAG:$T")
|
||||
done
|
||||
|
||||
if [ -z "$USE_BUILDX" ] || [ "$USE_BUILDX" != "1" ]; then
|
||||
# if buildx is not available, use docker build
|
||||
|
@ -197,7 +210,18 @@ else
|
|||
fi
|
||||
|
||||
if [ -z "$PLATFORM" ]; then
|
||||
PLATFORM="linux/amd64"
|
||||
# use system architecture if not specified
|
||||
UNAME="$(uname -m)"
|
||||
if [ "$UNAME" == "x86_64" ]; then
|
||||
PLATFORM="linux/amd64"
|
||||
elif [ "$UNAME" == "aarch64" ] || [ "$UNAME" == "arm64" ]; then
|
||||
PLATFORM="linux/arm64"
|
||||
elif [ "$UNAME" == "armv7l" ]; then
|
||||
PLATFORM="linux/arm/v7"
|
||||
else
|
||||
log "Unknown architecture: $UNAME"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
log "Using platform: $PLATFORM"
|
||||
|
||||
|
@ -290,10 +314,10 @@ fi
|
|||
|
||||
log "Building base image: $BASE_IMAGE"
|
||||
docker run --rm -i \
|
||||
-v ./:/src \
|
||||
-v "$(pwd)":/src \
|
||||
-e "RUNTIME_DOCKERFILE=$RUNTIME_DOCKERFILE" \
|
||||
--workdir /src \
|
||||
--entrypoint go \
|
||||
golang:1.24-bullseye \
|
||||
run ./docker/main.go \
|
||||
-i Dockerfile.tmpl -client $CLIENT_DIST | build_image $BASE_IMAGE -f - .
|
||||
run utils/docker/main.go \
|
||||
-i Dockerfile.tmpl -client "$CLIENT_DIST" | build_image $BASE_IMAGE -f - .
|
||||
|
|
|
@ -119,23 +119,43 @@
|
|||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 600px) {
|
||||
#neko.expanded {
|
||||
.neko-main {
|
||||
transform: translateX(calc(-100% + 65px));
|
||||
@media only screen and (max-width: 1024px) {
|
||||
html,
|
||||
body {
|
||||
overflow-y: auto !important;
|
||||
width: auto !important;
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
video {
|
||||
display: none;
|
||||
}
|
||||
body > p {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#neko {
|
||||
position: relative;
|
||||
flex-direction: column;
|
||||
max-height: initial !important;
|
||||
|
||||
.neko-main {
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.neko-menu {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 65px;
|
||||
width: calc(100% - 65px);
|
||||
height: 100vh;
|
||||
width: 100% !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 1024px) and (orientation: portrait) {
|
||||
#neko {
|
||||
&.expanded .neko-main {
|
||||
height: 40vh;
|
||||
}
|
||||
|
||||
&.expanded .neko-menu {
|
||||
height: 60vh;
|
||||
width: 100% !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -217,6 +237,20 @@
|
|||
}
|
||||
}
|
||||
|
||||
@Watch('side')
|
||||
onSide(side: boolean) {
|
||||
if (side) {
|
||||
console.log('side enabled')
|
||||
// scroll to the side
|
||||
this.$nextTick(() => {
|
||||
const side = document.querySelector('aside')
|
||||
if (side) {
|
||||
side.scrollIntoView({ behavior: 'smooth', block: 'start' })
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
controlAttempt() {
|
||||
if (this.shakeKbd || this.$accessor.remote.hosted) return
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
<style lang="scss" scoped>
|
||||
.connect {
|
||||
position: absolute;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
|
|
|
@ -60,8 +60,9 @@
|
|||
</style>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Vue } from 'vue-property-decorator'
|
||||
import { Component, Vue, Watch } from 'vue-property-decorator'
|
||||
import { messages } from '~/locale'
|
||||
import { set } from '~/utils/localstorage'
|
||||
|
||||
@Component({ name: 'neko-menu' })
|
||||
export default class extends Vue {
|
||||
|
@ -77,6 +78,11 @@
|
|||
this.$accessor.client.toggleAbout()
|
||||
}
|
||||
|
||||
@Watch('$i18n.locale')
|
||||
onLanguageChange(newLang: string) {
|
||||
set('lang', newLang)
|
||||
}
|
||||
|
||||
mounted() {
|
||||
const default_lang = new URL(location.href).searchParams.get('lang')
|
||||
if (default_lang && this.langs.includes(default_lang)) {
|
||||
|
|
|
@ -40,7 +40,12 @@
|
|||
<li v-if="admin"><i @click.stop.prevent="openResolution" class="fas fa-desktop"></i></li>
|
||||
<li v-if="!controlLocked && !implicitHosting" :class="extraControls || 'extra-control'">
|
||||
<i
|
||||
:class="[hosted && !hosting ? 'disabled' : '', !hosted && !hosting ? 'faded' : '', 'fas', 'fa-keyboard']"
|
||||
:class="[
|
||||
hosted && !hosting ? 'disabled' : '',
|
||||
!hosted && !hosting ? 'faded' : '',
|
||||
'fas',
|
||||
'fa-computer-mouse',
|
||||
]"
|
||||
@click.stop.prevent="toggleControl"
|
||||
/>
|
||||
</li>
|
||||
|
@ -57,6 +62,13 @@
|
|||
class="fas fa-external-link-alt"
|
||||
/>
|
||||
</li>
|
||||
<li
|
||||
v-if="hosting && is_touch_device"
|
||||
:class="extraControls || 'extra-control'"
|
||||
@click.stop.prevent="openMobileKeyboard"
|
||||
>
|
||||
<i class="fas fa-keyboard" />
|
||||
</li>
|
||||
</ul>
|
||||
<neko-resolution ref="resolution" v-if="admin" />
|
||||
<neko-clipboard ref="clipboard" v-if="hosting && (!clipboard_read_available || !clipboard_write_available)" />
|
||||
|
@ -117,7 +129,7 @@
|
|||
}
|
||||
@media (max-width: 768px) {
|
||||
&.extra-control {
|
||||
display: inline-block;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -353,6 +365,16 @@
|
|||
return this.$accessor.video.horizontal
|
||||
}
|
||||
|
||||
get is_touch_device() {
|
||||
return (
|
||||
// detect if the device has touch support
|
||||
('ontouchstart' in window || navigator.maxTouchPoints > 0) &&
|
||||
// the primary input mechanism includes a pointing device of
|
||||
// limited accuracy, such as a finger on a touchscreen.
|
||||
window.matchMedia('(pointer: coarse)').matches
|
||||
)
|
||||
}
|
||||
|
||||
@Watch('width')
|
||||
onWidthChanged() {
|
||||
this.onResize()
|
||||
|
@ -799,10 +821,20 @@
|
|||
@Watch('hosting')
|
||||
@Watch('locked')
|
||||
onFocus() {
|
||||
// focus opens the keyboard on mobile
|
||||
if (this.is_touch_device) {
|
||||
return
|
||||
}
|
||||
|
||||
// in order to capture key events, overlay must be focused
|
||||
if (this.focused && this.hosting && !this.locked) {
|
||||
this._overlay.focus()
|
||||
}
|
||||
}
|
||||
|
||||
openMobileKeyboard() {
|
||||
// focus opens the keyboard on mobile
|
||||
this._overlay.focus()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -15,7 +15,7 @@ export const EVENT = {
|
|||
ERROR: 'system/error',
|
||||
},
|
||||
CLIENT: {
|
||||
HEARTBEAT: 'client/heartbeat'
|
||||
HEARTBEAT: 'client/heartbeat',
|
||||
},
|
||||
SIGNAL: {
|
||||
OFFER: 'signal/offer',
|
||||
|
|
|
@ -1,11 +1,31 @@
|
|||
import Vue from 'vue'
|
||||
import VueI18n from 'vue-i18n'
|
||||
import { messages } from '~/locale'
|
||||
import { get } from '~/utils/localstorage'
|
||||
|
||||
Vue.use(VueI18n)
|
||||
|
||||
const fallbackLocale = 'en'
|
||||
|
||||
function detectBrowserLanguage(): string {
|
||||
const browserLang = navigator.language.toLowerCase()
|
||||
|
||||
const supportedLangs = Object.keys(messages)
|
||||
if (supportedLangs.includes(browserLang)) {
|
||||
return browserLang
|
||||
}
|
||||
|
||||
const baseLang = browserLang.split('-')[0]
|
||||
const matchingLang = supportedLangs.find((lang) => lang.startsWith(baseLang))
|
||||
if (matchingLang) {
|
||||
return matchingLang
|
||||
}
|
||||
|
||||
return fallbackLocale
|
||||
}
|
||||
|
||||
export const i18n = new VueI18n({
|
||||
locale: 'en',
|
||||
fallbackLocale: 'en',
|
||||
locale: get<string>('lang', detectBrowserLanguage()),
|
||||
fallbackLocale,
|
||||
messages,
|
||||
})
|
||||
|
|
|
@ -15,6 +15,3 @@ session:
|
|||
cookie:
|
||||
# needed for legacy API
|
||||
enabled: false
|
||||
|
||||
webrtc:
|
||||
icelite: true
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
version: "3.4"
|
||||
services:
|
||||
neko:
|
||||
image: "m1k1o/neko:firefox"
|
||||
image: "ghcr.io/m1k1o/neko/firefox:latest"
|
||||
restart: "unless-stopped"
|
||||
shm_size: "2gb"
|
||||
ports:
|
||||
- "8080:8080"
|
||||
- "52000-52100:52000-52100/udp"
|
||||
environment:
|
||||
NEKO_SCREEN: 1920x1080@30
|
||||
NEKO_PASSWORD: neko
|
||||
NEKO_PASSWORD_ADMIN: admin
|
||||
NEKO_EPR: 52000-52100
|
||||
NEKO_ICELITE: 1
|
||||
NEKO_DESKTOP_SCREEN: 1920x1080@30
|
||||
NEKO_MEMBER_MULTIUSER_USER_PASSWORD: neko
|
||||
NEKO_MEMBER_MULTIUSER_ADMIN_PASSWORD: admin
|
||||
NEKO_WEBRTC_EPR: 52000-52100
|
||||
NEKO_WEBRTC_ICELITE: 1
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
module github.com/m1k1o/neko/docker
|
||||
|
||||
go 1.24.1
|
|
@ -103,7 +103,9 @@ ENV NEKO_PLUGINS_DIR=/etc/neko/plugins/
|
|||
#
|
||||
# add healthcheck
|
||||
HEALTHCHECK --interval=10s --timeout=5s --retries=8 \
|
||||
CMD wget -O - http://localhost:${NEKO_SERVER_BIND#*:}/health || exit 1
|
||||
CMD wget -O - http://localhost:${NEKO_SERVER_BIND#*:}/health || \
|
||||
wget --no-check-certificate -O - https://localhost:${NEKO_SERVER_BIND#*:}/health || \
|
||||
exit 1
|
||||
|
||||
#
|
||||
# run neko
|
||||
|
|
|
@ -95,8 +95,9 @@ ENV NEKO_PLUGINS_DIR=/etc/neko/plugins/
|
|||
#
|
||||
# add healthcheck
|
||||
HEALTHCHECK --interval=10s --timeout=5s --retries=8 \
|
||||
CMD wget -O - http://localhost:${NEKO_SERVER_BIND#*:}/health || exit 1
|
||||
|
||||
CMD wget -O - http://localhost:${NEKO_SERVER_BIND#*:}/health || \
|
||||
wget --no-check-certificate -O - https://localhost:${NEKO_SERVER_BIND#*:}/health || \
|
||||
exit 1
|
||||
#
|
||||
# run neko
|
||||
CMD ["/usr/bin/supervisord", "-c", "/etc/neko/supervisord.conf"]
|
||||
|
|
|
@ -115,8 +115,9 @@ ENV RENDER_GID=
|
|||
#
|
||||
# add healthcheck
|
||||
HEALTHCHECK --interval=10s --timeout=5s --retries=8 \
|
||||
CMD wget -O - http://localhost:${NEKO_SERVER_BIND#*:}/health || exit 1
|
||||
|
||||
CMD wget -O - http://localhost:${NEKO_SERVER_BIND#*:}/health || \
|
||||
wget --no-check-certificate -O - https://localhost:${NEKO_SERVER_BIND#*:}/health || \
|
||||
exit 1
|
||||
#
|
||||
# run neko
|
||||
CMD ["/usr/bin/supervisord", "-c", "/etc/neko/supervisord.conf"]
|
||||
|
|
|
@ -262,7 +262,9 @@ COPY --from=gstreamer /usr/share/gstreamer /usr/share/gstreamer
|
|||
#
|
||||
# add healthcheck
|
||||
HEALTHCHECK --interval=10s --timeout=5s --retries=8 \
|
||||
CMD wget -O - http://localhost:${NEKO_SERVER_BIND#*:}/health || exit 1
|
||||
CMD wget -O - http://localhost:${NEKO_SERVER_BIND#*:}/health || \
|
||||
wget --no-check-certificate -O - https://localhost:${NEKO_SERVER_BIND#*:}/health || \
|
||||
exit 1
|
||||
|
||||
#
|
||||
# run neko
|
||||
|
|
|
@ -254,7 +254,9 @@ COPY --from=gstreamer /usr/share/gstreamer /usr/share/gstreamer
|
|||
#
|
||||
# add healthcheck
|
||||
HEALTHCHECK --interval=10s --timeout=5s --retries=8 \
|
||||
CMD wget -O - http://localhost:${NEKO_SERVER_BIND#*:}/health || exit 1
|
||||
CMD wget -O - http://localhost:${NEKO_SERVER_BIND#*:}/health || \
|
||||
wget --no-check-certificate -O - https://localhost:${NEKO_SERVER_BIND#*:}/health || \
|
||||
exit 1
|
||||
|
||||
#
|
||||
# run neko
|
||||
|
|
|
@ -33,7 +33,7 @@ redirect_stderr=true
|
|||
|
||||
[program:neko]
|
||||
environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s",DISPLAY="%(ENV_DISPLAY)s"
|
||||
command=/usr/bin/neko serve --static "/var/www"
|
||||
command=/usr/bin/neko serve --server.static "/var/www"
|
||||
stopsignal=INT
|
||||
stopwaitsecs=3
|
||||
autorestart=true
|
||||
|
|
|
@ -22,7 +22,7 @@ fi
|
|||
|
||||
#
|
||||
# load server dependencies
|
||||
go get -v -t -d .
|
||||
go get -v -t .
|
||||
|
||||
#
|
||||
# build server
|
||||
|
|
|
@ -9,9 +9,10 @@ GIT_COMMIT=`git rev-parse --short HEAD`
|
|||
GIT_BRANCH=`git rev-parse --symbolic-full-name --abbrev-ref HEAD`
|
||||
|
||||
echo "Building server image"
|
||||
docker build -t neko_server --build-arg "GIT_COMMIT=$GIT_COMMIT" --build-arg "GIT_BRANCH=$GIT_BRANCH" -f ../Dockerfile ..
|
||||
docker build -t neko_server:src -f ../Dockerfile ..
|
||||
|
||||
BUILD_IMAGE=neko_server FLAVOUR=$1 ../../build
|
||||
echo "Building base image"
|
||||
../../build -y -b neko_server:base -f "$1"
|
||||
|
||||
echo "Building app image"
|
||||
docker build -t neko_server:app --build-arg "BASE_IMAGE=neko_server:base" -f ./runtime/Dockerfile ./runtime
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#!/bin/bash
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
if [ "$(docker images -q neko_server 2> /dev/null)" == "" ]; then
|
||||
echo "Image 'neko_server' not found. Run ./build first."
|
||||
if [ "$(docker images -q neko_server:src 2> /dev/null)" == "" ]; then
|
||||
echo "Image 'neko_server:src' not found. Run ./build first."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
docker run -it --rm \
|
||||
--entrypoint="go" \
|
||||
-v "${PWD}/../:/src" \
|
||||
neko_server fmt ./...
|
||||
neko_server:src fmt ./...
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#!/bin/bash
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
if [ "$(docker images -q neko_server 2> /dev/null)" == "" ]; then
|
||||
echo "Image 'neko_server' not found. Run ./build first."
|
||||
if [ "$(docker images -q neko_server:src 2> /dev/null)" == "" ]; then
|
||||
echo "Image 'neko_server:src' not found. Run ./build first."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -10,7 +10,7 @@ docker run -it \
|
|||
--name "neko_server_go" \
|
||||
--entrypoint="go" \
|
||||
-v "${PWD}/../:/src" \
|
||||
neko_server "$@";
|
||||
neko_server:src "$@";
|
||||
#
|
||||
# copy package files
|
||||
docker cp neko_server_go:/src/go.mod "../go.mod"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#!/bin/bash
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
if [ "$(docker images -q neko_server 2> /dev/null)" == "" ]; then
|
||||
echo "Image 'neko_server' not found. Run ./build first."
|
||||
if [ "$(docker images -q neko_server:src 2> /dev/null)" == "" ]; then
|
||||
echo "Image 'neko_server:src' not found. Run ./build first."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -11,4 +11,4 @@ fi
|
|||
docker run --rm -it \
|
||||
-v "${PWD}/../:/src" \
|
||||
--entrypoint="/bin/bash" \
|
||||
neko_server -c '[ -f ./bin/golangci-lint ] || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.31.0;./bin/golangci-lint run';
|
||||
neko_server:src -c '[ -f ./bin/golangci-lint ] || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.31.0;./bin/golangci-lint run';
|
||||
|
|
|
@ -10,7 +10,7 @@ set -e
|
|||
docker run --rm -it \
|
||||
-v "${PWD}/../:/src" \
|
||||
--entrypoint="/bin/bash" \
|
||||
neko_server "./build" "$@";
|
||||
neko_server:src "./build" "$@";
|
||||
|
||||
#
|
||||
# remove old plugins
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
cd "$(dirname "$0")"
|
||||
cd ../../runtime/xorg-deps/xf86-input-neko
|
||||
cd ../../utils/xorg-deps/xf86-input-neko
|
||||
|
||||
#
|
||||
# aborting if any command returns a non-zero value
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
ARG BASE_IMAGE=neko_server:base
|
||||
ARG BASE_IMAGE=ghcr.io/m1k1o/neko/base:latest
|
||||
FROM $BASE_IMAGE
|
||||
|
||||
ARG SRC_URL="https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=en-US"
|
||||
|
@ -8,13 +8,13 @@ ARG SRC_URL="https://download.mozilla.org/?product=firefox-latest&os=linux64&lan
|
|||
RUN set -eux; apt-get update; \
|
||||
apt-get install -y --no-install-recommends \
|
||||
dbus-x11 xfce4 xfce4-terminal sudo \
|
||||
xz-utils bzip2 libgtk-3-0 libdbus-glib-1-2; \
|
||||
xz-utils libgtk-3-0 libdbus-glib-1-2; \
|
||||
#
|
||||
# fetch latest firefox release
|
||||
wget -O /tmp/firefox-setup.tar.bz2 "${SRC_URL}"; \
|
||||
wget -O /tmp/firefox-setup.tar.xz "${SRC_URL}"; \
|
||||
mkdir /usr/lib/firefox; \
|
||||
tar -xjf /tmp/firefox-setup.tar.bz2 -C /usr/lib; \
|
||||
rm -f /tmp/firefox-setup.tar.bz2; \
|
||||
tar -xvf /tmp/firefox-setup.tar.xz -C /usr/lib; \
|
||||
rm -f /tmp/firefox-setup.tar.xz; \
|
||||
ln -s /usr/lib/firefox/firefox /usr/bin/firefox; \
|
||||
#
|
||||
# add user to sudoers
|
||||
|
@ -22,7 +22,7 @@ RUN set -eux; apt-get update; \
|
|||
echo "neko:neko" | chpasswd; \
|
||||
echo "%sudo ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers; \
|
||||
# clean up
|
||||
apt-get --purge autoremove -y xz-utils bzip2; \
|
||||
apt-get --purge autoremove -y xz-utils; \
|
||||
apt-get clean -y; \
|
||||
rm -rf /var/lib/apt/lists/* /var/cache/apt/*
|
||||
|
||||
|
|
|
@ -90,12 +90,12 @@ func (Capture) Init(cmd *cobra.Command) error {
|
|||
return err
|
||||
}
|
||||
|
||||
cmd.PersistentFlags().String("capture.video.pipelines", "[]", "pipelines config in JSON used for video streaming")
|
||||
cmd.PersistentFlags().String("capture.video.pipelines", "{}", "pipelines config used for video streaming")
|
||||
if err := viper.BindPFlag("capture.video.pipelines", cmd.PersistentFlags().Lookup("capture.video.pipelines")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
cmd.PersistentFlags().String("capture.video.pipeline", "", "gstreamer pipeline used for video streaming; shortcut for having only a single video pipeline instead of multiple, ignored if capture.video.pipelines is set")
|
||||
cmd.PersistentFlags().String("capture.video.pipeline", "", "shortcut for configuring only a single gstreamer pipeline, ignored if pipelines is set")
|
||||
if err := viper.BindPFlag("capture.video.pipeline", cmd.PersistentFlags().Lookup("capture.video.pipeline")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -451,6 +451,7 @@ func (s *Capture) SetV2() {
|
|||
enableLegacy = true
|
||||
}
|
||||
|
||||
modifiedVideoCodec := false
|
||||
if videoCodec := viper.GetString("video_codec"); videoCodec != "" {
|
||||
s.VideoCodec, ok = codec.ParseStr(videoCodec)
|
||||
if !ok || s.VideoCodec.Type != webrtc.RTPCodecTypeVideo {
|
||||
|
@ -459,24 +460,29 @@ func (s *Capture) SetV2() {
|
|||
}
|
||||
log.Warn().Msg("you are using v2 configuration 'NEKO_VIDEO_CODEC' which is deprecated, please use 'NEKO_CAPTURE_VIDEO_CODEC' instead")
|
||||
enableLegacy = true
|
||||
modifiedVideoCodec = true
|
||||
}
|
||||
|
||||
if viper.GetBool("vp8") {
|
||||
s.VideoCodec = codec.VP8()
|
||||
log.Warn().Msg("you are using deprecated config setting 'NEKO_VP8=true', use 'NEKO_CAPTURE_VIDEO_CODEC=vp8' instead")
|
||||
enableLegacy = true
|
||||
modifiedVideoCodec = true
|
||||
} else if viper.GetBool("vp9") {
|
||||
s.VideoCodec = codec.VP9()
|
||||
log.Warn().Msg("you are using deprecated config setting 'NEKO_VP9=true', use 'NEKO_CAPTURE_VIDEO_CODEC=vp9' instead")
|
||||
enableLegacy = true
|
||||
modifiedVideoCodec = true
|
||||
} else if viper.GetBool("h264") {
|
||||
s.VideoCodec = codec.H264()
|
||||
log.Warn().Msg("you are using deprecated config setting 'NEKO_H264=true', use 'NEKO_CAPTURE_VIDEO_CODEC=h264' instead")
|
||||
enableLegacy = true
|
||||
modifiedVideoCodec = true
|
||||
} else if viper.GetBool("av1") {
|
||||
s.VideoCodec = codec.AV1()
|
||||
log.Warn().Msg("you are using deprecated config setting 'NEKO_AV1=true', use 'NEKO_CAPTURE_VIDEO_CODEC=av1' instead")
|
||||
enableLegacy = true
|
||||
modifiedVideoCodec = true
|
||||
}
|
||||
|
||||
videoHWEnc := HwEncUnset
|
||||
|
@ -498,7 +504,7 @@ func (s *Capture) SetV2() {
|
|||
videoPipeline := viper.GetString("video")
|
||||
|
||||
// video pipeline
|
||||
if videoHWEnc != HwEncUnset || videoBitrate != 0 || videoMaxFPS != 0 || videoPipeline != "" {
|
||||
if modifiedVideoCodec || videoHWEnc != HwEncUnset || videoBitrate != 0 || videoMaxFPS != 0 || videoPipeline != "" {
|
||||
pipeline, err := NewVideoPipeline(s.VideoCodec, s.Display, videoPipeline, videoMaxFPS, videoBitrate, videoHWEnc)
|
||||
if err != nil {
|
||||
log.Warn().Err(err).Msg("unable to create video pipeline, using default")
|
||||
|
@ -534,6 +540,7 @@ func (s *Capture) SetV2() {
|
|||
enableLegacy = true
|
||||
}
|
||||
|
||||
modifiedAudioCodec := false
|
||||
if audioCodec := viper.GetString("audio_codec"); audioCodec != "" {
|
||||
s.AudioCodec, ok = codec.ParseStr(audioCodec)
|
||||
if !ok || s.AudioCodec.Type != webrtc.RTPCodecTypeAudio {
|
||||
|
@ -542,31 +549,36 @@ func (s *Capture) SetV2() {
|
|||
}
|
||||
log.Warn().Msg("you are using v2 configuration 'NEKO_AUDIO_CODEC' which is deprecated, please use 'NEKO_CAPTURE_AUDIO_CODEC' instead")
|
||||
enableLegacy = true
|
||||
modifiedAudioCodec = true
|
||||
}
|
||||
|
||||
if viper.GetBool("opus") {
|
||||
s.AudioCodec = codec.Opus()
|
||||
log.Warn().Msg("you are using deprecated config setting 'NEKO_OPUS=true', use 'NEKO_CAPTURE_AUDIO_CODEC=opus' instead")
|
||||
enableLegacy = true
|
||||
modifiedAudioCodec = true
|
||||
} else if viper.GetBool("g722") {
|
||||
s.AudioCodec = codec.G722()
|
||||
log.Warn().Msg("you are using deprecated config setting 'NEKO_G722=true', use 'NEKO_CAPTURE_AUDIO_CODEC=g722' instead")
|
||||
enableLegacy = true
|
||||
modifiedAudioCodec = true
|
||||
} else if viper.GetBool("pcmu") {
|
||||
s.AudioCodec = codec.PCMU()
|
||||
log.Warn().Msg("you are using deprecated config setting 'NEKO_PCMU=true', use 'NEKO_CAPTURE_AUDIO_CODEC=pcmu' instead")
|
||||
enableLegacy = true
|
||||
modifiedAudioCodec = true
|
||||
} else if viper.GetBool("pcma") {
|
||||
s.AudioCodec = codec.PCMA()
|
||||
log.Warn().Msg("you are using deprecated config setting 'NEKO_PCMA=true', use 'NEKO_CAPTURE_AUDIO_CODEC=pcma' instead")
|
||||
enableLegacy = true
|
||||
modifiedAudioCodec = true
|
||||
}
|
||||
|
||||
audioBitrate := viper.GetUint("audio_bitrate")
|
||||
audioPipeline := viper.GetString("audio")
|
||||
|
||||
// audio pipeline
|
||||
if audioBitrate != 0 || audioPipeline != "" {
|
||||
if modifiedAudioCodec || audioBitrate != 0 || audioPipeline != "" {
|
||||
pipeline, err := NewAudioPipeline(s.AudioCodec, s.AudioDevice, audioPipeline, audioBitrate)
|
||||
if err != nil {
|
||||
log.Warn().Err(err).Msg("unable to create audio pipeline, using default")
|
||||
|
@ -604,7 +616,7 @@ func (s *Capture) SetV2() {
|
|||
|
||||
// set legacy flag if any V2 configuration was used
|
||||
if !viper.IsSet("legacy") && enableLegacy {
|
||||
log.Warn().Msg("legacy configuration is enabled because at least one V2 configuration was used, please migrate to V3 configuration, or set 'NEKO_LEGACY=true' to acknowledge this message")
|
||||
log.Warn().Msg("legacy configuration is enabled because at least one V2 configuration was used, please migrate to V3 configuration, visit https://neko.m1k1o.net/docs/v3/migration-from-v2 for more details")
|
||||
viper.Set("legacy", true)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -133,7 +133,7 @@ func (s *Desktop) SetV2() {
|
|||
|
||||
// set legacy flag if any V2 configuration was used
|
||||
if !viper.IsSet("legacy") && enableLegacy {
|
||||
log.Warn().Msg("legacy configuration is enabled because at least one V2 configuration was used, please migrate to V3 configuration, or set 'NEKO_LEGACY=true' to acknowledge this message")
|
||||
log.Warn().Msg("legacy configuration is enabled because at least one V2 configuration was used, please migrate to V3 configuration, visit https://neko.m1k1o.net/docs/v3/migration-from-v2 for more details")
|
||||
viper.Set("legacy", true)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,45 +22,45 @@ type Member struct {
|
|||
}
|
||||
|
||||
func (Member) Init(cmd *cobra.Command) error {
|
||||
cmd.PersistentFlags().String("member.provider", "multiuser", "choose member provider")
|
||||
cmd.PersistentFlags().String("member.provider", "multiuser", "selected member provider")
|
||||
if err := viper.BindPFlag("member.provider", cmd.PersistentFlags().Lookup("member.provider")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// file provider
|
||||
cmd.PersistentFlags().String("member.file.path", "", "member file provider: storage path")
|
||||
cmd.PersistentFlags().String("member.file.path", "", "member file provider: path to the file containing the users and their passwords")
|
||||
if err := viper.BindPFlag("member.file.path", cmd.PersistentFlags().Lookup("member.file.path")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
cmd.PersistentFlags().Bool("member.file.hash", true, "member file provider: whether to hash passwords using sha256 (recommended)")
|
||||
cmd.PersistentFlags().Bool("member.file.hash", true, "member file provider: whether the passwords are hashed using sha256 or not (recommended)")
|
||||
if err := viper.BindPFlag("member.file.hash", cmd.PersistentFlags().Lookup("member.file.hash")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// object provider
|
||||
cmd.PersistentFlags().String("member.object.users", "[]", "member object provider: users in JSON format")
|
||||
cmd.PersistentFlags().String("member.object.users", "[]", "member object provider: list of users with their passwords and profiles")
|
||||
if err := viper.BindPFlag("member.object.users", cmd.PersistentFlags().Lookup("member.object.users")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// multiuser provider
|
||||
cmd.PersistentFlags().String("member.multiuser.user_password", "neko", "member multiuser provider: user password")
|
||||
cmd.PersistentFlags().String("member.multiuser.user_password", "neko", "member multiuser provider: password for regular users")
|
||||
if err := viper.BindPFlag("member.multiuser.user_password", cmd.PersistentFlags().Lookup("member.multiuser.user_password")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
cmd.PersistentFlags().String("member.multiuser.admin_password", "admin", "member multiuser provider: admin password")
|
||||
cmd.PersistentFlags().String("member.multiuser.admin_password", "admin", "member multiuser provider: password for admin users")
|
||||
if err := viper.BindPFlag("member.multiuser.admin_password", cmd.PersistentFlags().Lookup("member.multiuser.admin_password")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
cmd.PersistentFlags().String("member.multiuser.user_profile", "{}", "member multiuser provider: user profile in JSON format")
|
||||
cmd.PersistentFlags().String("member.multiuser.user_profile", "{}", "member multiuser provider: profile template for regular users")
|
||||
if err := viper.BindPFlag("member.multiuser.user_profile", cmd.PersistentFlags().Lookup("member.multiuser.user_profile")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
cmd.PersistentFlags().String("member.multiuser.admin_profile", "{}", "member multiuser provider: admin profile in JSON format")
|
||||
cmd.PersistentFlags().String("member.multiuser.admin_profile", "{}", "member multiuser provider: profile template for admin users")
|
||||
if err := viper.BindPFlag("member.multiuser.admin_profile", cmd.PersistentFlags().Lookup("member.multiuser.admin_profile")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ func (s *Member) SetV2() {
|
|||
|
||||
// set legacy flag if any V2 configuration was used
|
||||
if !viper.IsSet("legacy") && enableLegacy {
|
||||
log.Warn().Msg("legacy configuration is enabled because at least one V2 configuration was used, please migrate to V3 configuration, or set 'NEKO_LEGACY=true' to acknowledge this message")
|
||||
log.Warn().Msg("legacy configuration is enabled because at least one V2 configuration was used, please migrate to V3 configuration, visit https://neko.m1k1o.net/docs/v3/migration-from-v2 for more details")
|
||||
viper.Set("legacy", true)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -139,7 +139,7 @@ func (s *Root) SetV2() {
|
|||
|
||||
// set legacy flag if any V2 configuration was used
|
||||
if !viper.IsSet("legacy") && enableLegacy {
|
||||
log.Warn().Msg("legacy configuration is enabled because at least one V2 configuration was used, please migrate to V3 configuration, or set 'NEKO_LEGACY=true' to acknowledge this message")
|
||||
log.Warn().Msg("legacy configuration is enabled because at least one V2 configuration was used, please migrate to V3 configuration, visit https://neko.m1k1o.net/docs/v3/migration-from-v2 for more details")
|
||||
viper.Set("legacy", true)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -172,7 +172,7 @@ func (s *Server) SetV2() {
|
|||
|
||||
// set legacy flag if any V2 configuration was used
|
||||
if !viper.IsSet("legacy") && enableLegacy {
|
||||
log.Warn().Msg("legacy configuration is enabled because at least one V2 configuration was used, please migrate to V3 configuration, or set 'NEKO_LEGACY=true' to acknowledge this message")
|
||||
log.Warn().Msg("legacy configuration is enabled because at least one V2 configuration was used, please migrate to V3 configuration, visit https://neko.m1k1o.net/docs/v3/migration-from-v2 for more details")
|
||||
viper.Set("legacy", true)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -206,7 +206,7 @@ func (s *Session) SetV2() {
|
|||
|
||||
// set legacy flag if any V2 configuration was used
|
||||
if !viper.IsSet("legacy") && enableLegacy {
|
||||
log.Warn().Msg("legacy configuration is enabled because at least one V2 configuration was used, please migrate to V3 configuration, or set 'NEKO_LEGACY=true' to acknowledge this message")
|
||||
log.Warn().Msg("legacy configuration is enabled because at least one V2 configuration was used, please migrate to V3 configuration, visit https://neko.m1k1o.net/docs/v3/migration-from-v2 for more details")
|
||||
viper.Set("legacy", true)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,17 +67,17 @@ func (WebRTC) Init(cmd *cobra.Command) error {
|
|||
}
|
||||
|
||||
// Looks like this is conflicting with the frontend and backend ICE servers since latest versions
|
||||
//cmd.PersistentFlags().String("webrtc.iceservers", "[]", "Global STUN and TURN servers in JSON format with `urls`, `username` and `credential` keys")
|
||||
//cmd.PersistentFlags().String("webrtc.iceservers", "[]", "STUN and TURN servers used by the ICE agent")
|
||||
//if err := viper.BindPFlag("webrtc.iceservers", cmd.PersistentFlags().Lookup("webrtc.iceservers")); err != nil {
|
||||
// return err
|
||||
//}
|
||||
|
||||
cmd.PersistentFlags().String("webrtc.iceservers.frontend", "[]", "Frontend only STUN and TURN servers in JSON format with `urls`, `username` and `credential` keys")
|
||||
cmd.PersistentFlags().String("webrtc.iceservers.frontend", "[]", "STUN and TURN servers used by the frontend")
|
||||
if err := viper.BindPFlag("webrtc.iceservers.frontend", cmd.PersistentFlags().Lookup("webrtc.iceservers.frontend")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
cmd.PersistentFlags().String("webrtc.iceservers.backend", "[]", "Backend only STUN and TURN servers in JSON format with `urls`, `username` and `credential` keys")
|
||||
cmd.PersistentFlags().String("webrtc.iceservers.backend", "[]", "STUN and TURN servers used by the backend")
|
||||
if err := viper.BindPFlag("webrtc.iceservers.backend", cmd.PersistentFlags().Lookup("webrtc.iceservers.backend")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -217,14 +217,14 @@ func (s *WebRTC) Set() {
|
|||
|
||||
// parse frontend ice servers
|
||||
if err := viper.UnmarshalKey("webrtc.iceservers.frontend", &s.ICEServersFrontend, viper.DecodeHook(
|
||||
utils.JsonStringAutoDecode([]types.ICEServer{}),
|
||||
utils.JsonStringAutoDecode(s.ICEServersFrontend),
|
||||
)); err != nil {
|
||||
log.Warn().Err(err).Msgf("unable to parse frontend ICE servers")
|
||||
}
|
||||
|
||||
// parse backend ice servers
|
||||
if err := viper.UnmarshalKey("webrtc.iceservers.backend", &s.ICEServersBackend, viper.DecodeHook(
|
||||
utils.JsonStringAutoDecode([]types.ICEServer{}),
|
||||
utils.JsonStringAutoDecode(s.ICEServersBackend),
|
||||
)); err != nil {
|
||||
log.Warn().Err(err).Msgf("unable to parse backend ICE servers")
|
||||
}
|
||||
|
@ -238,7 +238,7 @@ func (s *WebRTC) Set() {
|
|||
// parse global ice servers
|
||||
var iceServers []types.ICEServer
|
||||
if err := viper.UnmarshalKey("webrtc.iceservers", &iceServers, viper.DecodeHook(
|
||||
utils.JsonStringAutoDecode([]types.ICEServer{}),
|
||||
utils.JsonStringAutoDecode(iceServers),
|
||||
)); err != nil {
|
||||
log.Warn().Err(err).Msgf("unable to parse global ICE servers")
|
||||
}
|
||||
|
@ -409,7 +409,7 @@ func (s *WebRTC) SetV2() {
|
|||
|
||||
// set legacy flag if any V2 configuration was used
|
||||
if !viper.IsSet("legacy") && enableLegacy {
|
||||
log.Warn().Msg("legacy configuration is enabled because at least one V2 configuration was used, please migrate to V3 configuration, or set 'NEKO_LEGACY=true' to acknowledge this message")
|
||||
log.Warn().Msg("legacy configuration is enabled because at least one V2 configuration was used, please migrate to V3 configuration, visit https://neko.m1k1o.net/docs/v3/migration-from-v2 for more details")
|
||||
viper.Set("legacy", true)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,14 +10,19 @@ import (
|
|||
"github.com/m1k1o/neko/server/pkg/xevent"
|
||||
)
|
||||
|
||||
const (
|
||||
ClipboardTextPlainTarget = "UTF8_STRING"
|
||||
ClipboardTextHtmlTarget = "text/html"
|
||||
)
|
||||
|
||||
func (manager *DesktopManagerCtx) ClipboardGetText() (*types.ClipboardText, error) {
|
||||
text, err := manager.ClipboardGetBinary("STRING")
|
||||
text, err := manager.ClipboardGetBinary(ClipboardTextPlainTarget)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Rich text must not always be available, can fail silently.
|
||||
html, _ := manager.ClipboardGetBinary("text/html")
|
||||
html, _ := manager.ClipboardGetBinary(ClipboardTextHtmlTarget)
|
||||
|
||||
return &types.ClipboardText{
|
||||
Text: string(text),
|
||||
|
@ -31,10 +36,10 @@ func (manager *DesktopManagerCtx) ClipboardSetText(data types.ClipboardText) err
|
|||
// is set, if available. Otherwise plain text.
|
||||
|
||||
if data.HTML != "" {
|
||||
return manager.ClipboardSetBinary("text/html", []byte(data.HTML))
|
||||
return manager.ClipboardSetBinary(ClipboardTextHtmlTarget, []byte(data.HTML))
|
||||
}
|
||||
|
||||
return manager.ClipboardSetBinary("STRING", []byte(data.Text))
|
||||
return manager.ClipboardSetBinary(ClipboardTextPlainTarget, []byte(data.Text))
|
||||
}
|
||||
|
||||
func (manager *DesktopManagerCtx) ClipboardGetBinary(mime string) ([]byte, error) {
|
||||
|
|
|
@ -9,6 +9,7 @@ import (
|
|||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/m1k1o/neko/server/internal/api"
|
||||
oldEvent "github.com/m1k1o/neko/server/internal/http/legacy/event"
|
||||
|
@ -35,9 +36,6 @@ var (
|
|||
return true
|
||||
},
|
||||
}
|
||||
|
||||
// DefaultDialer is a dialer with all fields set to the default zero values.
|
||||
DefaultDialer = websocket.DefaultDialer
|
||||
)
|
||||
|
||||
type LegacyHandler struct {
|
||||
|
@ -45,16 +43,21 @@ type LegacyHandler struct {
|
|||
serverAddr string
|
||||
bannedIPs map[string]struct{}
|
||||
sessionIPs map[string]string
|
||||
wsDialer *websocket.Dialer
|
||||
}
|
||||
|
||||
func New() *LegacyHandler {
|
||||
func New(serverAddr string) *LegacyHandler {
|
||||
// Init
|
||||
|
||||
return &LegacyHandler{
|
||||
logger: log.With().Str("module", "legacy").Logger(),
|
||||
serverAddr: "127.0.0.1:8080",
|
||||
serverAddr: serverAddr,
|
||||
bannedIPs: make(map[string]struct{}),
|
||||
sessionIPs: make(map[string]string),
|
||||
wsDialer: &websocket.Dialer{
|
||||
Proxy: nil, // disable proxy for local requests
|
||||
HandshakeTimeout: 45 * time.Second,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -99,7 +102,7 @@ func (h *LegacyHandler) Route(r types.Router) {
|
|||
defer s.destroy()
|
||||
|
||||
// dial to the remote backend
|
||||
connBackend, _, err := DefaultDialer.Dial("ws://"+h.serverAddr+"/api/ws?token="+url.QueryEscape(s.token), nil)
|
||||
connBackend, _, err := h.wsDialer.Dial("ws://"+h.serverAddr+"/api/ws?token="+url.QueryEscape(s.token), nil)
|
||||
if err != nil {
|
||||
h.logger.Error().Err(err).Msg("couldn't dial to the remote backend")
|
||||
|
||||
|
@ -142,7 +145,7 @@ func (h *LegacyHandler) Route(r types.Router) {
|
|||
m = websocket.FormatCloseMessage(e.Code, e.Text)
|
||||
}
|
||||
}
|
||||
errc <- err
|
||||
errc <- fmt.Errorf("src read message error: %w", err)
|
||||
dst.WriteMessage(websocket.CloseMessage, m)
|
||||
break
|
||||
}
|
||||
|
@ -163,12 +166,20 @@ func (h *LegacyHandler) Route(r types.Router) {
|
|||
})
|
||||
continue
|
||||
} else if errors.Is(err, ErrWebsocketSend) {
|
||||
errc <- err
|
||||
errc <- fmt.Errorf("dst write message error: %w", err)
|
||||
break
|
||||
} else {
|
||||
h.logger.Error().Err(err).Msg("couldn't rewrite text message")
|
||||
}
|
||||
}
|
||||
// forward ping messages
|
||||
if msgType == websocket.PingMessage {
|
||||
err = dst.WriteMessage(websocket.PingMessage, nil)
|
||||
if err != nil {
|
||||
errc <- err
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -181,9 +192,9 @@ func (h *LegacyHandler) Route(r types.Router) {
|
|||
var message string
|
||||
select {
|
||||
case err = <-errClient:
|
||||
message = "websocketproxy: Error when copying from backend to client: %v"
|
||||
message = "websocketproxy: Error when copying from backend to client"
|
||||
case err = <-errBackend:
|
||||
message = "websocketproxy: Error when copying from client to backend: %v"
|
||||
message = "websocketproxy: Error when copying from client to backend"
|
||||
}
|
||||
|
||||
if e, ok := err.(*websocket.CloseError); !ok || e.Code == websocket.CloseAbnormalClosure {
|
||||
|
|
|
@ -55,13 +55,18 @@ type session struct {
|
|||
}
|
||||
|
||||
func (h *LegacyHandler) newSession(r *http.Request) *session {
|
||||
transport := http.DefaultTransport.(*http.Transport).Clone()
|
||||
transport.Proxy = nil // disable proxy for local requests
|
||||
|
||||
return &session{
|
||||
r: r,
|
||||
h: h,
|
||||
logger: h.logger,
|
||||
serverAddr: h.serverAddr,
|
||||
client: http.DefaultClient,
|
||||
sessions: make(map[string]*memberStruct),
|
||||
client: &http.Client{
|
||||
Transport: transport,
|
||||
},
|
||||
sessions: make(map[string]*memberStruct),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ package http
|
|||
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
|
@ -56,11 +57,6 @@ func New(WebSocketManager types.WebSocketManager, ApiManager types.ApiManager, c
|
|||
return config.AllowOrigin(r.Header.Get("Origin"))
|
||||
}))
|
||||
|
||||
// Legacy handler
|
||||
if viper.GetBool("legacy") {
|
||||
legacy.New().Route(router)
|
||||
}
|
||||
|
||||
batch := batchHandler{
|
||||
Router: router,
|
||||
PathPrefix: "/api",
|
||||
|
@ -122,6 +118,24 @@ func (manager *HttpManagerCtx) Start() {
|
|||
}
|
||||
}()
|
||||
manager.logger.Info().Msgf("https listening on %s", manager.http.Addr)
|
||||
|
||||
// if we have legacy mode, we need to start local http server too
|
||||
if viper.GetBool("legacy") {
|
||||
// create a listener for the API server with a random port
|
||||
listener, err := net.Listen("tcp", "127.0.0.1:0")
|
||||
if err != nil {
|
||||
manager.logger.Panic().Err(err).Msg("unable to start legacy http proxy")
|
||||
}
|
||||
|
||||
go func() {
|
||||
if err := http.Serve(listener, manager.router); err != http.ErrServerClosed {
|
||||
manager.logger.Panic().Err(err).Msg("unable to start http server")
|
||||
}
|
||||
}()
|
||||
manager.logger.Info().Msgf("legacy proxy listening on %s", listener.Addr().String())
|
||||
|
||||
legacy.New(listener.Addr().String()).Route(manager.router)
|
||||
}
|
||||
} else {
|
||||
go func() {
|
||||
if err := manager.http.ListenAndServe(); err != http.ErrServerClosed {
|
||||
|
@ -129,6 +143,11 @@ func (manager *HttpManagerCtx) Start() {
|
|||
}
|
||||
}()
|
||||
manager.logger.Info().Msgf("http listening on %s", manager.http.Addr)
|
||||
|
||||
// start legacy proxy if enabled
|
||||
if viper.GetBool("legacy") {
|
||||
legacy.New(manager.http.Addr).Route(manager.router)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ func (manager *WebRTCManagerCtx) handleLegacy(
|
|||
}
|
||||
|
||||
logger.
|
||||
Debug().
|
||||
Trace().
|
||||
Str("x", strconv.Itoa(int(payload.X))).
|
||||
Str("y", strconv.Itoa(int(payload.Y))).
|
||||
Msg("scroll")
|
||||
|
@ -97,7 +97,7 @@ func (manager *WebRTCManagerCtx) handleLegacy(
|
|||
return nil
|
||||
}
|
||||
|
||||
logger.Debug().Msgf("button down %d", payload.Key)
|
||||
logger.Trace().Msgf("button down %d", payload.Key)
|
||||
} else {
|
||||
err := manager.desktop.KeyDown(uint32(payload.Key))
|
||||
if err != nil {
|
||||
|
@ -105,7 +105,7 @@ func (manager *WebRTCManagerCtx) handleLegacy(
|
|||
return nil
|
||||
}
|
||||
|
||||
logger.Debug().Msgf("key down %d", payload.Key)
|
||||
logger.Trace().Msgf("key down %d", payload.Key)
|
||||
}
|
||||
case OP_KEY_UP:
|
||||
payload := &PayloadKey{}
|
||||
|
@ -121,7 +121,7 @@ func (manager *WebRTCManagerCtx) handleLegacy(
|
|||
return nil
|
||||
}
|
||||
|
||||
logger.Debug().Msgf("button up %d", payload.Key)
|
||||
logger.Trace().Msgf("button up %d", payload.Key)
|
||||
} else {
|
||||
err := manager.desktop.KeyUp(uint32(payload.Key))
|
||||
if err != nil {
|
||||
|
@ -129,7 +129,7 @@ func (manager *WebRTCManagerCtx) handleLegacy(
|
|||
return nil
|
||||
}
|
||||
|
||||
logger.Debug().Msgf("key up %d", payload.Key)
|
||||
logger.Trace().Msgf("key up %d", payload.Key)
|
||||
}
|
||||
case OP_KEY_CLK:
|
||||
// unused
|
||||
|
|
|
@ -276,7 +276,9 @@ func (manager *WebSocketManagerCtx) connect(connection *websocket.Conn, r *http.
|
|||
|
||||
e, ok := err.(*websocket.CloseError)
|
||||
if !ok {
|
||||
err = errors.Unwrap(err) // unwrap if possible
|
||||
if e := errors.Unwrap(err); e != nil {
|
||||
err = e // unwrap if possible
|
||||
}
|
||||
logger.Warn().Err(err).Msg("read message error")
|
||||
// client is expected to reconnect soon
|
||||
delayedDisconnect = true
|
||||
|
|
|
@ -43,7 +43,9 @@ func (peer *WebSocketPeerCtx) Send(event string, payload any) {
|
|||
})
|
||||
|
||||
if err != nil {
|
||||
err = errors.Unwrap(err) // unwrap if possible
|
||||
if e := errors.Unwrap(err); e != nil {
|
||||
err = e // unwrap if possible
|
||||
}
|
||||
peer.logger.Warn().Err(err).Str("event", event).Msg("send message error")
|
||||
return
|
||||
}
|
||||
|
|
3
utils/docker/go.mod
Normal file
3
utils/docker/go.mod
Normal file
|
@ -0,0 +1,3 @@
|
|||
module github.com/m1k1o/neko/utils/docker
|
||||
|
||||
go 1.24.1
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue