Browse Source

Misc fixes

imwald
Nuša Pukšič 9 months ago
parent
commit
db7596ebcb
  1. 2
      docker/cron/crontab
  2. 3
      docker/cron/index_articles.sh
  3. 15
      frankenphp/Caddyfile
  4. 2
      src/Service/NostrClient.php
  5. 2
      src/Service/NostrLinkParser.php
  6. 4
      src/Twig/Components/SearchComponent.php

2
docker/cron/crontab

@ -1 +1 @@
0 */6 * * * /index_articles.sh >> /var/log/cron.log 2>&1 */5 * * * * /index_articles.sh >> /var/log/cron.log 2>&1

3
docker/cron/index_articles.sh

@ -2,5 +2,4 @@
set -e set -e
export PATH="/usr/local/bin:/usr/bin:/bin" export PATH="/usr/local/bin:/usr/bin:/bin"
php /var/www/html/bin/console articles:get -- '-1 week' 'now' php /var/www/html/bin/console articles:get -- '-6 min' 'now'
php /var/www/html/bin/console articles:qa

15
frankenphp/Caddyfile

@ -22,21 +22,6 @@
root /app/public root /app/public
encode zstd br gzip encode zstd br gzip
mercure {
# Transport to use (default to Bolt)
transport_url {$MERCURE_TRANSPORT_URL:bolt:///data/mercure.db}
# Publisher JWT key
publisher_jwt {env.MERCURE_PUBLISHER_JWT_KEY} {env.MERCURE_PUBLISHER_JWT_ALG}
# Subscriber JWT key
subscriber_jwt {env.MERCURE_SUBSCRIBER_JWT_KEY} {env.MERCURE_SUBSCRIBER_JWT_ALG}
# Allow anonymous subscribers (double-check that it's what you want)
anonymous
# Enable the subscription API (double-check that it's what you want)
subscriptions
# Extra directives
{$MERCURE_EXTRA_DIRECTIVES}
}
vulcain vulcain
{$CADDY_SERVER_EXTRA_DIRECTIVES} {$CADDY_SERVER_EXTRA_DIRECTIVES}

2
src/Service/NostrClient.php

@ -26,7 +26,7 @@ class NostrClient
/** /**
* List of reputable relays in descending order of reputation * List of reputable relays in descending order of reputation
*/ */
private const array REPUTABLE_RELAYS = [ private const REPUTABLE_RELAYS = [
'wss://theforest.nostr1.com', 'wss://theforest.nostr1.com',
]; ];

2
src/Service/NostrLinkParser.php

@ -7,7 +7,7 @@ use Psr\Log\LoggerInterface;
readonly class NostrLinkParser readonly class NostrLinkParser
{ {
private const string NOSTR_LINK_PATTERN = '/(?:nostr:)?(nevent1[a-z0-9]+|naddr1[a-z0-9]+|nprofile1[a-z0-9]+|note1[a-z0-9]+|npub1[a-z0-9]+)/'; private const NOSTR_LINK_PATTERN = '/(?:nostr:)?(nevent1[a-z0-9]+|naddr1[a-z0-9]+|nprofile1[a-z0-9]+|note1[a-z0-9]+|npub1[a-z0-9]+)/';
public function __construct( public function __construct(

4
src/Twig/Components/SearchComponent.php

@ -32,8 +32,8 @@ final class SearchComponent
#[LiveProp] #[LiveProp]
public int $resultsPerPage = 12; public int $resultsPerPage = 12;
private const string SESSION_KEY = 'last_search_results'; private const SESSION_KEY = 'last_search_results';
private const string SESSION_QUERY_KEY = 'last_search_query'; private const SESSION_QUERY_KEY = 'last_search_query';
public function __construct( public function __construct(
private readonly ArticleRepository $articleRepository, private readonly ArticleRepository $articleRepository,

Loading…
Cancel
Save