thearyadev / MSRF

Automates Microsoft rewards.
Apache License 2.0
62 stars 9 forks source link

[FEATURE] Windows/Linux Server Support #11

Closed DerMuffin closed 1 year ago

DerMuffin commented 1 year ago

I using now the legacy script in headless mode on a linux Server without any gui. Will this script work there? Or is this for GUI only machines?

Thanks

thearyadev commented 1 year ago

It can but some changes would be needed. I’ve had it on my list for a while now, it will likely be implemented for the v1.0 release.

The GUI library im using is Flet, which can be run as a desktop application or a webpage, from the same source code.

The only thing stopping a server instance from being possible currently is testing on Linux. I haven’t had the opportunity to thoroughly test functionality on multiple environments because of the lack of a complete test suite, which is something im currently working on.

There’s also some other changes id like to make to better suit a server environment of this.

I can’t provide an ETA for this, but it is on the list of things I’d like to add to this project.

DerMuffin commented 1 year ago

Thanks!

thearyadev commented 1 year ago

I've got this working in my test build. I'm looking to make this available for the 0.6b or 0.7b release of MSRF. ETA: 7-10 days.

As theres special setup required, I'm likely moving towards a Docker image to deploy a server instance to avoid confusion with setup. Ill also be providing manual installation instructions in case using Docker isn't ideal.

thearyadev commented 1 year ago

@DerMuffin

I've spent a few hours working on this. It likely has some problems, but I've included everything required to get a server up and running. Goal is to make this more stable for the 0.7b release.

Its included in the latest release. https://github.com/thearyadev/MSRF/releases/tag/v0.6b

Feedback on this will be greatly appriciated. Let me know if you need any help getting this set up.

Server installation is supported through Docker. The following steps assumes:

Installation steps:

  1. Create a new directory to work with the project files. This example will use ./msrf-home. cd ./msrf-home
  2. Run the following command: curl -o msrf-v0.6b.zip https://codeload.github.com/thearyadev/MSRF/zip/refs/tags/v0.6b && unzip msrf-v0.6b.zip && rm msrf-v0.6b.zip
  3. A new directory has been created, ./msrf-home/MSRF-0.6b. CD into this directory.
  4. Open the file ./msrf-home/configuration.yaml in an editor. Change the line mode: APPLICATION to mode: SERVER
  5. Run the command docker build -t msrf_06b .. This will create a docker image.
  6. Run the command docker run -d -p 50947:50947 msrf_06b
  7. Navigate to http://<IP_ADDRESS>:50947 in your web browser.
thearyadev commented 1 year ago

selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally. Currently addressing a problem where the browser fails to initialize correctly in the docker container.

thearyadev commented 1 year ago

The problem identified above is caused by chrome not running correctly in the screenless environment. A change has been made to the browser intialization to prevent this from happening.

options.add_argument("--no-sandbox")  # without this causes chrome to crash in screen-less environment
options.add_argument("--disable-dev-shm-usage")  # without this causes chrome to crash in screen-less environment
driver = webdriver.Chrome(options=options)

Will be included in v0.7b

Changes are currently available in the main branch. Config is setup for development.

thearyadev commented 1 year ago

Continuing to address some persistent issues with the server instance. Likely stable for v0.7b release.