Giter Site home page Giter Site logo

mahjongpantheon / pantheon Goto Github PK

View Code? Open in Web Editor NEW
42.0 9.0 12.0 101.94 MB

Primary Pantheon project repository

Home Page: https://riichimahjong.org

License: GNU General Public License v3.0

Makefile 1.10% Shell 0.70% PHP 26.46% HTML 0.03% JavaScript 0.60% CSS 0.61% TypeScript 67.36% Dockerfile 0.33% MDX 2.80%
mahjong japanese-majhong riichi

pantheon's People

Contributors

actions-user avatar alex-karpov avatar alexeydergunov avatar applysci avatar arrachne avatar bogachev-pa avatar comographer avatar ctizen avatar dependabot[bot] avatar hassantanveer avatar jesterboxboy avatar kovavka avatar nihisil avatar snyk-bot avatar unstatik avatar xelia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pantheon's Issues

Incorrect priority of storage engines

LocalStorage has first priority while cookies have secondary. See

this.cookieEngine.set(key, type, valuePrimary);

This leads to some undesirable behavior after password reset:

  • User resets password from Rheda
  • User tries to log in from Rheda
  • User gets to Tyr, but they already have an auth token in localStorage, so the right token in cookie is overwritten by the expired one.

Also check domain of cookies for Tyr and Rheda: the domain should be exactly .riichi.top everywhere (started with dot)

Get rid of yellow zone setting

  • Remove "Yellow zone duration" setting in Rheda and in DB
  • Use "Session duration" setting as an amount of guaranteed time when using yellow zone mode.

Review password recovery flow

  • We can't nullify reset token code on first visit, as it doesn't allow sharing links via messengers with auto-previews.
  • There's some questionable logic with temporary passwords that is probably to be deleted.
  • Maybe use some digit-code to prevent nullifying token with auto-previews

[Forseti] Long Timeouts after chancel rounds

The bug was replicated a few times, by using a fresh pull from commit a9b2e23
running
make container
make run
make dev
make seed
make seed_tournament

creating a tournament with EMA Rules and prescripted seating.

After canceling a round in the management page in Forseti, and then Reentering the exact same result once more via Frey, the backend seems to time out as a lot of timeout errors are visible in PHP logs from Rheda, and the whole frontend times out. After a long time(some minutes) and a reauth the system seems to recover, and the error cannot be recreated until the next session.

2023/04/21 12:49:12 [error] 113#113: *1439 upstream timed out (110: Operation timed out) while reading response header from upstream, client: 127.0.0.1, server: , request: "POST /v2/Common.Frey/QuickAuthorize HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost:4004" 127.0.0.1 - - [21/Apr/2023:12:49:12 +0300] "POST /v2/Common.Frey/QuickAuthorize HTTP/1.1" 504 497 "-" "GuzzleHttp/7" "-" 2023/04/21 12:49:13 [error] 113#113: *1441 upstream timed out (110: Operation timed out) while reading response header from upstream, client: 127.0.0.1, server: , request: "POST /v2/Common.Frey/QuickAuthorize HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost:4004" 127.0.0.1 - - [21/Apr/2023:12:49:13 +0300] "POST /v2/Common.Frey/QuickAuthorize HTTP/1.1" 504 497 "-" "GuzzleHttp/7" "-" 2023/04/21 12:49:13 [error] 112#112: *1417 upstream timed out (110: Operation timed out) while reading response header from upstream, client: 127.0.0.1, server: , request: "POST /v2/Common.Frey/GetPersonalInfo HTTP/1.1", upstream:

Potential fraud in event management

  • Any user can create an event and add there any other user
  • There should be a way to prevent fraudulent events (advertising, inappropriate naming, etc)

Add rating results export

Either change the results table from <div> to <table>, or add a button for a CSV export (hidden URL?). Any way to properly export the results would be great.

Right now, if you attempt to copy rating results, they will not be copied as a table.

Original:

image

Copied to the google doc:

image

Seating list on timer page shows more tables that actual

Steps to reproduce:

  • Create tournament
  • Add 8 players, exclude 4 of them from the seating
  • Make new seating for next session
  • Open timer page
  • Actual result: There's two rows with duplicated players
  • Expected result: Only one table is shown, excluded players don't show in ratings table.

