diff --git a/.dockerignore b/.dockerignore index 68bc17f..8e8949f 100644 --- a/.dockerignore +++ b/.dockerignore @@ -92,7 +92,7 @@ ipython_config.py # 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 +Pipfile.lock # poetry # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. @@ -152,6 +152,8 @@ dmypy.json # Cython debug symbols cython_debug/ +images/ + # PyCharm # JetBrains specific template is maintained in a separate JetBrains.gitignore that can # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..2646326 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,18 @@ +name: Docker Image CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag droidzed/disco-hooker:latest \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 6e1979a..f130b3c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,8 @@ WORKDIR /python-docker COPY requirements.txt requirements.txt RUN pip3 install -r requirements.txt -COPY . . +COPY app.py app.py +COPY src ./src + CMD [ "python3" , "app.py"] \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a7fbff0 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 DroidZed + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index e69de29..c987334 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,57 @@ +
+

Disco Hooker

+ + +[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) +[![License](https://img.shields.io/github/license/mashape/apistatus.svg)](https://pypi.org/project/leafengine/) +[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/) +[![linting: pylint](https://img.shields.io/badge/linting-pylint-yellowgreen)](https://github.com/pylint-dev/pylint) + +
+ +
+ +## Intro + +Thi is a simple Discord Hook notifier backend written in `flask` & `discord-webhook`. + +![Example](/images/example.png) + +## Usage: + +1. Docker image: + + a. Pull the image: + ```sh + docker pull droidzed/disco-hooker:latest + ``` + + b. Run the container: + ```sh + docker run -d -p 6000:6000 -e PORT=6000 -e WEBHOOK_URL=YOUR_DISCORD_WEBHOOK_URL droidzed/disco-hooker:latest + ``` + +2. Run locally: + + a. Clone the repo: + ```sh + git clone https://github.com/DroidZed/disco-hooker.git + ``` + + b. Install deps: + + ```sh + pipenv install + ``` + + c. Run: + ```sh + py app.py + ``` + +3. API Request: + + ![API Request](/images/request.png) + +
+ diff --git a/images/example.png b/images/example.png new file mode 100644 index 0000000..6145f33 Binary files /dev/null and b/images/example.png differ diff --git a/images/request.png b/images/request.png new file mode 100644 index 0000000..066aa26 Binary files /dev/null and b/images/request.png differ diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..1f1a92d --- /dev/null +++ b/requirements.txt @@ -0,0 +1,22 @@ +anyio==4.0.0 +asgiref==3.7.2 +blinker==1.7.0 +certifi==2023.7.22 +charset-normalizer==3.3.2 +click==8.1.7 +colorama==0.4.6 +discord-webhook==1.3.0 +Flask==3.0.0 +h11==0.14.0 +httpcore==0.16.3 +httpx==0.23.3 +idna==3.4 +itsdangerous==2.1.2 +Jinja2==3.1.2 +MarkupSafe==2.1.3 +python-decouple==3.8 +requests==2.31.0 +rfc3986==1.5.0 +sniffio==1.3.0 +urllib3==2.0.7 +Werkzeug==3.0.1