Graveyard is an attempt at open-source reimplementation of DraciDoupe.cz

Overview

Graveyard: Place for Dead (and Undead)

Documentation Status

Graveyard is an attempt at open-source reimplementation of DraciDoupe.cz (referred to as DDCZ in this text).

Developer's documentation is at Read the Docs.

Production is running at http://nove.dracidoupe.cz/ . But be warned, we are heading for the root domain soon!

Contributions

Contributions are welcome provided you agree your work will be shared under the same license as Graveyard (MIT). Please use black for code formatting.

If you don't know where to start, take a look at the roadmap or ask Almad on development Slack or in Pošta on DraciDoupe.cz.

Please install EditorConfig support for your editor (plugin for VS Code, plugin for PyCharm/WebStorm/IDEAJ)

Installation

You can run Graveyard either directly on your machine or inside Docker. Arm64 systems (like M1 Mac) are supported.

Installing and running Graveyard directly is faster (on some systems) and removes one lever of indirection, but it makes the setup more complicated.

Running in Docker requires familiarity with it, but it makes setup easier and guarantees consistency with the testing environment (and hopefully in the future, production environment as well).

In both cases, first clone this repository and run all commands in its directory.

Installing in Docker

Requirements:

Verify you have everything ready by running the test suite:

  • docker-compose run web python3 manage.py test

If you see output like this:

(graveyard-venv) almad@zeruel:~/projects/graveyard$ docker-compose run web python3 manage.py test
Starting graveyard_db_1 ... done
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
....
----------------------------------------------------------------------
Ran 4 tests in 0.000s

OK
Destroying test database for alias 'default'...
(graveyard-venv) almad@zeruel:~/projects/graveyard$

You are all set. Afterwards, install database schema by running

  • docker-compose run web python3 manage.py migrate

and load data about pages

  • docker-compose run web python3 manage.py loaddata pages

You are done! Now you can just run the project and develop using

  • docker-compose start

Verify your application works and open http://localhost:8000 (localhost may be a different host if you are not working on linux). If so, create yourself a superuser.

For all commands in the manual that ask for python manage.py command, run docker-compose run web python3 manage.py command instead

Installing on your machine

Graveyard is currently written in Django. Requirements to develop it:

  • You have working Python 3 installation on your machine
  • You have working MySQL installation on your machine

To use the project, clone this repository, enter its directory with cd graveyard and:

  • Create a virtual environment: python3 -m venv gvenv
    • If this fails and you are on Ubuntu, you may need to sudo apt-get update && sudo apt-get install python3-pip && sudo pip3 install virtualenv
  • Enter it (on Mac OS X or Linux): source gvenv/bin/activate
  • Install dependencies within the pip install -r requirements.txt
  • Copy settings template: cp graveyard/settings/local.example.py graveyard/settings/local.py
  • Edit the settings above, especially enter credentials to your local MySQL (see Stack Overflow on how to do that)
    • When creating database, for compatibility, use latin2 as default charset: CREATE DATABASE dracidoupe_cz DEFAULT CHARACTER SET latin2;
  • Verify you have correct installation and run tests with python manage.py test. You should see output like this:
(graveyard-venv) almad@zeruel:~/projects/graveyard$ python manage.py test
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
...........
----------------------------------------------------------------------
Ran 11 tests in 0.031s

OK
Destroying test database for alias 'default'...
(graveyard-venv) almad@zeruel:~/projects/graveyard$
  • If you see error like selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home, you have to go to the linked page and download the chromedriver to your computer. Place it somewhere in $PATH like /usr/local/bin
  • Create the database schema: python manage.py migrate
  • Load data about pages to see what's on production: python manage.py loaddata pages
  • Run the thing! python manage.py runserver
  • Observe if you have contact at http://localhost:8000

Installing on Windows

Follow the list above, except:

  • It is strongly recommended to use Python 3.7 and MySQL 8, otherwise you'll have to compile mysqlclient manually
  • Activate virtualenv using gvenv\Scripts\activate instaed of source gvenv/bin/activate

After Installation

  • Load initial version of editorial articles: python manage.py loaddata editorarticles
  • Create a superuser for yourself: python manage.py createsuperuser
  • Look around the administration interface at http://localhost:8000/admin/

Installation issues

  • Installation failes with "mysql_config not found"

If you get something like this:

    File "/tmp/pip-install-wfhe9zue/mysqlclient/setup_posix.py", line 29, in mysql_config
        raise EnvironmentError("%s not found" % (_mysql_config_path,))
    OSError: mysql_config not found

you may be using MariaDB fork of MySQL that the Python client is not equipped to talk to, installation-wise. You need to manually symlink the appropriate command:

ln -s /usr/bin/mariadb_config /usr/bin/mysql_config

