Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

CL3 rewritten #181

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .env

This file was deleted.

26 changes: 26 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Set this to true in a development environment
DEVELOPMENT=false

# Change this if you have a reverse proxy or if it uses a different header
IP_HEADER=

# To allow for getting IP details and proxy blocking, set up an IPHub account and provide the API key below
IPHUB_KEY=

# Change this to true if you want to block proxies (requires IPHub to be setup)
BLOCK_PROXIES=false

# Set this to the host you want Meower server served on
HOST=127.0.0.1

# Use these to change the ports Meower services are run on
API_PORT=3000
CL3_PORT=3001

# If needed, change the MongoDB and Redis connection info
DB_URI=mongodb://127.0.0.1:27017
DB_NAME=meowerserver
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
REDIS_DB=0
REDIS_PASSWORD=
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
__pycache__/
.env
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "better_profanity"]
path = better_profanity
path = src/common/util/better_profanity
url = https://github.com/meower-media-co/better_profanity.git
25 changes: 25 additions & 0 deletions background_worker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import time

from src.common.entities import users
from src.common.util import config, display_startup, logging
from src.common.database import db


def scheduled_account_deletions():
_users = db.users.find({"delete_after": {"$lt": int(time.time())}})
for user in _users:
users.User(**user).delete()


if __name__ == "__main__":
display_startup()

try:
while True:
time.sleep(60)
for task in [scheduled_account_deletions]:
if config.development:
logging.info(f"Running task {task.__name__}...")
task()
except KeyboardInterrupt:
exit()
1 change: 0 additions & 1 deletion better_profanity
Submodule better_profanity deleted from a023c2
Loading