forked from ICEDTEACTF/CTFeed
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
56 lines (45 loc) · 1.62 KB
/
Copy pathconfig.py
File metadata and controls
56 lines (45 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import asyncio
from pydantic_settings import BaseSettings, SettingsConfigDict
# settings
class Settings(BaseSettings):
# Discord bot configuration
DISCORD_BOT_TOKEN:str
GUILD_ID:int
# from database
ANNOUNCEMENT_CHANNEL_ID:int=-1
CTF_CHANNEL_CATEGORY_ID:int=-1
ARCHIVE_CATEGORY_ID:int=-1
PM_ROLE_ID:int=-1
MEMBER_ROLE_ID:int=-1
# HTTP API configuration
HTTP_SECRET_KEY:str
HTTP_FRONTEND_URL:str # for example https://example.com
HTTP_API_URL:str # for example https://api.example.com
HTTP_COOKIE_DOMAIN:str # for example .example.com
HTTP_COOKIE_SECURE:bool
HTTP_COOKIE_MAX_AGE:int=60*60*24*30 # in seconds, default 30 days
# Discord OAuth2 configuration
DISCORD_OAUTH2_CLIENT_ID:str
DISCORD_OAUTH2_CLIENT_SECRET:str
# CTFTime configuration
CHECK_INTERVAL_MINUTES:int
CTFTIME_API:str="https://ctftime.org/api/v1"
CTFTIME_API_EVENT:str=""
CTFTIME_API_TEAM:str=""
DATABASE_SEARCH_DAYS:int=-90 # search events which finish after now_days+DATABASE_SEARCH_DAYS (for example: now_days+(-90)) in database
# Database configuration
DATABASE_URL:str
# Metadata
COMMIT_ID:str="unknown"
model_config = SettingsConfigDict(env_file=".env")
settings = Settings()
settings.CTFTIME_API_EVENT = settings.CTFTIME_API + "/events/"
settings.CTFTIME_API_TEAM = settings.CTFTIME_API + "/teams/"
# lock
# for the following members
# - ANNOUNCEMENT_CHANNEL_ID
# - CTF_CHANNEL_CATEGORY_ID
# - ARCHIVE_CATEGORY_ID
# - PM_ROLE_ID
# - MEMBER_ROLE_ID
settings_lock = asyncio.Lock()