If even mysql_config is not there, you have to install development headers for the database. That's apt-get install libmariadbclient-dev on Debian.

  • error: invalid command 'bdist_wheel'

Old setuptools: pip install setuptools -U

Setup

Create user account

Use python manage.py registeruser command, see manage.py registeruser --help for parameters.

Debugging with Django Debug Toolbar

  • pip install django-debug-toolbar==2.2.1
  • Add to local.py:
from .base import INSTALLED_APPS, MIDDLEWARE

INSTALLED_APPS.append("debug_toolbar")
MIDDLEWARE.insert(
    0,
    "debug_toolbar.middleware.DebugToolbarMiddleware",
)

INTERNAL_IPS = ["127.0.0.1", "::1"]
Comments
  • Password reset broken on production

    Password reset broken on production

    Works on localhost and in tests though.

    https://sentry.io/share/issue/3566acf3746b44998959b8383cf3d6ee/ https://sentry.io/share/issue/5abe7afbfdf245c0807dadd9e4d424d9/

    bug-production 
    opened by Almad 6
  • Tavern sometimes times out

    Tavern sometimes times out

    Happened to @jimmeak and finally to me as well:

    2021-05-06T11:33:08.463146+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/putyka/?vypis=oblibene" host=nove.dracidoupe.cz request_id=b805ef6b-564d-4862-84dc-7308351d6f1b fwd="213.29.32.47" dyno=web.1 connect=0ms service=30000ms status=503 bytes=0 protocol=http
    2021-05-06T11:33:08.938499+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=nove.dracidoupe.cz request_id=e819e81e-a8c4-45da-830d-4c279ed81ae6 fwd="213.29.32.47" dyno=web.1 connect=0ms service=80ms status=404 bytes=266 protocol=http
    2021-05-06T11:33:08.937045+00:00 app[web.1]: 2021-05-06 13:33:08 [WARNING] Not Found: /favicon.ico
    2021-05-06T11:33:08.937069+00:00 app[web.1]: 2021-05-06 13:33:08 [WARNING] Not Found: /favicon.ico
    2021-05-06T11:33:08.937477+00:00 app[web.1]: 10.1.7.55 - - [06/May/2021:13:33:08 +0200] "GET /favicon.ico HTTP/1.1" 404 77 "http://nove.dracidoupe.cz/putyka/?vypis=oblibene" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:89.0) Gecko/20100101 Firefox/89.0"
    2021-05-06T11:33:08.981794+00:00 app[web.1]: [2021-05-06 11:33:08 +0000] [4] [CRITICAL] WORKER TIMEOUT (pid:11)
    2021-05-06T11:33:09.987822+00:00 app[web.1]: [2021-05-06 11:33:09 +0000] [14] [INFO] Booting worker with pid: 14
    
    speedup bug-production infrastructure 
    opened by Almad 6
  • Migrate database to eu-west-1

    Migrate database to eu-west-1

    • [x] Turn off old version (lighty)
    • [x] Heroku maintenance mode
    • [x] DB export on the node
      • [x] Local back up
    • [x] Terraform RDS in a new region (and related network etc.) https://github.com/dracidoupe/ddcz-box/commit/22a067b14460bd2edea69ea6a20b825474ccfeec
    • [x] Load data (and hope all encodings went well 😬 )
    • [x] Verify everybody is using the correct database
    • [x] Heroku maintenance off & lighty up
    • [x] Terraform delete old resources https://github.com/dracidoupe/ddcz-box/commit/32336b1ee13b8c516e48e87ec4f670e286480c10
    infrastructure 
    opened by Almad 4
  • Legacy router | Routing from index.php

    Legacy router | Routing from index.php

    Closes #84

    I believe there might be some future changes when we will create new pages (like statistics or similar).

    Creative pages should be covered right now, also many of the static pages, e.g. oao or faq.

    opened by jimmeak 3
  • Fix reputation migrations

    Fix reputation migrations

    In #288, migrations actually altered table instead of only renaming model fields and leaving the underlying db_column intact.

    This should be fixed so that old version works until migration.

    bug-production 
    opened by Almad 3
  • Ranger Spell Data Recovery

    Ranger Spell Data Recovery

    We have lost data for ranger spells because of botched translation migration in #283 :

            migrations.RemoveField(
                model_name="rangerspell",
                name="dosah",
            ),
            migrations.RemoveField(
                model_name="rangerspell",
                name="rozsah",
            ),
            migrations.RemoveField(
                model_name="rangerspell",
                name="vyvolani",
            ),
            migrations.AddField(
                model_name="rangerspell",
                name="extent",
                field=models.IntegerField(
                    blank=True, db_column="rozsah", null=True, verbose_name="Rozsah"
                ),
            ),
            migrations.AddField(
                model_name="rangerspell",
                name="invocation",
                field=models.IntegerField(
                    blank=True, db_column="vyvolani", null=True, verbose_name="Vyvolání"
                ),
            ),
            migrations.AddField(
                model_name="rangerspell",
                name="reach",
                field=models.IntegerField(
                    blank=True, db_column="dosah", null=True, verbose_name="Rozsah"
                ),
            ),
    

    AlterField should've been used instead, as it was for all other attributes and models.

    Given the extend of the damage, I say it's best to dig into the backups and reenter it through admin manually.

    help wanted bug-production data-quality 
    opened by Almad 3
  • Missing dragon.ico

    Missing dragon.ico

    Bug from #183 https://github.com/dracidoupe/graveyard/pull/183/files#diff-4ad4574b164538a1f65640d6188467bac65d9e5add5d9eed21d3237f13f2df4dL15

    Causes https://sentry.io/share/issue/26ba35e5012e41a28427fd7e9e9b4428/

    bug-production 
    opened by Almad 2
  • Font for historic

    Font for historic

    Historic use to have the font "Papyrus" but it has been all developed via images.

    We can try to create something similar to papyrus with CSS and some fonts. Following links can be useful.

    Font Design Generating random background

    good first issue designer needed low-tech frontend 
    opened by jimmeak 2
  • Author not found, data migration error for creation

    Author not found, data migration error for creation

    https://sentry.io/share/issue/50675c0996754e659645c100aff64efe/

    Author not found, data migration error for creation clanky: Hodiny Záhuby - Ohnivé moře (část I.) od Shadowmage

    bug-production data-quality 
    opened by Almad 2
  • Consider render.com migration

    Consider render.com migration

    • Looks like we'd fit into the free plan for the web site
    • Even if not, same price-ish as Heroku
    • Their postgres will probably end up cheaper than AWS actually
    infrastructure 
    opened by Almad 0
  • Add touch icons

    Add touch icons

    
    Aug 05 21:48:30 ddcz-prod app/web.1: 2022-08-05 21:48:30 [WARNING] Not Found: /apple-touch-icon-precomposed.png 
    Aug 05 21:48:30 ddcz-prod app/web.1: 2022-08-05 21:48:30 [WARNING] Not Found: /apple-touch-icon-precomposed.png 
    Aug 05 21:48:30 ddcz-prod app/web.1: 2022-08-05 21:48:30 [WARNING] Not Found: /apple-touch-icon.png 
    Aug 05 21:48:30 ddcz-prod app/web.1: 2022-08-05 21:48:30 [WARNING] Not Found: /apple-touch-icon.png 
    Aug 05 21:48:30 ddcz-prod app/web.1: 2022-08-05 21:48:30 [WARNING] Not Found: /apple-touch-icon.png 
    Aug 05 21:48:30 ddcz-prod app/web.1: 2022-08-05 21:48:30 [WARNING] Not Found: /apple-touch-icon.png 
    Aug 05 21:48:30 ddcz-prod app/web.1: 2022-08-05 21:48:30 [WARNING] Not Found: /apple-touch-icon-precomposed.png 
    Aug 05 21:48:30 ddcz-prod app/web.1: 2022-08-05 21:48:30 [WARNING] Not Found: /apple-touch-icon-precomposed.png 
    Aug 05 21:48:30 ddcz-prod app/web.1: 2022-08-05 21:48:30 [WARNING] Not Found: /apple-touch-icon.png 
    Aug 05 21:48:30 ddcz-prod app/web.1: 2022-08-05 21:48:30 [WARNING] Not Found: /apple-touch-icon.png 
    Aug 05 21:48:30 ddcz-prod app/web.1: 2022-08-05 21:48:30 [WARNING] Not Found: /apple-touch-icon-precomposed.png 
    Aug 05 21:48:30 ddcz-prod app/web.1: 2022-08-05 21:48:30 [WARNING] Not Found: /apple-touch-icon-precomposed.png 
    
    low-tech 
    opened by Almad 0
  • Yet Another Email Provider Migration

    Yet Another Email Provider Migration

    Mailgun is changing pricing and cheapest plan is $35/mo (for 50k).

    From twitter thread with analytics:

    • SendInBlue 300 emails/day free, or $25/mo
    • Sendgrid free for 100 emails/day, than $15/50k/mo
    • Postmark $10k/10k
    • Mailchimp $20/25k for transactional
    • or, well AWS SES with custom wiring: 62k/mo free, then $1/10k + attachments

    What to do about this? Let's use the mailgun as long as we can for initial outreaches, but then I'd probably migrate to Sendgrid and see if we stay under limit of the free plan. If so, great, if not, let's do my side-project of an easy email sending application on aws lambda with SES.

    The first step will be to send the overarching GDPR email and than only notify people who accept, plus those who log in in the last year (or three?). Notify them when they haven't.

    infrastructure 
    opened by Almad 0
