I like the game cardboard game codenames and now that COVID-19 is part of our life I have played a lot online with my friends on this website. But I realized that I want to play codename pictures instead. So I've decided to create my own.
- Realtime online multiplayer
- Multiple game modes:
- Codename classic (with words)
- Codename pictures
- Does not include any images (for copyright reasons, but you can import your own)
- Just like the codenames board game...
- Python >= 3.6
- Almost every database engine is supported (SQLite in memory by default)
- Clone this repo
- Create a virtualenv and join them
- Install python requirements
$ pip3 install -r requirements.txt
- Generate text images (for the classic mode)
Optional: Import images for picture mode
$ ./words2img/words2img.py
- Configuration
- 5.1 Create a secret key by running
python3 -c "import os; print(os.urandom(24).hex())"
and insert that key into theconfig.py
- 5.1 Create a secret key by running
- Test your setup by running
flask run
- If everything works as expected, you should now be able to play at
http://localhost:5000
In this example we'll add france as language for the classic mode.
- Create a language file:
./words2img/words/fr.txt
(one word each line) - Run the script (existing files will be overwritten)
$ python3 ./words2img/words2img.py
- Append
classic_fr
to theGAME_MODES
list in theconfig.py
To get the best experience it's recommend to buy the original cardboard game and scan all images. In my case I scanned
all pictures with 400dpi and used picpunch to cut them to size and render for
web (--border 5 --quallity 30
).The new images have to be placed into the corresponding folders.
The code images into (at least 20):
codenames/static/images/codes
And the colored team cards (at least 1 each):
codenames/static/images/cards/assassin
codenames/static/images/cards/blue
codenames/static/images/cards/neutral
codenames/static/images/cards/red
The filename does not matter. But the file extension and type has to be JPEG/JPG.
flask run
works fine but you should'nt use it for production deployment. However you can use Apache2 instead.
If not already installed you have to install libapache2-mod-wsgi-py3
. After installation you can create a virtualhost
like in this example:
<VirtualHost *:80>
ServerName codenames.example.org
Redirect / https://codenames.example.org/
</VirtualHost>
<VirtualHost *:443>
ServerName codenames.example.org
WSGIDaemonProcess wsgi_codenames user=www-data group=www-data processes=1 threads=5 python-home=python-home=/virtualenvs/codenames/
WSGIScriptAlias / /var/www/codenames/wsgi.py
SSLEngine On
SSLCertificateFile /etc/letsencrypt/live/codenames.example.org/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/codenames.example.org/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/codenames.example.org/chain.pem
SSLProtocol ALL -SSLv2 -SSLv3
SSLHonorCipherOrder On
SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:
SSLCompression Off
Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"
<Directory /var/www/codenames/>
WSGIProcessGroup wsgi_codenames
WSGIApplicationGroup %{GLOBAL}
</Directory>
</VirtualHost>
I use Let's Encrypt for free ssl certificates. Please ensure that all paths are correct. After restating Apache2, codenames should be run as part of the Apache2-daemon.
Created and maintained by Schluggi.