From ed96d70bbfd83852fb7bebb623542c019d715e07 Mon Sep 17 00:00:00 2001 From: Vosjedev Date: Sat, 24 Jan 2026 12:19:57 +0100 Subject: administrative stuff add a gitignore, add an env.sh for autostarting and configuring a database, add ws4py as dep (gateway needs it) Signed-off-by: Vosjedev --- .gitignore | 3 +++ env.sh | 24 ++++++++++++++++++++++++ poetry.lock | 38 +++++++++++++++++++++++++++++++++++--- pyproject.toml | 7 ++++++- 4 files changed, 68 insertions(+), 4 deletions(-) create mode 100644 .gitignore create mode 100644 env.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6cd50d6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +token.txt +**/__pycache__ + diff --git a/env.sh b/env.sh new file mode 100644 index 0000000..4a3d0bc --- /dev/null +++ b/env.sh @@ -0,0 +1,24 @@ + +export MYSQL_HOST=127.0.0.1 +export MYSQL_ROOT_PASSWORD=supersecurepassword +export MYSQL_PASSWORD=securepassword +export MYSQL_DATABASE=discord_image_bridge +export MYSQL_USER=bridge + +[[ -f "bottoken.txt" ]] && read -r BOT_TOKEN <"bottoken.txt" + +export BOT_TOKEN + +echo "Setup database..." +mkdir -p /tmp/database +podman run --rm -d \ + --name tmp_database \ + --hostname db \ + --env 'MYSQL_*' \ + -v /tmp/database:/var/lib/mysql \ + -p 3306:3306 \ + yobasystems/alpine-mariadb + +podman ps +echo "Done" + diff --git a/poetry.lock b/poetry.lock index d03cb54..9000d23 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.1.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.3.1 and should not be changed by hand. [[package]] name = "autocommand" @@ -12,6 +12,23 @@ files = [ {file = "autocommand-2.2.2.tar.gz", hash = "sha256:878de9423c5596491167225c2a455043c3130fb5b7286ac83443d45e74955f34"}, ] +[[package]] +name = "backports-tarfile" +version = "1.2.0" +description = "Backport of CPython tarfile module" +optional = false +python-versions = ">=3.8" +groups = ["main"] +markers = "python_version < \"3.12\"" +files = [ + {file = "backports.tarfile-1.2.0-py3-none-any.whl", hash = "sha256:77e284d754527b01fb1e6fa8a1afe577858ebe4e9dad8919e34c862cb399bc34"}, + {file = "backports_tarfile-1.2.0.tar.gz", hash = "sha256:d75e02c268746e1b8144c278978b6e98e85de6ad16f8e4b0844a154557eca991"}, +] + +[package.extras] +docs = ["furo", "jaraco.packaging (>=9.3)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] +testing = ["jaraco.test", "pytest (!=8.0.*)", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)"] + [[package]] name = "certifi" version = "2026.1.4" @@ -244,6 +261,9 @@ files = [ {file = "jaraco_context-6.1.0.tar.gz", hash = "sha256:129a341b0a85a7db7879e22acd66902fda67882db771754574338898b2d5d86f"}, ] +[package.dependencies] +"backports.tarfile" = {version = "*", markers = "python_version < \"3.12\""} + [package.extras] check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1) ; sys_platform != \"cygwin\""] cover = ["pytest-cov"] @@ -483,6 +503,18 @@ h2 = ["h2 (>=4,<5)"] socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] zstd = ["backports-zstd (>=1.0.0) ; python_version < \"3.14\""] +[[package]] +name = "ws4py" +version = "0.6.0" +description = "WebSocket client and server library for Python 2 and 3 as well as PyPy" +optional = false +python-versions = "*" +groups = ["main"] +files = [ + {file = "ws4py-0.6.0-py3-none-any.whl", hash = "sha256:1499c3fc103a65eb12d7b1ead7566f88487f6f678ab10ee4e53cf2411c068752"}, + {file = "ws4py-0.6.0.tar.gz", hash = "sha256:9f87b19b773f0a0744a38f3afa36a803286dd3197f0bb35d9b75293ec7002d19"}, +] + [[package]] name = "zc-lockfile" version = "4.0" @@ -503,5 +535,5 @@ test = ["zope.testing"] [metadata] lock-version = "2.1" -python-versions = ">=3.13" -content-hash = "511de4272831f7668e92ba27767ee1020a33522f543f170aed6fcc9fb62071f2" +python-versions = ">=3.10" +content-hash = "b78940d6cda11cb62509700eea1b09c52246eb7afe824cf0cfcef173dd4a9bf6" diff --git a/pyproject.toml b/pyproject.toml index a976dd6..93d6303 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,9 +10,14 @@ requires-python = ">=3.10" dependencies = [ "cherrypy (>=18.10.0,<19.0.0)", "requests (>=2.32.5,<3.0.0)", - "mariadb (>=1.1.14,<2.0.0)" + "mariadb (>=1.1.14,<2.0.0)", + "ws4py (>=0.6.0,<0.7.0)" ] +[project.urls] +homepage = "https://git.vosjedev.net/discord_image_bridge.git/" +"Bug Tracker" = "https://bugs.vosjedev.net/discord_image_bridge/" + [tool.poetry] packages = [{include = "discord_image_bridge", from = "src"}] -- cgit