Upgrading from 1.0.3 to 1.0.4

Handbook · Operations · Changelog (CHANGELOG.md)

1.0.4 follows 1.0.3. Upgrade from 1.0.3. If you are on an older release, follow the earlier guides first: 1.0.1, 1.0.2, 1.0.3. It has seven database migrations and no required .env key. It changes:

  • Turning two-factor sign-in off takes a code. The same goes for reading or regenerating recovery codes. Each needs an authenticator or recovery code as well as the password. Before, a stolen session that knew the password could turn 2FA off. Staff can reset a member's lost 2FA.
  • Linking a sign-in provider asks a two-factor account for its code. The owner is emailed on every link and unlink.
  • Error-log redaction is stricter, and a migration scrubs stored rows again. Resolving error-log rows needs a recent password confirmation, as deleting them already did.
  • Multi-account detection works end to end once you switch it on. The admin console has a clusters screen. A cluster trade lock now reaches device-linked members only.
  • Player transfer limits: minimum level, daily caps, and a new-recipient cooldown. They are off unless the game sets them.
  • Moderators receive alerts. A plugin that stores a report or a ticket can announce it, and moderators and admins get the alert.

The changelog (CHANGELOG.md) lists every change.

Steps

Run commands from the installation's backend directory with the PHP CLI the site uses. In Docker, run docker compose exec backend php artisan ... from the project root.

  1. Take a backup, for example with php artisan pulse:backup:database, and keep a copy of the project folder.

  2. Switch the code to 1.0.4. Extract the release archive over the installation. It adds and replaces files and deletes none, so your .env files, storage, uploads and installed plugins stay.

  3. Run the migrations.

    php artisan migrate --force
    
    Migration What it does
    2026_11_13_150000_create_transfer_recipient_introductions_table Adds transfer_recipient_introductions, the first try to pay a new recipient (for the cooldown), and an index on economy_transactions(sender_id, created_at) for the daily send cap.
    2026_11_13_160000_add_receiver_created_index_to_economy_transactions Adds an index on economy_transactions(receiver_id, created_at) for the daily receive cap.
    2026_11_25_160000_rescrub_error_logs_with_review_rules Scrubs stored error_logs rows again with the 1.0.4 rules. It also repairs rows the old log import split across lines, then reruns the 1.0.2 scrub. It changes data only and cannot be reversed (the redacted text is gone).
    2026_11_27_090000_create_device_address_sightings_table Adds device_address_sightings, every address an account signed in from with its own first and last sighting. It copies existing fingerprint rows in once.
    2026_11_27_090100_add_seen_days_to_device_fingerprints Adds device_fingerprints.seen_days, used to keep the strongest evidence when an account hits its row cap.
    2026_11_27_090200_add_linked_accounts_to_multi_account_clusters Adds the account count a shared-network note shows.
    2026_11_27_090300_create_anti_multi_locks_table Adds the one lock row that cluster evaluations take first, so two sign-ins cannot create overlapping clusters.

    Two migrations carry November 13 timestamps although 1.0.3 did not have them. Laravel runs every pending migration, so the order does not matter for an upgrade. The rescrub reads every error-log row once; on a large table, run it in a quiet hour.

  4. Rebuild the configuration cache and restart long-running processes.

    php artisan config:cache
    php artisan route:cache
    

    Then restart this site's PHP-FPM, and Horizon or the queue workers. Docker: from the project root run docker compose up -d --build.

  5. Two-factor sign-in. Members turning 2FA off from Account settings now enter a code from their authenticator app, or a recovery code, with their password.

    • A member who lost the authenticator signs in with a recovery code and turns 2FA off with another one.
    • If a member has no codes left, an admin can turn 2FA off from the user editor (Users > the member > Sensitive actions > Reset two-factor sign-in, after confirming the admin's own password). An admin cannot do this for their own account or for another admin's.
    • An admin's 2FA, or any account's when no admin can use the console, is reset on the server with php artisan user:reset-two-factor <username or email>.
    • Each reset emails the member and is logged. Check that the request really comes from the account holder before you do it.
  6. Multi-account detection (optional, off by default). To switch it on:

    1. Check that request()->ip() is the player's real address on your host (config/trustedproxy.php). Otherwise every player behind your proxy shares one address.

    2. Add the privacy note from Multi-account detection to the game's privacy page. It says what the player app collects (a hash of a random browser id and browser details, keyed again on the server) and how long it is kept (90 days unused).

    3. Set the switch:

      ANTI_MULTI_RECORD_ON_AUTH=true
      # Optional: a key used only for browser values (otherwise APP_KEY). Changing it starts device links afresh.
      ANTI_MULTI_FINGERPRINT_KEY=
      
    4. Run php artisan config:cache again and rebuild the player front end (step 9).

    The thresholds (ANTI_MULTI_FINGERPRINT_WINDOW_DAYS, ANTI_MULTI_IP_WINDOW_HOURS, ANTI_MULTI_MAX_CLUSTER_SIZE, ANTI_MULTI_FINGERPRINT_RETENTION_DAYS, ANTI_MULTI_MAX_FINGERPRINTS_PER_USER, ANTI_MULTI_MAX_ADDRESSES_PER_USER) have working defaults. Staff review clusters under Players > Multi-account clusters. Banning, trade-locking, lifting a lock and dismissing need an admin with a fresh password confirmation.

  7. Review old trade-locked clusters. A cluster trade lock now reaches device-linked members only, as a ban does. After the upgrade, members of an already trade-locked cluster who were linked by address alone can trade again. Clusters written before 1.0.2 may hold device-linked members that were linked by a server-derived hash, which is not device evidence. Look through the trade-locked and banned clusters on the clusters screen and lift or dismiss what no longer holds.

  8. Player transfer limits (optional, off by default). A game sets them in its environment, and an admin can change each one later under Settings > Player Transfers (a saved value wins). Mafia: Underworld uses:

    ECONOMY_TRANSFER_MIN_LEVEL=5
    ECONOMY_TRANSFER_DAILY_SEND_CAP=250000
    ECONOMY_TRANSFER_DAILY_RECEIVE_CAP=250000
    ECONOMY_TRANSFER_NEW_RECIPIENT_COOLDOWN_MINUTES=10
    

    0 turns a rule off. A refused transfer answers 422 with the rule. A deadlocked transfer is rerun up to three times. A transfer whose outcome is unknown answers 409 outcome_unknown, so a resend with the same Idempotency-Key pays nothing twice. See Economy.

  9. Rebuild the front ends if you build them yourself (npm run build in frontend/ and in backend/resources/admin/). The release archive ships both built. A game running the Mafia Underworld kit gets kit 1.4.1, whose login page reads the OAuth return. Install it again with php artisan kit:install mafia-underworld after the upgrade.

  10. Error logs. After the migration, open Admin > Error logs and check that stored rows read as before, with secrets now shown as [redacted]. Resolving, unresolving and bulk-resolving rows now asks for your password, as deleting already did.

For plugin and front-end authors

  • 2FA contract. POST /api/v1/2fa/disable, POST /api/v1/2fa/recovery-codes and POST /api/v1/2fa/regenerate-recovery-codes take code as well as password. code is an authenticator code or a recovery code, and a recovery code used here is spent. A missing or wrong code answers 422 on code. The two recovery-code routes are limited to 5 a minute.
  • OAuth link. For an account with 2FA on, POST /api/v1/oauth/{provider}/link needs two_factor_code after current_password. Without it the answer is 422 code: two_factor_required. The new GET /api/v1/oauth/{provider}/link/pending returns the provider account waiting to be linked (provider, email, name, nickname) for the confirm form. The player router reads oauth_error and oauth_2fa for whatever page draws /login, a kit's login page included.
  • Moderation-alert hooks. A plugin that stores a player report fires moderation.report_created. One that stores a support ticket fires support.ticket_created. Core then sends the report or ticket alert to admins and moderators after commit (and the ticket.created webhook), at most 10 per player in 10 minutes. The ticket alert links to /plugins/tickets.
  • Transfers. A payout between players that does not go through EconomyService::transfer() must call TransferLimitService::check() itself.
  • Plugin builds. npm run plugin:build -- <slug> resolves every installed @tiptap/* package from the engine. A plugin built from its own repository no longer needs a temporary link to the engine's Tiptap.
  • Log text. LogRedactor now also redacts URL-encoded pairs (password%3D…), credentials in any URL scheme, and key=value, key: value and key => value pairs with a sensitive key. Write log text that keeps secrets out of it anyway.

Going back

Put the 1.0.3 files back from the copy in step 1 and repeat step 4. 1.0.3 ignores the new tables and columns. To remove them, run php artisan migrate:rollback --step=7 before switching back. The error-log rescrub cannot be undone.