Check behavior when excluding one or two players, but not the whole table.

При отсутствии фамилии, в мобильном интерфейсе отображается точка через пробел после имени

Код, ответственный за это:

private function _makeShortName($name)
{
list($surname, $name) = explode(' ', $name . ' '); // Trailing slash will suppress errors with names without any space
return $surname . ' ' . mb_substr($name, 0, 1, 'utf8') . '.';
}

Предлагаю, если в $name нет пробелов, возвращать просто $name, не пытаясь ничего с ним делать.

"End game" button to force session finish

Use case:

  • Players use some external timer during club games, and after the time is expired they would like to end the game without adding bogus noten hands.

Suggestion:

  • Add a "Force finish" button (or checkbox) either in admin panel or in mobile assistant. Having the checkbox checked will finish the game right after last hand is recorded.

Более независимая i18n

Сейчас, английский перевод несёт на себе ещё и функцию placeholder'ов, что приводит к тому, что при изменении английского текста, менять одно и то же нужно в двух местах. Может быть стоит сделать placeholder'ы языконезависимыми?

Wrong game timestamps

например вот эта игра https://rating.riichimahjong.org/eid146/game/beec8b068bbda3732d4daf3f9088bdd3c8b9b333 имеет правильный таймстамп

а эта https://rating.riichimahjong.org/eid146/game/660436f0b486a07dd04bfb854d85552747ef6902 на самом деле закончилась на 2 часа раньше, в 21:22

если зайти в профиль любого игрока и кликать на точки на графике рейтинга, то там игры в правильном порядке, и как раз сбитое время можно будет обнаружить

Seating generation issue in tournament management

When attempting to generate new seating on the Games Management page, by clicking the designated button, the status changes to "Seating..." but then, after a few seconds, returns to "Not Started" without any seating being created.

Additionally, if manual seating arrangements are specified for the same tournament, the status remains stuck on "Seating..." indefinitely.

image

Affected tournament: https://manage.riichimahjong.org/event/184/games

Error after last round in prescript tournament

After finishing the last round of a tournament with preseating, the tournament control page throws an error:
Something went wrong: Response: HTTP/1.1 500 Internal Server Error

PHP Error:
[28-Mar-2023 07:34:07 UTC] PHP Warning: Undefined array key 8 in /var/www/html/pantheon-prod/Mimir/src/primitives/EventPrescript.php on line 262 [28-Mar-2023 07:34:07 UTC] PHP Fatal error: Uncaught TypeError: array_map(): Argument #2 ($array) must be of type array, null given in /var/www/html/pantheon-prod/Mimir/src/helpers/Seating.php:624
It does not really pose a problem, as the round is calculated properly.
Bug can be mitigated by adding a "dummy" round in the prescripting.

Solution:
tournament control page should display something along the lines of "no more prescripted rounds available" or similar, but should still allow hiding and showing rating table(newer version have this toggle in the tournament overview as well).

Pantheon version used when discovering bug hast the following commit as head:
1221ea0

Не запускается на чистой Ubuntu 16.04

Как повторить:

  • Установить Ubuntu 16.04 на виртуальной машине
  • sudo apt install docker.io git
  • git clone https://github.com/MahjongPantheon/pantheon.git
  • cd pantheon
  • sudo make container
  • sudo make run

Как проявляется:
На 4001 и 4002 портах пустая страница, 4003 недоступен.

Ошибки:

  • bin/phinx не найден при sudo make seed
  • nodejs пропустил опциональную зависимость [email protected], т.к. ожидал архитектуру darwin, а получил linux

Логи:

  • docker.log - вывод sudo make logs
  • full_bash.log - полный вывод терминала от начала до конца. Примечание: cyclopentan/pantheon это полная копия MahjongPantheon/pantheon, был склонирован 13 августа 2018г. и не изменялся (коммит HEAD = 014e74a).
  • npm.log - 24-ый шаг сборки docker, проблема с fsevents

Improve Rheda graphs

  • Half of titles are hidden if there's too many yaku
  • Count numbers are messed up

Image

Maybe replace with some other histogram drawer?

Authentication in Frey not working for Forseti

Behavior was tested with docker dev environment.
When logging in via Frey, the authentication works for rheda but not for Forseti.
Vice versa, when logging in via Forseti, Frey is also authenticated.
Rheda accepts the auth in both cases.

