diff --git a/.github/workflows/windows-build.yml b/.github/workflows/release.yml similarity index 51% rename from .github/workflows/windows-build.yml rename to .github/workflows/release.yml index 90f42f04..31e8eda5 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/release.yml @@ -1,9 +1,8 @@ -name: Windows Build +name: Binary Release on: - push: - branches: master - + workflow_dispatch: + jobs: build: runs-on: windows-latest @@ -36,23 +35,44 @@ jobs: - name: Prepare distribution run: | + cd poker mkdir dist\main\log mkdir dist\main\pics mkdir dist\main\log\screenshots - mkdir dist\main\decisionmaker - copy icon.ico dist\main - copy config_default.ini dist\main\config.ini + xcopy icon.ico dist\main\poker.ico* /Y + xcopy config_default.ini dist\main\config.ini* /Y xcopy vboxapi dist\main\vboxapi\ /E + - name: Show content + run: | + cd poker + dir dist\main + - name: Install NSIS run: | choco install nsis - name: Run NSIS - run: makensis -V3 DeepMindPokerbot.nsi - - - name: Upload Artifacts - uses: actions/upload-artifact@v2 + run: | + makensis -V3 DeepMindPokerbot.nsi + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: DeepermindPokerbot-${{ github.run_number }} + release_name: Release ${{ github.run_number }} + draft: false + prerelease: false + + - name: Upload Executable to Release + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - name: compiled-app - path: DeepMindPokerbot_winstaller.exe + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./DeepMindPokerbot_winstaller.exe + asset_name: DeepMindPokerbot_winstaller.exe + asset_content_type: application/octet-stream diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml new file mode 100644 index 00000000..483d9ad8 --- /dev/null +++ b/.github/workflows/website.yml @@ -0,0 +1,36 @@ +name: Update Website + +on: + push: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Use Node.js + uses: actions/setup-node@v1 + with: + node-version: '14' + + - name: Install Dependencies + run: npm install + working-directory: ./website + + - name: Build + run: npm run build + working-directory: ./website + + - name: Deploy to Server + run: | + mkdir -p ~/.ssh + echo "${{ secrets.DEPLOYMENT_KEY }}" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + ssh-keyscan dickreuter.com >> ~/.ssh/known_hosts + scp -i ~/.ssh/id_rsa -r ./dist/* ec2-user@dickreuter.com:/home/ec2-user/www/deepermind-pokerbot.com + env: + DEPLOY_KEY: ${{ secrets.DEPLOYMENT_KEY }} + working-directory: ./website diff --git a/.gitignore b/.gitignore index 481e4c36..c7f62dd3 100644 --- a/.gitignore +++ b/.gitignore @@ -166,7 +166,6 @@ cython_debug/ best_strategies.js package.bat *.exe -*.nsi pokwerbot_downloader_initia.py desktop.ini pokerbot_downloader_initial.py @@ -229,4 +228,8 @@ Poker.code-workspace *.png*.dmg *.autosave *.code-workspace -*.png \ No newline at end of file +*.png +*.ini +*.sh +*.spec +*.ipynb \ No newline at end of file diff --git a/main.spec b/main.spec deleted file mode 100644 index 6cdd58f0..00000000 --- a/main.spec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- mode: python ; coding: utf-8 -*- - -block_cipher = None - - -a = Analysis(['main.py'], - pathex=['poker'], - datas=[ ( 'gui/ui/*.ui', '.' ),( 'gui/ui/*.ui', 'gui/ui' ),( 'decisionmaker/*.json', 'decisionmaker' )], - binaries=[], - hiddenimports=['pkg_resources.py2_warn', 'fastapi'], - hookspath=[], - runtime_hooks=[], - excludes=[], - win_no_prefer_redirects=False, - win_private_assemblies=False, - cipher=block_cipher, - noarchive=False) -pyz = PYZ(a.pure, a.zipped_data, - cipher=block_cipher) -exe = EXE(pyz, - a.scripts, - [], - exclude_binaries=True, - name='main', - debug=False, - bootloader_ignore_signals=False, - strip=False, - upx=True, - console=True, - icon='icon.ico') -coll = COLLECT(exe, - a.binaries, - a.zipfiles, - a.datas, - strip=False, - upx=True, - upx_exclude=[], - name='main') diff --git a/poker/DeepMindPokerbot.nsi b/poker/DeepMindPokerbot.nsi new file mode 100755 index 00000000..5a3e7152 --- /dev/null +++ b/poker/DeepMindPokerbot.nsi @@ -0,0 +1,148 @@ +;NSIS Modern User Interface +;Basic Example Script + +;-------------------------------- +;Include Modern UI + + !include "MUI2.nsh" + !define MUI_PRODUCT "DeepMind Pokerbot" + !define MUI_FILE "main" + !define MUI_VERSION "" + !define MUI_BRANDINGTEXT "DeepMind Pokerbot" + !define MUI_ICON "icon.ico" + !define MUI_UNICON "icon.ico" + CRCCheck On + + ;-------------------------------- +;Language + !insertmacro MUI_LANGUAGE "English" + !include LogicLib.nsh + +;-------------------------------- + + +;Folder selection page + + InstallDir "$APPDATA\${MUI_PRODUCT}" + + +;-------------------------------- +;Modern UI Configuration + +Page components +Page directory +Page instfiles +UninstPage uninstConfirm +UninstPage instfiles + + + + + +;-------------------------------- +;General + + ;Name and file + Name "DeepMindPokerbot" + OutFile "..\DeepMindPokerbot_winstaller.exe" + + + + + ;Get installation folder from registry if available + InstallDirRegKey HKCU "Software\DeepMindPokerbot" "" + + ;Request application privileges for Windows Vista + RequestExecutionLevel admin ;Require admin rights on NT6+ (When UAC is turned on) + + +;-------------------------------- +;Installer Sections + +Section "DeepMind Pokerbot" +SectionIn RO + + SetOutPath "$INSTDIR\tessdata" + File /r "..\tessdata\*" + SetOutPath "$INSTDIR" + File /r "dist\main\*" + + + ;Store installation folder + WriteRegStr HKCU "Software\DeepMindPokerbot" "" $INSTDIR + + ;create desktop shortcut + CreateShortCut "$DESKTOP\${MUI_PRODUCT}.lnk" "$INSTDIR\${MUI_FILE}" "" "$INSTDIR\icon.ico" + + ;create start-menu items + CreateDirectory "$SMPROGRAMS\${MUI_PRODUCT}" + CreateShortCut "$SMPROGRAMS\${MUI_PRODUCT}\Uninstall.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0 + CreateShortCut "$SMPROGRAMS\${MUI_PRODUCT}\${MUI_PRODUCT}.lnk" "$INSTDIR\${MUI_FILE}.exe" "$INSTDIR\icon.ico" "$INSTDIR\${MUI_FILE}.exe" 0 + + ;write uninstall information to the registry + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" "DisplayName" "${MUI_PRODUCT} (remove only)" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" "UninstallString" "$INSTDIR\Uninstall.exe" + + ;Create uninstaller + WriteUninstaller "$INSTDIR\Uninstall.exe" + + Call LaunchLink +SectionEnd + + +;-------------------------------- + +;Uninstaller Section +Section "Uninstall" + +;Delete Files + RMDir /r "$INSTDIR\*.*" + +;Remove the installation directory + RMDir "$INSTDIR" + +;Delete Start Menu Shortcuts + Delete "$DESKTOP\${MUI_PRODUCT}.lnk" + Delete "$SMPROGRAMS\${MUI_PRODUCT}\*.*" + RmDir "$SMPROGRAMS\${MUI_PRODUCT}" + + ;Delete Desktop Shortcuts + Delete "$DESKTOP\${MUI_PRODUCT}.lnk" + +;Delete Uninstaller And Unistall Registry Entries + DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\${MUI_PRODUCT}" + DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" + +SectionEnd + + +;-------------------------------- +;MessageBox Section + + + + +Function un.onUninstSuccess + MessageBox MB_OK "You have successfully uninstalled ${MUI_PRODUCT}." +FunctionEnd + + Function LaunchLink + MessageBox MB_YESNO "Start the Pokerbot now?" IDYES true IDNO false + true: + ExecShell "" "$DESKTOP\${MUI_PRODUCT}.lnk" + false: + +FunctionEnd + + +Function .onInit +UserInfo::GetAccountType +pop $0 +${If} $0 != "admin" ;Require admin rights on NT4+ + MessageBox mb_iconstop "Administrator rights required!" + SetErrorLevel 740 ;ERROR_ELEVATION_REQUIRED + Quit +${EndIf} +FunctionEnd + +;eof \ No newline at end of file diff --git a/poker/main.spec b/poker/main.spec index 39014552..6cdd58f0 100644 --- a/poker/main.spec +++ b/poker/main.spec @@ -1,50 +1,38 @@ # -*- mode: python ; coding: utf-8 -*- - block_cipher = None -a = Analysis( - ['main.py'], - pathex=[], - binaries=[], - datas=[], - hiddenimports=[], - hookspath=[], - hooksconfig={}, - runtime_hooks=[], - excludes=[], - win_no_prefer_redirects=False, - win_private_assemblies=False, - cipher=block_cipher, - noarchive=False, -) -pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) - -exe = EXE( - pyz, - a.scripts, - [], - exclude_binaries=True, - name='main', - debug=False, - bootloader_ignore_signals=False, - strip=False, - upx=True, - console=True, - disable_windowed_traceback=False, - argv_emulation=False, - target_arch=None, - codesign_identity=None, - entitlements_file=None, -) -coll = COLLECT( - exe, - a.binaries, - a.zipfiles, - a.datas, - strip=False, - upx=True, - upx_exclude=[], - name='main', -) +a = Analysis(['main.py'], + pathex=['poker'], + datas=[ ( 'gui/ui/*.ui', '.' ),( 'gui/ui/*.ui', 'gui/ui' ),( 'decisionmaker/*.json', 'decisionmaker' )], + binaries=[], + hiddenimports=['pkg_resources.py2_warn', 'fastapi'], + hookspath=[], + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False) +pyz = PYZ(a.pure, a.zipped_data, + cipher=block_cipher) +exe = EXE(pyz, + a.scripts, + [], + exclude_binaries=True, + name='main', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + console=True, + icon='icon.ico') +coll = COLLECT(exe, + a.binaries, + a.zipfiles, + a.datas, + strip=False, + upx=True, + upx_exclude=[], + name='main') diff --git a/requirements.txt b/requirements.txt index 9e577dde..86cd8f05 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,31 +1,31 @@ -pandas -pytest +pandas==2.0.3 +pytest==7.3.1 pylint pydocstyle -numpy -matplotlib +numpy==1.23.5 +matplotlib==3.7.2 scipy -opencv-python +opencv-python==4.8.0.76 pillow -pyinstaller -pymongo +pyinstaller==5.13.0 +pymongo==4.3.3 pyqt6 -pytesseract +pytesseract==0.3.10 virtualbox pyyaml requests jupyter xlib xlrd -lmfit -openpyxl -numexpr -fastapi -tensorflow +lmfit==1.2.0 +openpyxl==3.1.2 +numexpr==2.8.4 +fastapi==0.101.1 +tensorflow==2.12.0 tqdm -seaborn +seaborn==0.12.2 PyJWT==1.7.0 flask_jwt_extended fastapi_auth -uvicorn +uvicorn==0.23.2 tesserocr diff --git a/website/package.json b/website/package.json index b332f817..a7ae36dc 100644 --- a/website/package.json +++ b/website/package.json @@ -5,8 +5,8 @@ "type": "module", "scripts": { "dev": "vite", - "build": "tsc && vite build", - "build2": "vite build", + "build_strict": "tsc && vite build", + "build": "vite build", "forcebuild": "vite build", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "preview": "vite preview" diff --git a/website/src/routes/NavBar.tsx b/website/src/routes/NavBar.tsx index 93c34c50..2edcf580 100644 --- a/website/src/routes/NavBar.tsx +++ b/website/src/routes/NavBar.tsx @@ -1,45 +1,77 @@ -import 'bootstrap/dist/css/bootstrap.css'; +import "bootstrap/dist/css/bootstrap.css"; import { Link } from "react-router-dom"; +import { useDlLink } from "../views/config"; function NavBar() { - return ( - - ) + + + ); } -export default NavBar \ No newline at end of file +export default NavBar; diff --git a/website/src/views/Purchase.tsx b/website/src/views/Purchase.tsx index ee779f87..1806d10d 100644 --- a/website/src/views/Purchase.tsx +++ b/website/src/views/Purchase.tsx @@ -1,194 +1,233 @@ -import Button from '@mui/material/Button'; -import ClickAwayListener from '@mui/material/ClickAwayListener'; -import Tooltip from '@mui/material/Tooltip'; -import 'bootstrap/dist/css/bootstrap.css'; -import { useState } from 'react'; +import Button from "@mui/material/Button"; +import ClickAwayListener from "@mui/material/ClickAwayListener"; +import Tooltip from "@mui/material/Tooltip"; +import axios from "axios"; +import "bootstrap/dist/css/bootstrap.css"; +import { useState } from "react"; +import { useDlLink } from './config'; function PaymentCards() { - const [hover, setHover] = useState(false); - const [showBitcoin, setShowBitcoin] = useState(false); - const bitcoinAddress = "bc1q6r0l549jefv3rgs7e0jzsdkx9pq9trd2cqyw50" - const dl_link = "https://onedrive.live.com/download?cid=A3B69BDCC03E82A9&resid=A3B69BDCC03E82A9%21111289&authkey=AEftpEpz8jxnBdI" + const [hover, setHover] = useState(false); + const [showBitcoin, setShowBitcoin] = useState(false); + const bitcoinAddress = "bc1q6r0l549jefv3rgs7e0jzsdkx9pq9trd2cqyw50"; + const dlLink = useDlLink(); + const goToLink = (link: string) => { + window.location.href = link; + }; + const handleCopy = () => { + if (!showBitcoin) setShowBitcoin(true); + else setShowBitcoin(false); + }; - const goToLink = (link: string) => { - window.location.href = link; - } - const handleCopy = () => { - if (!showBitcoin) setShowBitcoin(true); - else setShowBitcoin(false); - }; - - return ( - <>
-
-
-
- {/*
*/} -
-
-
Free
-
Version
-
-
-
-

    -
  • Scrape Table and Analyze
  • -
  • Auto Click on best action
  • -
  • Select table templates
  • -
  • Map your own tables
  • -
  • Analyze results
  • -
  • Track payoff
  • -
    -
  • Trial strategies
  • -
    -
  • Get free trial for betfair-bot.com
  • - -