Attempt at creating organized collection of little handy snippets of code I'm receiving along the way

ChaosCode Attempt at creating organized collection of little handy snippets of code I'm receiving along the way I always considered coding and program

INFU 4 Nov 26, 2022
A hackers attempt at an MVP anki plugin

my anki plugin if you have found this by accident, you should probably run away this is nothing more than a hackers attempt at an MVP anki plugin I re

Chris Hall 1 Nov 2, 2021
An attempt at furthering Factorio Calculator to work in more general contexts.

factorio-optimizer Lets do Factorio Calculator but make it optimize. Why not use Factorio Calculator? Becuase factorio calculator is not general. The

Jonathan Woollett-Light 1 Jun 3, 2022
My attempt at this years Advent of Code!

Advent-of-code-2021 My attempt at this years Advent of Code! day 1: ** day 2: ** day 3: ** day 4: ** day 5: ** day 6: ** day 7: ** day 8: * day 9: day

null 1 Jul 6, 2022
chiarose(XCR) based on chia(XCH) source code fork, open source public chain

chia-rosechain 一个无耻的小活动 | A shameless little event 如果您喜欢这个项目,请点击star 将赠送您520朵玫瑰,可以去 facebook 留下您的(xcr)地址,和github用户名。 If you like this project, please

ddou123 376 Dec 14, 2022
Source-o-grapher is a tool built with the aim to investigate software resilience aspects of Open Source Software (OSS) projects.

