This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
## OP25 Core Container
|
## OP25 Core Container
|
||||||
FROM ubuntu:24.04
|
FROM python:slim-trixie
|
||||||
|
|
||||||
# Set environment variables
|
# Set environment variables
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
@@ -7,7 +7,7 @@ ENV DEBIAN_FRONTEND=noninteractive
|
|||||||
# Install system dependencies
|
# Install system dependencies
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get upgrade -y && \
|
apt-get upgrade -y && \
|
||||||
apt-get install git python3 python3-pip pulseaudio pulseaudio-utils liquidsoap -y
|
apt-get install git pulseaudio pulseaudio-utils liquidsoap -y
|
||||||
|
|
||||||
# Clone the boatbod op25 repository
|
# Clone the boatbod op25 repository
|
||||||
RUN git clone -b gr310 https://github.com/boatbod/op25 /op25
|
RUN git clone -b gr310 https://github.com/boatbod/op25 /op25
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import signal
|
|||||||
import json
|
import json
|
||||||
from models import ConfigGenerator, DecodeMode, ChannelConfig, DeviceConfig, TrunkingConfig, TrunkingChannelConfig, TerminalConfig, MetadataConfig
|
from models import ConfigGenerator, DecodeMode, ChannelConfig, DeviceConfig, TrunkingConfig, TrunkingChannelConfig, TerminalConfig, MetadataConfig
|
||||||
from internal.logger import create_logger
|
from internal.logger import create_logger
|
||||||
from internal.bot_manager import DiscordBotManager
|
|
||||||
from internal.op25_config_utls import save_talkgroup_tags, save_whitelist, del_none_in_dict, get_current_system_from_config
|
from internal.op25_config_utls import save_talkgroup_tags, save_whitelist, del_none_in_dict, get_current_system_from_config
|
||||||
|
|
||||||
LOGGER = create_logger(__name__)
|
LOGGER = create_logger(__name__)
|
||||||
@@ -14,7 +13,7 @@ op25_process = None
|
|||||||
OP25_PATH = "/op25/op25/gr-op25_repeater/apps/"
|
OP25_PATH = "/op25/op25/gr-op25_repeater/apps/"
|
||||||
OP25_SCRIPT = "run_multi-rx_service.sh"
|
OP25_SCRIPT = "run_multi-rx_service.sh"
|
||||||
|
|
||||||
def create_op25_router(bot_manager: DiscordBotManager):
|
def create_op25_router():
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
@router.post("/start")
|
@router.post("/start")
|
||||||
@@ -107,9 +106,6 @@ def create_op25_router(bot_manager: DiscordBotManager):
|
|||||||
with open('/configs/active.cfg.json', 'w') as f:
|
with open('/configs/active.cfg.json', 'w') as f:
|
||||||
json.dump(del_none_in_dict(config_dict), f, indent=2)
|
json.dump(del_none_in_dict(config_dict), f, indent=2)
|
||||||
|
|
||||||
# Set the presence of the bot (if it's online)
|
|
||||||
await bot_manager.set_presence(generator.systemName)
|
|
||||||
|
|
||||||
return {"message": "Config exported to '/configs/active.cfg.json'"}
|
return {"message": "Config exported to '/configs/active.cfg.json'"}
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise HTTPException(status_code=500, detail=str(e))
|
raise HTTPException(status_code=500, detail=str(e))
|
||||||
@@ -120,7 +116,6 @@ def create_op25_router(bot_manager: DiscordBotManager):
|
|||||||
if not current_system:
|
if not current_system:
|
||||||
raise HTTPException(status_code=500, detail="Unable to get current system.")
|
raise HTTPException(status_code=500, detail="Unable to get current system.")
|
||||||
|
|
||||||
await bot_manager.set_presence(current_system)
|
|
||||||
return current_system
|
return current_system
|
||||||
|
|
||||||
return router
|
return router
|
||||||
|
|||||||
Reference in New Issue
Block a user