From ddb86ae144f7224ad0b6f09123c2dc5ff055c873 Mon Sep 17 00:00:00 2001 From: chrisjsimpson Date: Sat, 15 Feb 2020 20:51:44 +0000 Subject: [PATCH] uwsi socket must be unique per site --- app.skel | 2 ++ main.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app.skel b/app.skel index 9329e8d..6af6fb3 100644 --- a/app.skel +++ b/app.skel @@ -7,5 +7,7 @@ wsgi-file = %d/subscribie/subscribie.wsgi master = true vacuum = true # %n the filename without extension +# NOTE filename must be uniqe (socket must be +# uniq per app so we use the .ini socket = /tmp/sockets/%n.sock #subscribe-to = /tmp/sock2:three.example.com diff --git a/main.py b/main.py index d5f37b5..6f6a82f 100644 --- a/main.py +++ b/main.py @@ -141,10 +141,10 @@ def deploy(): contents = f.read() # Append uwsgi's subscribe-to line with hostname of new site: contents += "\nsubscribe-to = /tmp/sock2:" + webaddress + "\n" - # Writeout app.ini config to file. uwsgi watches for .ini files + # Writeout .ini config to file. uwsgi watches for .ini files # uwsgi will automatically detect this .ini file and start # routing requests to the site - with open(dstDir + '/' + 'app.ini', 'w') as f: + with open(dstDir + '/' + webaddress + '.ini', 'w') as f: f.write(contents) login_url = ''.join(['https://', webaddress, '/login/', login_token])