Compare commits

..

1 Commits

Author SHA1 Message Date
ffc5c14177 fix perms 2025-07-10 18:41:23 +03:00
2 changed files with 11 additions and 16 deletions

View File

@ -272,12 +272,12 @@ class RepositoryPaths(LazyLogging):
path = path or self.root path = path or self.root
def walk(root: Path) -> Generator[Path, None, None]: def walk(root: Path) -> Generator[Path, None, None]:
for child in root.iterdir(): for entry in root.iterdir():
yield child yield entry
if child in (self.chroot.parent,): if entry in (self.chroot.parent,):
yield from child.iterdir() yield from entry.iterdir()
elif child.is_dir(): elif entry.is_dir():
yield from walk(child) yield from walk(entry)
# get current filesystem and run action # get current filesystem and run action
previous_snapshot = set(walk(path)) previous_snapshot = set(walk(path))

View File

@ -72,7 +72,7 @@ def _create_socket(configuration: Configuration, application: Application) -> so
async def remove_socket(_: Application) -> None: async def remove_socket(_: Application) -> None:
unix_socket.unlink(missing_ok=True) unix_socket.unlink(missing_ok=True)
application.on_shutdown.append(remove_socket) application.on_shutdown.append(remove_socket) # type: ignore[arg-type]
return sock return sock
@ -142,8 +142,8 @@ def setup_server(configuration: Configuration, spawner: Spawn, repositories: lis
InitializeError: if no repositories set InitializeError: if no repositories set
""" """
application = Application(logger=logging.getLogger(__name__)) application = Application(logger=logging.getLogger(__name__))
application.on_shutdown.append(_on_shutdown) application.on_shutdown.append(_on_shutdown) # type: ignore[arg-type]
application.on_startup.append(_on_startup) application.on_startup.append(_on_startup) # type: ignore[arg-type]
application.middlewares.append(normalize_path_middleware(append_slash=False, remove_slash=True)) application.middlewares.append(normalize_path_middleware(append_slash=False, remove_slash=True))
application.middlewares.append(exception_handler(application.logger)) application.middlewares.append(exception_handler(application.logger))
@ -166,16 +166,11 @@ def setup_server(configuration: Configuration, spawner: Spawn, repositories: lis
# package cache # package cache
if not repositories: if not repositories:
raise InitializeError("No repositories configured, exiting") raise InitializeError("No repositories configured, exiting")
database = SQLite.load(configuration)
watchers: dict[RepositoryId, Watcher] = {} watchers: dict[RepositoryId, Watcher] = {}
configuration_path, _ = configuration.check_loaded()
for repository_id in repositories: for repository_id in repositories:
application.logger.info("load repository %s", repository_id) application.logger.info("load repository %s", repository_id)
# load settings explicitly for architecture if any client = Client.load(repository_id, configuration, database, report=False) # explicitly load local client
repository_configuration = Configuration.from_path(configuration_path, repository_id)
# load database instance, because it holds identifier
database = SQLite.load(repository_configuration)
# explicitly load local client
client = Client.load(repository_id, repository_configuration, database, report=False)
watchers[repository_id] = Watcher(client) watchers[repository_id] = Watcher(client)
application[WatcherKey] = watchers application[WatcherKey] = watchers
# workers cache # workers cache