Skip to content

Commit

Permalink
small change to work with private api
Browse files Browse the repository at this point in the history
  • Loading branch information
extreme4all committed Oct 5, 2023
1 parent 3464d2f commit 91f2dfd
Show file tree
Hide file tree
Showing 19 changed files with 996 additions and 992 deletions.
36 changes: 18 additions & 18 deletions .env-example
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
EMAIL_FROM =
EMAIL_TIPOFF =
SMTP_PASSWORD =
SMTP_PORT =
SMTP_SERVER =
JMOD_TAG =

SERVER_LOGIN =
SERVER_PASSWORD =
SERVER_ADDRESS =
DATABASE =

GRAVEYARD_WEBHOOK =
CONSUMER_KEY =
CONSUMER_SECRET =
BEARER_TOKEN =
ACCESS_TOKEN =
ACCESS_TOKEN_SECRET =
EMAIL_FROM =
EMAIL_TIPOFF =
SMTP_PASSWORD =
SMTP_PORT =
SMTP_SERVER =
JMOD_TAG =
SERVER_LOGIN =
SERVER_PASSWORD =
SERVER_ADDRESS =
DATABASE =
GRAVEYARD_WEBHOOK =
CONSUMER_KEY =
CONSUMER_SECRET =
BEARER_TOKEN =
ACCESS_TOKEN =
ACCESS_TOKEN_SECRET =
PATRON_WEBHOOK =
16 changes: 8 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.env
venv/linux/*
venv/windows/*

__pycache__/
Reports/

error.log
.env
venv/linux/*
venv/windows/*

__pycache__/
Reports/

error.log
46 changes: 23 additions & 23 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "Run main",
"type": "python",
"request": "launch",
"program": "src/main.py",
"console": "integratedTerminal",
"justMyCode": true
}
]
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "Run main",
"type": "python",
"request": "launch",
"program": "src/main.py",
"console": "integratedTerminal",
"justMyCode": true
}
]
}
10 changes: 5 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
},
"python.formatting.provider": "none"
{
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
},
"python.formatting.provider": "none"
}
44 changes: 22 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
FROM python:3.10-slim

# Keeps Python from generating .pyc files in the container
ENV PYTHONDONTWRITEBYTECODE=1

# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED=1

# set the working directory
WORKDIR /project

# install dependencies
COPY ./requirements.txt /project
RUN pip install --no-cache-dir -r requirements.txt

# copy the scripts to the folder
COPY ./src /project/src

# Creates a non-root user with an explicit UID and adds permission to access the /project folder
RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /project
USER appuser

FROM python:3.10-slim

# Keeps Python from generating .pyc files in the container
ENV PYTHONDONTWRITEBYTECODE=1

# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED=1

# set the working directory
WORKDIR /project

# install dependencies
COPY ./requirements.txt /project
RUN pip install --no-cache-dir -r requirements.txt

# copy the scripts to the folder
COPY ./src /project/src

# Creates a non-root user with an explicit UID and adds permission to access the /project folder
RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /project
USER appuser

CMD [ "python", "src/main.py" ]
48 changes: 24 additions & 24 deletions deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: bd-automations
spec:
selector:
matchLabels:
app: bd-automations
replicas: 1
template:
metadata:
labels:
app: bd-automations
spec:
containers:
- name: bd-automations
image: hub.osrsbotdetector.com/bot-detector/bd-automations:latest
imagePullPolicy: Always
resources:
limits:
cpu: "500m"
memory: "750Mi"
imagePullSecrets:
- name: regcred
apiVersion: apps/v1
kind: Deployment
metadata:
name: bd-automations
spec:
selector:
matchLabels:
app: bd-automations
replicas: 1
template:
metadata:
labels:
app: bd-automations
spec:
containers:
- name: bd-automations
image: hub.osrsbotdetector.com/bot-detector/bd-automations:latest
imagePullPolicy: Always
resources:
limits:
cpu: "500m"
memory: "750Mi"
imagePullSecrets:
- name: regcred
136 changes: 68 additions & 68 deletions docker-compose-env.yml
Original file line number Diff line number Diff line change
@@ -1,68 +1,68 @@
version: '3'
services:
automation:
build:
context: .
dockerfile: Dockerfile
container_name: bd-automation
env_file:
- .env
networks:
- botdetector-network
depends_on:
- kafka
- api
- mysql
mysql:
build:
context: ../bot-detector-mysql
dockerfile: Dockerfile
image: bot-detector/bd-mysql:latest
environment:
- MYSQL_ROOT_PASSWORD=root_bot_buster
- MYSQL_USER=botssuck
- MYSQL_PASSWORD=botdetector
volumes:
- ../bot-detector-mysql/mount:/var/lib/mysql
- '../bot-detector-mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d'
ports:
- 3306:3306
networks:
- botdetector-network
api:
build:
context: ../Bot-Detector-Core-Files/
dockerfile: Dockerfile
target: base
args:
root_path: /
api_port: 5000
command: uvicorn src.core.server:app --host 0.0.0.0 --reload --reload-include src/*
container_name: bd-dev-api
environment:
- sql_uri=mysql+asyncmy://root:root_bot_buster@mysql:3306/playerdata
- discord_sql_uri=mysql+asyncmy://root:root_bot_buster@mysql:3306/discord
- token=verify_ban
volumes:
- ../Bot-Detector-Core-Files/src:/project/src:rw
ports:
- 5000:5000
networks:
- botdetector-network
depends_on:
- mysql
kafka:
image: bitnami/kafka:latest
environment:
- ALLOW_PLAINTEXT_LISTENER=yes
- KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093,EXTERNAL://:9094
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,EXTERNAL:PLAINTEXT
- KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092,EXTERNAL://localhost:9094
- KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE=true
ports:
- 9094:9094
networks:
- botdetector-network

networks:
botdetector-network:
version: '3'
services:
automation:
build:
context: .
dockerfile: Dockerfile
container_name: bd-automation
env_file:
- .env
networks:
- botdetector-network
depends_on:
- kafka
- api
- mysql
mysql:
build:
context: ../bot-detector-mysql
dockerfile: Dockerfile
image: bot-detector/bd-mysql:latest
environment:
- MYSQL_ROOT_PASSWORD=root_bot_buster
- MYSQL_USER=botssuck
- MYSQL_PASSWORD=botdetector
volumes:
- ../bot-detector-mysql/mount:/var/lib/mysql
- '../bot-detector-mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d'
ports:
- 3306:3306
networks:
- botdetector-network
api:
build:
context: ../Bot-Detector-Core-Files/
dockerfile: Dockerfile
target: base
args:
root_path: /
api_port: 5000
command: uvicorn src.core.server:app --host 0.0.0.0 --reload --reload-include src/*
container_name: bd-dev-api
environment:
- sql_uri=mysql+asyncmy://root:root_bot_buster@mysql:3306/playerdata
- discord_sql_uri=mysql+asyncmy://root:root_bot_buster@mysql:3306/discord
- token=verify_ban
volumes:
- ../Bot-Detector-Core-Files/src:/project/src:rw
ports:
- 5000:5000
networks:
- botdetector-network
depends_on:
- mysql
kafka:
image: bitnami/kafka:latest
environment:
- ALLOW_PLAINTEXT_LISTENER=yes
- KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093,EXTERNAL://:9094
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,EXTERNAL:PLAINTEXT
- KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092,EXTERNAL://localhost:9094
- KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE=true
ports:
- 9094:9094
networks:
- botdetector-network

networks:
botdetector-network:
Loading

0 comments on commit 91f2dfd

Please sign in to comment.