-
-
- {/*
*/} -
-
-
-
-
-
Monthly
-
$25 / month
-
-
-
-

    -
  • Scrape Table and Analyze
  • -
  • Auto Click on best action
  • -
  • Select table templates
  • -
  • Map your own tables
  • -
  • Analyze results
  • -
  • Track payoff
  • -
    + return ( + <> +
    +
    +
    +
    + {/*
    */} +
    +
    +
    Free
    +
    Version
    +
    + +
    +
    +
      +
      +
    • Scrape Table and Analyze
    • +
    • Auto Click on best action
    • +
    • Select table templates
    • +
    • Map your own tables
    • +
    • Analyze results
    • +
    • Track payoff
    • +
      +
    • Trial strategies
    • +
      +
    • Get free trial for betfair-bot.com
    • +
    +
    +
    + {/*
    */} +
    +
    +
    +
    +
    +
    Monthly
    +
    $25 / month
    +
    + +
    +
    +
      +
      +
    • Scrape Table and Analyze
    • +
    • Auto Click on best action
    • +
    • Select table templates
    • +
    • Map your own tables
    • +
    • Analyze results
    • +
    • Track payoff
    • +
      -
    • Support chat
    • -
    • Access to all strategies
    • -
    • Edit strategies
    • -
    • Create custom strategies
    • -
      -
    • Get free licence for betfair-bot.com
    • -
    -
    -
    - {/*
    */} -
    -
    -
    -
    -
    -
    1 year
    -
    $49 / year
    -
    - -
    -
    -

      -
    • Scrape Table and Analyze
    • -
    • Auto Click on best action
    • -
    • Select table templates
    • -
    • Map your own tables
    • -
    • Analyze results
    • -
    • Track payoff
    • -
      +
    • Support chat
    • +
    • Access to all strategies
    • +
    • Edit strategies
    • +
    • Create custom strategies
    • +
      +
    • Get free licence for betfair-bot.com
    • +
    +
    +
    + {/*
    */} +
    +
    +
    +
    +
    +
    1 year
    +
    $49 / year
    +
    + +
    +
    +
      +
      +
    • Scrape Table and Analyze
    • +
    • Auto Click on best action
    • +
    • Select table templates
    • +
    • Map your own tables
    • +
    • Analyze results
    • +
    • Track payoff
    • +
      -
    • Support chat
    • -
    • Access to all strategies
    • -
    • Edit strategies
    • -
    • Create custom strategies
    • -
      -
    • Get free licence for betfair-bot.com
    • -
    -
    -
    -
    +
  • Support chat
  • +
  • Access to all strategies
  • +
  • Edit strategies
  • +
  • Create custom strategies
  • +
    +
  • Get free licence for betfair-bot.com
  • +
+
+
+
+
+
+
+
+
1 year
+
$49 / year
+
+ setHover(false)}> + + + {showBitcoin && ( +
+ Bitcoin address: {bitcoinAddress}
+ Please email me to confirm once you have made a payment: + dickreuter@gmail.com
-
-
-
-
1 year
-
$49 / year
-
- setHover(false)}> - - - {showBitcoin && -
- Bitcoin address: {bitcoinAddress}
Please email me to confirm once you have made a payment: dickreuter@gmail.com -
- } - -
- {/*

Bitcoin: bc1q6r0l549jefv3rgs7e0jzsdkx9pq9trd2cqyw50
*/} -
-

    -
  • Scrape Table and Analyze
  • -
  • Auto Click on best action
  • -
  • Select table templates
  • -
  • Map your own tables
  • -
  • Analyze results
  • -
  • Track payoff
  • -
    + )} +
