Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
fix unix socket permission
Browse files Browse the repository at this point in the history
  • Loading branch information
gwy15 committed Nov 2, 2019
1 parent 2e839ec commit ad904e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions server/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ logs/
.vscode
.idea
# production
deploy.ps1
*.pex
.env
dist*
Expand Down
6 changes: 6 additions & 0 deletions server/src/app.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import argparse

from aiohttp import web
Expand All @@ -17,6 +18,11 @@ def runDirectly():

app = pushbot.createApp()
if args.sock:
import socket
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
s.bind(args.sock)
s.close()
os.chmod(args.sock, 0o777)
web.run_app(app, path=args.sock)
else:
web.run_app(app, host=args.host, port=args.port)
Expand Down

0 comments on commit ad904e7

Please sign in to comment.