Compare commits
4 Commits
a2c9045c9e
...
99b914dd17
Author | SHA1 | Date | |
---|---|---|---|
99b914dd17 | |||
1bd341a396 | |||
b384ff49ec | |||
9f01b4c909 |
1
description
Normal file
1
description
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Track fear and phase in multiplayer games of the board game Spirit Island.
|
16
fear-tracker-gunicorn.service
Normal file
16
fear-tracker-gunicorn.service
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# Based on https://docs.gunicorn.org/en/stable/deploy.html#systemd
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=/usr/bin/gunicorn3 fear_tracker_site.asgi:application --config=/home/anyoneeb/sites/apps/fear-tracker/gnuicorn.conf.py
|
||||||
|
ExecReload=/bin/kill -s HUP $MAINPID
|
||||||
|
Restart=always
|
||||||
|
StandardOutput=syslog
|
||||||
|
StandardError=syslog
|
||||||
|
SyslogIdentifier=fear-tracker
|
||||||
|
User=fear-tracker
|
||||||
|
Group=fear-tracker
|
||||||
|
KillMode=mixed
|
||||||
|
PrivateTmp=true
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
11
fear-tracker-uwsgi.service
Normal file
11
fear-tracker-uwsgi.service
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
[Service]
|
||||||
|
ExecStart=/usr/bin/uwsgi --ini /home/anyoneeb/sites/apps/fear-tracker/uwsgi.ini
|
||||||
|
Restart=always
|
||||||
|
StandardOutput=syslog
|
||||||
|
StandardError=syslog
|
||||||
|
SyslogIdentifier=fear-tracker
|
||||||
|
User=fear-tracker
|
||||||
|
Group=fear-tracker
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
|
@ -10,13 +10,12 @@ from asgiref.sync import async_to_sync
|
||||||
from channels.generic.http import AsyncHttpConsumer
|
from channels.generic.http import AsyncHttpConsumer
|
||||||
from channels.layers import get_channel_layer
|
from channels.layers import get_channel_layer
|
||||||
|
|
||||||
from django.conf import settings
|
|
||||||
from django.db import transaction
|
from django.db import transaction
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
from django.shortcuts import get_object_or_404, redirect, render
|
from django.shortcuts import get_object_or_404, redirect, render
|
||||||
from django.views.decorators.http import require_safe, require_http_methods,\
|
from django.views.decorators.http import require_safe, require_http_methods,\
|
||||||
require_POST
|
require_POST
|
||||||
from django.urls import reverse, set_script_prefix
|
from django.urls import reverse
|
||||||
|
|
||||||
from .forms import NewGameForm, JoinGameForm, PlayerFormSet
|
from .forms import NewGameForm, JoinGameForm, PlayerFormSet
|
||||||
from .models import Game, Player, Fear
|
from .models import Game, Player, Fear
|
||||||
|
@ -388,12 +387,6 @@ class StatusLongPollConsumer(AsyncHttpConsumer):
|
||||||
})
|
})
|
||||||
|
|
||||||
async def fear_tracker_invalidate_status(self, event):
|
async def fear_tracker_invalidate_status(self, event):
|
||||||
# get script_prefix for reverse()
|
|
||||||
script_prefix = self.scope.get("root_path", "") or ""
|
|
||||||
if settings.FORCE_SCRIPT_NAME:
|
|
||||||
script_prefix = settings.FORCE_SCRIPT_NAME
|
|
||||||
set_script_prefix(script_prefix)
|
|
||||||
|
|
||||||
no_hash_status = reverse('status',
|
no_hash_status = reverse('status',
|
||||||
kwargs={'access_code': self.access_code})
|
kwargs={'access_code': self.access_code})
|
||||||
await self.send_response(302, b'', headers=[
|
await self.send_response(302, b'', headers=[
|
||||||
|
|
14
gnuicorn.conf.py
Normal file
14
gnuicorn.conf.py
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
import multiprocessing
|
||||||
|
|
||||||
|
bind = "127.0.0.1:8043"
|
||||||
|
worker_class = "uvicorn.workers.UvicornWorker"
|
||||||
|
workers = multiprocessing.cpu_count() * 2 + 1
|
||||||
|
chdir = "/home/anyoneeb/sites/apps/fear-tracker"
|
||||||
|
raw_env = "DJANGO_SETTINGS_MODULE=fear_tracker_site.local_settings"
|
||||||
|
proc_name = "gnuicorn-fear-tracker"
|
||||||
|
pidfile = "/tmp/gnuicorn-fear-tracker.pid"
|
||||||
|
user = "fear-tracker"
|
||||||
|
group = "fear-tracker"
|
||||||
|
max_requests=5000
|
||||||
|
max_requests_jitter=100
|
||||||
|
preload_app=True
|
14
uwsgi.ini
Normal file
14
uwsgi.ini
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
[uwsgi]
|
||||||
|
socket=127.0.0.1:8043
|
||||||
|
mount = /fear-tracker=fear_tracker_site.wsgi:application
|
||||||
|
manage-script-name = true
|
||||||
|
chdir=/home/anyoneeb/sites/apps/fear-tracker
|
||||||
|
plugin=python3
|
||||||
|
module=fear_tracker_site.wsgi:application
|
||||||
|
env=DJANGO_SETTINGS_MODULE=fear_tracker_site.local_settings
|
||||||
|
master=True
|
||||||
|
pidfile=/tmp/fear-tracker-master.pid
|
||||||
|
vacuum=True
|
||||||
|
max-requests=5000
|
||||||
|
uid=fear-tracker
|
||||||
|
gid=fear-tracker
|
Loading…
Reference in New Issue
Block a user