diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..3ab35f70 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,41 @@ +# credit: https://data-dive.com/multi-os-deployment-in-cloud-using-pyinstaller-and-github-actions +name: Card Cojurer (server) +on: + push: + tags: + - "v*" + workflow_dispatch: +jobs: + build: + name: Build packages + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: macos-latest + TARGET: macos + - os: windows-latest + TARGET: windows + - os: ubuntu-latest + TARGET: linux + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + version: 1.2.2 + - name: Install dependencies + run: | + poetry install + - name: Build with PyInstaller + run: | + poetry run pyinstaller server.spec ${{ github.ref_name }} + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + path: ./dist/cardconjurer-server.${{ github.ref_name }}.zip + name: CC Server (${{ matrix.TARGET }}) diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 13566b81..00000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/www.iml b/.idea/cardconjurer.iml similarity index 58% rename from .idea/www.iml rename to .idea/cardconjurer.iml index 16ea33aa..d0876a78 100644 --- a/.idea/www.iml +++ b/.idea/cardconjurer.iml @@ -5,11 +5,4 @@ - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index d1e22ecb..d629bb51 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml index 2cbe6417..aaed4a8f 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,7 +2,7 @@ - + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 00000000..0513e5eb --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + 1669081298142 + + + + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index 3797fd68..4b7397db 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,12 @@ # Card Conjurer -Use the following link to start creating your own custom Magic: The Gathering cards! -https://cardconjurer.com/ +Card Conjurer was created by a passionate Magic the Gathering player and grew to become probably the most popular online card generator known to the game. +In November of 2022, Wizards of the Coast served the original creator and webhost of the site with Ceas and Desist paperwork, forcing the site offline. +This repository is for the purpose of making the application usable on your local machine and maintaining templates in perpetuity. +## Setup +- Clone this repo somewhere on your system. (Or download the Zip with CODE > Download Zip above) +- Run server.exe (or mac-server for MacOS, linux-server for linux) +- You're good to go! You could also set up Card Conjurer in a more traditional method using WAMP, Docker, XAMPP, etc. [![Donate](https://img.shields.io/badge/Donate-PayPal-blue.svg?longCache=true&style=popout)](https://www.paypal.me/kyleburtondonate -) ← Help me keep playing magic by donating any amount - -[![Donate](https://img.shields.io/badge/Donate-Patreon-orange.svg?longCache=true&style=popout)](https://www.patreon.com/KyleBurton) ← Check out my Patreon +) ← Help out Card Conjurer's original creator, Kyle. We love you buddy. diff --git a/dist/launcher.exe b/dist/launcher.exe new file mode 100644 index 00000000..7f3f1789 Binary files /dev/null and b/dist/launcher.exe differ diff --git a/serve.py b/launcher.py similarity index 88% rename from serve.py rename to launcher.py index 07956133..536a2b48 100644 --- a/serve.py +++ b/launcher.py @@ -1,17 +1,31 @@ -# Python 3 server example +""" +IMPORTS +""" from http.server import SimpleHTTPRequestHandler, HTTPServer import webbrowser import os +""" +SETTINGS +""" + NAME = "localhost" PORT = 8080 DIRECTORY = os.getcwd() +""" +REQUEST HANDLER +""" + class Handler(SimpleHTTPRequestHandler): def __init__(self, *args, **kwargs): super().__init__(*args, directory=DIRECTORY, **kwargs) +""" +START APP +""" + if __name__ == "__main__": webServer = HTTPServer((NAME, PORT), Handler) print("Server started http://%s:%s" % (NAME, PORT)) diff --git a/launcher.spec b/launcher.spec new file mode 100644 index 00000000..ab41bfc1 --- /dev/null +++ b/launcher.spec @@ -0,0 +1,42 @@ +# -*- mode: python ; coding: utf-8 -*- +block_cipher = None + + +a = Analysis( + ['launcher.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, + a.binaries, + a.zipfiles, + a.datas, + [], + name='launcher', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=True, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, +) diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 00000000..83178b0a --- /dev/null +++ b/poetry.lock @@ -0,0 +1,132 @@ +[[package]] +name = "altgraph" +version = "0.17.3" +description = "Python graph (network) package" +category = "main" +optional = false +python-versions = "*" + +[[package]] +name = "future" +version = "0.18.2" +description = "Clean single-source support for Python 3 and 2" +category = "main" +optional = false +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" + +[[package]] +name = "macholib" +version = "1.16.2" +description = "Mach-O header analysis and editing" +category = "main" +optional = false +python-versions = "*" + +[package.dependencies] +altgraph = ">=0.17" + +[[package]] +name = "pefile" +version = "2022.5.30" +description = "Python PE parsing module" +category = "main" +optional = false +python-versions = ">=3.6.0" + +[package.dependencies] +future = "*" + +[[package]] +name = "pyinstaller" +version = "5.2" +description = "PyInstaller bundles a Python application and all its dependencies into a single package." +category = "main" +optional = false +python-versions = "<3.11,>=3.7" + +[package.dependencies] +altgraph = "*" +macholib = {version = ">=1.8", markers = "sys_platform == \"darwin\""} +pefile = {version = ">=2022.5.30", markers = "sys_platform == \"win32\""} +pyinstaller-hooks-contrib = ">=2021.4" +pywin32-ctypes = {version = ">=0.2.0", markers = "sys_platform == \"win32\""} +setuptools = "*" + +[package.extras] +encryption = ["tinyaes (>=1.0.0)"] +hook-testing = ["execnet (>=1.5.0)", "psutil", "pytest (>=2.7.3)"] + +[[package]] +name = "pyinstaller-hooks-contrib" +version = "2022.13" +description = "Community maintained hooks for PyInstaller" +category = "main" +optional = false +python-versions = ">=3.7" + +[[package]] +name = "pywin32-ctypes" +version = "0.2.0" +description = "" +category = "main" +optional = false +python-versions = "*" + +[[package]] +name = "setuptools" +version = "65.6.0" +description = "Easily download, build, install, upgrade, and uninstall Python packages" +category = "main" +optional = false +python-versions = ">=3.7" + +[package.extras] +docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-hoverxref (<2)", "sphinx-inline-tabs", "sphinx-notfound-page (==0.8.3)", "sphinx-reredirects", "sphinxcontrib-towncrier"] +testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8 (<5)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pip-run (>=8.8)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] +testing-integration = ["build[virtualenv]", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] + +[metadata] +lock-version = "1.1" +python-versions = ">=3.10,<3.11" +content-hash = "c8eeb12a28ab98102e72ce215aa683009880bbc190285c426d7e9203607f8146" + +[metadata.files] +altgraph = [ + {file = "altgraph-0.17.3-py2.py3-none-any.whl", hash = "sha256:c8ac1ca6772207179ed8003ce7687757c04b0b71536f81e2ac5755c6226458fe"}, + {file = "altgraph-0.17.3.tar.gz", hash = "sha256:ad33358114df7c9416cdb8fa1eaa5852166c505118717021c6a8c7c7abbd03dd"}, +] +future = [ + {file = "future-0.18.2.tar.gz", hash = "sha256:b1bead90b70cf6ec3f0710ae53a525360fa360d306a86583adc6bf83a4db537d"}, +] +macholib = [ + {file = "macholib-1.16.2-py2.py3-none-any.whl", hash = "sha256:44c40f2cd7d6726af8fa6fe22549178d3a4dfecc35a9cd15ea916d9c83a688e0"}, + {file = "macholib-1.16.2.tar.gz", hash = "sha256:557bbfa1bb255c20e9abafe7ed6cd8046b48d9525db2f9b77d3122a63a2a8bf8"}, +] +pefile = [ + {file = "pefile-2022.5.30.tar.gz", hash = "sha256:a5488a3dd1fd021ce33f969780b88fe0f7eebb76eb20996d7318f307612a045b"}, +] +pyinstaller = [ + {file = "pyinstaller-5.2-py3-none-macosx_10_13_universal2.whl", hash = "sha256:f10b19ad4f66ccad16574ff1979cc15e1ea010f8577292500125dd45abcd8303"}, + {file = "pyinstaller-5.2-py3-none-manylinux2014_aarch64.whl", hash = "sha256:1061f7a6de055007949ec9ad1c6a080b93e102b2a288c8ff88f65e5d7716d4aa"}, + {file = "pyinstaller-5.2-py3-none-manylinux2014_i686.whl", hash = "sha256:6ecce857491bc4f477fcbde1b430d63b957d99bc511fa7e79136c07f831fc505"}, + {file = "pyinstaller-5.2-py3-none-manylinux2014_ppc64le.whl", hash = "sha256:dda3a4787fa4498bb9e688f81bed918f061bd583c8ff0e47881a5422a4b2093b"}, + {file = "pyinstaller-5.2-py3-none-manylinux2014_s390x.whl", hash = "sha256:9d44f331f96fa0ef556cf5304f8b906ca20f55503ddd7aa2a914e87bc58e2cc9"}, + {file = "pyinstaller-5.2-py3-none-manylinux2014_x86_64.whl", hash = "sha256:03984eed0baa252ea9854eb0785a1c40ac033c5c28d3abdae7d820da734aed5a"}, + {file = "pyinstaller-5.2-py3-none-musllinux_1_1_aarch64.whl", hash = "sha256:a21c07dd026bc127684e7a451320bf59cac2c85bea4cb412f7193876ad741d58"}, + {file = "pyinstaller-5.2-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:60c53ba54651f22f75dce2bcf49f0a1bcd03c729ced15f2efabad28e0ea0c938"}, + {file = "pyinstaller-5.2-py3-none-win32.whl", hash = "sha256:4def5b6433b4233b2b53ef92ac351788edb11e4d1e08123b9c90e21a7b310a41"}, + {file = "pyinstaller-5.2-py3-none-win_amd64.whl", hash = "sha256:5d170f7c4c402c820b4c5cf7fde61dd9741bf0456342b19b207e29041d75aa30"}, + {file = "pyinstaller-5.2.tar.gz", hash = "sha256:5efc1b3ffb13fe50a51305fe57fb9e6e7bce00d009c16dd3cb76ea4d702a04ab"}, +] +pyinstaller-hooks-contrib = [ + {file = "pyinstaller-hooks-contrib-2022.13.tar.gz", hash = "sha256:e06d0881e599d94dc39c6ed1917f0ad9b1858a2478b9892faac18bd48bcdc2de"}, + {file = "pyinstaller_hooks_contrib-2022.13-py2.py3-none-any.whl", hash = "sha256:91ecb30db757a8db8b6661d91d5df99e0998245f05f5cfaade0550922c7030a3"}, +] +pywin32-ctypes = [ + {file = "pywin32-ctypes-0.2.0.tar.gz", hash = "sha256:24ffc3b341d457d48e8922352130cf2644024a4ff09762a2261fd34c36ee5942"}, + {file = "pywin32_ctypes-0.2.0-py2.py3-none-any.whl", hash = "sha256:9dc2d991b3479cc2df15930958b674a48a227d5361d413827a4cfd0b5876fc98"}, +] +setuptools = [ + {file = "setuptools-65.6.0-py3-none-any.whl", hash = "sha256:6211d2f5eddad8757bd0484923ca7c0a6302ebc4ab32ea5e94357176e0ca0840"}, + {file = "setuptools-65.6.0.tar.gz", hash = "sha256:d1eebf881c6114e51df1664bc2c9133d022f78d12d5f4f665b9191f084e2862d"}, +] diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..167e3d7f --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,16 @@ +[tool.poetry] +name = "cardconjurer" +version = "0.1.0" +description = "Run card conjurer locally, credit to Kyle for original repo, remember the legends." +authors = ["MrTeferi "] +license = "GPL3" +readme = "README.md" + +[tool.poetry.dependencies] +python = ">=3.10,<3.11" +pyinstaller = "5.2" + + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api"