Commit Graph

48 Commits

Author SHA1 Message Date
HolgerHatGarKeineNode 8fd4900138 🔠 Standardize brand name casing to **EINUNDZWANZIG** across translations, controllers, views, and configurations 2026-06-13 23:53:11 +02:00
HolgerHatGarKeineNode d07b141b40 🎨 Add logo field to meetups API responses and fetch media relations for meetups
- ✏️ Updated `MeetupController` to include `with('media')` for meetups query.
- 🖼️ Added `logo` to `MeetupResource` via `getFirstMediaUrl`.
- 🧪 Extended feature tests to validate `logo` presence and type in API responses.
2026-06-13 22:56:10 +02:00
HolgerHatGarKeineNode 8d7b1515d8 Update MeetupController to use pivot memberships for "My Meetups" in both listing and detail views
- ✏️ Adjust `mine` method to fetch meetups based on dashboard selections (`meetup_user` pivot).
- ✏️ Add `viewMine` policy to control access to individual meetups for pivot members.
- 🧪 Update feature tests to reflect pivot-based logic for "My Meetups."
2026-06-13 22:42:33 +02:00
HolgerHatGarKeineNode b6f5d57530 🔄 Update flag asset paths for cities, venues, and countries across API and tools 2026-06-12 18:09:54 +02:00
HolgerHatGarKeineNode 0b454dfc80 🧪 Add API tests and update controllers for city and venue details
- ✏️ Added feature tests for cities and venues, including pagination limits and `withDetails` parameter handling.
- ✏️ Updated `CityController` to support `withDetails`, returning country code and flag URL while lifting pagination limits.
- ✏️ Updated `VenueController` to support `withDetails`, lifting pagination limits and enriching venue responses with city details.
2026-06-12 18:00:14 +02:00
HolgerHatGarKeineNode 6a2958c90a 🧪 Add API tests and update controllers for detailed course and lecturer data
- 🚀 Introduced feature tests for courses and lecturers, covering pagination limits, detailed data retrieval, and 404 responses.
- ✏️ Updated `CourseController` to support `withDetails` for courses, including lecturer and next event data.
- ✏️ Updated `LecturerController` to support `withDetails` for lecturers, including future events count.
- ⚙️ Expanded routes to include `show` endpoints for courses and lecturers.
2026-06-12 17:16:53 +02:00
HolgerHatGarKeineNode f9b3428865 Add DELETE /api/mobile/token so the app can revoke its token on logout 2026-06-12 15:12:38 +02:00
HolgerHatGarKeineNode 54c959d18e Return the signed event to the app via custom scheme, not a browser page
A signer-owned Custom Tab never reliably displayed the browser handoff
page, so the token never returned. The Nostr launcher now uses the app's
custom scheme as the callback (einundzwanzig://signed/{k1}/): Amber opens
it directly after signing and the app exchanges the event for a token via
/api/mobile/token — no browser handoff in the loop.
2026-06-12 01:14:01 +02:00
HolgerHatGarKeineNode 76787a1bee Render the handoff page directly instead of 302-redirecting to /app/auth
Chrome follows a server 302 internally and never dispatches the /app/auth
App Link, so the handoff page stayed in the browser and the token never
reached the app. The signed callback (and complete/confirm) now render
the handoff page directly with the einundzwanzig:// deep-link button — the
signer opens the callback in the browser, the user lands on the handoff
page and taps once to return to the app, which stores the token.
2026-06-12 00:29:44 +02:00
HolgerHatGarKeineNode 7e491326a9 Build the Nostr signer URI in the browser, not server-side
Server-side percent-encoding (rawurlencode/http_build_query) produced a
nostrsigner: URI that Amber rejected as malformed. The launcher view now
assembles it in JS with encodeURIComponent(JSON.stringify(event)) — the
exact encoding Amber accepts (verified working earlier in the session).
The controller only passes k1 and the callback URL.
2026-06-11 22:40:57 +02:00
HolgerHatGarKeineNode 58c7e410b0 Add headless Nostr launcher page for the mobile app
A direct ACTION_VIEW intent to nostrsigner: (Browser::open from the app)
lacks category.BROWSABLE, so Amber routes it into its app-to-app path
and rejects it as malformed. The app instead opens /auth/mobile/nostr in
an in-app browser; that page fires the signer via window.location, so
the intent carries BROWSABLE and Amber uses its web-signing flow. No
visible login UI, local signing, token returned via the App Link.
2026-06-11 22:08:17 +02:00
HolgerHatGarKeineNode 7531f28f22 Add verified App Link handoff and mobile token exchange endpoint
Replaces the custom-scheme auto-redirect (which triggers Chrome's
confirmation prompt) with a verified Android App Link handoff:

- public/.well-known/assetlinks.json for space.einundzwanzig.mobile
  (debug cert fingerprint; add the release cert before store builds)
- GET /app/auth handoff: opens the app directly when the App Link is
  verified; renders a button-based fallback page otherwise
- POST /api/mobile/token: trades a NIP-55-signed login event for a
  Sanctum token — used when Amber's callback opens the app directly
- complete/confirm/signedCallback now redirect to the handoff URL
2026-06-11 19:51:14 +02:00
HolgerHatGarKeineNode 4aba1514e9 Make the NIP-55 signer callback robust against Amber URL rewriting
Amber drops the query string when it rebuilds the callback URL and
appends the signed event directly to the path. The mobile login page now
hands out path-based callback URLs (/auth/mobile/signed/{k1}/) so the
event arrives as the remainder of the path.

The new callback runs in the web middleware group: the signer opens it
in the system browser, which shares cookies with the in-app browser
session, so the flow completes immediately — a bridge page issues the
token and fires the einundzwanzig:// deep link. The LoginKey row is
still written as a fallback for the polling login page.
2026-06-11 18:43:59 +02:00
HolgerHatGarKeineNode 07169dfee6 Add mobile app auth flow with Sanctum token handoff via deep link
The Einundzwanzig mobile app opens /auth/mobile in an in-app browser.
After a Lightning (LNURL) or Nostr login the flow issues a personal
access token and hands it back via the einundzwanzig://auth deep link.

- New auth.mobile-login Livewire view: Lightning QR (shared k1) plus
  Nostr signing via NIP-55 Android signers (Amber) with server callback,
  and a confirmation screen for already authenticated sessions
- MobileAuthController: NIP-55 callback verification, completion route
  issuing the token (replacing same-device tokens), redirect whitelist
- Nostr login event verification and npub user resolution extracted to
  App\Support\NostrLogin, now shared with the interactive login
- GET /api/user (auth:sanctum) returns the token owner's profile
2026-06-11 18:01:50 +02:00
HolgerHatGarKeineNode 8c68b19138 Add Super-Admin tools for managing any model
- 🛠️ Introduced generic Super-Admin MCP tools, including `list-models`, `describe-model`, `list-records`, `show-record`, `create-record`, and `update-record`.
- 🛡️ Restricted modification of critical fields (e.g., passwords, roles, tokens) to enhance security.
-  Added extensive feature tests for Super-Admin functionality and access control.
- 📜 Increased pagination length to accommodate new tools on a single page.
- 🔗 Registered Super-Admin tools in `EinundzwanzigServer`.
2026-06-08 13:39:04 +02:00
HolgerHatGarKeineNode d0544bfac9 Add OAuth functionality, MCP tools, and feature tests
- 🔒 Added migrations for `oauth_access_tokens`, `oauth_refresh_tokens`, `oauth_auth_codes`, `oauth_clients`, and `oauth_device_codes`.
- 🤖 Created MCP tools (Meetups, Cities, Venues, Courses, Lecturers) for managing entities with authentication and validation.
- 🛠️ Implemented Passport-backed OAuth API guard configuration and validation endpoints.
-  Added comprehensive feature tests for MCP tools and OAuth functionality (access control, validation, and token-based authentication).
2026-06-08 09:37:00 +02:00
HolgerHatGarKeineNode 3cad5f5636 **Enhance input validation and error handling across APIs**
- 🛠️ Refactored controllers to utilize `FiltersNumericIds` concern, ensuring secure numeric ID filtering and avoiding type-sensitive errors in queries.
-  Added feature tests to validate robust input hardening for non-numeric or malformed query parameters (`user_id`, `selected[]`).
- 🔒 Introduced `PublicPropertyNotFoundException` handling in Livewire, returning 400 for invalid property probes and suppressing unnecessary log entries.
-  Updated `MeetupEventController` to handle invalid date formats gracefully, aborting with a 400 response instead of 500.
-  Expanded exception handling pipeline for enhanced resilience against malformed input, bot noise, and exploitable probes.
2026-06-08 02:53:44 +02:00
HolgerHatGarKeineNode 3b93e22e95 **Add authenticated API endpoints for managing Meetups, Cities, Venues, and Lecturers**
-  Introduced `store`, `update`, `mine`, and `mineShow` endpoints for `Meetups`, `Cities`, `Venues`, and `Lecturers` with validation and authorization.
- 🔒 Added `Policies` for `Meetups`, `Cities`, `Venues`, and `Lecturers` leveraging `ChecksCreatorOwnership` for ownership checks.
- 🌐 Created `Resources` for structured API responses: `MeetupResource`, `CityResource`, `VenueResource`, and `LecturerResource`.
-  Added dedicated `Request` classes for input validation: `Store` and `Update` variants for all models.
- 🛠️ Updated controllers to support new functionalities with localized error messages and proper HTTP responses.
2026-06-08 01:58:37 +02:00
HolgerHatGarKeineNode 3875e127e4 🔥 **Remove Highscore and Bindle features**
- 🗑️ Deleted `Highscore` feature (Model, Controller, Factory, Tests, Routes, Migrations) and associated logic.
- 🗑️ Removed `BindleController` and its related test.
- 🧹 Cleaned up unused routes, database seeders, and localization references.
- 🚫 Deprecated inactive book rental guide component and associated views.
2026-06-08 01:08:07 +02:00
HolgerHatGarKeineNode 351dd87fa9 **Enhance API functionality and localizations**
- 🌐 Added API documentation annotations for multiple controllers (Meetups, Cities, Countries, Courses, Highscores, Venues), improving public and developer-facing endpoint clarity.
-  Integrated and configured the `dedoc/scramble` package for automated OpenAPI documentation generation.
- 🔒 Excluded internal routes and actions from API documentation using `ExcludeRouteFromDocs` attributes.
- 🌍 Added new localization keys for API Token features across multiple languages (`lv`, `es`, etc.).
- 🛠️ Introduced `Group`, `Response`, and `QueryParameter` attributes for better request descriptions and structured documentation.
- 🚀 Enhanced functionality for listing operations in controllers with filters and query parameters like `search` and `selected`.
2026-06-08 00:09:59 +02:00
HolgerHatGarKeineNode a3062f6c4e feat(api): authenticated course & course-event write endpoints
Implements Sanctum-authenticated write endpoints so a lecturer can create
and update their own courses and dated course events programmatically
(e.g. to keep the portal's course events in sync with an external system).

- CourseController@store / @update implemented (validation mirrors the
  Livewire course create form; create requires is_lecturer, update is
  restricted to the owner or a super-admin).
- New CourseEventController with index/store/update. index returns only the
  authenticated user's own events (optional ?course_id= filter) for
  idempotent syncing; validation mirrors the Livewire course event form.
- Public `courses` API resource narrowed to index/show; all writes moved
  behind an `auth:sanctum` route group (the previous store/update/destroy
  actions were empty no-ops).
- Pest feature test covering auth (401), authorization (403/is_lecturer/
  ownership), creation (201), validation (422) and ownership-scoped listing.

Ported from Einundzwanzig-Podcast/einundzwanzig-portal#25, adapted to this
repo's conventions (inline authorization instead of policies, Pest tests,
validation mirroring the current Livewire forms) while keeping the same
endpoint outputs.

Co-authored-by: schnuartz-ai <schnuartz@gmail.com>
2026-06-07 22:14:29 +02:00
HolgerHatGarKeineNode 52276ee682 🗑️ **Remove redundant Laravel Boost guidelines**
Deleted unused Laravel Boost guideline files (`laravel-boost.md` and `laravel-boost.mdc`) to clean up the repository.
2026-05-17 15:08:01 +02:00
Claude d46c0161fe security: medium-severity fixes (proxies, ssrf, uploads, lnurl, github_data)
- Trust the Forge reverse proxy and force https URLs in production so
  generated absolute URLs match the actual TLS termination.
- Reject Nostr profile photo URLs that aren't http(s) or that resolve to
  loopback / private (RFC1918) addresses to close an SSRF vector in
  FetchNostrProfileJob.
- Tighten image upload validation across meetup, course, and lecturer
  create/edit components: explicit mimes whitelist (jpeg, png, webp),
  max 5 MiB, and dimension cap of 4000x4000.
- Replace the silent "skip if exists" branch in LnurlAuthController with
  updateOrCreate so concurrent callers cannot race on the k1 record.
- Validate github_data on Meetup edit, decoding the JSON, and keep only
  the whitelisted keys (top, left, state) with strict type coercion to
  prevent storing arbitrary attacker-controlled JSON.
2026-05-03 12:57:57 +00:00
Claude 9b81f6cd92 security: high-severity fixes (api throttle, fillable, idor, path, rel)
- Add 60 req/min throttle to the public API group and a stricter 10 req/min
  throttle to POST /highscores.
- Replace mass-assigned $guarded=[] with explicit $fillable on User, Meetup,
  Course, Lecturer, and SelfHostedService. created_by stays out of the
  whitelist; the existing creating() hooks continue to populate it.
- Require authenticated user on Api/MeetupController::index instead of
  trusting the user_id query parameter (IDOR).
- Constrain the /img and /img-public route paths to a safe character set
  and reject any path containing ".." in ImageController.
- Add rel="noopener noreferrer" to every target="_blank" link on the meetup
  and course landing pages.
2026-05-03 12:55:09 +00:00
Claude 90835f8b1f security: critical fixes (test route, edit authz, nostr signature, calendar IDOR)
- Remove unauthenticated /test route that dispatched FetchNostrProfileJob
  for a hardcoded user (routes/web.php).
- Enforce created_by ownership check in meetup and lecturer Livewire edit
  components; mirror the existing services/edit pattern.
- Replace blind-trust nostrLoggedIn handler with NIP-42-style signed event
  verification: server-issued challenge stored in session, client signs a
  kind:22242 event, server verifies signature via swentel/nostr-php and
  derives npub. Challenge is single-use with 5-minute TTL.
- Validate the ?my[] parameter on the calendar download endpoint as an
  array of integers and intersect with the authenticated user's meetups.
2026-05-03 12:51:10 +00:00
HolgerHatGarKeineNode bb84117fd1 🛠️ Remove deprecated Forge deployment workflow, add logic for fetching missing highscore names via Nostr, and update API routes with refined highscore endpoints. 2026-02-02 12:36:00 +01:00
HolgerHatGarKeineNode 6dd04dee30 🏆 Add highscore feature with API endpoints, validations, and tests
- **Added:** Endpoints for submitting highscores (`highscores.store`) and retrieving the leaderboard (`highscores.index`).
- **Implemented:** Validation rules via `StoreHighscoreRequest` to ensure highscore integrity.
- **Included:** `Highscore` model, migration, and factory for data handling and seeding.
- **Enhanced:** Comprehensive feature tests covering submission, updating, retrieval, and payload validation.
2026-02-02 12:27:01 +01:00
HolgerHatGarKeineNode da1324adda 🗓️ Add MeetupEventFactory, implement rate limiting for calendar downloads, and enhance test coverage
- **Added:** `MeetupEventFactory` for generating test data.
- **Implemented:** Rate limiting (`throttle:calendar`) for `stream-calendar` routes to prevent abuse.
- **Enhanced:** `DownloadMeetupCalendar` controller with validation and cleaner query structure.
- **Added:** Feature tests for calendar downloading, invalid input handling, and rate limiting.
2026-01-17 21:18:55 +01:00
HolgerHatGarKeineNode 74263a4581 🔒 Add manual hex validation for LNURL-Auth parameters k1 and key with improved test coverage 2026-01-17 17:25:21 +01:00
HolgerHatGarKeineNode e5ea65fa77 🔑 Implement LNURL-Auth support with error handling, frontend polling, and test coverage
- Added `LnurlAuthController` to handle LNURL authentication flow with signature verification, user creation, and session expiry checks.
- Integrated authentication error polling in `nostrLogin.js`.
- Added `LoginKeyFactory` for testing and database seed purposes.
- Created feature tests (`LnurlAuthTest`) to validate LNURL callback, error responses, and session handling.
- Extended `login.blade.php` with dynamic error handling and reset logic for expired sessions.
2026-01-17 15:23:38 +01:00
HolgerHatGarKeineNode 233402dace 🔧 Add .gitignore for static assets and update comment language in DomainMiddleware 2025-12-14 20:53:09 +01:00
HolgerHatGarKeineNode 52c05e6d47 ⚙️ Preserve user language preference in DomainMiddleware and adjust locale‑setting logic to avoid overwriting existing session values while still configuring domain‑specific app settings. 2025-12-09 23:41:44 +01:00
HolgerHatGarKeineNode d263eaf92d 🛠️ Add German portal domain and refactor URL handling for Nostr publishing
- Introduce `portal.einundzwanzig.space` with locale settings in `DomainMiddleware`.
- Replace verbose if‑chain in `NostrTrait::getUrl()` with a concise match expression.
- Add `DOMAIN_MAP` constant to `PublishUnpublishedItems` and force URL generation to use the correct domain per country.
- Update command flow: set domain before configuring timezone/locale.
2025-12-09 22:45:26 +01:00
HolgerHatGarKeineNode 2a70537fcb 🛠️ Add Nostr publishing support with i18n templates and country‑specific configuration for domain handling and CLI command 2025-12-09 22:35:54 +01:00
HolgerHatGarKeineNode 6f77108ca2 🌐 Add Polish translations and expand Spanish dictionaries
- Added a new `lang/pl.json` file with comprehensive Polish translations.
- Enhanced `lang/es.json` with additional Spanish keys and phrases for better coverage.
2025-12-02 19:56:35 +01:00
HolgerHatGarKeineNode f7102f0d43 🚨 Add numeric validation to user_id in MeetupController@index 2025-11-27 15:57:06 +01:00
HolgerHatGarKeineNode 572889bf42 🛠️ Use findOrFail in MeetupController@index to handle missing users gracefully 2025-11-27 15:51:25 +01:00
HolgerHatGarKeineNode c4f9f1a089 Add meetup/ical route and handler in MeetupController
- Introduced a new route `meetup/ical` in `api.php` to handle iCal data export.
- Added `ical` method to `MeetupController` returning a 404 response for now.
2025-11-27 15:48:40 +01:00
HolgerHatGarKeineNode fe09947ec3 🛠️ Fix case typo in Meetup model import in MeetupController 2025-11-27 15:18:04 +01:00
HolgerHatGarKeineNode 2cfd7abc07 🌐 Replace manual language selection with reusable language selector component and add Hungarian translations
- Replaced inline language selection logic in `profile.blade.php` with `<x-einundzwanzig.language-selector>`.
- Introduced Hungarian (`hu.json`) translations for improved multilingual support.
- Updated `DomainMiddleware` to include settings for Hungarian locale and portal branding.
2025-11-23 22:34:38 +01:00
HolgerHatGarKeineNode 6f7ee806ae 🌐 Introduce dynamic domain-based locale and country handling
- Added `DomainMiddleware` to dynamically set locale, language-country session, and app name based on domain.
- Updated views and components to leverage `lang_country` session for language and region-specific content.
- Enhanced country parameter retrieval with `config('app.domain_country')` as fallback.
- Refined language filtering by scanning available language files dynamically.
- Added language-specific assets and translations (`nl.json`, `es.json`) with improved language-region associations.
- Updated `app-logo-icon` to display region-specific images or default SVGs.
- Improved views with cleaner, dynamic rendering and session-aware functionalities.
2025-11-23 20:45:29 +01:00
HolgerHatGarKeineNode ca9cd9b875 Enhance timezone support across application
- Introduced a `SetTimezone` middleware to dynamically apply user-specific timezones.
- Added a `timezone chooser` component for users to select their timezone.
- Enhanced date and time display in views with `asDate`, `asTime`, and `asDateTime` methods.
- Updated `AppServiceProvider` to leverage `preventLazyLoading` in local environments and set custom `Carbon` instance for dates.
- Expanded configuration with `user-timezone`.
- Integrated timezone support into meetups and events for consistent scheduling.
2025-11-23 19:21:19 +01:00
HolgerHatGarKeineNode af7a05e44c 🔧 Filter events to include only upcoming ones in calendar download 2025-11-23 00:30:23 +01:00
HolgerHatGarKeineNode 8600f98312 🌐 Add multilingual configuration and translation files 2025-11-22 23:53:15 +01:00
HolgerHatGarKeineNode eb089f670c 🌍 Add static 'country=de' parameter to dashboard routes 2025-11-22 20:57:53 +01:00
HolgerHatGarKeineNode efe44cf344 Add storage configuration, localization updates, and feed generation
- Added `publicDisk` configuration to `filesystems.php`.
- Expanded locale translations in `es.json` and `de.json`.
- Implemented RSS, Atom, and JSON feed views.
- Added `feed.php` configuration for feed generation.
- Introduced `ImageController` for image handling.
- Updated application routing to include `api.php`.
2025-11-21 16:23:55 +01:00
HolgerHatGarKeineNode 69e46fabce 🌐 Add German translations and implement calendar streaming functionality 2025-11-21 13:11:39 +01:00
user e4a4cfae2b 🚀 initial commit 2025-11-21 04:28:08 +01:00