From 77dfe1c285146a3d89277c5468ad0c1855444c89 Mon Sep 17 00:00:00 2001 From: "Victor-ray, S" <12261439+ZendaiOwl@users.noreply.github.com> Date: Thu, 6 Jul 2023 22:59:32 +0200 Subject: [PATCH] =?UTF-8?q?=E0=BF=93=E2=9D=AF=20First=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Victor-ray, S <12261439+ZendaiOwl@users.noreply.github.com> --- .dockerignore | 1081 +++++++++++++++++++++++++++++++++++++++++++++ .gitignore | 1088 ++++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 7 + LICENSE | 14 + README.md | 1 + requirements.txt | 9 + server.py | 170 ++++++++ 7 files changed, 2370 insertions(+) create mode 100644 .dockerignore create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 LICENSE create mode 100644 README.md create mode 100644 requirements.txt create mode 100644 server.py diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..300fda6 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,1081 @@ +# flyctl launch added from .gitignore +# Built application files +**/*.apk +**/*.aar +**/*.ap_ +**/*.aab + +# Files for the ART/Dalvik VM +**/*.dex + +# Java class files +**/*.class + +# Generated files +**/bin +**/gen +**/out +# Uncomment the following line in case you need and you don't have the release build type files in your app +# release/ + +# Gradle files +**/.gradle +**/build + +# Local configuration file (sdk path, etc) +**/local.properties + +# Proguard folder generated by Eclipse +**/proguard + +# Log Files +**/*.log + +# Android Studio Navigation editor temp files +**/.navigation + +# Android Studio captures folder +**/captures + +# IntelliJ +**/*.iml +**/.idea/workspace.xml +**/.idea/tasks.xml +**/.idea/gradle.xml +**/.idea/assetWizardSettings.xml +**/.idea/dictionaries +**/.idea/libraries +# Android Studio 3 in .gitignore file. +**/.idea/caches +**/.idea/modules.xml +# Comment next line if keeping position of elements in Navigation Editor is relevant for you +**/.idea/navEditor.xml + +# Keystore files +# Uncomment the following lines if you do not want to check your keystore files in. +#*.jks +#*.keystore + +# External native build folder generated in Android Studio 2.2 and later +**/.externalNativeBuild +**/.cxx + +# Google Services (e.g. APIs or Firebase) +# google-services.json + +# Freeline +**/freeline.py +**/freeline +**/freeline_project_description.json + +# fastlane +**/fastlane/report.xml +**/fastlane/Preview.html +**/fastlane/screenshots +**/fastlane/test_output +**/fastlane/readme.md + +# Version control +**/vcs.xml + +# lint +**/lint/intermediates +**/lint/generated +**/lint/outputs +**/lint/tmp +# lint/reports/ +# For projects using Nanoc (http://nanoc.ws/) + +# Default location for output (needs to match output_dir's value found in nanoc.yaml) +**/output + +# Temporary file directory +**/tmp/nanoc + +# Crash Log +**/crash.log +# ignore everything in the root except the "wp-content" directory. +!**/wp-content + +# ignore everything in the "wp-content" directory, except: +# "mu-plugins", "plugins", "themes" directory +**/wp-content/* +!**/wp-content/mu-plugins +!**/wp-content/plugins +!**/wp-content/themes + +# ignore these plugins +**/wp-content/plugins/hello.php + +# ignore specific themes +**/wp-content/themes/twenty* + +# ignore node dependency directories +**/node_modules + +# ignore log files and databases +**/*.log +**/*.sql +**/*.sqlite +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +**/*.rsuser +**/*.suo +**/*.user +**/*.userosscache +**/*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +**/*.userprefs + +# Mono auto generated files +**/mono_crash.* + +# Build results +**/[Dd]ebug +**/[Dd]ebugPublic +**/[Rr]elease +**/[Rr]eleases +**/x64 +**/x86 +**/[Aa][Rr][Mm] +**/[Aa][Rr][Mm]64 +**/bld +**/[Bb]in +**/[Oo]bj +**/[Ll]og +**/[Ll]ogs + +# Visual Studio 2015/2017 cache/options directory +**/.vs +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +**/Generated\ Files + +# MSTest test Results +**/[Tt]est[Rr]esult* +**/[Bb]uild[Ll]og.* + +# NUnit +**/*.VisualState.xml +**/TestResult.xml +**/nunit-*.xml + +# Build Results of an ATL Project +**/[Dd]ebugPS +**/[Rr]eleasePS +**/dlldata.c + +# Benchmark Results +**/BenchmarkDotNet.Artifacts + +# .NET Core +**/project.lock.json +**/project.fragment.lock.json +**/artifacts + +# StyleCop +**/StyleCopReport.xml + +# Files built by Visual Studio +**/*_i.c +**/*_p.c +**/*_h.h +**/*.ilk +**/*.meta +**/*.obj +**/*.iobj +**/*.pch +**/*.pdb +**/*.ipdb +**/*.pgc +**/*.pgd +**/*.rsp +**/*.sbr +**/*.tlb +**/*.tli +**/*.tlh +**/*.tmp +**/*.tmp_proj +**/*_wpftmp.csproj +**/*.log +**/*.vspscc +**/*.vssscc +**/.builds +**/*.pidb +**/*.svclog +**/*.scc + +# Chutzpah Test files +**/_Chutzpah* + +# Visual C++ cache files +**/ipch +**/*.aps +**/*.ncb +**/*.opendb +**/*.opensdf +**/*.sdf +**/*.cachefile +**/*.VC.db +**/*.VC.VC.opendb + +# Visual Studio profiler +**/*.psess +**/*.vsp +**/*.vspx +**/*.sap + +# Visual Studio Trace Files +**/*.e2e + +# TFS 2012 Local Workspace +**/$tf + +# Guidance Automation Toolkit +**/*.gpState + +# ReSharper is a .NET coding add-in +**/_ReSharper* +**/*.[Rr]e[Ss]harper +**/*.DotSettings.user + +# TeamCity is a build add-in +**/_TeamCity* + +# DotCover is a Code Coverage Tool +**/*.dotCover + +# AxoCover is a Code Coverage Tool +**/.axoCover/* +!**/.axoCover/settings.json + +# Visual Studio code coverage results +**/*.coverage +**/*.coveragexml + +# NCrunch +**/_NCrunch_* +**/.*crunch*.local.xml +**/nCrunchTemp_* + +# MightyMoose +**/*.mm.* +**/AutoTest.Net + +# Web workbench (sass) +**/.sass-cache + +# Installshield output folder +**/[Ee]xpress + +# DocProject is a documentation generator add-in +**/DocProject/buildhelp +**/DocProject/Help/*.HxT +**/DocProject/Help/*.HxC +**/DocProject/Help/*.hhc +**/DocProject/Help/*.hhk +**/DocProject/Help/*.hhp +**/DocProject/Help/Html2 +**/DocProject/Help/html + +# Click-Once directory +**/publish + +# Publish Web Output +**/*.[Pp]ublish.xml +**/*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +**/*.pubxml +**/*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +**/PublishScripts + +# NuGet Packages +**/*.nupkg +# NuGet Symbol Packages +**/*.snupkg +# The packages folder can be ignored because of Package Restore +**/**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/**/[Pp]ackages/build +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +**/*.nuget.props +**/*.nuget.targets + +# Microsoft Azure Build Output +**/csx +**/*.build.csdef + +# Microsoft Azure Emulator +**/ecf +**/rcf + +# Windows Store app package directories and files +**/AppPackages +**/BundleArtifacts +**/Package.StoreAssociation.xml +**/_pkginfo.txt +**/*.appx +**/*.appxbundle +**/*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +**/*.[Cc]ache +# but keep track of directories ending in .cache +!**/?*.[Cc]ache + +# Others +**/ClientBin +**/~$* +**/*~ +**/*.dbmdl +**/*.dbproj.schemaview +**/*.jfm +**/*.pfx +**/*.publishsettings +**/orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +**/Generated_Code + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +**/_UpgradeReport_Files +**/Backup* +**/UpgradeLog*.XML +**/UpgradeLog*.htm +**/ServiceFabricBackup +**/*.rptproj.bak + +# SQL Server files +**/*.mdf +**/*.ldf +**/*.ndf + +# Business Intelligence projects +**/*.rdl.data +**/*.bim.layout +**/*.bim_*.settings +**/*.rptproj.rsuser +**/*- [Bb]ackup.rdl +**/*- [Bb]ackup ([0-9]).rdl +**/*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +**/FakesAssemblies + +# GhostDoc plugin setting file +**/*.GhostDoc.xml + +# Node.js Tools for Visual Studio +**/.ntvs_analysis.dat +**/node_modules + +# Visual Studio 6 build log +**/*.plg + +# Visual Studio 6 workspace options file +**/*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +**/*.vbw + +# Visual Studio LightSwitch build output +**/**/*.HTMLClient/GeneratedArtifacts +**/**/*.DesktopClient/GeneratedArtifacts +**/**/*.DesktopClient/ModelManifest.xml +**/**/*.Server/GeneratedArtifacts +**/**/*.Server/ModelManifest.xml +**/_Pvt_Extensions + +# Paket dependency manager +**/.paket/paket.exe +**/paket-files + +# FAKE - F# Make +**/.fake + +# CodeRush personal settings +**/.cr/personal + +# Python Tools for Visual Studio (PTVS) +**/__pycache__ +**/*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +**/*.tss + +# Telerik's JustMock configuration file +**/*.jmconfig + +# BizTalk build output +**/*.btp.cs +**/*.btm.cs +**/*.odx.cs +**/*.xsd.cs + +# OpenCover UI analysis results +**/OpenCover + +# Azure Stream Analytics local run output +**/ASALocalRun + +# MSBuild Binary and Structured Log +**/*.binlog + +# NVidia Nsight GPU debugger configuration file +**/*.nvuser + +# MFractors (Xamarin productivity tool) working folder +**/.mfractor + +# Local History for Visual Studio +**/.localhistory + +# BeatPulse healthcheck temp database +**/healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +**/MigrationBackup + +# Ionide (cross platform F# VS Code tools) working folder +**/.ionide +# Generated by Cargo +# will have compiled files and executables +target + +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html +**/Cargo.lock + +# These are backup files generated by rustfmt +**/**/*.rs.bk +# Byte-compiled / optimized / DLL files +**/__pycache__ +**/*.py[cod] +**/*$py.class + +# C extensions +**/*.so + +# Distribution / packaging +**/.Python +**/build +**/develop-eggs +**/dist +**/downloads +**/eggs +**/.eggs +**/lib +**/lib64 +**/parts +**/sdist +**/var +**/wheels +**/pip-wheel-metadata +**/share/python-wheels +**/*.egg-info +**/.installed.cfg +**/*.egg +**/MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +**/*.manifest +**/*.spec + +# Installer logs +**/pip-log.txt +**/pip-delete-this-directory.txt + +# Unit test / coverage reports +**/htmlcov +**/.tox +**/.nox +**/.coverage +**/.coverage.* +**/.cache +**/nosetests.xml +**/coverage.xml +**/*.cover +**/*.py,cover +**/.hypothesis +**/.pytest_cache + +# Translations +**/*.mo +**/*.pot + +# Django stuff: +**/*.log +**/local_settings.py +**/db.sqlite3 +**/db.sqlite3-journal + +# Flask stuff: +**/instance +**/.webassets-cache + +# Scrapy stuff: +**/.scrapy + +# Sphinx documentation +**/docs/_build + +# PyBuilder +**/target + +# Jupyter Notebook +**/.ipynb_checkpoints + +# IPython +**/profile_default +**/ipython_config.py + +# pyenv +**/.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +**/__pypackages__ + +# Celery stuff +**/celerybeat-schedule +**/celerybeat.pid + +# SageMath parsed files +**/*.sage.py + +# Environments +**/.env +**/.venv +**/env +**/venv +**/ENV +**/env.bak +**/venv.bak + +# Spyder project settings +**/.spyderproject +**/.spyproject + +# Rope project settings +**/.ropeproject + +# mkdocs documentation +site + +# mypy +**/.mypy_cache +**/.dmypy.json +**/dmypy.json + +# Pyre type checker +**/.pyre +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## User settings +**/xcuserdata + +## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) +**/*.xcscmblueprint +**/*.xccheckout + +## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) +**/build +**/DerivedData +**/*.moved-aside +**/*.pbxuser +!**/default.pbxuser +**/*.mode1v3 +!**/default.mode1v3 +**/*.mode2v3 +!**/default.mode2v3 +**/*.perspectivev3 +!**/default.perspectivev3 + +## Obj-C/Swift specific +**/*.hmap + +## App packaging +**/*.ipa +**/*.dSYM.zip +**/*.dSYM + +# CocoaPods +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# +# Pods/ +# +# Add this line if you want to avoid checking in source code from the Xcode workspace +# *.xcworkspace + +# Carthage +# +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +**/Carthage/Build + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. +# Instead, use fastlane to re-generate the screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/#source-control + +**/fastlane/report.xml +**/fastlane/Preview.html +**/fastlane/screenshots/**/*.png +**/fastlane/test_output + +# Code Injection +# +# After new code Injection tools there's a generated folder /iOSInjectionProject +# https://github.com/johnno1962/injectionforxcode + +**/iOSInjectionProject +# Logs +**/logs +**/*.log +**/npm-debug.log* +**/yarn-debug.log* +**/yarn-error.log* +**/lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +**/report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +**/pids +**/*.pid +**/*.seed +**/*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +**/lib-cov + +# Coverage directory used by tools like istanbul +**/coverage +**/*.lcov + +# nyc test coverage +**/.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +**/.grunt + +# Bower dependency directory (https://bower.io/) +**/bower_components + +# node-waf configuration +**/.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +**/build/Release + +# Dependency directories +**/node_modules +**/jspm_packages + +# TypeScript v1 declaration files +**/typings + +# TypeScript cache +**/*.tsbuildinfo + +# Optional npm cache directory +**/.npm + +# Optional eslint cache +**/.eslintcache + +# Microbundle cache +**/.rpt2_cache +**/.rts2_cache_cjs +**/.rts2_cache_es +**/.rts2_cache_umd + +# Optional REPL history +**/.node_repl_history + +# Output of 'npm pack' +**/*.tgz + +# Yarn Integrity file +**/.yarn-integrity + +# dotenv environment variables file +**/.env +**/.env.test + +# parcel-bundler cache (https://parceljs.org/) +**/.cache + +# Next.js build output +**/.next + +# Nuxt.js build / generate output +**/.nuxt +**/dist + +# Gatsby files +**/.cache +# Comment in the public line in if your project uses Gatsby and *not* Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +**/.vuepress/dist + +# Serverless directories +**/.serverless + +# FuseBox cache +**/.fusebox + +# DynamoDB Local files +**/.dynamodb + +# TernJS port file +**/.tern-port +**/target +**/pom.xml.tag +**/pom.xml.releaseBackup +**/pom.xml.versionsBackup +**/pom.xml.next +**/release.properties +**/dependency-reduced-pom.xml +**/buildNumber.properties +**/.mvn/timing.properties +# https://github.com/takari/maven-wrapper#usage-without-binary-jar +**/.mvn/wrapper/maven-wrapper.jar +# Compiled class file +**/*.class + +# Log file +**/*.log + +# BlueJ files +**/*.ctxt + +# Mobile Tools for Java (J2ME) +**/.mtj.tmp + +# Package Files # +**/*.jar +**/*.war +**/*.nar +**/*.ear +**/*.zip +**/*.tar.gz +**/*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +**/hs_err_pid* +**/_site +**/.sass-cache +**/.jekyll-cache +**/.jekyll-metadata +**/jboss/server/all/deploy/project.ext +**/jboss/server/default/deploy/project.ext +**/jboss/server/minimal/deploy/project.ext +**/jboss/server/all/log/*.log +**/jboss/server/all/tmp/**/* +**/jboss/server/all/data/**/* +**/jboss/server/all/work/**/* +**/jboss/server/default/log/*.log +**/jboss/server/default/tmp/**/* +**/jboss/server/default/data/**/* +**/jboss/server/default/work/**/* +**/jboss/server/minimal/log/*.log +**/jboss/server/minimal/tmp/**/* +**/jboss/server/minimal/data/**/* +**/jboss/server/minimal/work/**/* + +# deployed package files # + +**/*.DEPLOYED +# Compiled class file +**/*.class + +# Log file +**/*.log + +# BlueJ files +**/*.ctxt + +# Mobile Tools for Java (J2ME) +**/.mtj.tmp + +# Package Files # +**/*.jar +**/*.war +**/*.nar +**/*.ear +**/*.zip +**/*.tar.gz +**/*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +**/hs_err_pid* +**/.gradle +build + +# Ignore Gradle GUI config +**/gradle-app.setting + +# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) +!**/gradle-wrapper.jar + +# Cache of project +**/.gradletasknamecache + +# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 +# gradle/wrapper/gradle-wrapper.properties +# Binaries for programs and plugins +**/*.exe +**/*.exe~ +**/*.dll +**/*.so +**/*.dylib + +# Test binary, built with `go test -c` +**/*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +**/*.out + +# Dependency directories (remove the comment below to include it) +# vendor/ +# Node rules: +## Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +**/.grunt + +## Dependency directory +## Commenting this out is preferred by some people, see +## https://docs.npmjs.com/misc/faq#should-i-check-my-node_modules-folder-into-git +**/node_modules + +# Book build output +**/_book + +# eBook build output +**/*.epub +**/*.mobi +**/*.pdf +# the composer package lock file and install directory +# Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file +# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file +# /composer.lock +fuel/vendor + +# the fuelphp document +docs + +# you may install these packages with `oil package`. +# http://fuelphp.com/docs/packages/oil/package.html +# /fuel/packages/auth/ +# /fuel/packages/email/ +# /fuel/packages/oil/ +# /fuel/packages/orm/ +# /fuel/packages/parser/ + +# dynamically generated files +fuel/app/logs/*/*/* +fuel/app/cache/*/* +fuel/app/config/crypt.php +**/*.FASL +**/*.fasl +**/*.lisp-temp +**/*.dfsl +**/*.pfsl +**/*.d64fsl +**/*.p64fsl +**/*.lx64fsl +**/*.lx32fsl +**/*.dx64fsl +**/*.dx32fsl +**/*.fx64fsl +**/*.fx32fsl +**/*.sx64fsl +**/*.sx32fsl +**/*.wx64fsl +**/*.wx32fsl +# CakePHP 3 + +vendor/* +config/app.php + +tmp/cache/models/* +!tmp/cache/models/empty +tmp/cache/persistent/* +!tmp/cache/persistent/empty +tmp/cache/views/* +!tmp/cache/views/empty +tmp/sessions/* +!tmp/sessions/empty +tmp/tests/* +!tmp/tests/empty + +logs/* +!logs/empty + +# CakePHP 2 + +app/tmp/* +app/Config/core.php +app/Config/database.php +vendors/* +# http://www.gnu.org/software/automake + +**/Makefile.in +ar-lib +mdate-sh +py-compile +test-driver +ylwrap + +# http://www.gnu.org/software/autoconf + +**/autom4te.cache +autoscan.log +autoscan-*.log +aclocal.m4 +compile +config.guess +config.h.in +config.log +config.status +config.sub +configure +configure.scan +depcomp +install-sh +missing +stamp-h1 + +# https://www.gnu.org/software/libtool/ + +ltmain.sh + +# http://www.gnu.org/software/texinfo + +texinfo.tex + +# http://www.gnu.org/software/m4/ + +**/m4/libtool.m4 +**/m4/ltoptions.m4 +**/m4/ltsugar.m4 +**/m4/ltversion.m4 +**/m4/lt~obsolete.m4 + +# Generated Makefile +# (meta build system like autotools, +# can automatically generate from config.status script +# (which is called by configure script)) +**/Makefile +**/CMakeLists.txt.user +**/CMakeCache.txt +**/CMakeFiles +**/CMakeScripts +**/Testing +**/Makefile +**/cmake_install.cmake +**/install_manifest.txt +**/compile_commands.json +**/CTestTestfile.cmake +**/_deps +# Prerequisites +**/*.d + +# Object files +**/*.o +**/*.ko +**/*.obj +**/*.elf + +# Linker output +**/*.ilk +**/*.map +**/*.exp + +# Precompiled Headers +**/*.gch +**/*.pch + +# Libraries +**/*.lib +**/*.a +**/*.la +**/*.lo + +# Shared objects (inc. Windows DLLs) +**/*.dll +**/*.so +**/*.so.* +**/*.dylib + +# Executables +**/*.exe +**/*.out +**/*.app +**/*.i*86 +**/*.x86_64 +**/*.hex + +# Debug files +**/*.dSYM +**/*.su +**/*.idb +**/*.pdb + +# Kernel Module Compile Results +**/*.mod* +**/*.cmd +**/.tmp_versions +**/modules.order +**/Module.symvers +**/Mkfile.old +**/dkms.conf +fly.toml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..56ee8c5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,1088 @@ +# Fly.io toml file +fly.toml + +# Deta Space +.space + +# Deta Cloud +.deta + +# Built application files +*.apk +*.aar +*.ap_ +*.aab + +# Files for the ART/Dalvik VM +*.dex + +# Java class files +*.class + +# Generated files +bin/ +gen/ +out/ +# Uncomment the following line in case you need and you don't have the release build type files in your app +# release/ + +# Gradle files +.gradle/ +build/ + +# Local configuration file (sdk path, etc) +local.properties + +# Proguard folder generated by Eclipse +proguard/ + +# Log Files +*.log + +# Android Studio Navigation editor temp files +.navigation/ + +# Android Studio captures folder +captures/ + +# IntelliJ +*.iml +.idea/workspace.xml +.idea/tasks.xml +.idea/gradle.xml +.idea/assetWizardSettings.xml +.idea/dictionaries +.idea/libraries +# Android Studio 3 in .gitignore file. +.idea/caches +.idea/modules.xml +# Comment next line if keeping position of elements in Navigation Editor is relevant for you +.idea/navEditor.xml + +# Keystore files +# Uncomment the following lines if you do not want to check your keystore files in. +#*.jks +#*.keystore + +# External native build folder generated in Android Studio 2.2 and later +.externalNativeBuild +.cxx/ + +# Google Services (e.g. APIs or Firebase) +# google-services.json + +# Freeline +freeline.py +freeline/ +freeline_project_description.json + +# fastlane +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots +fastlane/test_output +fastlane/readme.md + +# Version control +vcs.xml + +# lint +lint/intermediates/ +lint/generated/ +lint/outputs/ +lint/tmp/ +# lint/reports/ +# For projects using Nanoc (http://nanoc.ws/) + +# Default location for output (needs to match output_dir's value found in nanoc.yaml) +output/ + +# Temporary file directory +tmp/nanoc/ + +# Crash Log +crash.log +# ignore everything in the root except the "wp-content" directory. +!wp-content/ + +# ignore everything in the "wp-content" directory, except: +# "mu-plugins", "plugins", "themes" directory +wp-content/* +!wp-content/mu-plugins/ +!wp-content/plugins/ +!wp-content/themes/ + +# ignore these plugins +wp-content/plugins/hello.php + +# ignore specific themes +wp-content/themes/twenty*/ + +# ignore node dependency directories +node_modules/ + +# ignore log files and databases +*.log +*.sql +*.sqlite +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ +# Generated by Cargo +# will have compiled files and executables +/target/ + +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html +Cargo.lock + +# These are backup files generated by rustfmt +**/*.rs.bk +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## User settings +xcuserdata/ + +## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) +*.xcscmblueprint +*.xccheckout + +## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) +build/ +DerivedData/ +*.moved-aside +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 + +## Obj-C/Swift specific +*.hmap + +## App packaging +*.ipa +*.dSYM.zip +*.dSYM + +# CocoaPods +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# +# Pods/ +# +# Add this line if you want to avoid checking in source code from the Xcode workspace +# *.xcworkspace + +# Carthage +# +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build/ + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. +# Instead, use fastlane to re-generate the screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/#source-control + +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots/**/*.png +fastlane/test_output + +# Code Injection +# +# After new code Injection tools there's a generated folder /iOSInjectionProject +# https://github.com/johnno1962/injectionforxcode + +iOSInjectionProject/ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# Next.js build output +.next + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and *not* Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +# https://github.com/takari/maven-wrapper#usage-without-binary-jar +.mvn/wrapper/maven-wrapper.jar +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* +_site/ +.sass-cache/ +.jekyll-cache/ +.jekyll-metadata +jboss/server/all/deploy/project.ext +jboss/server/default/deploy/project.ext +jboss/server/minimal/deploy/project.ext +jboss/server/all/log/*.log +jboss/server/all/tmp/**/* +jboss/server/all/data/**/* +jboss/server/all/work/**/* +jboss/server/default/log/*.log +jboss/server/default/tmp/**/* +jboss/server/default/data/**/* +jboss/server/default/work/**/* +jboss/server/minimal/log/*.log +jboss/server/minimal/tmp/**/* +jboss/server/minimal/data/**/* +jboss/server/minimal/work/**/* + +# deployed package files # + +*.DEPLOYED +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* +.gradle +/build/ + +# Ignore Gradle GUI config +gradle-app.setting + +# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) +!gradle-wrapper.jar + +# Cache of project +.gradletasknamecache + +# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 +# gradle/wrapper/gradle-wrapper.properties +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +# vendor/ +# Node rules: +## Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +## Dependency directory +## Commenting this out is preferred by some people, see +## https://docs.npmjs.com/misc/faq#should-i-check-my-node_modules-folder-into-git +node_modules + +# Book build output +_book + +# eBook build output +*.epub +*.mobi +*.pdf +# the composer package lock file and install directory +# Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file +# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file +# /composer.lock +/fuel/vendor + +# the fuelphp document +/docs/ + +# you may install these packages with `oil package`. +# http://fuelphp.com/docs/packages/oil/package.html +# /fuel/packages/auth/ +# /fuel/packages/email/ +# /fuel/packages/oil/ +# /fuel/packages/orm/ +# /fuel/packages/parser/ + +# dynamically generated files +/fuel/app/logs/*/*/* +/fuel/app/cache/*/* +/fuel/app/config/crypt.php +*.FASL +*.fasl +*.lisp-temp +*.dfsl +*.pfsl +*.d64fsl +*.p64fsl +*.lx64fsl +*.lx32fsl +*.dx64fsl +*.dx32fsl +*.fx64fsl +*.fx32fsl +*.sx64fsl +*.sx32fsl +*.wx64fsl +*.wx32fsl +# CakePHP 3 + +/vendor/* +/config/app.php + +/tmp/cache/models/* +!/tmp/cache/models/empty +/tmp/cache/persistent/* +!/tmp/cache/persistent/empty +/tmp/cache/views/* +!/tmp/cache/views/empty +/tmp/sessions/* +!/tmp/sessions/empty +/tmp/tests/* +!/tmp/tests/empty + +/logs/* +!/logs/empty + +# CakePHP 2 + +/app/tmp/* +/app/Config/core.php +/app/Config/database.php +/vendors/* +# http://www.gnu.org/software/automake + +Makefile.in +/ar-lib +/mdate-sh +/py-compile +/test-driver +/ylwrap + +# http://www.gnu.org/software/autoconf + +autom4te.cache +/autoscan.log +/autoscan-*.log +/aclocal.m4 +/compile +/config.guess +/config.h.in +/config.log +/config.status +/config.sub +/configure +/configure.scan +/depcomp +/install-sh +/missing +/stamp-h1 + +# https://www.gnu.org/software/libtool/ + +/ltmain.sh + +# http://www.gnu.org/software/texinfo + +/texinfo.tex + +# http://www.gnu.org/software/m4/ + +m4/libtool.m4 +m4/ltoptions.m4 +m4/ltsugar.m4 +m4/ltversion.m4 +m4/lt~obsolete.m4 + +# Generated Makefile +# (meta build system like autotools, +# can automatically generate from config.status script +# (which is called by configure script)) +Makefile +CMakeLists.txt.user +CMakeCache.txt +CMakeFiles +CMakeScripts +Testing +Makefile +cmake_install.cmake +install_manifest.txt +compile_commands.json +CTestTestfile.cmake +_deps +# Prerequisites +*.d + +# Object files +*.o +*.ko +*.obj +*.elf + +# Linker output +*.ilk +*.map +*.exp + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex + +# Debug files +*.dSYM/ +*.su +*.idb +*.pdb + +# Kernel Module Compile Results +*.mod* +*.cmd +.tmp_versions/ +modules.order +Module.symvers +Mkfile.old +dkms.conf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f5e8e0e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +# syntax=docker/dockerfile:1 +# Victor-ray, S. +FROM sanicframework/sanic:LTS +COPY ./server.py ./requirements.txt /srv/ +RUN pip install --upgrade pip; pip install -r /srv/requirements.txt +EXPOSE 8080 +CMD ["python", "/srv/server.py"] diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..64334a2 --- /dev/null +++ b/LICENSE @@ -0,0 +1,14 @@ +BSD Zero Clause License + +Copyright (c) 2023 by Victor-ray, S. <12261439+ZendaiOwl@users.noreply.github.com> + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..2da815f --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# Checkport diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..a14546f --- /dev/null +++ b/requirements.txt @@ -0,0 +1,9 @@ +aiofiles==22.1.0 +httptools==0.5.0 +multidict==6.0.4 +sanic==22.9.1 +sanic-routing==22.8.0 +sockets==1.0.0 +ujson==5.6.0 +uvloop==0.17.0 +websockets==10.4 diff --git a/server.py b/server.py new file mode 100644 index 0000000..876d4c3 --- /dev/null +++ b/server.py @@ -0,0 +1,170 @@ +#!/usr/bin/env python3 +# Victor-ray, S. + +from sanic import Sanic +from sanic.response import json +from sanic.response import text +import ipaddress +import socket + +app = Sanic("portcheck") +app.config.REAL_IP_HEADER = "Fly-Client-IP" + +@app.route('/') +async def index(request, path=""): + return json({"msg": "I'm a Teapot"}, 418) + +@app.get('/health') +async def health_check(request): + return json({"msg": "OK"}, 200) + +@app.get('/check') +async def check_ports(request): + headers = request.headers + clientIP = headers.get("Fly-Client-IP") + protocol = ("") + port80 = ("") + port443 = ("") + try: + validate = await validateIP(clientIP) + if validate == 0: + result = "valid" + if await getIPversion(clientIP) == 4: + protocol = "IPv4" + port80 = await checkIPv4(clientIP, 80) + port443 = await checkIPv4(clientIP, 443) + else: + protocol = "IPv6" + port80 = await checkIPv6(clientIP, 80) + port443 = await checkIPv6(clientIP, 443) + elif validate == 1: + result = "invalid" + else: + result = "error" + except: + result = "error" + return json({ + "ip": clientIP, + "format": result, + "type": protocol, + "80": port80, + "443": port443 + }) + +@app.get('/80') +async def check_port_80(request): + headers = request.headers + clientIP = headers.get("Fly-Client-IP") + protocol = ("") + port80 = ("") + port443 = ("") + try: + validate = await validateIP(clientIP) + if validate == 0: + result = "valid" + if await getIPversion(clientIP) == 4: + protocol = "IPv4" + port80 = await checkIPv4(clientIP, 80) + else: + protocol = "IPv6" + port80 = await checkIPv6(clientIP, 80) + elif validate == 1: + result = "invalid" + else: + result = "error" + except: + result = "error" + return json({ + "ip": clientIP, + "format": result, + "type": protocol, + "80": port80 + }) + +@app.get('/443') +async def check_port_443(request): + headers = request.headers + clientIP = headers.get("Fly-Client-IP") + protocol = ("") + port80 = ("") + port443 = ("") + try: + validate = await validateIP(clientIP) + if validate == 0: + result = "valid" + if await getIPversion(clientIP) == 4: + protocol = "IPv4" + port443 = await checkIPv4(clientIP, 443) + else: + protocol = "IPv6" + port80 = await checkIPv6(clientIP, 443) + elif validate == 1: + result = "invalid" + else: + result = "error" + except: + result = "error" + return json({ + "ip": clientIP, + "format": result, + "type": protocol, + "443": port443 + }) + +@app.get('/client') +async def get_client_ip(request): + try: + headers = request.headers + clientIP = headers.get("Fly-Client-IP") + message = json({"ip":clientIP}) + except: + message = json({"message":"error"}) + return message + +async def validateIP(incomingIP): + try: + ip = ipaddress.ip_address(incomingIP) + validation = 0 + except ValueError: + validation = 1 + except: + validation = -1 + return validation + +async def getIPversion(theIP): + try: + ip = ipaddress.ip_address(theIP) + if isinstance(ip, ipaddress.IPv4Address): + protocol = 4 + elif isinstance(ip, ipaddress.IPv6Address): + protocol = 6 + except: + protocol = "error" + return protocol + +async def checkIPv4(IPv4, portIPv4): + try: + IPv4socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + IPv4socket.settimeout(1.5) + IPv4socket.connect((IPv4,int(portIPv4))) + result = "open" + except: + result = "closed" + finally: + IPv4socket.close() + return result + +async def checkIPv6(IPv6, portIPv6): + try: + IPv6socket = socket.socket(socket.AF_INET6, socket.SOCK_STREAM) + IPv6socket.settimeout(1.5) + IPv6socket.connect((IPv6,int(portIPv6))) + result = "open" + except: + result = "closed" + finally: + IPv6socket.close() + return result + +if __name__ == "__main__": + app.run(host='::',port=8080,fast=True)