Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

noVNC/portal, tunnel, notifications, ARM, docker #13

Open
4 of 6 tasks
vogler opened this issue Apr 9, 2022 · 8 comments
Open
4 of 6 tasks

noVNC/portal, tunnel, notifications, ARM, docker #13

vogler opened this issue Apr 9, 2022 · 8 comments
Labels
feature New feature or request

Comments

@vogler
Copy link
Owner

vogler commented Apr 9, 2022

Planning/discussion issue for the ideas that came up in #11

  • noVNC to remote-control browser for login or captcha

  • tunnel / reverse proxy for easy access from outside the local network

    @jackblk: I think implementing noVNC is nice, because if we meet captcha, we can send a notification to our device (maybe use apprise?). Then user can open noVNC to control the browser, solve the captcha & claim the game. It has password built in so it's fine to forward the port. Maybe we can use ngrok to tunnel it as well.

    @vogler: ngrok docs look like you need an API key to use it? Here are some alternatives we could try:

    Via ssh in docker: https://serveo.net

    Alternative: puppeteer-extra-plugin-portal, but unclear if it works with Playwright.

  • notifications

    apprise is in Python and I didn't find any JS bindings or an alternative project for nodejs.
    We could use it in the docker image, but it would be nicer to send notifications from the JS files.
    We could shell out from JS, but then you'd still have the setup problem for people not using the docker image. @vogler

  • GitHub actions to upload to Docker hub

  • Reduce the image size (alpine, Firefox instead of Chromium) slim docker image #68

    @jackblk: As much as I want to use Alpine image, it doesn't work with Playwright due to browser binaries again (alpine uses musl instead of glibc).

  • ARM support Run on Raspberry Pi -> requires 64-bit OS #3

    @jackblk: Consider using Firefox? -> can fix raspberry arm 32bit issue, smaller size
    @jackblk: Playwright browser binaries only fully supports amd64 and arm64 for now. This means the docker image will not work for Raspberry <4.
    For arm 32 bit, using local built browser for armhf won't work even if we use executablePath. If you can find a way for it to work with executablePath then we can consider but I doubt it.
    @vogler: Raspberry Pi (3, 4, Zero 2): Raspbian won't work since it's 32-bit, but Raspberry Pi OS (64-bit) or Ubuntu will.

@vogler
Copy link
Owner Author

vogler commented Apr 10, 2022

@jackblk I added you as a collaborator and created a project board: https://github.com/vogler/free-games-claimer/projects/1

Not sure what's better, I guess having this meta issue is enough to keep an overview.

@jackblk
Copy link
Collaborator

jackblk commented Apr 13, 2022

@vogler I made it so it can work with Alpine in branch docker-alpine-wip. The chromium shipped with playwright will not work in Alpine because of musl/glibc incompatibility, so I tried using chromium build shipped with Alpine packages.

It can run, but it will be detected by captcha and I have to reset my IP for a clean one 😞 .

So for now, I save the progress in the branch, but we have to abandon this method until Playwright has better support for Alpine.


For your Raspberry 4 (arm64?), maybe the problem is with 32bit userland? Because we can only use Chromium coming from Playwright to evade captcha, I don't think it can be supported. So right now we can only support x86/x64 and arm64 (only tested on Mac M1). Firefox approach seems to be a dead end for Raspberry too, because Playwright needs patched binaries for Firefox & Webkit.

@vogler
Copy link
Owner Author

vogler commented May 5, 2022

Maybe use

@vogler
Copy link
Owner Author

vogler commented May 5, 2022

Heads-up: I'll move userDataDir -> data/browser, screenshots -> data/screenshots such that there's just one directory with all user data to ignore and map into docker.

@QIN2DIM
Copy link

QIN2DIM commented May 5, 2022

GitHub actions to upload to Docker hub

Maybe this configuration can achieve the demand. New docker_token.

name: ci

on:
  workflow_dispatch:
  push:
    branches:
      - main
    paths-ignore:
      - ".github/**"
      - "README.md"
      - "LICENSE"
      - ".gitignore"
env:
  IMAGE_TAG: # such as vogler/free-games-claimer:alpha

jobs:
  docker:
    runs-on: ubuntu-latest
    steps:
      -
        name: Checkout
        uses: actions/checkout@v2
      -
        name: Project Init
        run: # Do some pre-processing initialization work, if not necessary, you can delete this step
      -
        name: Set up QEMU
        uses: docker/setup-qemu-action@v1
      -
        name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
      -
        name: Login to DockerHub
        uses: docker/login-action@v1
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}
      -
        name: Build and push
        uses: docker/build-push-action@v2
        with:
          context: .
          platforms: linux/amd64 # linux/arm64
          push: true
          tags: ${{ env.IMAGE_TAG }}

@vogler
Copy link
Owner Author

vogler commented Oct 21, 2022

GitHub Action to build and push images: https://github.com/vogler/free-games-claimer/blob/main/.github/workflows/docker.yml
Also see #31.

@vogler
Copy link
Owner Author

vogler commented Jan 25, 2023

Notifications merged with #49.
Screenshot 2023-01-25 at 19 07 24

@vogler
Copy link
Owner Author

vogler commented Jan 25, 2023

Running on ARM requires 64-bit (not just available for RPi4), mentioned in readme:

Raspberry Pi (3, 4, Zero 2): Raspbian won't work since it's 32-bit, but Raspberry Pi OS (64-bit) or Ubuntu will.

@vogler vogler added the feature New feature or request label Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants