2.9 KiB
2.9 KiB
kodi-timekeeper
An approach to having kids use a Kodi media center instance: manage session use and keep track of time spent and available budget.
Getting started
- Set up a MySQL database by whatever means you prefer. This step is outside the scope of this getting started guide.
- In your MySQL daemon create one database and a user with all grants except for the
GRANT
grant on that database, here with accountkodi-timekeeper
as an example on a MySQL 5.7.22 daemon:
Here# Create account CREATE USER 'kodi-timekeeper'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*hash' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK; # Grants for kodi-timekeeper@localhost GRANT USAGE ON *.* TO 'kodi-timekeeper'@'localhost'; GRANT ALL PRIVILEGES ON `kodi-timekeeper`.* TO 'kodi-timekeeper'@'localhost';
hash
is the hashed account password. To compute it yourself head into your MySQL daemon and execute the query:
The result of which will be something like:SELECT CONCAT('*', UPPER(SHA1(UNHEX(SHA1('topsecret')))));
Which is the hash representation of password*6C47D9CD3A183D230B04FE7F38D7D313E2B4B5AE
topsecret
. This query-hash mechanism comes courtesy of René Cannaò formerly of Pythian Services Inc. in his 2011 article "Hashing Algorithm in MySQL PASSWORD()" at blog.pythian.com.
- In your MySQL daemon create one database and a user with all grants except for the
- On your operating system make sure the
mysql_config
binary exists. On a Debian or a derivative distribution that typically involvessudo apt-get install default-libmysqlclient-dev
. git clone
this repo- Install requirements via
pip install -r requirements.txt
- Export the following shell environment variables as needed. The next step will use these variables to connect to your database and create tables. Values below are defaults so if you want to stick to a default feel free to simply not export the variable.
export DB_DIALECTDRIVER='mysql' export DB_USER='kodi-timekeeper' export DB_PASSWORD='-kodi-timekeeper' export DB_HOST='localhost' export DB_NAME='kodi-timekeeper'
- Navigate into the repository's
db
subdirectory - Initialize your database:
alembic upgrade head
Valid Conventional Commits scopes
meta
: Affects the Git project's structure such as for example apyproject.toml
change, adding a new directory or changing how a news fragment file is formatted- Examples:
refactor(meta): Move pytest config into 'pyproject.toml'
build(meta): Set custom towncrier news topics
- Examples:
db
: Affects database connectivity features, for example being able to migrate database versions or installing an empty database- Examples:
feat(db): Add requirements for database work
- Examples: