Skip to content

Commit

Permalink
Made the project even cooler ! 🔮
Browse files Browse the repository at this point in the history
  • Loading branch information
DroidZed committed Nov 9, 2023
1 parent f38fbac commit 72f3a8f
Show file tree
Hide file tree
Showing 8 changed files with 124 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -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.
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<div align="center">
<h1>Disco Hooker</h1>


[![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)

</div>

<div>

## 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)

</div>

Binary file added images/example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/request.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 72f3a8f

Please sign in to comment.