Skip to content

Commit

Permalink
Pyright and README tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
phin05 committed Feb 10, 2024
1 parent 83c21ad commit 69eef9e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
```
Expand Down
4 changes: 2 additions & 2 deletions core/discord.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ async def handshake(self) -> None:
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
Expand Down
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
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)
Expand All @@ -19,8 +19,8 @@
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:
Expand Down

0 comments on commit 69eef9e

Please sign in to comment.