{"id":16934032,"url":"https://github.com/lucas-c/rpg-bonhomme","last_synced_at":"2025-04-11T18:51:29.345Z","repository":{"id":25563272,"uuid":"28996528","full_name":"Lucas-C/rpg-bonhomme","owner":"Lucas-C","description":"A tabletop RPG character sheet editor \u0026 viewer","archived":false,"fork":false,"pushed_at":"2024-01-17T19:11:05.000Z","size":9493,"stargazers_count":4,"open_issues_count":11,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T14:44:43.039Z","etag":null,"topics":["character-sheet","game-master","jsonp","key-value-store","pen-and-paper","python","rpg","tabletop-rpgs","wsgi"],"latest_commit_sha":null,"homepage":"https://chezsoi.org/lucas/rpg-bonhomme","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Lucas-C.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-01-09T02:20:10.000Z","updated_at":"2023-09-08T16:53:38.000Z","dependencies_parsed_at":"2025-02-19T23:33:22.864Z","dependency_job_id":"b79cc3c0-9eda-488b-9a53-2334d8f8c165","html_url":"https://github.com/Lucas-C/rpg-bonhomme","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lucas-C%2Frpg-bonhomme","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lucas-C%2Frpg-bonhomme/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lucas-C%2Frpg-bonhomme/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lucas-C%2Frpg-bonhomme/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lucas-C","download_url":"https://codeload.github.com/Lucas-C/rpg-bonhomme/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248464212,"owners_count":21108238,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["character-sheet","game-master","jsonp","key-value-store","pen-and-paper","python","rpg","tabletop-rpgs","wsgi"],"created_at":"2024-10-13T20:51:08.207Z","updated_at":"2025-04-11T18:51:29.316Z","avatar_url":"https://github.com/Lucas-C.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\nIDEAS FOR IMPROVEMENTS:\n* add notes sections that are only visible to the user with the modification-key\n* template-index.html potential improvements:\n+ dynamic, JS-based list of characters on home page (aka get rid of --db-filepath argument of index_generator.py)\n=\u003e would also avoid to repeatedly download homepage images while viewing/editing characters\n--\u003e\n\nA tabletop RPG character sheet editor \u0026 viewer.\n\n[![build status](https://github.com/Lucas-C/rpg-bonhomme/workflows/CI/badge.svg)](https://github.com/Lucas-C/rpg-bonhomme/actions?query=branch%3Amaster)\n[![Known Vulnerabilities](https://snyk.io/test/github/lucas-c/rpg-bonhomme/badge.svg)](https://snyk.io/test/github/lucas-c/rpg-bonhomme)\n\nFeatures:\n\n- **web-based** : only require a web browser for end users\n- characters are read-only by default; **editing is only allowed with a unique URL** generated on character creation\n- **can support character sheets from any game**, simply by adding a new background image and matching CSS stylesheet\n- **easily deployable** on your own server, and also usable locally with no Internet connexion\n- locally load \u0026 save your character from **JSON files**, or save it on a remote server\n- _technical_: WSGI Python app implementing a JSONP key-value store backed by SQLite\n\n# Online website \u0026 examples\n\n[Homepage](https://chezsoi.org/lucas/rpg-bonhomme)\n\nSupported games:\n\n- [Blades In The Dark](https://bladesinthedark.com): [character sheet](https://chezsoi.org/lucas/jdr/rpg-bonhomme/?layout=BladesInTheDark) \u0026 [crew sheet](https://chezsoi.org/lucas/jdr/rpg-bonhomme/?layout=BladesInTheDark-Crew)\n- [PsyRun](https://chezsoi.org/lucas/rpg-bonhomme?layout=PsiRun) - discover the French version of the game [here](http://nightskygames.com/welcome/game/PsiRun)\n- [Ultime Vengeance 3D](https://chezsoi.org/lucas/jdr/rpg-bonhomme/?layout=UltimeVengeance3D) - discover the game [here](https://blog.xyrop.com/post/Ultime-Vengeance-3D)\n- [Biohazard – Resident Evil RPG](https://chezsoi.org/lucas/jdr/rpg-bonhomme/?layout=Biohazard) - discover Yno's game [here](http://www.misterfrankenstein.com/wordpress/?page_id=3)\n- [Scavengers](https://chezsoi.org/lucas/jdr/rpg-bonhomme/?layout=Scavengers) - discover Greg Pogorzelski's game [here](http://awarestudios.blogspot.fr/2014/01/scavengers.html)\n- [Dédale](https://chezsoi.org/lucas/rpg-bonhomme?layout=Dedale) - discover the game [here](http://lab00.free.fr/sommaire/home.htm).\n\nSome character examples from home-made TTRPGs:\n\n- [Kathelyn Terblanche](https://chezsoi.org/lucas/rpg-bonhomme?layout=Absence\u0026name=kathelyn_terblanche) \u0026 [Raphaelle Lepercq](https://chezsoi.org/lucas/rpg-bonhomme?layout=Absence\u0026name=raphaelle_lepercq_se_fait_appeler_lila_), two characters from a _one-shot_ TTRPG called 'Absence'\n- [Atharès](https://chezsoi.org/lucas/rpg-bonhomme?layout=InCognito1\u0026name=athares), a character from my TTRPG game _In Cognito_\n- [Ted Sand](https://chezsoi.org/lucas/rpg-bonhomme?layout=Allegoria\u0026name=ted_sand) \u0026 [Jacob Valens](https://chezsoi.org/lucas/rpg-bonhomme?layout=Allegoria\u0026name=jacob_valens) from my TTRPG campaign _Allegoria_\n\n# Usage\n\nAll the interactions are made using the 4 top right buttons and the 'name' input field.\n\nTo remote load an existing character, simply go to https://chezsoi.org/lucas/rpg-bonhomme?layout= and type a layout name at the end of URL, then enter your character name and press 'Load from remote server'. Alternatively you can directly enter an URL formatted like this: '?layout=\u003clayout-name\u003e\u0026name=\u003ccharacter-id\u003e'.\n\nTo edit and remote save a new character, simply go to https://chezsoi.org/lucas/rpg-bonhomme?layout= and type a layout name at the end of the URL, then enter your character name and press the 'Save to remote server' button.\n\nThe currently available layouts matches the list of file in the **layout/** \u0026 **background/** directories of this repository.\n\n# Internals \u0026 asumptions\n\n- a `?layout=` URL parameter provided to `index.html` allows to select the character sheet.\n- this _layout_ must match the name of a `.css` file in the `layout/` directory, and a `.png` character sheet image in `background/`.\n- `input` (or `textarea`) form fields are defined once and only once by rules starting with `input#\u003cname\u003e` in the `$layout.css` files,\nand they must be the only selectors starting that way in the file.\nNon-textual form fields must be specified as `input[type=.+]#\u003cname\u003e`\n- the `layout.css` file ****MUST define a text input with id `#name`.\n- (up)loading a new character currently only replace inputs defined in the provided file,\nnon-redefined caracteristics will keep their old value.\n\n# jsonp_db\n\nThis is a simple key-value store, written in Python and using a SQLite DB, developped to allow simple GET/PUT through JSONP.\n\nIf the key is not found, the returned value will be `undefined`. Else the API will returns the matching value or an error if anything wrong happens (a JS `Error` object if using JSONP, else an HTML error page).\n\nThere are some key/value length limitations currently hardcoded at the top of the Python file. `uwsgi` `--buffer-size` parameter also limits the URI length, and hence the value size.\nBeware of your server limitation on the request URI (between 2KB \u0026 8KB usually), that can e.g. trigger a 414 error with Apache.\n\nFinally, a word of warning: trusting a 3rd party JSONP API is a big confidence commitment / security risk.\nMore details [here](http://security.stackexchange.com/a/23439).\n\nThat being said, this WSGI app won't do anything nasty.\n\n## Environment setup\n\nInstalling a Python virtualenv and the needed dependencies with [pew](https://github.com/berdario/pew) :\n\n    pew new rpg-bonhomme -p python3\n    make install\n\n## Deployment\n\nInitial configuration \u0026 file permissions:\n\n    echo modification_key_salt = $(strings /dev/urandom | grep -o '[[:alnum:]]' | head -n 30 | tr -d '\\n') \u003e\u003e jsonp_db.ini\n    sqlite3 jsonp_db.db 'CREATE TABLE KVStore(Key TEXT PRIMARY KEY, Value TEXT);'\n    chmod ugo+rw jsonp_db.db\n\nInstalling the backup cron task:\n\n    sudo sed -e \"s~\\$USER~$USER~\" -e \"s~\\$PWD~$PWD~g\" jsonp_db-crons \u003e /etc/cron.d/jsonp_db-crons\n    chmod u+x /etc/cron.d/jsonp_db-crons\n\nInstalling `uwsgi`:\n\n    pew-in rpg-bonhomme pip install -r prod-requirements.txt\n\n### For Apache\n\nWith [`mod_wsgi`](https://modwsgi.readthedocs.org), simply:\n\n    sudo -u www-data bash -c \"source /var/www/apache-python-venv/bin/activate \u0026\u0026 pip install configobj requests\"\n\nAnd the Apache httpd.conf:\n\n    WSGIScriptAlias /path/to/jsonp_db /path/to/jsonp_db.py\n\n### For Nginx\n\n    cat \u003c\u003c EOF | sudo tee /etc/init/rpg-bonhomme.conf\n    start on startup\n    script\n        set -o errexit -o nounset -o xtrace\n        cd $PWD\n        exec \u003e\u003e upstart-stdout.log\n        exec 2\u003e\u003e upstart-stderr.log\n        date\n        pew-in rpg-bonhomme uwsgi --buffer-size 64000 --http :8088 --static-map /=. --manage-script-name --mount /jsonp_db=jsonp_db.py\n    end script\n    EOF\n    service rpg-bonhomme start\n\nAnd the Nginx configuration:\n\n    # Required to handle very long query parameters:\n    http2_max_field_size 64k;\n    large_client_header_buffers 4 64k;\n\n    location /jsonp_db {\n        include uwsgi_params;\n        rewrite ^/jsonp_db(.*)$ $1 break;\n        proxy_pass http://127.0.0.1:8088;\n    }\n    location /jsonp_db-tests.ini {\n        deny all;\n    }\n\nNote that nginx has built-in limits on the HTTP headers length,\nthat may cause `rpg-bonhomme` to malfunction.\nHence we configure higher values for [`http2_max_field_size`](http://nginx.org/en/docs/http/ngx_http_v2_module.html#http2_max_field_size)\nand [`large_client_header_buffers`](http://nginx.org/en/docs/http/ngx_http_core_module.html#large_client_header_buffers).\n\n\n## Validating\n\n    make check\n    make test\n\n## Developping\n\nRequire a `jsonp_db.db`:\n\n    make\n    make run-server\n\n## Useful shell functions\n\n### Retrieving a modification key\n\n    function get_mod_key () {\n        local layout=\"${1?}\"\n        local char_name=\"${2?}\"\n        python -c \"from jsonp_db import get_modification_key;print('\u0026modification-key='+get_modification_key('${layout}_'+'${char_name}'.lower()))\"\n    }\n\n### Changing an avatar\n\n    function avatar_chg () {\n        local key=\"${1?}\"\n        local img=\"${2?}\"\n        python -c \"import json;from jsonp_db import db_get,db_put;k='$key';v=json.loads(db_get(k));v['avatar']='$img';db_put(k, json.dumps(v))\"\n    }\n\n# License\nAdaptive Public License 1.0 (APL-1.0)\n\nTl;dr plain English version: https://tldrlegal.com/license/adaptive-public-license-1.0-%28apl-1.0%29\n\n# Resources\n\n- zero Javascript dependencies, only 2 Python requirements\n- all icons are from Google Material Design icons set (CC BY 4.0) : https://github.com/google/material-design-icons\n- the default avatar image was made by [NoHoDamon](https://www.flickr.com/photos/nohodamon/6485519491/in/photolist-7HSNkN-rzqCWQ-7HSNxA-5JtRYh-apeuDG-6MdYX2-aT6YZz-dRq1jf-dbRcxi-6igHjz-PHJD6-dN5YT-79V2QG-5ShoNL-FAQmN-4mU9vu-9rBg5B-9rBg8M-5ShoaN-5Z7D5b-EMUuT-78gz6Q-Gn5u9-GRGtNs) (CC BY-NC-ND)\n\n# Notes\n\n- why this project name ? It's a reference to the line \"T'as tué mon bonhomme !\" from the video \"Tom et ses chums! Farador D\u0026D\" : http://youtu.be/T9FMURHhgzc?t=4m40s\n- in case you want to add a character sheet in PDF format, you can use `pdftoppm` then ImageMagick `convert` to get a PNG image file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucas-c%2Frpg-bonhomme","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucas-c%2Frpg-bonhomme","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucas-c%2Frpg-bonhomme/lists"}