Pyright and README tweaks

This commit is contained in:
Phin 2024-02-10 12:41:18 +05:30
parent 83c21ad526
commit 69eef9e94a
3 changed files with 7 additions and 7 deletions

View file

@ -219,8 +219,8 @@ services:
DRPP_UID: 1000
DRPP_GID: 1000
volumes:
- ./data:/app/data
- /run/user/1000:/run/app
- ./drpp:/app/data
```
### Containerised Discord
@ -252,8 +252,8 @@ services:
image: ghcr.io/phin05/discord-rich-presence-plex:latest
restart: unless-stopped
volumes:
- ./kasmcord:/run/app:ro
- ./drpp:/app/data
- ./kasmcord:/run/app:ro
depends_on:
- kasmcord
```

View file

@ -30,10 +30,10 @@ class DiscordIpcService:
for pipe in self.pipes:
try:
if isUnix:
self.pipeReader, self.pipeWriter = await asyncio.open_unix_connection(pipe) # pyright: ignore[reportGeneralTypeIssues,reportUnknownMemberType]
self.pipeReader, self.pipeWriter = await asyncio.open_unix_connection(pipe) # pyright: ignore[reportAttributeAccessIssue,reportUnknownMemberType]
else:
self.pipeReader = asyncio.StreamReader()
self.pipeWriter = (await self.loop.create_pipe_connection(lambda: asyncio.StreamReaderProtocol(self.pipeReader), pipe))[0] # pyright: ignore[reportGeneralTypeIssues,reportUnknownMemberType]
self.pipeWriter = (await self.loop.create_pipe_connection(lambda: asyncio.StreamReaderProtocol(self.pipeReader), pipe))[0] # pyright: ignore[reportAttributeAccessIssue,reportUnknownMemberType,reportArgumentType]
self.write(0, { "v": 1, "client_id": discordClientID })
if await self.read():
self.connected = True

View file

@ -7,7 +7,7 @@ if isInContainer:
if not os.path.isdir(runtimeDirectory):
logger.error(f"Runtime directory does not exist. Ensure that it is mounted into the container at {runtimeDirectory}")
exit(1)
if os.geteuid() == 0: # pyright: ignore[reportGeneralTypeIssues,reportUnknownMemberType]
if os.geteuid() == 0: # pyright: ignore[reportAttributeAccessIssue,reportUnknownMemberType]
if uid == -1 or gid == -1:
logger.warning(f"Environment variable(s) DRPP_UID and/or DRPP_GID are/is not set. Manually ensure appropriate ownership of {runtimeDirectory}")
statResult = os.stat(runtimeDirectory)
@ -19,8 +19,8 @@ if isInContainer:
os.system(f"chmod 700 {runtimeDirectory}")
os.system(f"chown -R {uid}:{gid} {runtimeDirectory}")
os.system(f"chown -R {uid}:{gid} {containerCwd}")
os.setgid(gid) # pyright: ignore[reportGeneralTypeIssues,reportUnknownMemberType]
os.setuid(uid) # pyright: ignore[reportGeneralTypeIssues,reportUnknownMemberType]
os.setgid(gid) # pyright: ignore[reportAttributeAccessIssue,reportUnknownMemberType]
os.setuid(uid) # pyright: ignore[reportAttributeAccessIssue,reportUnknownMemberType]
else:
logger.warning(f"Not running as the superuser. Manually ensure appropriate ownership of mounted contents")
else: