# HG changeset patch # User ymh # Date 1731015494 -3600 # Node ID 4a1e6952afe583e9a619c9217ce89c54bcfac07d # Parent c175d505e40d0a3b875fd23d8e8edc17f06e700e Improve on mastodon management diff -r c175d505e40d -r 4a1e6952afe5 .hgignore --- a/.hgignore Tue Oct 22 10:01:37 2024 +0200 +++ b/.hgignore Thu Nov 07 22:38:14 2024 +0100 @@ -39,6 +39,7 @@ ^script/utils/ghostdriver.log$ ^sbin/sync/sync_live ^web/vendor +^web/data ^web/devroot$ ^web/node_modules$ ^web/.direnv diff -r c175d505e40d -r 4a1e6952afe5 sbin/docker/Caddyfile --- a/sbin/docker/Caddyfile Tue Oct 22 10:01:37 2024 +0200 +++ b/sbin/docker/Caddyfile Thu Nov 07 22:38:14 2024 +0100 @@ -3,19 +3,19 @@ root * /var/www/html @main path_regexp ^/(.+)/([0-9A-Za-z_-]+)\.php$ - @phpfile `file() && path('*.php')` + @phpfile `file() && path('*.php')` - rewrite /sitemap.xml /sitemap.php + rewrite /sitemap.xml /sitemap.php - handle @phpfile { - php_fastcgi php-fpm:9000 - } + handle @phpfile { + php_fastcgi php-fpm:9000 + } handle { root * /var/www/html - rewrite @main /{re.2}.php?rep={re.1} + rewrite @main /{re.2}.php?{query}&rep={re.1} php_fastcgi php-fpm:9000 file_server } -} \ No newline at end of file +} diff -r c175d505e40d -r 4a1e6952afe5 web/callback.php --- a/web/callback.php Tue Oct 22 10:01:37 2024 +0200 +++ b/web/callback.php Thu Nov 07 22:38:14 2024 +0100 @@ -68,7 +68,8 @@ 'code' => $_GET['code'], 'scope' => 'read write push', ]]); - $token_ent = json_decode($token_resp->getBody(), true); + $body = $token_resp->getBody(); + $token_ent = json_decode($body, true); $_SESSION['SOCIAL_ACCESS_TOKEN'] = serialize($token_ent['access_token']); $_SESSION['SOCIAL_AUTH_STATE'] = null; diff -r c175d505e40d -r 4a1e6952afe5 web/client.php --- a/web/client.php Tue Oct 22 10:01:37 2024 +0200 +++ b/web/client.php Thu Nov 07 22:38:14 2024 +0100 @@ -11,11 +11,11 @@ include_once 'common.php'; - /** * Do we already have a valid Access Token or need to go get one? */ -if (!isset($_SESSION['SOCIAL_ACCESS_TOKEN']) && isset($_GET['CONNECT']) ) { +if ((!isset($_SESSION['SOCIAL_ACCESS_TOKEN'])) && isset($_GET['CONNECT']) ) { + // /** // * Guess we need to go get one! // */ @@ -135,8 +135,11 @@ - + -