diff --git a/app/Traits/NostrFetcherTrait.php b/app/Traits/NostrFetcherTrait.php index 305c706..4399e25 100644 --- a/app/Traits/NostrFetcherTrait.php +++ b/app/Traits/NostrFetcherTrait.php @@ -3,7 +3,6 @@ namespace App\Traits; use App\Models\Profile; -use Illuminate\Support\Facades\Log; use swentel\nostr\Filter\Filter; use swentel\nostr\Key\Key; use swentel\nostr\Message\RequestMessage; @@ -13,7 +12,6 @@ use swentel\nostr\Subscription\Subscription; trait NostrFetcherTrait { - public function fetchProfile($npubs) { $hex = collect([]); @@ -58,14 +56,16 @@ trait NostrFetcherTrait $response = $request->send(); $data = $response[$relayUrl]; if (!empty($data)) { + \Log::info('Successfully fetched data from relay: '.$relayUrl); break; // Exit the loop if data is not empty } } catch (\Exception $e) { - // Log the exception or handle it if needed + \Log::warning('Failed to fetch from relay '.$relayUrl.': '.$e->getMessage()); } } if (empty($data)) { + \Log::warning('No data found from any relay'); return; } foreach ($data as $item) { @@ -87,9 +87,11 @@ trait NostrFetcherTrait 'deleted' => $result['deleted'] ?? false, ], ); + \Log::info('Profile updated/created for pubkey: '.$item->event->pubkey); } } catch (\JsonException $e) { - throw new \RuntimeException('Error decoding JSON: ' . $e->getMessage()); + \Log::error('Error decoding JSON: '.$e->getMessage()); + throw new \RuntimeException('Error decoding JSON: '.$e->getMessage()); } } } diff --git a/docker-compose.yml b/docker-compose.yml index c62b2d6..65422e0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ services: dockerfile: Dockerfile args: WWWGROUP: '${WWWGROUP}' - image: sail-8.3/app + image: sail-8.3/verein-einundzwanzig extra_hosts: - 'host.docker.internal:host-gateway' ports: diff --git a/maintainers.yaml b/maintainers.yaml deleted file mode 100644 index 60e5122..0000000 --- a/maintainers.yaml +++ /dev/null @@ -1,5 +0,0 @@ -identifier: einundzwanzig-nostr -maintainers: -- npub1pt0kw36ue3w2g4haxq3wgm6a2fhtptmzsjlc2j2vphtcgle72qesgpjyc6 -relays: -- wss://nostr.einundzwanzig.space diff --git a/resources/views/pages/association/project-support/form/[ProjectProposal:slug].blade.php b/resources/views/pages/association/project-support/form/[ProjectProposal:slug].blade.php index 6ba3841..39fec6a 100644 --- a/resources/views/pages/association/project-support/form/[ProjectProposal:slug].blade.php +++ b/resources/views/pages/association/project-support/form/[ProjectProposal:slug].blade.php @@ -1,6 +1,8 @@ null, ]); -mount(function ($projectProposal) { - $this->form->fill($projectProposal->toArray()); - $this->image = $projectProposal->getFirstMedia('main'); -}); - usesFileUploads(); -mount(function () { - if (\App\Support\NostrAuth::check()) { - $this->currentPubkey = \App\Support\NostrAuth::pubkey(); +mount(function (ProjectProposal $projectProposal) { + if (NostrAuth::check()) { + $this->currentPubkey = NostrAuth::pubkey(); $this->currentPleb = \App\Models\EinundzwanzigPleb::query()->where('pubkey', $this->currentPubkey)->first(); $this->isAllowed = true; + $this->form->fill($projectProposal->toArray()); + $this->image = $projectProposal->getFirstMedia('main'); } }); on([ 'nostrLoggedIn' => function ($pubkey) { - \App\Support\NostrAuth::login($pubkey); + NostrAuth::login($pubkey); $this->currentPubkey = $pubkey; $this->currentPleb = \App\Models\EinundzwanzigPleb::query()->where('pubkey', $pubkey)->first(); $this->isAllowed = true; @@ -77,7 +76,7 @@ $save = function () { @volt