+ {/*

Bitcoin: bc1q6r0l549jefv3rgs7e0jzsdkx9pq9trd2cqyw50
*/} +
+
    +
    +
  • Scrape Table and Analyze
  • +
  • Auto Click on best action
  • +
  • Select table templates
  • +
  • Map your own tables
  • +
  • Analyze results
  • +
  • Track payoff
  • +
    -
  • Support chat
  • -
  • Access to all strategies
  • -
  • Edit strategies
  • -
  • Create custom strategies
  • -
    -
  • Get free licence for betfair-bot.com
  • -
-
-
-
-
-
-
-
-
Lifetime
-
$499 / life
-
- -
-
-

    -
  • Scrape Table and Analyze
  • -
  • Auto Click on best action
  • -
  • Select table templates
  • -
  • Map your own tables
  • -
  • Analyze results
  • -
  • Track payoff
  • -
    +
  • Support chat
  • +
  • Access to all strategies
  • +
  • Edit strategies
  • +
  • Create custom strategies
  • +
    +
  • Get free licence for betfair-bot.com
  • +
+
+
+
+
+
+
+
+
Lifetime
+
$499 / life
+
+ +
+
+
    +
    +
  • Scrape Table and Analyze
  • +
  • Auto Click on best action
  • +
  • Select table templates
  • +
  • Map your own tables
  • +
  • Analyze results
  • +
  • Track payoff
  • +
    -
  • Support chat
  • -
  • Access to all strategies
  • -
  • Edit strategies
  • -
  • Create custom strategies
  • -
    -
  • Get free licence for betfair-bot.com
  • -