Source-o-grapher is a tool built with the aim to investigate software resilience aspects of Open Source Software (OSS) projects.

Aristotle University 5 Jun 28, 2022
A free and open-source chess improvement app that combines the power of Lichess and Anki.

A free and open-source chess improvement app that combines the power of Lichess and Anki. Chessli Project Activity & Issue Tracking PyPI Build & Healt

null 93 Nov 23, 2022
🏆 A ranked list of awesome Python open-source libraries and tools. Updated weekly.

Best-of Python ?? A ranked list of awesome Python open-source libraries & tools. Updated weekly. This curated list contains 230 awesome open-source pr

Machine Learning Tooling 2.7k Jan 3, 2023
TickerRain is an open-source web app that stores and analysis Reddit posts in a transparent and semi-interactive manner.

TickerRain is an open-source web app that stores and analysis Reddit posts in a transparent and semi-interactive manner

GonVas 180 Oct 8, 2022
Open source home automation that puts local control and privacy first

Home Assistant Open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiast

Home Assistant 57k Jan 2, 2023
Nimbus - Open Source Cloud Computing Software - 100% Apache2 licensed

⚠️ The Nimbus infrastructure project is no longer under development. ⚠️ For more information, please read the news announcement. If you are interested

Nimbus 194 Jun 30, 2022
World's best free and open source ERP.

World's best free and open source ERP.

Frappe 12.5k Jan 7, 2023
An open source server for Super Mario Bros. 35

SMB35 A custom server for Super Mario Bros. 35 This server is highly experimental. Do not expect it to work without flaws.

Yannik Marchand 162 Dec 7, 2022
Backend/API for the Mumble.dev, an open source social media application.

Welcome to the Mumble Api Repository Getting Started If you are trying to use this project for the first time, you can get up and running by following

Dennis Ivy 189 Dec 27, 2022
A deployer and package manager for OceanBase open-source software.

OceanBase Deploy OceanBase Deploy (简称 OBD)是 OceanBase 开源软件的安装部署工具。OBD 同时也是包管理器,可以用来管理 OceanBase 所有的开源软件。本文介绍如何安装 OBD、使用 OBD 和 OBD 的命令。 安装 OBD 您可以使用以下方

OceanBase 59 Dec 27, 2022
sawa (ꦱꦮ) is an open source programming language, an interpreter to be precise, where you can write python code using javanese character.

ꦱꦮ sawa (ꦱꦮ) is an open source programming language, an interpreter to be precise, where you can write python code using javanese character. sawa iku

Rony Lantip 307 Jan 7, 2023
Open source tools to allow working with ESP devices in the browser

ESP Web Tools Allow flashing ESPHome or other ESP-based firmwares via the browser. Will automatically detect the board type and select a supported fir

ESPHome 195 Dec 31, 2022
PyMedPhys is an open-source Medical Physics python library

PyMedPhys is an open-source Medical Physics python library built by an open community that values and prioritises code sharing, review, improvement, and learning from each other. I

PyMedPhys 238 Dec 27, 2022
La version open source du bot Discord Sblerboy

Sblerboy-Open-Source La version open source du bot Discord Sblerboy Sblerboy est un bot Discord permettant de jouer à des jeux de Gameboy directement

null 15 Nov 19, 2022