Auth cookie looks the same in both instances
image

New roles for event management

  • Owner role: equivalent to administrator, but can't be revoked by anyone. Owner role can be transferred explicitly to another user (with confirmation).
  • Manager role: can only add new players to the event and cancel hands or games when possible. Manager can't remove players from event, assign other managers or administrators or change event settings.
  • Consider adding non-playing administrators (now one can add player, make them an administrator, then remove, but it's a workaround)

Tournament stuck on seating stage in certain conditions

  • Make a tournament event with prescripted seating
  • Add 8 players to the tournament
  • Make a prescripted seating stating that only 4 of 8 players are playing with each other in every game. Example:
7-2-1-8

4-2-6-3

2-4-3-8

1-7-8-6

7-6-3-8

1-2-4-6

1-7-4-3

2-7-6-8

2-7-4-6

1-4-3-8

1-2-6-3

7-4-3-8

1-4-6-8

2-7-1-3
  • Try to start the tournament
  • Expected behavior: seating is prepared, there is a start button. Actual behavior: UI is stuck on "preparing seating" stage.

This happens due to hardcoded condition in Rheda: https://github.com/MahjongPantheon/pantheon/blob/master/Rheda/src/controllers/TournamentControlPanel.php#L226
Looks like this logic is incorrect, and we should rely on the total number of players participating in certain hanchan.

Password recovery issues

  1. Check if password is properly updated after recovery.
  2. Ensure all cookies are properly cleared after attempt of unsuccessful login
  3. Auth reset token is not cleared after it's used - this is not correct.

Enhancement Autoconfigure mail in docker-compose production

It would be very comfortable if the functionality to send recovery and signup mails via smarthost would work out of the box with docker compose.

Tested Steps to make it work:

  • Add Environment Variables to env file for Docker Compose
   FROM_MAIL=Pantheon<[email protected]>`
   SMTP_HOST=mail.domain.test:587
   [email protected]
   SMTP_PASS=password
   SMTP_TLS=YES
   SMTP_STARTTLS=YES
  • apk add ssmtp in Frey container

  • Add configuration for ssmtp to /etc/ssmtp/ssmtp.conf filled with env variables

  # cat /etc/ssmtp/ssmtp.conf 
  # Config file for sSMTP sendmail 
  #
  # The person who gets all mail for userids < 1000
  # Make this empty to disable rewriting.
  root=

  # The place where the mail goes. The actual machine name is required no
  # MX records are consulted. Commonly mailhosts are named mail.domain.com
  mailhub=SMTP_HOST

  # Where will the mail seem to come from?
  rewriteDomain=

  # The full hostname
  hostname=pantheon

  # Are users allowed to set their own From: address?
  # YES - Allow the user to specify their own From: address
  # NO - Use the system generated From: address
  FromLineOverride=YES

  AuthUser=SMTP_USER
  AuthPass=SMTP_PASS
  UseTLS=SMTP_TLS
  UseSTARTTLS=SMTP_STARTTLS
  • Add FROM Header i.e. in send function in Mailer class in Frey/src/helper/Mailer.php
    protected function _send(string $to, string $subject, string $message, array
     $additionalHeaders, string $additionalParams)
    {
        $boundary = md5(uniqid() . microtime());
        $additionalHeaders['Content-Type'] = 'multipart/alternative; boundary="' . $boundary .      '"';
        $additionalHeaders['From'] = SMTP_FROM;

Refine yaku list

  • Remove yakuhai 5 everywhere. Do not change other yaku ids!
  • Ensure yakuhai 4 is accessible in assistant.

User-defined presets of rules

Now we have 4 predefined rulesets with the ability to change details when making a new event. Usually club ratings are based on previous season rules, so there could be some improvements in the process:

  • Add ability to use any existing events rules as a base
    or
  • Add some user-defined presets of rules so they could be shared. The presets could be either private or public (in this case we need some kind of moderation to avoid chaos).

[Forseti improvement] Add view "Registered Tournaments"

Adding a view for a player to see for which events they are enrolled in would be helpful.
Maybe adding "Enrolled/Registered Events" or something like that in Forset, with the option to click an enrolled event and be redirected to rating table in rheda.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.