Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 14 additions & 0 deletions indexer/src/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,17 @@ def parse(self, filename: str) -> None:
raise Exception(exception_msg)
self.target = match.group(1)
self.type = match.group(2) + "_" + match.group(6)


class busybarFileParser(FileParser):
def parse(self, filename: str) -> None:
regex = re.compile(
r"^busybar-(\w+)-(\w+)-([0-9.]+(-rc)?|(dev-\w+-\w+))\.(\w+)$"
)
match = regex.match(filename)
if not match:
exception_msg = f"Unknown file {filename}"
logging.exception(exception_msg)
raise Exception(exception_msg)
self.target = match.group(1)
self.type = match.group(2) + "_" + match.group(6)
14 changes: 13 additions & 1 deletion indexer/src/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
from .parsers import parse_github_channels
from .models import *
from .settings import settings
from .models import qFlipperFileParser, blackmagicFileParser, vgmFileParser
from .models import (
qFlipperFileParser,
blackmagicFileParser,
vgmFileParser,
busybarFileParser,
)


class RepositoryIndex:
Expand Down Expand Up @@ -163,6 +168,13 @@ def get_file_from_latest_version(
github_org=settings.github_org,
file_parser=vgmFileParser,
),
"busybar-firmware": RepositoryIndex(
directory="busybar-firmware",
github_token=settings.busybar_github_token,
github_repo=settings.busybar_github_repo,
github_org=settings.github_org,
file_parser=busybarFileParser,
),
}

raw_file_upload_directories = ["toolchain"]
11 changes: 10 additions & 1 deletion indexer/src/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class Settings(BaseModel):
blackmagic_github_repo: str
vgm_github_token: str
vgm_github_repo: str
busybar_github_token: str
busybar_github_repo: str
private_paths: List[str]


Expand All @@ -48,5 +50,12 @@ class Settings(BaseModel):
blackmagic_github_repo=os.getenv("INDEXER_BLACKMAGIC_GITHUB_REPO"),
vgm_github_token=os.getenv("INDEXER_VGM_GITHUB_TOKEN"),
vgm_github_repo=os.getenv("INDEXER_VGM_GITHUB_REPO"),
private_paths=["reindex", "uploadfiles", "uploadfilesraw"],
busybar_github_token=os.getenv("INDEXER_BUSYBAR_GITHUB_TOKEN"),
busybar_github_repo=os.getenv("INDEXER_BUSYBAR_GITHUB_REPO"),
private_paths=[
"reindex",
"uploadfiles",
"uploadfilesraw",
*os.getenv("INDEXER_PRIVATE_PATHS", "").split(","),
],
)
2 changes: 1 addition & 1 deletion nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ http {
fancyindex_localtime on;
fancyindex_ignore "nginx-theme";
}
location ~ ^/(qFlipper|firmware|blackmagic-firmware|vgm-firmware|toolchain)/ {
location ~ ^/(qFlipper|firmware|blackmagic-firmware|vgm-firmware|busybar-firmware|toolchain)/ {
more_set_headers 'Cache-Control: no-cache, max-age=0, s-max-age=0, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
Expand Down
Empty file modified startup.sh
100644 → 100755
Empty file.