diff --git a/.env.example b/.env.example index b1b51fc..ec0810d 100644 --- a/.env.example +++ b/.env.example @@ -2,8 +2,8 @@ # LATTE_CACHE=/tmp/proxitok_api # Path for Latte cache, leave commented for ./cache/latte # API CONFIG -# API_SIGNER_URL="https://example.com" # External signing service -# API_BROWSER_URL="http://localhost:4444" # chromedriver url +# API_SIGNER="remote" +# API_SIGNER_URL="http://localhost:8080" # API_TEST_ENDPOINTS=true # Uncomment for usage of testing TikTok endpoints, may help sometimes # API_CACHE=redis diff --git a/Dockerfile b/Dockerfile index c9b048f..c5e5b81 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8-apache +FROM php:8.1-apache WORKDIR /var/www/html COPY --from=composer /usr/bin/composer /usr/bin/composer RUN apt update -y && apt upgrade -y \ diff --git a/README.md b/README.md index 07da2e5..9cad266 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ Apply to: Main window (address bar) ``` ## TODO / Known issues +* Replace placeholder favicon * Make video on /video fit screen and don't overflow * Fix embed styling * Fix crash when invalid vm.tiktok.com/CODE or www.tiktok.com/t/CODE is provided diff --git a/android-chrome-192x192.png b/android-chrome-192x192.png new file mode 100644 index 0000000..c83bb63 Binary files /dev/null and b/android-chrome-192x192.png differ diff --git a/android-chrome-512x512.png b/android-chrome-512x512.png new file mode 100644 index 0000000..9f112b7 Binary files /dev/null and b/android-chrome-512x512.png differ diff --git a/app/Cache/JSONCache.php b/app/Cache/JSONCache.php index fd7b44a..fd0ee53 100644 --- a/app/Cache/JSONCache.php +++ b/app/Cache/JSONCache.php @@ -1,7 +1,9 @@ cache_path . '/' . $cache_key . '.json', $data); } } diff --git a/app/Cache/RedisCache.php b/app/Cache/RedisCache.php index 82063a0..e86cf63 100644 --- a/app/Cache/RedisCache.php +++ b/app/Cache/RedisCache.php @@ -1,7 +1,9 @@ client = new \Redis(); @@ -21,10 +23,7 @@ class RedisCache { public function get(string $cache_key): ?object { $data = $this->client->get($cache_key); - if ($data) { - return json_decode($data); - } - return null; + return $data ? json_decode($data) : null; } public function exists(string $cache_key): bool { diff --git a/app/Constants/CacheMethods.php b/app/Constants/CacheMethods.php new file mode 100644 index 0000000..f4ec604 --- /dev/null +++ b/app/Constants/CacheMethods.php @@ -0,0 +1,7 @@ + Misc::env('API_TEST_ENDPOINTS', false) || isset($_COOKIE['api-test_endpoints']) && $_COOKIE['api-test_endpoints'] === 'yes', 'signer' => [ - 'remote_url' => Misc::env('API_SIGNER_URL', ''), - 'browser_url' => Misc::env('API_BROWSER_URL', ''), + 'method' => $method, + 'url' => $url, 'close_when_done' => false ] ]; // Cache config - $cacheEngine = false; + $cacheEngine = null; if (isset($_ENV['API_CACHE'])) { switch ($_ENV['API_CACHE']) { - case 'json': + case CacheMethods::JSON: $cacheEngine = new JSONCache(); break; - case 'redis': + case CacheMethods::REDIS: if (!(isset($_ENV['REDIS_URL']) || isset($_ENV['REDIS_HOST'], $_ENV['REDIS_PORT']))) { throw new \Exception('You need to set REDIS_URL or REDIS_HOST and REDIS_PORT to use Redis Cache!'); } diff --git a/apple-touch-icon.png b/apple-touch-icon.png new file mode 100644 index 0000000..939de46 Binary files /dev/null and b/apple-touch-icon.png differ diff --git a/components/head.latte b/components/head.latte index 082b50b..c435dde 100644 --- a/components/head.latte +++ b/components/head.latte @@ -2,6 +2,10 @@ + + + + diff --git a/composer.json b/composer.json index daa23ae..227bbd9 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "pablouser1/proxitok", "description": "An alternative frontend for TikTok", - "version": "2.3.2.2", + "version": "2.4.0.0", "license": "AGPL-3.0-or-later", "type": "project", "authors": [ @@ -24,7 +24,7 @@ "latte/latte": "^2.11", "bramus/router": "^1.6", "josegonzalez/dotenv": "dev-master", - "pablouser1/tikscraper": "^2.1" + "pablouser1/tikscraper": "^2.2" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 7bc7cae..71dd0f1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "15ff00ea59afbf0d6d064d4cbefb05fb", + "content-hash": "4e398680c8c683b157043558c21a25ad", "packages": [ { "name": "bramus/router", @@ -263,16 +263,16 @@ }, { "name": "pablouser1/tikscraper", - "version": "v2.1.2.0", + "version": "v2.2.0.0", "source": { "type": "git", "url": "https://github.com/pablouser1/TikScraperPHP.git", - "reference": "96326226e54de2d1feedcc708200ba023a0553e5" + "reference": "5561b82442caf4968f0c4f408ee5847a97cd8940" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pablouser1/TikScraperPHP/zipball/96326226e54de2d1feedcc708200ba023a0553e5", - "reference": "96326226e54de2d1feedcc708200ba023a0553e5", + "url": "https://api.github.com/repos/pablouser1/TikScraperPHP/zipball/5561b82442caf4968f0c4f408ee5847a97cd8940", + "reference": "5561b82442caf4968f0c4f408ee5847a97cd8940", "shasum": "" }, "require": { @@ -304,9 +304,9 @@ "description": "Get data from TikTok API", "support": { "issues": "https://github.com/pablouser1/TikScraperPHP/issues", - "source": "https://github.com/pablouser1/TikScraperPHP/tree/v2.1.2.0" + "source": "https://github.com/pablouser1/TikScraperPHP/tree/v2.2.0.0" }, - "time": "2022-08-11T21:32:02+00:00" + "time": "2022-08-13T10:17:31+00:00" }, { "name": "php-webdriver/webdriver", diff --git a/docker-compose.yml b/docker-compose.yml index 2c32142..8d5ad7d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,6 +11,7 @@ services: - API_CACHE=redis - REDIS_HOST=proxitok-redis - REDIS_PORT=6379 + - API_SIGNER=remote - API_SIGNER_URL=http://proxitok-signer:8080/signature volumes: - proxitok-cache:/cache diff --git a/favicon-16x16.png b/favicon-16x16.png new file mode 100644 index 0000000..6b143c4 Binary files /dev/null and b/favicon-16x16.png differ diff --git a/favicon-32x32.png b/favicon-32x32.png new file mode 100644 index 0000000..492f8a3 Binary files /dev/null and b/favicon-32x32.png differ diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..682cd98 Binary files /dev/null and b/favicon.ico differ diff --git a/site.webmanifest b/site.webmanifest new file mode 100644 index 0000000..7151210 --- /dev/null +++ b/site.webmanifest @@ -0,0 +1,23 @@ +{ + "name": "ProxiTok", + "short_name": "ProxiTok", + "description": "Use TikTok with a privacy-friendly alternative frontend", + "orientation": "portrait-primary", + "icons": [ + { + "src": "./android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "./android-chrome-512x512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "id": "./", + "start_url": "./", + "theme_color": "#4040ff", + "background_color": "#ffffff", + "display": "standalone" +}