-
-
-
-
+
  • Support chat
  • +
  • Access to all strategies
  • +
  • Edit strategies
  • +
  • Create custom strategies
  • +
    +
  • Get free licence for betfair-bot.com
  • +
    +
    - - ) +
    +
    +
    + + ); +} + +export default PaymentCards; + +function fetchDlLink() { + throw new Error("Function not implemented."); } -export default PaymentCards \ No newline at end of file diff --git a/website/src/views/StrategyAnalyzer.tsx b/website/src/views/StrategyAnalyzer.tsx index 478a0fa4..4069de78 100644 --- a/website/src/views/StrategyAnalyzer.tsx +++ b/website/src/views/StrategyAnalyzer.tsx @@ -9,10 +9,10 @@ import { pirate } from '../assets/Images'; import FundsChangeLineChart from '../components/FundsChangeChart'; import Loading from '../components/Loading'; import DataTable from '../components/TableData'; +import { API_URL } from './config'; const StrategyAnalyzer: React.FC = () => { - const API_URL = import.meta.env.VITE_REACT_APP_API_URL || 'http://dickreuter.com:7777'; const [strategies, setStrategies] = useState([]); const [selectedStrategy, setSelectedStrategy] = useState(null); const [endStage, setEndStage] = useState('All'); diff --git a/website/src/views/TableAnalyzer.tsx b/website/src/views/TableAnalyzer.tsx index 27f6be9b..7d17f204 100644 --- a/website/src/views/TableAnalyzer.tsx +++ b/website/src/views/TableAnalyzer.tsx @@ -3,9 +3,9 @@ import axios from 'axios'; import 'bootstrap/dist/css/bootstrap.css'; import { useEffect, useState } from 'react'; import { Bar, BarChart, CartesianGrid, Legend, Tooltip, XAxis, YAxis } from 'recharts'; +import { API_URL } from './config'; function TableAnalyzer() { - const API_URL = import.meta.env.VITE_REACT_APP_API_URL || 'http://dickreuter.com:7777'; const [tableData, setTableData] = useState([]); const [loading, setLoading] = useState(true); // New state for loading diff --git a/website/src/views/TableMapper.tsx b/website/src/views/TableMapper.tsx index 68c082e2..f1d8328d 100644 --- a/website/src/views/TableMapper.tsx +++ b/website/src/views/TableMapper.tsx @@ -4,10 +4,9 @@ import "bootstrap/dist/css/bootstrap.css"; import React, { useEffect, useRef, useState } from "react"; import { Dropdown } from "react-bootstrap"; import "./TableMapper.css"; +import { API_URL } from "./config"; function TableMapper() { - const API_URL = - import.meta.env.VITE_REACT_APP_API_URL || "http://dickreuter.com:7777"; const canvasRef = useRef(null); const previewRef = useRef(null); const [isDrawing, setIsDrawing] = useState(false); diff --git a/website/src/views/config.tsx b/website/src/views/config.tsx new file mode 100644 index 00000000..f8d2db28 --- /dev/null +++ b/website/src/views/config.tsx @@ -0,0 +1,24 @@ +import axios from "axios"; +import { useEffect, useState } from "react"; + +export const API_URL = + import.meta.env.VITE_REACT_APP_API_URL || "http://dickreuter.com:7777"; + +export const useDlLink = () => { + const [dlLink, setDlLink] = useState(""); + + useEffect(() => { + const fetchDlLink = async () => { + try { + const response = await axios.post(`${API_URL}/get_internal`); + setDlLink(response.data[0].dl); + } catch (error) { + console.error("Error fetching dl link:", error); + } + }; + + fetchDlLink(); + }, []); + + return dlLink; +};