diff --git a/DailymotionConfig.json b/DailymotionConfig.json index 47f30d5a109e9fd6e0b620b60bce0780e1e43b10..c58524e87788e126f04cf6b41b57b0292211888f 100644 --- a/DailymotionConfig.json +++ b/DailymotionConfig.json @@ -8,7 +8,7 @@ "scriptUrl": "./DailymotionScript.js", "repositoryUrl": "https://github.com/stefancruz/GrayjayDailymotion", "version": 14, - "iconUrl": "./dailymotion.png", + "iconUrl": "./DailymotionIcon.png", "id": "9c87e8db-e75d-48f4-afe5-2d203d4b95c5", "scriptSignature": "", "scriptPublicKey": "", diff --git a/assets/dailymotion.png b/assets/DailymotionIcon.png similarity index 100% rename from assets/dailymotion.png rename to assets/DailymotionIcon.png diff --git a/build/DailymotionConfig.json b/build/DailymotionConfig.json index 47f30d5a109e9fd6e0b620b60bce0780e1e43b10..c58524e87788e126f04cf6b41b57b0292211888f 100644 --- a/build/DailymotionConfig.json +++ b/build/DailymotionConfig.json @@ -8,7 +8,7 @@ "scriptUrl": "./DailymotionScript.js", "repositoryUrl": "https://github.com/stefancruz/GrayjayDailymotion", "version": 14, - "iconUrl": "./dailymotion.png", + "iconUrl": "./DailymotionIcon.png", "id": "9c87e8db-e75d-48f4-afe5-2d203d4b95c5", "scriptSignature": "", "scriptPublicKey": "", diff --git a/build/dailymotion.png b/build/DailymotionIcon.png similarity index 100% rename from build/dailymotion.png rename to build/DailymotionIcon.png diff --git a/build/Readme.md b/build/Readme.md deleted file mode 100644 index 640b29f97a4e10fc96153b5c333b8e1c7eed7ff8..0000000000000000000000000000000000000000 --- a/build/Readme.md +++ /dev/null @@ -1,52 +0,0 @@ -# Dailymotion plugin for Grayjay - work in progress - -Click [here](https://stefancruz.github.io/GrayjayDailymotion/index.html) to install into Grayjay - -## Features -- [x] - Home -- [x] - Home search -- [x] - Live videos from home search -- [x] - Search autocomplete -- [x] - Video details (likes, dislikes, views, publish date) -- [x] - Subscriptions -- [x] - Channel search -- [x] - Channel details -- [x] - Channel playlist tab -- [x] - Downloads -- [x] - Playlists search -- [x] - Settings / Thumbnail resolution -- [x] - Settings / Creator avatar resolution -- [x] - Settings / Hide sensitive content -- [x] - Settings / Prefered Country -- [x] - Sign in (import subscriptions and playlists (and Likes, Favorites, Recently Watched)) -- [x] - Policentric Comments -- [x] - Subtitles - -## Todo -- [ ] - State management -- [ ] - Platform comments (not generally available) - -## Known bugs -- [ ] - Live filter in Subscriptions tab - - - -## Install -npm install - -## Update graphql types (optional) - -npm run get-token - -npm run codegen - -## Build - -npm run build - -npm start - will build and watch for changes - -# notes: -- Content of the 'build' folder should not be manually changed since it's recreated for each build. -- Used [rollup](https://rollupjs.org/) to bundle all the scripts into one. -- Used npm shrinkwrap to lock the dependency versions of the project. This should avoid new bugs, vulnerabilities and breaking changes (in minor and patches), introduced when the dependencies are automatically updated by npm. \ No newline at end of file diff --git a/deploy.sh b/deploy.sh index 9131478278c119758e4bb857b205190fb8f54078..1ee27afd688eca6456a5ff5f09ee6ce44c440ff0 100644 --- a/deploy.sh +++ b/deploy.sh @@ -1,25 +1,25 @@ -#!/bin/sh -DOCUMENT_ROOT=/var/www/sources - -# Take site offline -echo "Taking site offline..." -touch $DOCUMENT_ROOT/maintenance.file - -# Swap over the content -echo "Deploying content..." -mkdir -p $DOCUMENT_ROOT/Dailymotion -cp build/dailymotion.png $DOCUMENT_ROOT/Dailymotion -cp build/DailymotionConfig.json $DOCUMENT_ROOT/Dailymotion -cp build/DailymotionScript.js $DOCUMENT_ROOT/Dailymotion -sh sign.sh $DOCUMENT_ROOT/Dailymotion/DailymotionScript.js $DOCUMENT_ROOT/Dailymotion/DailymotionConfig.json - -# Notify Cloudflare to wipe the CDN cache -echo "Purging Cloudflare cache for zone $CLOUDFLARE_ZONE_ID..." -curl -X POST "https://api.cloudflare.com/client/v4/zones/$CLOUDFLARE_ZONE_ID/purge_cache" \ - -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ - -H "Content-Type: application/json" \ - --data '{"files":["https://plugins.grayjay.app/Dailymotion/Dailymotion.png", "https://plugins.grayjay.app/Dailymotion/DailymotionConfig.json", "https://plugins.grayjay.app/Dailymotion/DailymotionScript.js"]}' - -# Take site back online -echo "Bringing site back online..." -rm $DOCUMENT_ROOT/maintenance.file +#!/bin/sh +DOCUMENT_ROOT=/var/www/sources + +# Take site offline +echo "Taking site offline..." +touch $DOCUMENT_ROOT/maintenance.file + +# Swap over the content +echo "Deploying content..." +mkdir -p $DOCUMENT_ROOT/Dailymotion +cp build/DailymotionIcon.png $DOCUMENT_ROOT/Dailymotion +cp build/DailymotionConfig.json $DOCUMENT_ROOT/Dailymotion +cp build/DailymotionScript.js $DOCUMENT_ROOT/Dailymotion +sh sign.sh $DOCUMENT_ROOT/Dailymotion/DailymotionScript.js $DOCUMENT_ROOT/Dailymotion/DailymotionConfig.json + +# Notify Cloudflare to wipe the CDN cache +echo "Purging Cloudflare cache for zone $CLOUDFLARE_ZONE_ID..." +curl -X POST "https://api.cloudflare.com/client/v4/zones/$CLOUDFLARE_ZONE_ID/purge_cache" \ + -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ + -H "Content-Type: application/json" \ + --data '{"files":["https://plugins.grayjay.app/Dailymotion/DailymotionIcon.png", "https://plugins.grayjay.app/Dailymotion/DailymotionConfig.json", "https://plugins.grayjay.app/Dailymotion/DailymotionScript.js"]}' + +# Take site back online +echo "Bringing site back online..." +rm $DOCUMENT_ROOT/maintenance.file diff --git a/rollup.config.js b/rollup.config.js index 918d2613cbf99a089bcdd458561053a6ba453779..f8e67b436a338d5c87350e0aa2a7f1f48b4ea843 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,30 +1,29 @@ -const resolve = require('@rollup/plugin-node-resolve').default; -const commonjs = require('@rollup/plugin-commonjs'); -const typescript = require('@rollup/plugin-typescript'); -const copy = require('rollup-plugin-copy'); -const del = require('rollup-plugin-delete'); - -const dest = './build'; // Output folder - -module.exports = { - input: 'src/DailymotionScript.ts', // Entry file - output: { - file: `${dest}/DailymotionScript.js`, - format: 'cjs', // Use IIFE format for browser compatibility - sourcemap: false - }, - plugins: [ - del({ targets: `${dest}/*` }), // Clean up the dist folder before building - resolve(), - commonjs(), - typescript({ tsconfig: './tsconfig.json' }), - copy({ - targets: [ - { src: 'DailymotionConfig.json', dest }, - { src: 'assets/dailymotion.png', dest }, - { src: 'assets/index.html', dest }, - { src: 'Readme.md', dest }, - ] - }) - ] -}; +const resolve = require('@rollup/plugin-node-resolve').default; +const commonjs = require('@rollup/plugin-commonjs'); +const typescript = require('@rollup/plugin-typescript'); +const copy = require('rollup-plugin-copy'); +const del = require('rollup-plugin-delete'); + +const dest = './build'; // Output folder + +module.exports = { + input: 'src/DailymotionScript.ts', // Entry file + output: { + file: `${dest}/DailymotionScript.js`, + format: 'cjs', // Use IIFE format for browser compatibility + sourcemap: false + }, + plugins: [ + del({ targets: `${dest}/*` }), // Clean up the dist folder before building + resolve(), + commonjs(), + typescript({ tsconfig: './tsconfig.json' }), + copy({ + targets: [ + { src: 'DailymotionConfig.json', dest }, + { src: 'assets/DailymotionIcon.png', dest }, + { src: 'assets/index.html', dest } + ] + }) + ] +};