From 1ddfb1187025b4c0346c2e93d71df999f3c36047 Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Thu, 7 Oct 2021 13:27:47 -0400 Subject: [PATCH 01/13] first PR! Create actions for Odysee Delete deploy.yml Remove Mac remove publish hook don't build, just compile --- .github/workflows/deploy.yml | 100 ---------------------------------- .github/workflows/node.js.yml | 59 ++++++++++++++++++++ README.md | 9 +-- 3 files changed, 61 insertions(+), 107 deletions(-) delete mode 100644 .github/workflows/deploy.yml create mode 100644 .github/workflows/node.js.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 6f10abc1c..000000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,100 +0,0 @@ -name: Node.js CI - -on: - push: - branches: [master] - pull_request: - branches: [master] - -jobs: - lint: - name: lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: Borales/actions-yarn@v2.3.0 - - run: yarn lint - - build: - needs: ['lint'] - name: 'build' - strategy: - matrix: - node-version: [14.x] - os: - - ubuntu-latest - - macos-latest - - windows-latest - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2-beta - with: - node-version: ${{ matrix.node-version }} - - - uses: maxim-lobanov/setup-xcode@v1 - if: startsWith(runner.os, 'mac') - with: - xcode-version: '10.3.0' - - - name: Download blockchain headers - run: | - mkdir -p ./static/daemon - curl -o ./static/daemon/headers https://headers.lbry.io/blockchain_headers_latest - ls ./static/daemon - - - name: Build - run: | - yarn global add cross-env - yarn - yarn build - node ./build/afterSignHook.js - env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} - NOTARIZATION_USERNAME: ${{ secrets.NOTARIZATION_USERNAME }} - NOTARIZATION_PASSWORD: ${{ secrets.NOTARIZATION_PASSWORD }} - WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }} - CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} - WIN_CSC_LINK: https://s3.amazonaws.com/files.lbry.io/cert/win-csc-2020-2021-08.p12 - CSC_LINK: https://s3.amazonaws.com/files.lbry.io/cert/osx-csc-2021-2022.p12 - - # UI - MATOMO_URL: https://analytics.lbry.com/ - MATOMO_ID: 4 - WELCOME_VERSION: 1.0 - DOMAIN: lbry.tv - URL: https://lbry.tv - SHARE_DOMAIN_URL: https://open.lbry.com - SITE_TITLE: lbry.tv - SITE_NAME: lbry.tv - SHOW_ADS: false - YRBL_HAPPY_IMG_URL: https://cdn.lbryplayer.xyz/api/v3/streams/free/yrbl-happy/7aa50a7e5adaf48691935d55e45d697547392929/839d9a - YRBL_SAD_IMG_URL: https://cdn.lbryplayer.xyz/api/v3/streams/free/yrbl-sad/c2d9649633d974e5ffb503925e1f17d951f1bd0f/f262dd - ENABLE_COMMENT_REACTIONS: true - ENABLE_NO_SOURCE_CLAIMS: false - - DEFAULT_LANGUAGE: en - KNOWN_APP_DOMAINS: lbry.tv,lbry.lat,odysee.com - CHANNEL_STAKED_LEVEL_VIDEO_COMMENTS: 0 - - - uses: actions/upload-artifact@v2 - if: | - startsWith(runner.os, 'linux') - with: - name: Linux - path: ./dist/electron/*.* - - - uses: actions/upload-artifact@v2 - if: | - startsWith(runner.os, 'mac') - with: - name: macOS - path: ./dist/electron/*.* - - - uses: actions/upload-artifact@v2 - if: | - github.event.pull_request.head.repo.full_name == github.repository - with: - name: Windows - path: ./dist/electron/*.* diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 000000000..85a1436b9 --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,59 @@ +# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Node.js CI + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + lint: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: Borales/actions-yarn@v2.3.0 + - run: yarn lint + + build: + needs: ['lint'] + name: 'build' + strategy: + matrix: + node-version: [14.x] + os: + - ubuntu-latest + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2-beta + with: + node-version: ${{ matrix.node-version }} + + - name: Build + run: | + yarn global add cross-env + yarn + yarn compile:web + env: + # UI + MATOMO_URL: https://analytics.lbry.com/ + MATOMO_ID: 4 + WELCOME_VERSION: 1.0 + DOMAIN: odysee.com + URL: https://odysee.com + SHARE_DOMAIN_URL: https://odysee.com + SITE_TITLE: Odysee + SITE_NAME: Odysee + SHOW_ADS: false + YRBL_HAPPY_IMG_URL: https://cdn.lbryplayer.xyz/api/v3/streams/free/yrbl-happy/7aa50a7e5adaf48691935d55e45d697547392929/839d9a + YRBL_SAD_IMG_URL: https://cdn.lbryplayer.xyz/api/v3/streams/free/yrbl-sad/c2d9649633d974e5ffb503925e1f17d951f1bd0f/f262dd + ENABLE_COMMENT_REACTIONS: true + ENABLE_NO_SOURCE_CLAIMS: true + DEFAULT_LANGUAGE: en + KNOWN_APP_DOMAINS: lbry.tv,lbry.lat,odysee.com + CHANNEL_STAKED_LEVEL_VIDEO_COMMENTS: 4 diff --git a/README.md b/README.md index 924bfa557..bcaf6012a 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,7 @@ - -# LBRY App - https://lbry.tv +# Odysee Frontend - Odysee.com -This repo contains the UI code that powers the official LBRY desktop app, as well as lbry.tv. The LBRY app is a graphical browser for the decentralized content marketplace provided by the -[LBRY](https://lbry.com) protocol. It is essentially the -[lbry daemon](https://github.com/lbryio/lbry) bundled with a UI using -[Electron](https://electron.atom.io/). +This repo contains the UI and front end code that powers Odysee.com. npm @@ -29,7 +25,6 @@ This repo contains the UI code that powers the official LBRY desktop app, as wel -![App GIF](https://spee.ch/ba/lbry-joule.gif) ## Table of Contents From 88794761d084d8a3c20c6e78bf8b06b2a228e0ac Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Thu, 7 Oct 2021 16:38:56 -0400 Subject: [PATCH 02/13] use thumbnails.odysee.com f --- .env.defaults | 5 ++++- config.js | 3 +++ ui/util/thumbnail.js | 12 ++++++------ web/src/html.js | 27 +++++++++++++++++++++++++-- 4 files changed, 38 insertions(+), 9 deletions(-) diff --git a/.env.defaults b/.env.defaults index 48c0ebb66..2b9c4e373 100644 --- a/.env.defaults +++ b/.env.defaults @@ -15,7 +15,10 @@ COMMENT_SERVER_API=https://comments.odysee.com/api/v2 COMMENT_SERVER_NAME=Odysee SEARCH_SERVER_API=https://lighthouse.odysee.com/search SOCKETY_SERVER_API=wss://sockety.odysee.com/ws -THUMBNAIL_CDN_URL=https://image-processor.vanwanet.com/optimize/ +THUMBNAIL_CDN_URL=https://thumbnails.odysee.com/optimize/ +THUMBNAIL_HEIGHT=220 +THUMBNAIL_WIDTH=390 +THUMBNAIL_QUALITY=85 WELCOME_VERSION=1.0 # STRIPE diff --git a/config.js b/config.js index 49e215c5b..7f25155ad 100644 --- a/config.js +++ b/config.js @@ -22,6 +22,9 @@ const config = { SHARE_DOMAIN_URL: process.env.SHARE_DOMAIN_URL, URL: process.env.URL, THUMBNAIL_CDN_URL: process.env.THUMBNAIL_CDN_URL, + THUMBNAIL_HEIGHT: process.env.THUMBNAIL_HEIGHT, + THUMBNAIL_WIDTH: process.env.THUMBNAIL_WIDTH, + THUMBNAIL_QUALITY: process.env.THUMBNAIL_QUALITY, SITE_TITLE: process.env.SITE_TITLE, SITE_NAME: process.env.SITE_NAME, SITE_DESCRIPTION: process.env.SITE_DESCRIPTION, diff --git a/ui/util/thumbnail.js b/ui/util/thumbnail.js index 3d5c8d73c..0825299c2 100644 --- a/ui/util/thumbnail.js +++ b/ui/util/thumbnail.js @@ -1,9 +1,5 @@ // @flow -import { THUMBNAIL_CDN_URL } from 'config'; - -const THUMBNAIL_HEIGHT = 220; -const THUMBNAIL_WIDTH = 390; -const THUMBNAIL_QUALITY = 85; +import { THUMBNAIL_CDN_URL, THUMBNAIL_HEIGHT, THUMBNAIL_WIDTH, THUMBNAIL_QUALITY } from 'config'; type Props = { thumbnail: ?string, @@ -23,7 +19,11 @@ export function getThumbnailCdnUrl(props: Props) { return `${THUMBNAIL_CDN_URL}s:${width}:${height}/quality:${quality}/plain/${thumbnail}`; } - if (thumbnail && thumbnail.includes('https://spee.ch')) { + if (thumbnail && thumbnail.includes('https://spee.ch') && !thumbnail.includes('?quality=')) { return `${thumbnail}?quality=${quality}&height=${height}&width=${width}`; } + + if (thumbnail && thumbnail.includes('https://spee.ch')) { + return thumbnail; + } } diff --git a/web/src/html.js b/web/src/html.js index 8367814cb..d149f03c9 100644 --- a/web/src/html.js +++ b/web/src/html.js @@ -10,6 +10,8 @@ const { SITE_NAME, FAVICON, LBRY_WEB_API, + THUMBNAIL_CDN_URL, + THUMBNAIL_QUALITY, } = require('../../config.js'); const { Lbry } = require('lbry-redux'); @@ -27,6 +29,27 @@ const SDK_API_PATH = `${LBRY_WEB_API}/api/v1`; const PROXY_URL = `${SDK_API_PATH}/proxy`; Lbry.setDaemonConnectionString(PROXY_URL); +function getThumbnailCdnUrl(url) { + if (!THUMBNAIL_CDN_URL || !url) { + return url; + } + + const width = 630; + const height = 1200; + + if (url && !url.includes('https://spee.ch')) { + return `${THUMBNAIL_CDN_URL}s:${width}:${height}/quality:${THUMBNAIL_QUALITY}/plain/${url}`; + } + + if (url && url.includes('https://spee.ch') && !url.includes('?quality=')) { + return `${url}?quality=${THUMBNAIL_QUALITY}&height=${height}&width=${width}`; + } + + if (url && url.includes('https://spee.ch')) { + return url; + } +} + function insertToHead(fullHtml, htmlToInsert) { const beginStr = ''; const finalStr = ''; @@ -143,7 +166,7 @@ function buildClaimOgMetadata(uri, claim, overrideOptions = {}) { const media = value && (value.video || value.audio || value.image); const source = value && value.source; const channel = signing_channel && signing_channel.name; - const thumbnail = value && value.thumbnail && value.thumbnail.url; + let thumbnail = value && value.thumbnail && value.thumbnail.url && getThumbnailCdnUrl(value.thumbnail.url); const mediaType = source && source.media_type; const mediaDuration = media && media.duration; const claimTitle = escapeHtmlProperty((value && value.title) || claimName); @@ -230,7 +253,7 @@ function buildGoogleVideoMetadata(uri, claim) { const { meta, value } = claim; const media = value && value.video; const source = value && value.source; - const thumbnail = value && value.thumbnail && value.thumbnail.url; + let thumbnail = value && value.thumbnail && value.thumbnail.url && getThumbnailCdnUrl(value.thumbnail.url); const mediaType = source && source.media_type; const mediaDuration = media && media.duration; const claimTitle = escapeHtmlProperty((value && value.title) || claimName); From b455e807bc8978e2161434b98a8b1d8eb01e1b4a Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Fri, 8 Oct 2021 17:58:17 +0800 Subject: [PATCH 03/13] Disable timestamp parsing in livestream chat ## Issues - The current version of the link handler doesn't seem able to control the livestream player's position. - The "live" position is always 0:00 and everything behind it is a negative timestamp. The current timestamp parser doesn't handle negative values. --- ui/component/common/markdown-preview.jsx | 17 ++++++++++++++--- ui/component/livestreamComment/view.jsx | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/ui/component/common/markdown-preview.jsx b/ui/component/common/markdown-preview.jsx index fba66eea5..a19e14476 100644 --- a/ui/component/common/markdown-preview.jsx +++ b/ui/component/common/markdown-preview.jsx @@ -42,6 +42,7 @@ type MarkdownProps = { className?: string, parentCommentId?: string, isMarkdownPost?: boolean, + disableTimestamps?: boolean, stakedLevel?: number, }; @@ -132,7 +133,17 @@ function isStakeEnoughForPreview(stakedLevel) { // **************************************************************************** const MarkdownPreview = (props: MarkdownProps) => { - const { content, strip, simpleLinks, noDataStore, className, parentCommentId, isMarkdownPost, stakedLevel } = props; + const { + content, + strip, + simpleLinks, + noDataStore, + className, + parentCommentId, + isMarkdownPost, + disableTimestamps, + stakedLevel, + } = props; const strippedContent = content ? content.replace(REPLACE_REGEX, (iframeHtml, y, iframeSrc) => { // Let the browser try to create an iframe to see if the markup is valid @@ -217,8 +228,8 @@ const MarkdownPreview = (props: MarkdownProps) => { // Note: The order is important .use(formatedLinks) .use(inlineLinks) - .use(isMarkdownPost ? null : inlineTimestamp) - .use(isMarkdownPost ? null : formattedTimestamp) + .use(disableTimestamps || isMarkdownPost ? null : inlineTimestamp) + .use(disableTimestamps || isMarkdownPost ? null : formattedTimestamp) // Emojis .use(remarkEmoji) // Render new lines without needing spaces. diff --git a/ui/component/livestreamComment/view.jsx b/ui/component/livestreamComment/view.jsx index cefdfc8ae..1ad8de144 100644 --- a/ui/component/livestreamComment/view.jsx +++ b/ui/component/livestreamComment/view.jsx @@ -104,7 +104,7 @@ function LivestreamComment(props: Props) { )}
- +
From aff69888dafcc52fe37402dee42dc996f9a6d719 Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Fri, 8 Oct 2021 18:21:16 +0800 Subject: [PATCH 04/13] Remove unintentional env-file changes I believe these are unintentional items from https://github.com/lbryio/lbry-desktop/commit/d54976e461462a209fc97a93e8f711b37dac38df because: - feels irrelevant to the change. - the env doesn't have correct values anyway (looks like for dev). That change was causing the env to be copied over to `/web` and appear as an untracked file in git. --- .env.ody | 92 ------------------------------------------------------ .gitignore | 2 +- 2 files changed, 1 insertion(+), 93 deletions(-) delete mode 100644 .env.ody diff --git a/.env.ody b/.env.ody deleted file mode 100644 index 2d9e1313e..000000000 --- a/.env.ody +++ /dev/null @@ -1,92 +0,0 @@ -# Copy this file to .env to make modifications - -# Base config - -WEBPACK_WEB_PORT=9090 -WEBPACK_ELECTRON_PORT=9091 -WEB_SERVER_PORT=1337 - -WELCOME_VERSION=1.0 - -# Custom Site info -DOMAIN=lbry.tv -URL=https://lbry.tv - -# UI -SITE_TITLE=lbry.tv -SITE_NAME=local.lbry.tv -SITE_DESCRIPTION=Meet LBRY, an open, free, and community-controlled content wonderland. -LOGO_TITLE=local.lbry.tv - -##### ODYSEE SETTINGS ####### - -MATOMO_URL=https://analytics.lbry.com/ -MATOMO_ID=4 - -# Base config -WEBPACK_WEB_PORT=9090 -WEBPACK_ELECTRON_PORT=9091 -WEB_SERVER_PORT=1337 - -## APIS -LBRY_API_URL=https://api.odysee.com -#LBRY_WEB_API=https://api.na-backend.odysee.com -#LBRY_WEB_STREAMING_API=https://cdn.lbryplayer.xyz -# deprecated: -#LBRY_WEB_BUFFER_API=https://collector-service.api.lbry.tv/api/v1/events/video -#COMMENT_SERVER_API=https://comments.lbry.com/api/v2 -WELCOME_VERSION=1.0 - -# STRIPE -STRIPE_PUBLIC_KEY='pk_live_e8M4dRNnCCbmpZzduEUZBgJO' - -## UI - -LOADING_BAR_COLOR=#e50054 - -# IMAGE ASSETS -YRBL_HAPPY_IMG_URL=https://spee.ch/spaceman-happy:a.png -YRBL_SAD_IMG_URL=https://spee.ch/spaceman-sad:d.png -LOGIN_IMG_URL=https://spee.ch/login:b.png -LOGO=https://spee.ch/odysee-logo-png:3.png -LOGO_TEXT_LIGHT=https://spee.ch/odysee-white-png:f.png -LOGO_TEXT_DARK=https://spee.ch/odysee-png:2.png -AVATAR_DEFAULT=https://spee.ch/spaceman-png:2.png -FAVICON=https://spee.ch/favicon-png:c.png - -# LOCALE -DEFAULT_LANGUAGE=en - -## LINKED CONTENT WHITELIST -KNOWN_APP_DOMAINS=open.lbry.com,lbry.tv,lbry.lat,odysee.com - -## CUSTOM CONTENT -# If the following is true, copy custom/homepage.example.js to custom/homepage.js and modify -CUSTOM_HOMEPAGE=true - -# Add channels to auto-follow on firstrun (space delimited) -AUTO_FOLLOW_CHANNELS=lbry://@Odysee#80d2590ad04e36fb1d077a9b9e3a8bba76defdf8 lbry://@OdyseeHelp#b58dfaeab6c70754d792cdd9b56ff59b90aea334 - -## FEATURES AND LIMITS -SIMPLE_SITE=true -BRANDED_SITE=odysee -# SIMPLE_SITE REPLACEMENTS -ENABLE_MATURE=false -ENABLE_UI_NOTIFICATIONS=true -ENABLE_WILD_WEST=true -SHOW_TAGS_INTRO=false - -# CENTRALIZED FEATURES -ENABLE_COMMENT_REACTIONS=true -ENABLE_FILE_REACTIONS=true -ENABLE_CREATOR_REACTIONS=true -ENABLE_NO_SOURCE_CLAIMS=true -ENABLE_PREROLL_ADS=false -SHOW_ADS=true - -CHANNEL_STAKED_LEVEL_VIDEO_COMMENTS=4 -CHANNEL_STAKED_LEVEL_LIVESTREAM=3 -WEB_PUBLISH_SIZE_LIMIT_GB=4 - -#SEARCH TYPES - comma-delimited -LIGHTHOUSE_DEFAULT_TYPES=audio,video diff --git a/.gitignore b/.gitignore index cef7245af..f3adf8f8a 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,6 @@ package-lock.json !/custom/robots.disallowall !/custom/robots.allowall .env -!.env.ody +.env.ody .env.desktop .env.lbrytv From 3077c778c38df35f75444c1915f0321a56e12a34 Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Fri, 8 Oct 2021 10:44:22 -0400 Subject: [PATCH 05/13] Test more twitter thumbnail stuff --- web/src/html.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/src/html.js b/web/src/html.js index d149f03c9..03ae21efd 100644 --- a/web/src/html.js +++ b/web/src/html.js @@ -36,9 +36,9 @@ function getThumbnailCdnUrl(url) { const width = 630; const height = 1200; - - if (url && !url.includes('https://spee.ch')) { - return `${THUMBNAIL_CDN_URL}s:${width}:${height}/quality:${THUMBNAIL_QUALITY}/plain/${url}`; + + if (url && url.includes('https://twitter-card')) { + return url; } if (url && url.includes('https://spee.ch') && !url.includes('?quality=')) { From 1bb491857e742739c6a35ee9b46c136d8ebe8c2d Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Fri, 8 Oct 2021 11:06:51 -0400 Subject: [PATCH 06/13] lint fix, return url always fix lint --- web/src/html.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/src/html.js b/web/src/html.js index 03ae21efd..0f1622beb 100644 --- a/web/src/html.js +++ b/web/src/html.js @@ -36,7 +36,7 @@ function getThumbnailCdnUrl(url) { const width = 630; const height = 1200; - + if (url && url.includes('https://twitter-card')) { return url; } @@ -48,6 +48,10 @@ function getThumbnailCdnUrl(url) { if (url && url.includes('https://spee.ch')) { return url; } + + if (url) { + return url; + } } function insertToHead(fullHtml, htmlToInsert) { From eaa32e4df437a8ecc62b1ec090927e9020c25400 Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Fri, 8 Oct 2021 15:22:03 -0400 Subject: [PATCH 07/13] Odysee references revamp, part1 --- ui/component/claimListDiscover/view.jsx | 2 +- ui/component/privacyAgreement/view.jsx | 22 +- ui/component/publishForm/view.jsx | 2 +- ui/component/router/view.jsx | 6 + ui/component/settingSystem/view.jsx | 2 +- ui/component/sideNavigation/view.jsx | 12 +- ui/component/userEmailNew/view.jsx | 2 +- ui/constants/pageTitles.js | 3 + ui/constants/pages.js | 3 + ui/page/help/view.jsx | 4 +- ui/page/rewards/view.jsx | 2 +- ui/page/youtubeSync/view.jsx | 2 +- web/component/footer.jsx | 18 +- web/component/nag-data-collection.jsx | 4 +- web/page/code2257/view.jsx | 18 +- web/page/privacypolicy/index.js | 2 + web/page/privacypolicy/view.jsx | 394 +++++++++++++++ web/page/tos/index.js | 2 + web/page/tos/view.jsx | 619 ++++++++++++++++++++++++ web/page/youtubetos/index.js | 2 + web/page/youtubetos/view.jsx | 619 ++++++++++++++++++++++++ 21 files changed, 1689 insertions(+), 51 deletions(-) create mode 100644 web/page/privacypolicy/index.js create mode 100644 web/page/privacypolicy/view.jsx create mode 100644 web/page/tos/index.js create mode 100644 web/page/tos/view.jsx create mode 100644 web/page/youtubetos/index.js create mode 100644 web/page/youtubetos/view.jsx diff --git a/ui/component/claimListDiscover/view.jsx b/ui/component/claimListDiscover/view.jsx index e450a2c45..c244b4206 100644 --- a/ui/component/claimListDiscover/view.jsx +++ b/ui/component/claimListDiscover/view.jsx @@ -450,7 +450,7 @@ function ClaimListDiscover(props: Props) {

, + contact_support: