Compare commits

...

117 commits

Author SHA1 Message Date
jessopb
363c079433
Merge pull request #1073 from lbryio/staging
cuts release from staging
2020-06-11 12:45:13 -04:00
jessopb
8ca76a6de1
Merge pull request #1072 from lbryio/master
redirect fixes
2020-06-11 12:31:04 -04:00
jessopb
99c7b087d7
Merge pull request #1071 from lbryio/redirect2
prevent server side redirect
2020-06-11 12:30:31 -04:00
jessop
67e198db2f prevent server side redirect 2020-06-11 12:29:26 -04:00
jessopb
50805ad4ea
Merge pull request #1070 from lbryio/master
cut staging from master
2020-06-10 17:14:01 -04:00
jessopb
b410eb8c94
Merge pull request #1069 from lbryio/redirectTv
redirect content to lbry.tv
2020-06-10 17:12:46 -04:00
jessop
efc38529c7 redirect content to lbry.tv 2020-06-10 17:01:44 -04:00
Thomas Zarebczan
dfa6db6276
fix broken claims?
https://spee.ch/@Deterrence-Dispensed:2/AR22LR-MagazineKit-1.1
2020-06-05 16:46:39 -04:00
jessopb
5215bfbc4e
Merge pull request #1068 from lbryio/staging
cut release
2020-06-05 16:30:13 -04:00
jessopb
2b4a379638
Merge pull request #1067 from lbryio/master
cut staging
2020-06-05 16:27:37 -04:00
Thomas Zarebczan
9df4d29dda
Use only streams for channel
Maybe fix the repost bug where a channel won't load for now.
2020-06-04 21:14:42 -04:00
jessopb
68b6f484e4
Merge pull request #1066 from lbryio/staging
Staging
2020-05-16 11:08:51 -04:00
jessopb
7584d0c7e3
Merge pull request #1065 from lbryio/master
Merge pull request #1064 from lbryio/updateMessaging
2020-05-15 14:11:35 -04:00
jessopb
7940c61b17
Merge pull request #1064 from lbryio/updateMessaging
update messaging, disable publish and channels
2020-05-15 14:11:00 -04:00
jessopb
3d36f136f1
Merge pull request #1063 from lbryio/updateMessaging
Update messaging
2020-05-15 14:10:08 -04:00
jessop
5ed72b0e14 update messaging, disable publish and channels 2020-04-22 20:24:23 -04:00
Jeremy Kauffman
922a53cc30
Merge pull request #1055 from ykris45/patch-5
Update LICENSE
2020-02-03 15:00:34 -05:00
YULIUS KURNIAWAN KRISTIANTO
d11ba6225e
Update LICENSE
update year
2020-02-03 04:41:19 +07:00
jessopb
a8678f5d1f
Merge pull request #1054 from lbryio/staging
cuts release from master
2020-01-12 19:49:57 -05:00
jessopb
423c0c9311
Merge pull request #1053 from lbryio/master
cuts staging from master
2020-01-12 19:43:08 -05:00
jessopb
3d23635bf5
Merge pull request #1052 from lbryio/fixesJan20
pagination (thanks Tom)
2020-01-12 19:39:50 -05:00
jessop
707e144eff pagination (thanks Tom) 2020-01-12 19:34:16 -05:00
Thomas Zarebczan
ad87e2b8a7
Update README.md 2019-12-08 09:44:22 -05:00
jessopb
01ae90fc15
fix customize link 2019-12-07 11:15:24 -05:00
Thomas Zarebczan
1e6cb2a7c6
Merge pull request #1042 from StrikerRUS/patch-1
removed deprecated field in Travis
2019-10-15 11:53:56 -04:00
jessopb
2e7d4c5112
Merge pull request #1046 from lbryio/staging
Cuts Release from Staging
2019-10-14 11:16:23 -04:00
jessopb
15e4a97e6a
Merge pull request #1044 from lbryio/master
cuts staging from master
2019-10-10 22:20:57 -04:00
jessopb
5dc89f0a91
Merge pull request #1043 from lbryio/dmca-fix
Update report route
2019-10-10 18:11:57 -04:00
Thomas Zarebczan
0974e6d6b0
Update report route
+ pass claim id

Example: https://lbry.com/dmca/116d62d14d8efc311e1f8a9de92dcbc17deb259a
2019-10-10 13:42:29 -04:00
Nikita Titov
64d7afd278
removed deprecated field in Travis 2019-10-09 00:16:24 +03:00
jessopb
648639e6c6
Merge pull request #1041 from lbryio/cors2
applies open cors to publish routes
2019-10-08 09:45:53 -04:00
jessop
8ded28beb3 applies open cors to publish routes 2019-10-08 09:06:33 -04:00
jessopb
b1a9d8ee74
Merge pull request #1040 from lbryio/master
cuts staging from master
2019-10-01 15:52:45 -04:00
jessopb
9e76553f0a
Merge pull request #1039 from lbryio/speechCors
moves whitelist to config and catches errors
2019-10-01 15:39:38 -04:00
jessop
f4a50d0c85 moves whitelist to config and catches errors 2019-10-01 15:19:31 -04:00
jessopb
23953a32e8
Merge pull request #1037 from lbryio/cors
Cors
2019-09-29 15:06:43 -04:00
jessop
aa4a43a1a5 cors 2019-09-29 14:54:17 -04:00
Thomas Zarebczan
eba7fd596f
Merge pull request #1035 from lbryio/dependabot/npm_and_yarn/mixin-deep-1.3.2
Bump mixin-deep from 1.3.1 to 1.3.2
2019-09-18 11:45:54 -04:00
dependabot[bot]
9130b6f609
Bump mixin-deep from 1.3.1 to 1.3.2
Bumps [mixin-deep](https://github.com/jonschlinkert/mixin-deep) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/jonschlinkert/mixin-deep/releases)
- [Commits](https://github.com/jonschlinkert/mixin-deep/compare/1.3.1...1.3.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-08-27 22:24:31 +00:00
jessopb
94f5f6dc69
Merge pull request #1032 from lbryio/staging
cuts release from staging
2019-08-13 21:13:37 -04:00
jessopb
269a2c57a7
Merge pull request #1031 from lbryio/master
cuts staging from master
2019-08-09 10:04:19 -04:00
jessopb
1fd0ec1fc2
Merge pull request #1030 from lbryio/revert-1025-dependabot/npm_and_yarn/sequelize-5.3.0
Revert "Bump sequelize from 4.41.1 to 5.3.0"
2019-08-09 09:55:15 -04:00
jessopb
53e0d2a0db
Revert "Bump sequelize from 4.41.1 to 5.3.0" 2019-08-09 09:51:45 -04:00
Jeremy Kauffman
aebaa4f954
Merge pull request #1029 from lbryio/master
cuts staging from master
2019-08-07 11:05:01 -04:00
jessopb
5b2108796c
Merge pull request #1025 from lbryio/dependabot/npm_and_yarn/sequelize-5.3.0
Bump sequelize from 4.41.1 to 5.3.0
2019-08-07 10:42:32 -04:00
jessopb
200903827a
Merge pull request #1022 from lbryio/dependabot/npm_and_yarn/lodash.mergewith-4.6.2
Bump lodash.mergewith from 4.6.1 to 4.6.2
2019-08-07 10:39:37 -04:00
jessopb
993b1d31e9
Merge pull request #1023 from lbryio/dependabot/npm_and_yarn/axios-0.18.1
Bump axios from 0.18.0 to 0.18.1
2019-08-07 10:39:22 -04:00
jessopb
8891f298ae
Merge pull request #1024 from lbryio/dependabot/npm_and_yarn/lodash-4.17.13
Bump lodash from 4.17.11 to 4.17.13
2019-08-07 10:39:11 -04:00
jessopb
9bd779775a
Merge pull request #1026 from lbryio/dependabot/npm_and_yarn/handlebars-4.1.2
Bump handlebars from 4.1.0 to 4.1.2
2019-08-07 10:38:27 -04:00
jessopb
322b8a147d
Merge pull request #1027 from lbryio/dependabot/npm_and_yarn/fstream-1.0.12
Bump fstream from 1.0.11 to 1.0.12
2019-08-07 10:38:14 -04:00
jessopb
424827ea15
Merge pull request #1028 from lbryio/dependabot/npm_and_yarn/js-yaml-3.13.1
Bump js-yaml from 3.13.0 to 3.13.1
2019-08-07 10:38:03 -04:00
dependabot[bot]
15e7456a88
Bump fstream from 1.0.11 to 1.0.12
Bumps [fstream](https://github.com/npm/fstream) from 1.0.11 to 1.0.12.
- [Release notes](https://github.com/npm/fstream/releases)
- [Commits](https://github.com/npm/fstream/compare/v1.0.11...v1.0.12)

Signed-off-by: dependabot[bot] <support@github.com>
2019-08-05 18:45:42 +00:00
dependabot[bot]
d4e38db1ae
Bump js-yaml from 3.13.0 to 3.13.1
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.13.0 to 3.13.1.
- [Release notes](https://github.com/nodeca/js-yaml/releases)
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/3.13.0...3.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2019-08-05 18:45:42 +00:00
dependabot[bot]
d3f4c0aefb
Bump handlebars from 4.1.0 to 4.1.2
Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.1.0 to 4.1.2.
- [Release notes](https://github.com/wycats/handlebars.js/releases)
- [Changelog](https://github.com/wycats/handlebars.js/blob/master/release-notes.md)
- [Commits](https://github.com/wycats/handlebars.js/compare/v4.1.0...v4.1.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-08-05 18:45:33 +00:00
dependabot[bot]
ee004405a6
Bump sequelize from 4.41.1 to 5.3.0
Bumps [sequelize](https://github.com/sequelize/sequelize) from 4.41.1 to 5.3.0.
- [Release notes](https://github.com/sequelize/sequelize/releases)
- [Commits](https://github.com/sequelize/sequelize/compare/v4.41.1...v5.3.0)

Signed-off-by: dependabot[bot] <support@github.com>
2019-08-05 18:45:25 +00:00
dependabot[bot]
6313c7eeff
Bump lodash from 4.17.11 to 4.17.13
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.13.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.11...4.17.13)

Signed-off-by: dependabot[bot] <support@github.com>
2019-08-05 18:45:24 +00:00
dependabot[bot]
ee1b5c68bc
Bump axios from 0.18.0 to 0.18.1
Bumps [axios](https://github.com/axios/axios) from 0.18.0 to 0.18.1.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v0.18.1/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.18.0...v0.18.1)

Signed-off-by: dependabot[bot] <support@github.com>
2019-08-05 18:45:20 +00:00
dependabot[bot]
962d07a6c9
Bump lodash.mergewith from 4.6.1 to 4.6.2
Bumps [lodash.mergewith](https://github.com/lodash/lodash) from 4.6.1 to 4.6.2.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2019-08-05 18:45:11 +00:00
jessopb
a27f6e2b21
Merge pull request #1020 from lbryio/staging
cuts release from staging
2019-07-03 18:44:31 -04:00
jessopb
848077b057
Merge pull request #1019 from lbryio/master
cuts staging from master
2019-07-03 18:30:56 -04:00
jessopb
b9b4333b55
Merge pull request #1018 from lbryio/ipWhitelist
adds ip whitelist
2019-07-03 18:08:46 -04:00
jessop
ac3e9d1e67 adds ip whitelist 2019-07-03 17:55:33 -04:00
Jeremy Kauffman
bd0c3fd4c3
Merge pull request #1017 from AlessandroSpallina/master
Fixed broken link
2019-06-25 16:09:33 -04:00
AlessandroSpallina
85cc743f90 Fixed broken link 2019-06-25 21:46:00 +02:00
jessopb
0e357b7b56
Merge pull request #1016 from lbryio/staging
cuts release from staging
2019-06-21 17:53:54 -04:00
jessopb
2311e5685f
Merge pull request #1015 from lbryio/master
cuts staging from master
2019-06-21 16:42:06 -04:00
jessopb
a66511caaf
Merge pull request #1014 from lbryio/lenientPublishLimits
changes max publishes to 20
2019-06-21 15:23:12 -04:00
jessop
39095c16a9 changes max publishes to 20 2019-06-21 14:40:07 -04:00
Jeremy Kauffman
3d4ad3d827
Merge pull request #1013 from lbryio/noMetrics
stops logging metrics to localdb
2019-06-05 11:02:09 -04:00
Jessop Breth
6992b87033 stops logging metrics to localdb 2019-06-05 10:08:13 -04:00
jessopb
75818e47fe
Merge pull request #1012 from lbryio/fix-abandon
fix: abandoning claims
2019-05-31 15:23:10 -04:00
jessopb
4cfb85fed3
Merge pull request #1011 from ProfessorDey/patch-1
Added Server Response Error Handling
2019-05-31 14:36:09 -04:00
ProfessorDey
8a6cd2db13
Tab Removal & Check Abstraction
Per Jessop's request: https://github.com/lbryio/spee.ch/pull/1011#pullrequestreview-243975520
Corrected tabs and added the clarified abstraction to the request state check.
2019-05-31 00:15:27 +01:00
Tom
dee61b5b6f fix: abandoning claims
Confirmed working locally. File/claims table has outpoint. Claim was abandoned by the sdk.
2019-05-30 14:57:47 -04:00
ProfessorDey
82ab3b47b1
Added Server Response Error Handling
Presently the spee.ch client will error out if it received an unexpected response, resulting in hangs and a very vague JSON parsing error. This failsafe will catch the known issue of server request size limits causing 413 responses if misconfigured, making things easier to diagnose, as well as catching any other unexpected responses cleanly. Further specific behaviours can be added to ensure administrators spend less time debugging simple configuration issues.

The 413 error response should be fairly self explanatory, sufficient to not need further documentation, though adding an addendum to the README.md would aid other developers have a smooth experience.
2019-05-30 14:33:53 +01:00
jessopb
73667d4d9a
Merge pull request #1010 from lbryio/staging
cuts release from staging
2019-05-28 09:49:03 -04:00
jessopb
0b4eab9bb6
Merge pull request #1009 from lbryio/master
cuts staging from master
2019-05-28 09:18:18 -04:00
jessopb
68d2f303c1
Merge pull request #1008 from lbryio/0.37-fixes
Support for 0.37 SDK
2019-05-26 18:34:21 -04:00
Tom
b98fffc386 fix: updates! 2019-05-25 18:00:20 -04:00
Tom
adbafa4194 further
fixes!
2019-05-24 16:39:46 -04:00
Tom
1b069ba2a1 WIP - 0.37 SDK changes
Needs the metadata sub object removed, everything should be passed at the publish level - no need to set protobuf metadata directly.

Thumbnail > thumbnail_url, licenseURL > license_url and possibly a few others.
changes

fix: 1 of many
fix 2 of many
fix: 3 of many
fix: 4 of many
more fixes
fix license
fix thumb
remove tags
fix thumb?
remove log
fix
fix txid
2019-05-24 13:09:07 -04:00
jessopb
5f3f5c678a
Merge pull request #1006 from lbryio/staging
cuts release from staging 220419
2019-04-23 07:25:37 -04:00
jessopb
5ab338cfa5
Merge pull request #1005 from lbryio/master
cuts staging from master
2019-04-22 07:53:15 -04:00
jessopb
ec9f78de16
Merge pull request #1004 from lbryio/loggingImprovements
improves quality and reduces noise in logs
2019-04-19 17:11:06 -04:00
jessop
b2624026bb improves quality and reduces noise in logs 2019-04-19 12:14:03 -04:00
jessopb
2ec4f366b0
Merge pull request #991 from lbryio/staging
Cuts release from staging
2019-04-15 13:02:49 -04:00
jessopb
b2e35c7e13
Merge pull request #989 from D1V3/master
Adding more indentation to markup
2019-04-03 17:47:19 -04:00
D1V3
bf26e7d8a9
Addind more indentation 2019-04-03 11:30:00 -04:00
D1V3
8279b92a46
Fixing squished text 2019-04-03 11:26:46 -04:00
jessopb
e21761e278
Merge pull request #986 from lbryio/master
cuts staging from master
2019-04-01 14:38:58 -04:00
jessopb
1a9ceef1e0
Merge pull request #980 from jessopb/cssChange
security patch and css bug
2019-03-27 13:05:27 -04:00
jessop
87ca19d700 security patch and css bug 2019-03-27 10:32:49 -04:00
jessopb
13cee683c3
Merge pull request #974 from jessopb/fileAvailability
uses CQ-derived outpoint and file list to detect foreign file changes
2019-03-26 07:32:13 -04:00
jessop
c97685cfb5 uses chainquery derived outpoint and file list to detect foreign server file changes 2019-03-25 15:41:04 -04:00
jessopb
792bb51134
Merge pull request #973 from lbryio/staging
cuts release from staging
2019-03-23 15:52:47 -04:00
jessopb
e210773016
Merge pull request #972 from lbryio/master
cut staging from master
2019-03-22 19:58:37 -04:00
jessopb
a4cc7460d5
Merge pull request #967 from jessopb/isbot
avoids downloading content for googlebot and provides fallback thumbs
2019-03-20 12:09:57 -04:00
jessopb
3507bd6bf2
Merge pull request #966 from jessopb/persistExpand
persist expand state using redux
2019-03-20 12:09:37 -04:00
jessopb
cab6c6dc80
Merge pull request #965 from LavRadis/patch-4
small typo
2019-03-20 11:08:02 -04:00
jessopb
992eefd40c
Merge pull request #968 from jessopb/lbrydotcom
changes lbry.io to lbry.com
2019-03-20 11:07:13 -04:00
jessop
8799e0e320 changes lbry.io to lbry.com 2019-03-17 23:13:00 -04:00
jessop
302442385e avoids downloading content for googlebot and loads fallback images for missing thumbnails 2019-03-17 22:51:57 -04:00
jessop
4632ee6472 persist expand state using redux 2019-03-16 15:20:21 -04:00
Lav Radis
cf221b5aba
small typo 2019-03-16 20:14:26 +01:00
jessopb
2b20900ae5
Merge pull request #963 from lbryio/staging
cuts release from staging
2019-03-15 12:12:03 -04:00
jessopb
626b3f8b5c
Merge pull request #962 from lbryio/master
cuts staging from master
2019-03-15 11:50:27 -04:00
jessopb
373ee83c13
Merge pull request #961 from jessopb/fixChannelSelect
fixes channelSelectDropdown
2019-03-15 11:44:13 -04:00
jessop
220d043ff6 fixes channelSelectDropdown 2019-03-15 11:23:56 -04:00
jessopb
423c2827bc
Merge pull request #956 from jessopb/previewCards
improves preview cards, no logic changes
2019-03-08 02:39:57 -05:00
jessop
3411cedb55 improves preview cards 2019-03-07 01:43:49 -05:00
jessopb
eb5473bbb6
Update ubuntuinstall.md 2019-03-05 12:17:59 -05:00
jessopb
6b97b415ff
Update ubuntuinstall.md 2019-03-02 02:01:01 -05:00
jessopb
e6274fe9d8
Merge pull request #945 from jessopb/sdk32compat
updates lbrynet download_dir
2019-03-01 10:57:26 -05:00
jessop
a9627fbd96 updates lbrynet download_dir 2019-03-01 03:20:53 -05:00
jessopb
da4a1d6c03
Update ubuntuinstall.md
adds imagemagick
2019-03-01 03:07:01 -05:00
jessopb
63a1be5287
Update ubuntuinstall.md 2019-03-01 03:03:53 -05:00
jessopb
aa70c2854d
Update ubuntuinstall.md 2019-03-01 02:23:57 -05:00
73 changed files with 1477 additions and 1090 deletions

View file

@ -1,4 +1,3 @@
sudo: true
dist: xenial
#addons:
# apt:
@ -9,7 +8,7 @@ dist: xenial
# - mysql-client
language: node_js
node_js:
- "lts/*"
- "lts/dubnium"
cache:
directories:
- "node_modules"

View file

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2017-2019 LBRY Inc.
Copyright (c) 2017-2020 LBRY Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,

View file

@ -3,6 +3,8 @@
spee.ch provides a user-friendly, custom-designed, image and video hosting site backed by a decentralized network and
blockchain ([LBRY](https://lbry.tech/)). Via just a small set of config files, you can spin your an entire spee.ch site back up including assets.
**Please note: the spee.ch code base and setup instructions are no longer actively maintained now that we have lbry.tv. Proceed at your own caution. Setup will require dev ops skills.**
![App GIF](https://spee.ch/e/speechgif.gif)
For a completely open, unrestricted example of a spee.ch site, check out https://www.spee.ch.
@ -105,7 +107,7 @@ $ npm run start
#### Customize your app
Check out the [customization guide](https://github.com/lbryio/spee.ch/blob/readme-update/customize.md) to change your app's appearance and components
Check out the [customization guide](https://github.com/lbryio/spee.ch/blob/master/customize.md) to change your app's appearance and components
#### (optional) add custom components and update the styles
@ -300,8 +302,8 @@ This project is MIT licensed. For the full license, see [LICENSE](LICENSE).
## Security
We take security seriously. Please contact security@lbry.io regarding any security issues. [Our GPG key is here](https://lbry.io/faq/gpg-key) if you need it.
We take security seriously. Please contact security@lbry.com regarding any security issues. [Our GPG key is here](https://lbry.com/faq/gpg-key) if you need it.
## Contact
The primary contact for this project is [@jessopb](mailto:jessop@lbry.io).
The primary contact for this project is [@jessopb](mailto:jessop@lbry.com).

View file

@ -188,8 +188,8 @@ inquirer
.post('http://localhost:5279', {
method: 'channel_new',
params: {
channel_name: thumbnailChannelDefault,
amount: channelBid,
name: thumbnailChannelDefault,
bid: channelBid,
},
})
.then(response => {
@ -197,7 +197,6 @@ inquirer
if (response.data.error) {
throw new Error(response.data.error.message);
}
thumbnailChannel = thumbnailChannelDefault;
thumbnailChannelId = response.data.result.claim_id;
siteConfig['publishing']['thumbnailChannel'] = thumbnailChannel;
@ -237,7 +236,9 @@ inquirer
'\nIt\'s a good idea to BACK UP YOUR MASTER PASSWORD \nin "/site/private/authConfig.json" so that you don\'t lose \ncontrol of your channel.'
);
console.log('\nNext step: run "npm run start" to build and start your server!');
console.log(
'\nNext step: run "npm run build" (or "npm run dev") to compiles, and "npm run start" to start your server!'
);
console.log(
'If you want to change any settings, you can edit the files in the "/site" folder.'
);

View file

@ -1,5 +1,5 @@
{
"host": "public.chainquery.lbry.io",
"host": "public.chainquery.lbry.com",
"port": "3306",
"timeout": 30,
"database": "chainquery",

View file

@ -18,12 +18,11 @@
"host": "https://www.example.com",
"description": "A decentralized hosting platform built on LBRY",
"twitter": false,
"blockListEndpoint": "https://api.lbry.io/file/list_blocked"
"blockListEndpoint": "https://api.lbry.com/file/list_blocked"
},
"publishing": {
"primaryClaimAddress": null,
"uploadDirectory": "/home/lbry/Uploads",
"lbrynetHome": "/CURRENTLYUNUSED",
"thumbnailChannel": null,
"thumbnailChannelId": null,
"additionalClaimAddresses": [],

View file

@ -1,29 +1,88 @@
.asset-preview {
position: relative;
display: flex;
flex-direction: column;
background: $card-color;
padding: $thin-padding;
color: $text-color;
width: 240px;
border: $subtle-border;
height: 280px;
height: 256px;
&:hover {
border: 1px solid $highlight-border-color;
border-color: $highlight-border-color;
color: $primary-color;
}
}
.asset-preview__image {
height : 180px;
width : 240px;
overflow: hidden;
object-fit: cover;
padding: 0;
margin : 0;
box-sizing: border-box;
}
.asset-preview__image-box {
width : 240px;
height : 180px;
padding: 0;
margin : 0;
box-sizing: border-box;
}
.asset-preview__label {
padding: $thin-padding;
display: flex;
flex-direction: column;
justify-content: space-between;
height: 7.3em;
}
.asset-preview__label-text {
height: 4.5em;
overflow: hidden;
display: flex;
flex-direction: column;
justify-content: space-around;
box-sizing: border-box;
font-size: $text-small;
font-weight: bold;
height: 54px;
}
.asset-preview__label-info {
width: 100%;
height: 15px;
display: flex;
flex-direction: row;
justify-content: space-between;
overflow: hidden;
text-overflow: ellipsis;
box-sizing: border-box;
align-items: center;
}
.asset-preview__label-info-datum {
display: flex;
flex-direction: row;
align-items: center;
overflow: hidden;
box-sizing: border-box;
font-size: $text-small;
max-width: 40%;
}
.asset-preview__label-info-datum svg{
height: 1.2em;
width: 1.2em;
padding: 0;
padding-right: $thin-padding;
margin: 0;
}
.asset-preview__label-info-datum .svg-icon{
padding: 0px;
margin: 0;
height: 15px;
}
.asset-preview__blocked {
@ -34,22 +93,3 @@
padding: $thin-padding;
margin-bottom: $thin-padding;
}
.asset-preview__image {
width : 240px;
height : 180px;
overflow: hidden;
object-fit: cover;
padding: 0;
margin : 0;
box-sizing: border-box;
}
h3.asset-preview__title {
margin: 0;
text-overflow: ellipsis;
word-wrap: break-word;
overflow: hidden;
max-height: 4em;
font-size: $text-large;
}

View file

@ -1,7 +1,7 @@
.channel-claims-display {
width: 100%;
display: grid;
grid-gap: $thin-padding;
grid-gap: $tertiary-padding;
align-content: space-around;
@media (min-width: $break-point-x-large) {
grid-template-columns: 1fr 1fr 1fr 1fr 1fr;

View file

@ -1,13 +1,8 @@
import * as actions from '../constants/show_action_types';
import {
ASSET_DETAILS,
ASSET_LITE,
CHANNEL,
SPECIAL_ASSET,
} from '../constants/show_request_types';
import { ASSET_DETAILS, ASSET_LITE, CHANNEL, SPECIAL_ASSET } from '../constants/show_request_types';
// basic request parsing
export function onHandleShowPageUri (params, url) {
export function onHandleShowPageUri(params, url) {
return {
type: actions.HANDLE_SHOW_URI,
data: {
@ -17,7 +12,7 @@ export function onHandleShowPageUri (params, url) {
};
}
export function onHandleShowHomepage (params, url) {
export function onHandleShowHomepage(params, url) {
return {
type: actions.HANDLE_SHOW_HOMEPAGE,
data: {
@ -27,14 +22,14 @@ export function onHandleShowHomepage (params, url) {
};
}
export function onRequestError (error) {
export function onRequestError(error) {
return {
type: actions.REQUEST_ERROR,
data: error,
};
}
export function onNewChannelRequest (channelName, channelId) {
export function onNewChannelRequest(channelName, channelId) {
const requestType = CHANNEL;
const requestId = `cr#${channelName}#${channelId}`;
return {
@ -43,7 +38,7 @@ export function onNewChannelRequest (channelName, channelId) {
};
}
export function onNewSpecialAssetRequest (name) {
export function onNewSpecialAssetRequest(name) {
const requestType = SPECIAL_ASSET;
const requestId = `sar#${name}`;
return {
@ -52,7 +47,7 @@ export function onNewSpecialAssetRequest (name) {
};
}
export function onNewAssetRequest (name, id, channelName, channelId, extension) {
export function onNewAssetRequest(name, id, channelName, channelId, extension) {
const requestType = extension ? ASSET_LITE : ASSET_DETAILS;
const requestId = `ar#${name}#${id}#${channelName}#${channelId}`;
return {
@ -65,14 +60,14 @@ export function onNewAssetRequest (name, id, channelName, channelId, extension)
id,
channel: {
name: channelName,
id : channelId,
id: channelId,
},
},
},
};
}
export function onRequestUpdate (requestType, requestId) {
export function onRequestUpdate(requestType, requestId) {
return {
type: actions.REQUEST_UPDATE,
data: {
@ -82,7 +77,7 @@ export function onRequestUpdate (requestType, requestId) {
};
}
export function addRequestToRequestList (id, error, key) {
export function addRequestToRequestList(id, error, key) {
return {
type: actions.REQUEST_LIST_ADD,
data: { id, error, key },
@ -91,21 +86,21 @@ export function addRequestToRequestList (id, error, key) {
// asset actions
export function addAssetToAssetList (id, error, name, claimId, shortId, claimData, claimViews) {
export function addAssetToAssetList(id, error, name, claimId, shortId, claimData, claimViews) {
return {
type: actions.ASSET_ADD,
data: { id, error, name, claimId, shortId, claimData, claimViews },
};
}
export function updateAssetViewsInList (id, claimId, claimViews) {
export function updateAssetViewsInList(id, claimId, claimViews) {
return {
type: actions.ASSET_VIEWS_UPDATE,
data: { id, claimId, claimViews },
};
}
export function removeAsset (data) {
export function removeAsset(data) {
return {
type: actions.ASSET_REMOVE,
data,
@ -114,7 +109,7 @@ export function removeAsset (data) {
// channel actions
export function addNewChannelToChannelList (id, name, shortId, longId, claimsData) {
export function addNewChannelToChannelList(id, name, shortId, longId, claimsData) {
return {
type: actions.CHANNEL_ADD,
data: {
@ -127,39 +122,47 @@ export function addNewChannelToChannelList (id, name, shortId, longId, claimsDat
};
}
export function onUpdateChannelClaims (channelKey, name, longId, page) {
export function onUpdateChannelClaims(channelKey, name, longId, page) {
return {
type: actions.CHANNEL_CLAIMS_UPDATE_ASYNC,
data: {channelKey, name, longId, page},
data: { channelKey, name, longId, page },
};
}
export function updateChannelClaims (channelListId, claimsData) {
export function updateChannelClaims(channelListId, claimsData) {
return {
type: actions.CHANNEL_CLAIMS_UPDATE_SUCCEEDED,
data: {channelListId, claimsData},
data: { channelListId, claimsData },
};
}
// display a file
export function fileRequested (name, claimId) {
export function fileRequested(name, claimId) {
return {
type: actions.FILE_REQUESTED,
data: { name, claimId },
};
}
export function updateFileAvailability (status) {
export function updateFileAvailability(status) {
return {
type: actions.FILE_AVAILABILITY_UPDATE,
data: status,
};
}
export function updateDisplayAssetError (error) {
export function updateDisplayAssetError(error) {
return {
type: actions.DISPLAY_ASSET_ERROR,
data: error,
};
}
// viewer settings
export function toggleDetailsExpanded(isExpanded) {
return {
type: actions.TOGGLE_DETAILS_EXPANDED,
data: isExpanded,
};
}

View file

@ -1,6 +1,6 @@
import Request from '../utils/request';
export function getLongClaimId (host, name, modifier) {
export function getLongClaimId(host, name, modifier) {
let body = {};
// create request params
if (modifier) {
@ -13,40 +13,40 @@ export function getLongClaimId (host, name, modifier) {
}
body['claimName'] = name;
const params = {
method : 'POST',
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body : JSON.stringify(body),
body: JSON.stringify(body),
};
// create url
const url = `${host}/api/claim/long-id`;
// return the request promise
return Request(url, params);
};
}
export function getShortId (host, name, claimId) {
export function getShortId(host, name, claimId) {
const url = `${host}/api/claim/short-id/${claimId}/${name}`;
return Request(url);
};
}
export function getClaimData (host, name, claimId) {
export function getClaimData(host, name, claimId) {
const url = `${host}/api/claim/data/${name}/${claimId}`;
return Request(url);
};
}
export function checkClaimAvailability (claim) {
export function checkClaimAvailability(claim) {
const url = `/api/claim/availability/${claim}`;
return Request(url);
}
export function getClaimViews (claimId) {
export function getClaimViews(claimId) {
const url = `/api/claim/views/${claimId}`;
return Request(url);
}
export function doAbandonClaim (claimId) {
export function doAbandonClaim(outpoint) {
const params = {
method : 'POST',
body : JSON.stringify({claimId}),
method: 'POST',
body: JSON.stringify({ outpoint }),
headers: new Headers({
'Content-Type': 'application/json',
}),

View file

@ -16,7 +16,7 @@ import EditPage from '@pages/EditPage';
const App = () => {
return (
<Switch>
<Route exact path='/' component={HomePage} />
<Route exact path='/' component={AboutPage} />
<Route exact path='/about' component={AboutPage} />
<Route exact path='/tos' component={TosPage} />
<Route exact path='/faq' component={FaqPage} />

View file

@ -22,14 +22,29 @@ export const makePublishRequestChannel = (fd, isUpdate) => {
xhr.upload.addEventListener('load', onLoad);
// set state change handler
xhr.onreadystatechange = () => {
if (xhr.readyState === 4) {
const response = JSON.parse(xhr.response);
if ((xhr.status === 200) && response.success) {
emitter({success: response});
emitter(END);
} else {
emitter({error: new Error(response.message)});
emitter(END);
if (xhr.readyState === XMLHttpRequest.DONE) {
switch (xhr.status) {
case 413:
emitter({error: new Error("Unfortunately it appears this web server " +
"has been misconfigured, please inform the service administrators " +
"that they must set their nginx/apache request size maximums higher " +
"than their file size limits.")});
emitter(END);
break;
case 200:
var response = JSON.parse(xhr.response);
if (response.success) {
emitter({success: response});
emitter(END);
} else {
emitter({error: new Error(response.message)});
emitter(END);
}
break;
default:
emitter({error: new Error("Received an unexpected response from " +
"server: " + xhr.status)});
emitter(END);
}
}
};

View file

@ -1,32 +1,13 @@
import React from 'react';
import Row from '@components/Row';
import {Link} from 'react-router-dom';
const AboutSpeechDetails = () => {
return (
<div>
<Row>
<p className={'text--large'}>
<Link className={'link--primary'} to='/tos'>Terms of Service</Link>
<br />
<Link className={'link--primary'} to='/faq'>Frequently Asked Questions</Link>
</p>
</Row>
<Row>
<p className={'text--large'}>
Spee.ch is a media-hosting site that reads from and publishes content to the <a className='link--primary' href='https://lbry.io'>LBRY</a> blockchain.
</p>
<p className={'text--large'}>
Spee.ch is a hosting service, but with the added benefit that it stores your content on a decentralized network of computers -- the <a className='link--primary' href='https://lbry.io/get'>LBRY</a> network. This means that your images are stored in multiple locations without a single point of failure.
</p>
</Row>
<Row>
<h3>Contribute</h3>
<p className={'text--large'}>
If you have an idea for your own spee.ch-like site on top of LBRY, fork our <a className='link--primary' href='https://github.com/lbryio/spee.ch'>github repo</a> and go to town!
</p>
<p className={'text--large'}>
If you want to improve spee.ch, join our <a className='link--primary' href='https://chat.lbry.io'>discord channel</a> or solve one of our <a className='link--primary' href='https://github.com/lbryio/spee.ch/issues'>github issues</a>.
Spee.ch's journey may be on hold, but LBRY is still on mission. We'd like to thank all of our testers and early adopters for helping us explore this use case.
We're really excited about <a className='link--primary' href='https://lbry.tv' target='_blank'>lbry.tv</a> and can't wait to see you over there for a fully featured experience.
</p>
</Row>
</div>

View file

@ -5,14 +5,13 @@ const AboutSpeechOverview = () => {
return (
<div>
<Row>
<p className={'text--extra-large'}>Spee.ch is an open-source project. Please contribute to the existing site, or fork it and make your own.</p>
<p className={'text--extra-large'}>Lbry is no longer supporting Spee.ch. However, we're excited to show you <a className='link--primary' href='https://lbry.tv' target='_blank'>lbry.tv</a>!</p>
</Row>
<Row>
<div className={'text--large'}>
<a className='link--primary' target='_blank' href='https://twitter.com/spee_ch'>TWITTER</a><br/>
<a className='link--primary' target='_blank' href='https://github.com/lbryio/spee.ch'>GITHUB</a><br/>
<a className='link--primary' target='_blank' href='https://twitter.com/lbry'>TWITTER</a><br/>
<a className='link--primary' target='_blank' href='https://github.com/lbryio/'>GITHUB</a><br/>
<a className='link--primary' target='_blank' href='https://discord.gg/YjYbwhS'>DISCORD CHANNEL</a><br/>
<a className='link--primary' target='_blank' href='https://github.com/lbryio/spee.ch/blob/master/README.md'>DOCUMENTATION</a><br/>
</div>
</Row>
</div>

View file

@ -3,9 +3,13 @@ import Row from '@components/Row';
const AssetInfoFooter = ({ assetUrl, name }) => {
return (
<div className='asset-footer'>
<div className="asset-footer">
<p>
Hosted via the <a className={'link--primary'} href={'https://lbry.io/get'} target={'_blank'}>LBRY</a> blockchain
Hosted via the{' '}
<a className={'link--primary'} href={'https://lbry.com/get'} target={'_blank'}>
LBRY
</a>{' '}
blockchain
</p>
</div>
);

View file

@ -2,11 +2,24 @@ import React from 'react';
import { Link } from 'react-router-dom';
import createCanonicalLink from '@globalutils/createCanonicalLink';
import * as Icon from 'react-feather';
import Img from 'react-image';
const AssetPreview = ({ defaultThumbnail, claimData }) => {
const {name, fileExt, contentType, thumbnail, title, blocked} = claimData;
const {name, fileExt, contentType, thumbnail, title, blocked, transactionTime = 0} = claimData;
const showUrl = createCanonicalLink({asset: {...claimData}});
const embedUrl = `${showUrl}.${fileExt}`;
const ago = Date.now() / 1000 - transactionTime;
const dayInSeconds = 60 * 60 * 24;
const monthInSeconds = dayInSeconds * 30;
let when;
if (ago < dayInSeconds || transactionTime < 1) {
when = 'Just today';
} else if (ago < monthInSeconds) {
when = `${Math.floor(ago / dayInSeconds)} d ago`;
} else {
when = `${Math.floor(ago / monthInSeconds)} mo ago`;
}
/*
we'll be assigning media icon based on supported type / mime types
*/
@ -37,21 +50,36 @@ const AssetPreview = ({ defaultThumbnail, claimData }) => {
} else {
return (
<Link to={showUrl} className='asset-preview'>
<img
className={'asset-preview__image'}
src={thumb || defaultThumbnail}
alt={name}
/>
<div className='asset-preview__image-box'>
<Img
src={[
thumb,
defaultThumbnail,
'/assets/img/default_thumb.jpg',
]}
alt={name}
className={'asset-preview__image'}
/>
</div>
<div className={'asset-preview__label'}>
<div className={'asset-preview__label-text'}>
<p className='asset-preview__title text--medium'>{title}</p>
<p>{title}</p>
</div>
<div className={'asset-preview__label-info'}>
<div className={'text--medium'}>
{ media === 'image' && <Icon.Image />}
{ media === 'text' && <Icon.FileText />}
{ media === 'video' && contentType === 'video/mp4' && <Icon.Video />}
{ media !== 'image' && media !== 'text' && contentType !== 'video/mp4' && <Icon.File />}
<div className={'asset-preview__label-info '}>
<div className={'asset-preview__label-info-datum'}>
<div className={'svg-icon'}>
{ media === 'image' && <Icon.Image />}
{ media === 'text' && <Icon.FileText />}
{ media === 'video' && contentType === 'video/mp4' && <Icon.Video />}
{ media !== 'image' && media !== 'text' && contentType !== 'video/mp4' && <Icon.File />}
</div>
<div>{fileExt}</div>
</div>
<div className={'asset-preview__label-info-datum'}>
<div>{when}</div>
</div>
</div>
</div>

View file

@ -7,6 +7,9 @@ const ChannelSelectDropdown = ({ selectedChannel, handleSelection, loggedInChann
id='channel-name-select'
value={selectedChannel}
onChange={handleSelection}>
{ loggedInChannelName && (
<option value={loggedInChannelName} >{loggedInChannelName}</option>
)}
<option value={LOGIN}>Existing</option>
<option value={CREATE}>New</option>
</select>

View file

@ -3,7 +3,7 @@ import React from 'react';
const PublishFinePrint = () => {
return (
<p className={'text--extra-small text--secondary'}>
By clicking 'Publish', you affirm that you have the rights to publish this content to the LBRY network, and that you understand the properties of publishing it to a decentralized, user-controlled network. <a className='link--primary' target='_blank' href='https://lbry.io/learn'>Read more.</a>
By clicking 'Publish', you affirm that you have the rights to publish this content to the LBRY network, and that you understand the properties of publishing it to a decentralized, user-controlled network. <a className='link--primary' target='_blank' href='https://lbry.com/learn'>Read more.</a>
</p>
);
};

View file

@ -24,3 +24,4 @@ export const CHANNEL_CLAIMS_UPDATE_SUCCEEDED = 'CHANNEL_CLAIMS_UPDATE_SUCCEEDED'
export const FILE_REQUESTED = 'FILE_REQUESTED';
export const FILE_AVAILABILITY_UPDATE = 'FILE_AVAILABILITY_UPDATE';
export const DISPLAY_ASSET_ERROR = 'DISPLAY_ASSET_ERROR';
export const TOGGLE_DETAILS_EXPANDED = 'TOGGLE_DETAILS_EXPANDED';

View file

@ -17,7 +17,7 @@ class BlockedRight extends React.PureComponent {
return (
<div className={'asset-blocked__text'} >
<p>In response to a complaint we received under the US Digital Millennium Copyright Act, we have blocked access to this content from our applications.</p>
<p><a href={'https://lbry.io/faq/dmca'} >Click here</a> for more information.</p>
<p><a href={'https://lbry.com/faq/dmca'} >Click here</a> for more information.</p>
</div>
);
}

View file

@ -4,6 +4,8 @@ import ProgressBar from '@components/ProgressBar';
import { LOCAL_CHECK, UNAVAILABLE, ERROR, AVAILABLE } from '../../constants/asset_display_states';
import createCanonicalLink from '@globalutils/createCanonicalLink';
import FileViewer from '@components/FileViewer';
import isBot from 'isbot';
import Img from 'react-image';
class AvailableContent extends React.Component {
render () {
@ -15,20 +17,23 @@ class AvailableContent extends React.Component {
case 'image/gif':
case 'image/svg+xml':
return (
<img
className='asset-image'
src={sourceUrl}
<Img
src={[
sourceUrl,
'/assets/img/default_thumb.jpg',
]}
alt={name}
className={'asset-image'}
/>
);
case 'video/mp4':
return (
<video
className='asset-video'
controls poster={thumbnail}
controls poster={!!thumbnail && thumbnail || '/assets/img/default_thumb.jpg'}
>
<source
src={sourceUrl}
src={!!sourceUrl && sourceUrl}
/>
<p>Your browser does not support the <code>video</code> element.</p>
</video>
@ -36,14 +41,25 @@ class AvailableContent extends React.Component {
case 'text/markdown':
return (
<div className={'asset-document'}><FileViewer sourceUrl={sourceUrl}/></div>
(isBot(window.navigator.userAgent))
? (
<img
className='asset-image'
src={'/assets/img/default_thumb.jpg'}
alt={'markdown available on page load'}
/>
)
: <div className={'asset-document'}><FileViewer sourceUrl={!!sourceUrl && sourceUrl}/></div>
);
default:
return (
<img
className='asset-image'
src={thumbnail}
<Img
src={[
thumbnail,
'/assets/img/default_thumb.jpg',
]}
alt={name}
className={'asset-image'}
/>
);
}
@ -76,7 +92,7 @@ class AssetDisplay extends React.Component {
<div>
<p>Sit tight, we're searching the LBRY blockchain for your asset!</p>
<ProgressBar size={12} />
<p>Curious what magic is happening here? <a className='link--primary' target='blank' href='https://lbry.io/faq/what-is-lbry'>Learn more.</a></p>
<p>Curious what magic is happening here? <a className='link--primary' target='blank' href='https://lbry.com/faq/what-is-lbry'>Learn more.</a></p>
</div>
}
{(status === ERROR) && (
@ -87,7 +103,7 @@ class AssetDisplay extends React.Component {
) : (
<div>
<Row>
<p>Unfortunately, we couldn't download your asset from LBRY. You can help us out by sharing the following error message in the <a className='link--primary' href='https://chat.lbry.io' target='_blank'>LBRY discord</a>.</p>
<p>Unfortunately, we couldn't download your asset from LBRY. You can help us out by sharing the following error message in the <a className='link--primary' href='https://chat.lbry.com' target='_blank'>LBRY discord</a>.</p>
</Row>
<Row>
<p id='error-message'><i>{error}</i></p>

View file

@ -186,7 +186,7 @@ class AssetInfo extends React.Component {
</a>
<a
className={'link--primary'}
href={`https://open.lbry.io/${createPermanentURI(asset)}`}
href={`https://open.lbry.com/${createPermanentURI(asset)}`}
download={name}
>
LBRY URL
@ -194,7 +194,7 @@ class AssetInfo extends React.Component {
<a
className={'link--primary'}
target='_blank'
href='https://lbry.io/dmca'
href={`https://lbry.com/dmca/${claimId}`}
>
Report
</a>

View file

@ -33,14 +33,14 @@ class NavigationLinks extends React.Component {
const { channelName, showPublish, closedRegistration } = this.props;
return (
<div className='navigation-links'>
{showPublish && <NavLink
className='nav-bar-link link--nav'
activeClassName='link--nav-active'
to='/'
exact
>
Publish
</NavLink>}
{/*{showPublish && <NavLink*/}
{/* className='nav-bar-link link--nav'*/}
{/* activeClassName='link--nav-active'*/}
{/* to='/'*/}
{/* exact*/}
{/*>*/}
{/* Publish*/}
{/*</NavLink>}*/}
<NavLink
className='nav-bar-link link--nav'
activeClassName='link--nav-active'
@ -48,24 +48,24 @@ class NavigationLinks extends React.Component {
>
About
</NavLink>
{ channelName ? (
<NavBarChannelOptionsDropdown
channelName={this.props.channelName}
handleSelection={this.handleSelection}
defaultSelection={this.props.channelName}
VIEW={VIEW}
LOGOUT={LOGOUT}
/>
) : !closedRegistration && (
<NavLink
id='nav-bar-login-link'
className='nav-bar-link link--nav'
activeClassName='link--nav-active'
to='/login'
>
Channel
</NavLink>
)}
{/*{ channelName ? (*/}
{/* <NavBarChannelOptionsDropdown*/}
{/* channelName={this.props.channelName}*/}
{/* handleSelection={this.handleSelection}*/}
{/* defaultSelection={this.props.channelName}*/}
{/* VIEW={VIEW}*/}
{/* LOGOUT={LOGOUT}*/}
{/* />*/}
{/*) : !closedRegistration && (*/}
{/* <NavLink*/}
{/* id='nav-bar-login-link'*/}
{/* className='nav-bar-link link--nav'*/}
{/* activeClassName='link--nav-active'*/}
{/* to='/login'*/}
{/* >*/}
{/* Channel*/}
{/* </NavLink>*/}
{/*)}*/}
</div>
);
}

View file

@ -7,6 +7,9 @@ class PublishDisabledMessage extends React.Component {
<div className={'publish-disabled-message'}>
<div className={'message'}>
<p className={'text--secondary'}>Publishing is currently disabled.</p>
<p className={'text--secondary'}>
Try <a className='link--primary' href='https://lbry.tv' target='_blank'>lbry.tv</a>
</p>
<p className={'text--secondary'}>{message}</p>
</div>
</div>

View file

@ -38,7 +38,7 @@ class PublishStatus extends React.Component {
<ProgressBar size={12} />
</Row>
<Row>
<p>Curious what magic is happening here? <a className='link--primary' target='blank' href='https://lbry.io/faq/what-is-lbry'>Learn more.</a></p>
<p>Curious what magic is happening here? <a className='link--primary' target='blank' href='https://lbry.com/faq/what-is-lbry'>Learn more.</a></p>
</Row>
</div>
}
@ -61,7 +61,7 @@ class PublishStatus extends React.Component {
<p className={'text--strong'}>{message}</p>
</Row>
<Row>
<p>For help, post the above error text in the #speech channel on the <a className='link--primary' href='https://chat.lbry.io' target='_blank'>lbry discord</a></p>
<p>For help, post the above error text in the #speech channel on the <a className='link--primary' href='https://chat.lbry.com' target='_blank'>lbry discord</a></p>
</Row>
<Row>
<ButtonSecondary

View file

@ -1,5 +1,5 @@
import {connect} from 'react-redux';
import {updateMetadata} from '../../actions/publish';
import { connect } from 'react-redux';
import { updateMetadata } from '../../actions/publish';
import View from './view';
const mapStateToProps = ({ publish }) => {
@ -16,4 +16,7 @@ const mapDispatchToProps = dispatch => {
};
};
export default connect(mapStateToProps, mapDispatchToProps)(View);
export default connect(
mapStateToProps,
mapDispatchToProps
)(View);

View file

@ -3,7 +3,7 @@ import ErrorPage from '@pages/ErrorPage';
import ShowAssetLite from '@pages/ShowAssetLite';
import ShowAssetDetails from '@pages/ShowAssetDetails';
import ShowChannel from '@pages/ShowChannel';
import { withRouter } from 'react-router-dom';
import { withRouter, Redirect } from 'react-router-dom';
import {
CHANNEL,
@ -15,15 +15,24 @@ import {
class ContentPageWrapper extends React.Component {
componentDidMount () {
const { onHandleShowPageUri, match, homeChannel } = this.props;
onHandleShowPageUri(homeChannel ? { claim: homeChannel } : match.params);
//onHandleShowPageUri(homeChannel ? { claim: homeChannel } : match.params);
}
componentWillReceiveProps (nextProps) {
if (nextProps.match.params !== this.props.match.params) {
this.props.onHandleShowPageUri(nextProps.match.params);
//this.props.onHandleShowPageUri(nextProps.match.params);
}
}
render () {
const { error, requestType } = this.props;
const { error, requestType, match } = this.props;
const { params } = match;
const { claim, identifier } = params;
if (identifier && claim) {
return <Redirect to={`https://lbry.tv/${identifier}/${claim}`} />;
} else if (identifier) {
// return <Redirect to={`https://lbry.tv/${identifier}/`} />
} else {
return <Redirect to={`https://lbry.tv/${claim}`} />;
}
if (error) {
return (
<ErrorPage error={error} />
@ -31,13 +40,13 @@ class ContentPageWrapper extends React.Component {
}
switch (requestType) {
case CHANNEL:
return <ShowChannel />;
// return <ShowChannel />;
case ASSET_LITE:
return <ShowAssetLite />;
// return <ShowAssetLite />;
case ASSET_DETAILS:
return <ShowAssetDetails />;
// return <ShowAssetDetails />;
case SPECIAL_ASSET:
return <ShowChannel />;
// return <ShowChannel />;
default:
return <p>loading...</p>;
}

View file

@ -15,7 +15,7 @@ class FaqPage extends React.Component {
</Row>
<Row>
<h3>What is spee.ch?</h3>
<p>Spee.ch is a media-hosting site that reads from and publishes content to the <a href='http://lbry.io/'>LBRY blockchain</a>.</p>
<p>Spee.ch is a media-hosting site that reads from and publishes content to the <a href='http://lbry.com/'>LBRY blockchain</a>.</p>
</Row>
<Row>
<h3>OK But Why Should I Care?</h3>
@ -29,7 +29,7 @@ class FaqPage extends React.Component {
<p>Its easy. Drag the image or video file of your choice into the center of the spee.ch homepage.</p>
<p>Spee.ch is currently best suited for web optimized MP4 video and standard image filetypes (JPEG, PNG, GIF).</p>
<p>If you want to refer to a piece of content repeatedly, or to build a collection of related content, you could create a channel. Channels work both for private collections and for public repositories. Theres more info about how to do this <a href='https://spee.ch/login'>on the channel page</a>.</p>
<p>Published files will be wiewable and embeddable with any web browser and accesible in the LBRY app. You can also use spee.ch to view free and non-NSFW content published on LBRY network from LBRY app. You just need to replace "lbry://" with "http://spee.ch/" in the URL.</p>
<p>Published files will be viewable and embeddable with any web browser and accesible in the LBRY app. You can also use spee.ch to view free and non-NSFW content published on LBRY network from LBRY app. You just need to replace "lbry://" with "http://spee.ch/" in the URL.</p>
</Row>
<Row>
<h3>How Long Does Content Stay on Spee.ch?</h3>
@ -38,7 +38,7 @@ class FaqPage extends React.Component {
<Row>
<h3>Contribute</h3>
<p>If you have an idea for your own spee.ch-like site on top of LBRY, fork our <a href='https://github.com/lbryio/spee.ch'>github repo</a> and go to town!</p>
<p>If you want to improve spee.ch, join <a href='https://chat.lbry.io/'>our discord channel</a> or solve one of our <a href='https://github.com/lbryio/spee.ch/issues'>github issues</a>.</p>
<p>If you want to improve spee.ch, join <a href='https://chat.lbry.com/'>our discord channel</a> or solve one of our <a href='https://github.com/lbryio/spee.ch/issues'>github issues</a>.</p>
</Row>
</Row>
</PageLayout>

View file

@ -7,7 +7,7 @@ const MultisiteContent = () => {
<p className='text--pull-quote'>Introducing Spee.ch Multisite</p>
<p>Hi there! My name is <a href={'https://github.com/billbitt'} target={'_blank'}>Bill</a>, and Id like to speak with you about Spee.ch. No, not speech, <i><a href={'https://spee.ch'} target={'_blank'}>Spee.ch.</a></i> You know what, just read on...</p>
<h2>A Little Background</h2>
<p>Wow, time flies! A little over a year ago Spee.ch was nothing more than a glimmer in the eye of LBRY CEO Jeremy Kaufman. At that time, the <a href={'https://lbry.io/faq/what-is-lbry'} target={'_blank'}>LBRY protocol</a> was still so early in its development, that there were no web-based applications for interacting with the LBRY blockchain. But then, something beautiful happened. On March 29th, 2017, Jeremy sat down with Jack, and together they <a href={'https://www.youtube.com/watch?v=C9LCapt_OYw'} target={'_blank'}>live coded a single-page PHP site</a> that could publish images to the LBRY network. And just like that, Spee.ch was born!</p>
<p>Wow, time flies! A little over a year ago Spee.ch was nothing more than a glimmer in the eye of LBRY CEO Jeremy Kaufman. At that time, the <a href={'https://lbry.com/faq/what-is-lbry'} target={'_blank'}>LBRY protocol</a> was still so early in its development, that there were no web-based applications for interacting with the LBRY blockchain. But then, something beautiful happened. On March 29th, 2017, Jeremy sat down with Jack, and together they <a href={'https://www.youtube.com/watch?v=C9LCapt_OYw'} target={'_blank'}>live coded a single-page PHP site</a> that could publish images to the LBRY network. And just like that, Spee.ch was born!</p>
<p>Being that LBRY is an open source project, Jeremy ended the session by inviting community members who were interested in the project to take the reigns and see where Spee.ch could go. I was one of the devs that did just that, and it wasnt long before I was on a weekly call dedicated to this project with contributors from around the world.</p>
<p>At this point in time, the vision for Spee.ch was pretty simple: create a web-based hosting service that used the LBRY network as a database for free image and video sharing. In other words, an imgur on the blockchain.</p>
<h2>Growth</h2>
@ -41,7 +41,7 @@ const MultisiteContent = () => {
<li>Where: Google Hangouts</li>
<li>Link: <a href={'https://meet.google.com/aex-ghqg-kcs'} target={'_blank'}>meet.google.com/aex-ghqg-kcs</a></li>
<li>System Requirements: If you have a server, please make sure you have MySql, Node and NPM installed. If you need help installing the above, or if you need a server to run your own instance on, please join the Hangout 30 minutes ahead of time and we will help get you set up =]</li>
<li>Questions: hello@lbry.io</li>
<li>Questions: hello@lbry.com</li>
</ul>
</div>
);

View file

@ -1,11 +1,25 @@
import { connect } from 'react-redux';
import { selectAsset } from '../../selectors/show';
import { selectAsset, selectDetailsExpanded } from '../../selectors/show';
import { toggleDetailsExpanded } from '../../actions/show';
import View from './view';
const mapStateToProps = ({ show }) => {
const mapStateToProps = state => {
return {
asset: selectAsset(show),
asset: selectAsset(state.show),
detailsExpanded: selectDetailsExpanded(state),
};
};
export default connect(mapStateToProps, null)(View);
const mapDispatchToProps = dispatch => {
return {
onToggleDetailsExpanded: value => {
dispatch(toggleDetailsExpanded(value));
},
};
};
export default connect(
mapStateToProps,
mapDispatchToProps
)(View);

View file

@ -11,24 +11,15 @@ class ShowAssetDetails extends React.Component {
constructor (props) {
super(props);
this.collapse = this.collapse.bind(this);
// this.storageKey = 'vert-split-state-' + this.props.name;
// const closed = window && window.localStorage
// ? !!window.localStorage.getItem(this.storageKey) : false;
const closed = true;
this.state = { closed: closed };
this.toggleExpandDetails = this.toggleExpandDetails.bind(this);
}
collapse () {
this.setState({ closed: !this.state.closed });
// if (window && window.localStorage) {
// window.localStorage.setItem(this.storageKey, !this.state.closed);
// }
// document.querySelectorAll(`[data-name='${this.props.name}']`).forEach(el => el.classList.toggle('closed'));
toggleExpandDetails () {
this.props.onToggleDetailsExpanded(!this.props.detailsExpanded);
}
render () {
const { asset } = this.props;
const { asset, detailsExpanded } = this.props;
if (asset) {
const { claimData: { name, blocked } } = asset;
if (!blocked) {
@ -37,16 +28,16 @@ class ShowAssetDetails extends React.Component {
pageTitle={`${name} - details`}
asset={asset}
>
<div className="asset-main">
<div className='asset-main'>
<AssetTitle />
<AssetDisplay />
<div>
<button className='collapse-button' onClick={this.collapse}>
{this.state.closed ? <Icon.PlusCircle className='plus-icon' /> : <Icon.MinusCircle />}
<button className='collapse-button' onClick={this.toggleExpandDetails}>
{detailsExpanded ? <Icon.MinusCircle /> : <Icon.PlusCircle className='plus-icon' /> }
</button>
</div>
</div>
{!this.state.closed && <AssetInfo />}
{detailsExpanded && <AssetInfo />}
</PageLayout>
);

View file

@ -9,7 +9,7 @@ const AssetLiteFooter = ({ name, claimId }) => {
return (
<SpaceAround>
<p className={'text--extra-small'}>
<Link className='link--primary' to={`/${claimId}/${name}`}> hosted on spee.ch</Link> via the <a className='link--primary' href={'https://lbry.io/get'} target={'_blank'}>LBRY</a> blockchain
<Link className='link--primary' to={`/${claimId}/${name}`}> hosted on spee.ch</Link> via the <a className='link--primary' href={'https://lbry.com/get'} target={'_blank'}>LBRY</a> blockchain
</p>
</SpaceAround>
);

View file

@ -13,15 +13,15 @@ class TosPage extends React.Component {
<Row>
<h1>Terms of Service</h1>
<p>Last updated: September 25, 2018</p>
<p>Please read these Terms of Service ("Terms", "Terms of Service") carefully before using the <a className='link--primary' href='https://spee.ch'>https://spee.ch</a> website (the "Service") operated by <a className='link--primary' href='https://lbry.io'>LBRY INC</a> ("us", "we", or "our").</p>
<p>Please read these Terms of Service ("Terms", "Terms of Service") carefully before using the <a className='link--primary' href='https://spee.ch'>https://spee.ch</a> website (the "Service") operated by <a className='link--primary' href='https://lbry.com'>LBRY INC</a> ("us", "we", or "our").</p>
<p>Your access to and use of the Service is conditioned upon your acceptance of and compliance with these Terms. These Terms apply to all visitors, users and others who wish to access or use the Service.</p>
<p>By accessing or using the Service you agree to be bound by these Terms. If you disagree with any part of the terms then you do not have permission to access the Service.</p>
</Row>
<Row>
<h3>Links To Other Web Sites</h3>
<p>Our Service may contain links to third party web sites or services that are not owned or controlled by <a className='link--primary' href='https://lbry.io'>LBRY INC</a></p>
<p><a className='link--primary' href='https://lbry.io'>LBRY INC</a> has no control over, and assumes no responsibility for the content, privacy policies, or practices of any third party web sites or services. We do not warrant the offerings of any of these entities/individuals or their websites.</p>
<p>You acknowledge and agree that <a className='link--primary' href='https://lbry.io'>LBRY INC</a> shall not be responsible or liable, directly or indirectly, for any damage or loss caused or alleged to be caused by or in connection with use of or reliance on any such content, goods or services available on or through any such third party web sites or services.</p>
<p>Our Service may contain links to third party web sites or services that are not owned or controlled by <a className='link--primary' href='https://lbry.com'>LBRY INC</a></p>
<p><a className='link--primary' href='https://lbry.com'>LBRY INC</a> has no control over, and assumes no responsibility for the content, privacy policies, or practices of any third party web sites or services. We do not warrant the offerings of any of these entities/individuals or their websites.</p>
<p>You acknowledge and agree that <a className='link--primary' href='https://lbry.com'>LBRY INC</a> shall not be responsible or liable, directly or indirectly, for any damage or loss caused or alleged to be caused by or in connection with use of or reliance on any such content, goods or services available on or through any such third party web sites or services.</p>
<p>We strongly advise you to read the terms and conditions and privacy policies of any third party web sites or services that you visit.</p>
</Row>
<Row>
@ -35,12 +35,12 @@ class TosPage extends React.Component {
</Row>
<Row>
<h3>Limitation Of Liability</h3>
<p>In no event shall <a className='link--primary' href='https://lbry.io'>LBRY INC</a>, nor its directors, employees, partners, agents, suppliers, or affiliates, be liable for any indirect, incidental, special, consequential or punitive damages, including without limitation, loss of profits, data, use, goodwill, or other intangible losses, resulting from (i) your access to or use of or inability to access or use the Service; (ii) any conduct or content of any third party on the Service; (iii) any content obtained from the Service; and (iv) unauthorized access, use or alteration of your transmissions or content, whether based on warranty, contract, tort (including negligence) or any other legal theory, whether or not we have been informed of the possibility of such damage, and even if a remedy set forth herein is found to have failed of its essential purpose.</p>
<p>In no event shall <a className='link--primary' href='https://lbry.com'>LBRY INC</a>, nor its directors, employees, partners, agents, suppliers, or affiliates, be liable for any indirect, incidental, special, consequential or punitive damages, including without limitation, loss of profits, data, use, goodwill, or other intangible losses, resulting from (i) your access to or use of or inability to access or use the Service; (ii) any conduct or content of any third party on the Service; (iii) any content obtained from the Service; and (iv) unauthorized access, use or alteration of your transmissions or content, whether based on warranty, contract, tort (including negligence) or any other legal theory, whether or not we have been informed of the possibility of such damage, and even if a remedy set forth herein is found to have failed of its essential purpose.</p>
</Row>
<Row>
<h3>Disclaimer</h3>
<p>Your use of the Service is at your sole risk. The Service is provided on an "AS IS" and "AS AVAILABLE" basis. The Service is provided without warranties of any kind, whether express or implied, including, but not limited to, implied warranties of merchantability, fitness for a particular purpose, non-infringement or course of performance.</p>
<p><a className='link--primary' href='https://lbry.io'>LBRY INC</a> its subsidiaries, affiliates, and its licensors do not warrant that a) the Service will function uninterrupted, secure or available at any particular time or location; b) any errors or defects will be corrected; c) the Service is free of viruses or other harmful components; or d) the results of using the Service will meet your requirements.</p>
<p><a className='link--primary' href='https://lbry.com'>LBRY INC</a> its subsidiaries, affiliates, and its licensors do not warrant that a) the Service will function uninterrupted, secure or available at any particular time or location; b) any errors or defects will be corrected; c) the Service is free of viruses or other harmful components; or d) the results of using the Service will meet your requirements.</p>
</Row>
<Row>
<h3>Exclusions</h3>
@ -58,7 +58,7 @@ class TosPage extends React.Component {
</Row>
<Row>
<h3>Contact Us</h3>
<p>If you have any questions about these Terms, please <a className='link--primary' href='mailto:hello@lbry.io'>contact us</a>.</p>
<p>If you have any questions about these Terms, please <a className='link--primary' href='mailto:hello@lbry.com'>contact us</a>.</p>
</Row>
</Row>
</PageLayout>

View file

@ -40,7 +40,7 @@ const initialState = {
description: '',
license: '',
licenseUrl: '',
nsfw: false,
tags: [],
},
isUpdate: false,
hasChanged: false,

View file

@ -4,19 +4,20 @@ import { LOCAL_CHECK, ERROR } from '../constants/asset_display_states';
const initialState = {
request: {
error: null,
type : null,
id : null,
type: null,
id: null,
},
requestList : {},
channelList : {},
assetList : {},
requestList: {},
channelList: {},
assetList: {},
displayAsset: {
error : null,
error: null,
status: LOCAL_CHECK,
},
detailsExpanded: true,
};
export default function (state = initialState, action) {
export default function(state = initialState, action) {
switch (action.type) {
// handle request
case actions.REQUEST_ERROR:
@ -29,7 +30,7 @@ export default function (state = initialState, action) {
return Object.assign({}, state, {
request: Object.assign({}, state.request, {
type: action.data.requestType,
id : action.data.requestId,
id: action.data.requestId,
}),
});
// store requests
@ -38,7 +39,7 @@ export default function (state = initialState, action) {
requestList: Object.assign({}, state.requestList, {
[action.data.id]: {
error: action.data.error,
key : action.data.key,
key: action.data.key,
},
}),
});
@ -47,11 +48,11 @@ export default function (state = initialState, action) {
return Object.assign({}, state, {
assetList: Object.assign({}, state.assetList, {
[action.data.id]: {
error : action.data.error,
name : action.data.name,
claimId : action.data.claimId,
shortId : action.data.shortId,
claimData : action.data.claimData,
error: action.data.error,
name: action.data.name,
claimId: action.data.claimId,
shortId: action.data.shortId,
claimData: action.data.claimData,
claimViews: action.data.claimViews,
},
}),
@ -76,7 +77,7 @@ export default function (state = initialState, action) {
return {
...state,
assetList : newAssetList,
assetList: newAssetList,
channelList: {
...state.channelList,
[channelId]: {
@ -107,9 +108,9 @@ export default function (state = initialState, action) {
return Object.assign({}, state, {
channelList: Object.assign({}, state.channelList, {
[action.data.id]: {
name : action.data.name,
longId : action.data.longId,
shortId : action.data.shortId,
name: action.data.name,
longId: action.data.longId,
shortId: action.data.shortId,
claimsData: action.data.claimsData,
},
}),
@ -117,9 +118,13 @@ export default function (state = initialState, action) {
case actions.CHANNEL_CLAIMS_UPDATE_SUCCEEDED:
return Object.assign({}, state, {
channelList: Object.assign({}, state.channelList, {
[action.data.channelListId]: Object.assign({}, state.channelList[action.data.channelListId], {
claimsData: action.data.claimsData,
}),
[action.data.channelListId]: Object.assign(
{},
state.channelList[action.data.channelListId],
{
claimsData: action.data.claimsData,
}
),
}),
});
// display an asset
@ -132,10 +137,15 @@ export default function (state = initialState, action) {
case actions.DISPLAY_ASSET_ERROR:
return Object.assign({}, state, {
displayAsset: Object.assign({}, state.displayAsset, {
error : action.data,
error: action.data,
status: ERROR,
}),
});
case actions.TOGGLE_DETAILS_EXPANDED:
return {
...state,
detailsExpanded: action.data,
};
default:
return state;
}

View file

@ -5,17 +5,19 @@ import { updatePublishStatus, clearFile } from '../actions/publish';
import { removeAsset } from '../actions/show';
import { doAbandonClaim } from '../api/assetApi';
function * abandonClaim (action) {
function* abandonClaim(action) {
const { claimData, history } = action.data;
const { claimId } = claimData;
const { outpoint } = claimData;
const confirm = window.confirm('Are you sure you want to abandon this claim? This action cannot be undone.');
const confirm = window.confirm(
'Are you sure you want to abandon this claim? This action cannot be undone.'
);
if (!confirm) return;
yield put(updatePublishStatus(publishStates.ABANDONING, 'Your claim is being abandoned...'));
try {
yield call(doAbandonClaim, claimId);
yield call(doAbandonClaim, outpoint);
} catch (error) {
return console.log('abandon error:', error.message);
}
@ -25,6 +27,6 @@ function * abandonClaim (action) {
return history.push('/');
}
export function * watchAbandonClaim () {
export function* watchAbandonClaim() {
yield takeLatest(actions.ABANDON_CLAIM, abandonClaim);
};
}

View file

@ -9,11 +9,22 @@ import { selectShowState, selectAsset } from '../selectors/show';
import { validateChannelSelection, validateNoPublishErrors } from '../utils/validate';
import { createPublishMetadata, createPublishFormData, createThumbnailUrl } from '../utils/publish';
import { makePublishRequestChannel } from '../channels/publish';
function * publishFile (action) {
// yep
function* publishFile(action) {
const { history } = action.data;
const publishState = yield select(selectPublishState);
const { publishInChannel, selectedChannel, file, claim, metadata, thumbnailChannel, thumbnailChannelId, thumbnail, isUpdate, error: publishToolErrors } = publishState;
const {
publishInChannel,
selectedChannel,
file,
claim,
metadata,
thumbnailChannel,
thumbnailChannelId,
thumbnail,
isUpdate,
error: publishToolErrors,
} = publishState;
const { loggedInChannel } = yield select(selectChannelState);
const { host } = yield select(selectSiteState);
@ -39,7 +50,7 @@ function * publishFile (action) {
// create metadata
publishMetadata = createPublishMetadata(
isUpdate ? asset.name : claim,
isUpdate ? {type: asset.claimData.contentType} : file,
isUpdate ? { type: asset.claimData.contentType } : file,
metadata,
publishInChannel,
selectedChannel
@ -49,7 +60,12 @@ function * publishFile (action) {
}
if (thumbnail) {
// add thumbnail to publish metadata
publishMetadata['thumbnail'] = createThumbnailUrl(thumbnailChannel, thumbnailChannelId, claim, host);
publishMetadata['thumbnail'] = createThumbnailUrl(
thumbnailChannel,
thumbnailChannelId,
claim,
host
);
}
// create form data for main publish
publishFormData = createPublishFormData(file, thumbnail, publishMetadata);
@ -57,7 +73,7 @@ function * publishFile (action) {
publishChannel = yield call(makePublishRequestChannel, publishFormData, isUpdate);
while (true) {
const {loadStart, progress, load, success, error: publishError} = yield take(publishChannel);
const { loadStart, progress, load, success, error: publishError } = yield take(publishChannel);
if (publishError) {
return yield put(updatePublishStatus(publishStates.FAILED, publishError.message));
}
@ -67,7 +83,7 @@ function * publishFile (action) {
yield put({
type: 'ASSET_UPDATE_CLAIMDATA',
data: {
id : `a#${success.data.name}#${success.data.claimId}`,
id: `a#${success.data.name}#${success.data.claimId}`,
claimData: success.data.claimData,
},
});
@ -91,6 +107,6 @@ function * publishFile (action) {
}
}
export function * watchPublishStart () {
export function* watchPublishStart() {
yield takeLatest(actions.PUBLISH_START, publishFile);
};
}

View file

@ -4,12 +4,16 @@ export const selectAsset = show => {
const request = show.requestList[requestId] || null;
const assetList = show.assetList;
if (request && assetList) {
const assetKey = request.key; // note: just store this in the request
const assetKey = request.key; // note: just store this in the request
asset = assetList[assetKey] || null;
}
return asset;
};
export const selectShowState = (state) => {
export const selectShowState = state => {
return state.show;
};
export const selectDetailsExpanded = state => {
return state.show.detailsExpanded;
};

View file

@ -5,6 +5,7 @@ export const createPublishMetadata = (
publishInChannel,
selectedChannel
) => {
// this metadata stuff needs to be removed...
let metadata = {
name: claim,
title,

View file

@ -1,6 +1,6 @@
# Configure your own spee.ch
_note: this guide assumes you have done the [quickstart](https://github.com/lbryio/spee.ch/blob/readme-update/README.md) or [fullstart](https://github.com/lbryio/spee.ch/blob/readme-update/fullstart.md) guide and have a working spee.ch server_
_note: this guide assumes you have done the [quickstart](https://github.com/lbryio/spee.ch/blob/master/README.md) or [fullstart](https://github.com/lbryio/spee.ch/blob/master/fullstart.md) guide and have a working spee.ch server_
## Custom Components
The components used by spee.ch are taken from the `client/` folder, but you can override those components by defining your own in the `site/custom/` folder.

View file

@ -51,50 +51,50 @@ PUBLISHING:
}
SERVING:
"dynamicFileSizing": {
"enabled": false, - if you choose to allow your instance to serve transform images
"maxDimension": 2000 - the maximum size you allow transform to scale
},
"markdownSettings": {
"skipHtmlMain": true, - false: render html, in a somewhat unpredictable way~
"escapeHtmlMain": true, - true: rather than render html, escape it and print it visibly
"skipHtmlDescriptions": true, - as above, for descriptions
"escapeHtmlDescriptions": true, - as above, for descriptions
"allowedTypesMain": [], - markdown rendered as main content
"allowedTypesDescriptions": [], - markdown rendered in description in content details
"allowedTypesExample": [ - here are examples of allowed types
"see react-markdown docs", `https://github.com/rexxars/react-markdown`
"root",
"text",
"break",
"paragraph",
"emphasis",
"strong",
"thematicBreak",
"blockquote",
"delete",
"link",
"image", - you may not have a lot of control over how these are rendered
"linkReference",
"imageReference",
"table",
"tableHead",
"tableBody",
"tableRow",
"tableCell",
"list",
"listItem",
"heading",
"inlineCode",
"code",
"html", - potentially DANGEROUS, intended for `serveOnlyApproved = true` environments, includes iframes, divs.
"parsedHtml"
],
},
"customFileExtensions": { - suggest a file extension for experimental content types you may be publishing
"application/example-type": "example"
}
"dynamicFileSizing": {
"enabled": false, - if you choose to allow your instance to serve transform images
"maxDimension": 2000 - the maximum size you allow transform to scale
},
"markdownSettings": {
"skipHtmlMain": true, - false: render html, in a somewhat unpredictable way~
"escapeHtmlMain": true, - true: rather than render html, escape it and print it visibly
"skipHtmlDescriptions": true, - as above, for descriptions
"escapeHtmlDescriptions": true, - as above, for descriptions
"allowedTypesMain": [], - markdown rendered as main content
"allowedTypesDescriptions": [], - markdown rendered in description in content details
"allowedTypesExample": [ - here are examples of allowed types
"see react-markdown docs", `https://github.com/rexxars/react-markdown`
"root",
"text",
"break",
"paragraph",
"emphasis",
"strong",
"thematicBreak",
"blockquote",
"delete",
"link",
"image", - you may not have a lot of control over how these are rendered
"linkReference",
"imageReference",
"table",
"tableHead",
"tableBody",
"tableRow",
"tableCell",
"list",
"listItem",
"heading",
"inlineCode",
"code",
"html", - potentially DANGEROUS, intended for `serveOnlyApproved = true` environments, includes iframes, divs.
"parsedHtml"
],
},
"customFileExtensions": { - suggest a file extension for experimental content types you may be publishing
"application/example-type": "example"
}
STARTUP:

View file

@ -0,0 +1,15 @@
[Unit]
Description="LBRYnet daemon"
After=network.target
[Service]
Environment="HOME=/home/lbry"
ExecStart=/opt/lbry/lbrynet start
User=lbry
Group=lbry
Restart=on-failure
KillMode=process
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,16 @@
[Unit]
Description="LBRYnet daemon"
After=network.target
# Change environment to /home/{{USERNAME}}
[Service]
Environment="HOME=/home/{{USERNAME}}"
ExecStart=/opt/lbry/lbrynet start
User={{USERNAME}}
Group={{USERNAME}}
Restart=on-failure
KillMode=process
[Install]
WantedBy=multi-user.target

View file

@ -24,6 +24,8 @@
* Lbrynet DAEMON started on ports 3333 and 4444
* Spee.ch started on port 3000
_note: throughout this guide you'll be replacing `{{xyz}}` with `yourvalue` omitting the brackets_
# 1. Setup OS and install dependencies
## OS
@ -36,26 +38,27 @@ As root# _create user and add to sudo group_
su - username
```
As username: *paste public key in authorized\_keys*
```
`cd`
`mkdir .ssh`
`nano ~/.ssh/authorized_keys`
```
### Prep
Log in as username@domainname or username@ip_address
ssh to username@domainname or username@ip_address
`sudo apt-get update -y`
`ulimit -n 8192`
`wget -qO- https://deb.nodesource.com/setup_8.x | sudo -E bash -`
```
sudo apt-get update -y
ulimit -n 8192
wget -qO- https://deb.nodesource.com/setup_8.x | sudo -E bash -
```
## Git, Curl, Tmux, Unzip, ffmpeg, Node
## Git, Curl, Unzip, ffmpeg, imagemagick, Node
`sudo apt-get install git curl tmux unzip ffmpeg nodejs -y`
`sudo apt-get install git curl unzip ffmpeg nodejs imagemagick -y`
## Clone speech either from your own fork, or from the lbryio/spee.ch repo.
@ -67,7 +70,7 @@ Log in as username@domainname or username@ip_address
`git clone https://github.com/{{youraccount}}/spee.ch.git`
`git clone git@github.com:{{youraccount}}/spee.ch`
`git clone git@github.com:{{youraccount}}/spee.ch`
* For Publishers and Content creators - stable release
@ -78,24 +81,29 @@ Log in as username@domainname or username@ip_address
`chmod 750 -R ~/spee.ch/docs/setup`
# 2 Secure the UFW firewall
## UFW
`sudo ~/spee.ch/docs/setup/scripts/firewall.sh`
_if your distro isn't vanilla ubuntu 16 or 18, you may have to install it_
# 3 Install Caddy to handle https and reverse proxy
## Get Caddy
`curl https://getcaddy.com | sudo bash -s personal`
## Set up Caddy reverse proxy and ssl
`sudo mkdir -p /opt/caddy/logs/`
_Make Caddy's folders, copy the template, edit the Caddyfile, copy the caddyfile to its folder._
`sudo mkdir -p /opt/caddy/store/`
`cp ~/spee.ch/docs/setup/conf/caddy/Caddyfile.template ~/spee.ch/docs/setup/conf/caddy/Caddyfile`
`nano ~/spee.ch/docs/setup/conf/caddy/Caddyfile`
```
sudo mkdir -p /opt/caddy/logs/
sudo mkdir -p /opt/caddy/store/
cp ~/spee.ch/docs/setup/conf/caddy/Caddyfile.template ~/spee.ch/docs/setup/conf/caddy/Caddyfile
nano ~/spee.ch/docs/setup/conf/caddy/Caddyfile
```
( Change {{EXAMPLE.COM}} to YOURDOMAIN.COM )
@ -103,19 +111,15 @@ Log in as username@domainname or username@ip_address
## Set up Caddy to run as systemd service
`sudo cp ~/spee.ch/docs/setup/conf/caddy/caddy.service /etc/systemd/system/caddy.service`
`sudo chmod 644 /etc/systemd/system/caddy.service`
`sudo chown -R www-data:www-data /opt/caddy/`
`sudo setcap 'cap_net_bind_service=+ep' /usr/local/bin/caddy`
`sudo systemctl daemon-reload`
`sudo systemctl start caddy`
`sudo systemctl status caddy`
```
sudo cp ~/spee.ch/docs/setup/conf/caddy/caddy.service /etc/systemd/system/caddy.service
sudo chmod 644 /etc/systemd/system/caddy.service
sudo chown -R www-data:www-data /opt/caddy/
sudo setcap 'cap_net_bind_service=+ep' /usr/local/bin/caddy
sudo systemctl daemon-reload
sudo systemctl start caddy
sudo systemctl status caddy
```
`q` exits
@ -151,7 +155,7 @@ Log in as username@domainname or username@ip_address
mysql>
`ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_mysql_password';`
`ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'yourpassword123';`
mysql>
@ -165,78 +169,108 @@ Log in as username@domainname or username@ip_address
# 5 Get Lbrynet SDK Daemon
## Start tmux
tmux allows you to run multiple things in different sessions. Useful for manually starting daemons and watching its console logs.
`tmux`
* `Ctrl+b`, then `d` detaches leaving session running.
* `tmux`, reenters tmux, then
* `Ctrl+b`, `(` goes back to through sessions
## Get the SDK
`wget -O ~/latest_daemon.zip https://lbry.io/get/lbrynet.linux.zip`
`unzip -o -u ~/latest_daemon.zip`
We'll be putting it in /opt/lbry.
`sudo mkdir /opt/lbry`
`sudo wget -O /opt/lbry/latest_daemon.zip https://lbry.io/get/lbrynet.linux.zip`
`sudo unzip -o -u /opt/lbry/latest_daemon.zip -d /opt/lbry`
## Set up lbrynet to run as systemd service
We'll soon update the setup scripts. Meanwhile, here's an example lbrynet.service file. Again, fully replace {{USERNAME}}
```
[Unit]
Description="LBRYnet daemon"
After=network.target
# Replace {{USERNAME}} with your username, e.g. `bob` or `speechuser`
[Service]
Environment="HOME=/home/{{USERNAME}}"
ExecStart=/opt/lbry/lbrynet start
User={{USERNAME}}
Group={{USERNAME}}
Restart=on-failure
KillMode=process
[Install]
WantedBy=multi-user.target
```
`sudo nano /etc/systemd/system/lbrynet.service`
Then paste the above into the file and edit replacing {{USERNAME}} with yours.
Finally do the following.
```
sudo chmod 644 /etc/systemd/system/lbrynet.service
sudo systemctl daemon-reload
sudo systemctl start lbrynet
sudo systemctl status lbrynet
```
You'll find your lbrynet logs in ~/.local/share/lbry/lbrynet/lbrynet.log
Let's make our lives easier and link /opt/lbry/lbrynet in /usr/local/bin
`sudo ln -s /opt/lbry/lbrynet /usr/local/bin/lbrynet`
Now we can `lbrynet` without `/opt/lbry`. Let's make sure we're back in our home directory. `cd`
## Customize SDK settings
These settings will prevent you and your users from spending your server's LBC on paid content. Full documentation is [here](https://lbry.tech/resources/daemon-settings).
~$
`mkdir .lbrynet`
`cd .lbrynet`
`cd ~/.local/share/lbry/lbrynet`
`nano daemon_settings.yml`
copy and paste in the following code (Ctrl+Shift V)
_upnp is unnecessary for a vps but may be useful behind a properly configured NAT_
```
run_reflector_server: false
disable_max_key_fee: false
max_key_fee: {amount: 0, currency: LBC}
use_upnp: false
auto_re_reflect_interval: 0
```
`CONTROL+O` then `CONTROL+X` to save and exit
## Start the daemon
`./lbrynet start`
## Detatch tmux session
`Control + b`, then `d`
* `tmux` if you want to get back into tmux
* `Control+b`, then `)` while in tmux session to cycle back to your lbrynet session to see output
`tmux`
_note: `Control+b`, then `)` while in tmux session to cycle back to your lbrynet session to see output_
Restart lbrynet sdk:
`sudo systemctl restart lbrynet`
`sudo systemctl status lbrynet`
## Display wallet address to which to send 5+ LBC.
_note: These commands work when `./lbrynet start` is already running in another tmux session_
_note: These commands work when `lbrynet` is already running_
`./lbrynet commands` to check out the current commands
`lbrynet commands` to check out the current commands
`./lbrynet address_list` to get your wallet address
`lbrynet address list` to get your wallet address
`Ctrl + Shift + C` after highlighting an address to copy.
Use a LBRY app or daemon to send LBC to the address. Sending LBC may take a few seconds or longer.
`./lbrynet account_balance` to check your balance after you've sent LBC.
## Optional/Production: Set up lbrynet to run as a systemd service
`//coming soon`
`lbrynet account balance` to check your balance after you've sent LBC.
# 6 Set up spee.ch
## Build it
`cd spee.ch`
~/spee.ch:
@ -257,7 +291,8 @@ tmux allows you to run multiple things in different sessions. Useful for manuall
* Port: 3000
* Site Title: Your Site Name
* Enter your site's domain name: https://example.com or http://localhost:3000
* Enter a directory where uploads should be stored: (/home/lbry/Uploads)
* Enter a directory where uploads should be stored: (/home/{{username}}/Uploads) *
_* if you're not sure, `pwd`_
`npm run build` (or `npm run dev` to build for developing)
@ -270,15 +305,34 @@ tmux allows you to run multiple things in different sessions. Useful for manuall
# 7 Production
## pm2 to keep your speech app running
```
npm install -g pm2
```
If your server is running in the terminal from the last section, `Control+C` it.
`sudo npm install -g pm2` _There are tutorials online for avoiding sudo for npm i -g_
`cd spee.ch`
`pm2 start npm --name speech -- run start`
While pm2 installed this way will restart the server, it will not rebuild it on changes. You'll do that manually as discussed before.
### 7 Maintenance Procedures
#### Change daemon
* backup wallet (private keys!) to a safe place
* wget daemon from https://github.com/lbryio/lbry/releases
* wget -O ~/your_name_daemon.zip https://your_copied_file_path.zip
* rm ./lbrynet
* unzip -o -u ~/your_name_daemon.zip
#### Update sdk daemon
* Backup wallet (private keys!) to a safe place. It should be in ~/.local/share/lbry/lbryum/wallets.
* `lbrynet stop`
* Following the instructions in 5: Get the SDK will rename the old daemon and give you the new one.
* `lbrynet start`
* `lbrynet version`
* `lbrynet account balance`
#### Update speech
* Read the release notes to see if there are any breaking changes, address them
* `pm2 stop speech`
* `git pull origin release` (assuming you cloned release)
* `npm i` if necessary
* `npm run build`
* `pm2 start speech`
* Have an exotic energy drink

View file

@ -1,74 +1,82 @@
# Create Your Own Spee.ch!
## 1. Prerequisites
### You will need the following tools installed
* Node (v8 LTS).
* Make sure you install from the **Node** website [link](https://nodejs.org/en/download/).
* npm (should come installed with Node).
* Git
* Curl
* Tmux
* Unzip
- Node (v8 LTS).
- Make sure you install from the **Node** website [link](https://nodejs.org/en/download/).
- npm (should come installed with Node).
- Git
- Curl
- Tmux
- Unzip
### Make sure **npm** is up-to-date.
```
$ npm update
```
### Setup a Webserver to serve **Spee.ch** from Port **3000**.
* If you are using a server provided by **lbry**, we will have **caddy** installed already.
* If you are using your own server, make sure to have a web server installed and set up to serve from port **3000**.
* Nginx instructions (recommended).
* Insert directions for certbot before installing.
* Install [Nginx](http://nginx.org/en/docs/install.html).
* Create a config file called `spee.ch` in */etc/nginx/sites-available*
* see example: [config file](https://github.com/lbryio/spee.ch/blob/master/nginx_example_config).
* Rename all mentions of *sub.domain.com* with your subdomain name.
* Run this command to link the sites-available.
- If you are using a server provided by **lbry**, we will have **caddy** installed already.
- If you are using your own server, make sure to have a web server installed and set up to serve from port **3000**.
- Nginx instructions (recommended).
- Insert directions for certbot before installing.
- Install [Nginx](http://nginx.org/en/docs/install.html).
- Create a config file called `spee.ch` in _/etc/nginx/sites-available_
- see example: [config file](https://github.com/lbryio/spee.ch/blob/master/nginx_example_config).
- Rename all mentions of _sub.domain.com_ with your subdomain name.
- Run this command to link the sites-available.
`$ ln -s /etc/nginx/sites-available/speech /etc/nginx/sites-enabled/speech`
* Restart Nginx.
- Restart Nginx.
`$ sudo service nginx restart`
* Try visiting your website.
* If Nginx is working, you should get a **502** error because there is nothing running on **3000** yet.
* If you get the default Nginx greeting, you have not properly configured it to serve from port **3000**.
* You can find logs in */var/log/nginx/* too.
* Caddy tutorial: [https://caddyserver.com/tutorial](https://caddyserver.com/tutorial)
- Try visiting your website.
- If Nginx is working, you should get a **502** error because there is nothing running on **3000** yet.
- If you get the default Nginx greeting, you have not properly configured it to serve from port **3000**.
- You can find logs in _/var/log/nginx/_ too.
- Caddy tutorial: [https://caddyserver.com/tutorial](https://caddyserver.com/tutorial)
### MySql
* Install MySql
* [Instructions](https://dev.mysql.com/doc/mysql-installation-excerpt/5.7/en)
* Create user **root**.
* Note: We are going to access **mysql** as **root** for this setup, but you may want to create a separate user in the future.
* Keep your password somewhere handy!
* Create a database called **lbry** and make sure you can use it.
- Install MySql
- [Instructions](https://dev.mysql.com/doc/mysql-installation-excerpt/5.7/en)
- Create user **root**. \* Note: We are going to access **mysql** as **root** for this setup, but you may want to create a separate user in the future.
- Keep your password somewhere handy!
- Create a database called **lbry** and make sure you can use it.
`CREATE DATABASE lbry;`
`CREATE DATABASE lbry;`
`$ USE lbry;`
`$ USE lbry;`
`$ exit; (or press ctl + d)`
`$ exit; (or press ctl + d)`
* Try logging into mysql.
- Try logging into mysql.
`$ mysql -u username -p`
`$ mysql -u username -p`
* If you are using a **LBRY** server, your **password** is the one provided for **ssh**.
* Note: If it fails, try using `sudo`.
- If you are using a **LBRY** server, your **password** is the one provided for **ssh**.
- Note: If it fails, try using `sudo`.
##2. Install & Run the LBRY Daemon
##2. Install & Run the LBRY Daemon
### Install **lbrynet**
_note: if you have a server from LBRY, lbrynet is already installed, you can skip to 2.4._
```
$ wget --quiet -O ~/latest_daemon.zip https://lbry.io/get/lbrynet.linux.zip
$ wget --quiet -O ~/latest_daemon.zip https://lbry.com/get/lbrynet.linux.zip
$ unzip -o -u "~/latest_daemon.zip"
```
### Start lbrynet
```
$ tmux
$ ./lbrynet-daemon
@ -100,7 +108,7 @@ You should have **LBC**!
directions: [here](https://www.ffmpeg.org/download.html)
## 3. Set up Spee.ch
## 3. Set up Spee.ch
### Clone the spee.ch repo
@ -127,6 +135,7 @@ $ npm run configure
```
Check your site configs
```
$ cd /site/config/
$ nano siteConfig.json
@ -135,6 +144,7 @@ $ nano siteConfig.json
### Build & run
Run the below command to transpile, build, and start your server.
```
$ npm run start
```
@ -145,17 +155,18 @@ Spee.ch should now be running !
Visit your site in the browser. Try publishing an image!
## 4. Bonus:
### Install PM2 and run your server with PM2
Install PM2
```
$ sudo npm i -g pm2
```
From inside your projects folder, start your server with PM2.
```
$ pm2 start server.js
```

974
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -36,11 +36,12 @@
"@fortawesome/fontawesome-svg-core": "^1.2.8",
"@fortawesome/free-solid-svg-icons": "^5.5.0",
"@fortawesome/react-fontawesome": "^0.1.3",
"axios": "^0.18.0",
"axios": "^0.18.1",
"bcrypt": "^3.0.3",
"body-parser": "^1.18.3",
"connect-multiparty": "^2.2.0",
"cookie-session": "^2.0.0-beta.3",
"cors": "^2.8.5",
"express": "^4.16.4",
"express-handlebars": "^3.0.0",
"express-http-context": "^1.2.0",
@ -51,7 +52,8 @@
"image-size": "^0.6.3",
"inquirer": "^5.2.0",
"ip": "^1.1.5",
"lodash": "^4.17.11",
"isbot": "^2.2.1",
"lodash": "^4.17.13",
"make-dir": "^1.3.0",
"mime-types": "^2.1.21",
"module-alias": "^2.1.0",
@ -66,6 +68,7 @@
"react-feather": "^1.1.4",
"react-ga": "^2.5.3",
"react-helmet": "^5.2.0",
"react-image": "^2.0.0",
"react-markdown": "^4.0.6",
"react-redux": "^5.1.1",
"react-router-dom": "^4.3.1",

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View file

@ -82,6 +82,7 @@ export default (db, table, sequelize) => ({
};
const selectWhere = {
...whereClause,
claim_type: 1,
publisher_id: channelClaimId,
};
return await table
@ -103,6 +104,7 @@ export default (db, table, sequelize) => ({
.findAll({
where: {
name: claimName,
claim_type: 1,
publisher_id: channelClaimId,
bid_state: { [sequelize.Op.or]: ['Controlling', 'Active', 'Accepted'] },
},
@ -201,6 +203,10 @@ export default (db, table, sequelize) => ({
}
return claimArray[0];
})
.catch(error => {
logger.verbose(`resolveClaim failed: ${error}`)
reject(error);
});
},
@ -210,6 +216,7 @@ export default (db, table, sequelize) => ({
.findAll({
where: {
name: claimName,
claim_type: 1,
publisher_id: channelId,
},
})

View file

@ -9,28 +9,28 @@ const authenticateUser = require('../publish/authentication.js');
*/
const claimAbandon = async (req, res) => {
const {claimId} = req.body;
const {user} = req;
const { outpoint } = req.body;
const { user } = req;
try {
const [channel, claim] = await Promise.all([
authenticateUser(user.channelName, null, null, user),
db.Claim.findOne({where: {claimId}}),
db.Claim.findOne({ where: { outpoint } }),
]);
if (!claim) throw new Error('That channel does not exist');
if (!channel.channelName) throw new Error('You don\'t own this channel');
if (!channel.channelName) throw new Error("You don't own this channel");
await abandonClaim({claimId});
const file = await db.File.findOne({where: {claimId}});
await abandonClaim({ outpoint });
const file = await db.File.findOne({ where: { outpoint } });
await Promise.all([
deleteFile(file.filePath),
db.File.destroy({where: {claimId}}),
db.Claim.destroy({where: {claimId}}),
db.File.destroy({ where: { outpoint } }),
db.Claim.destroy({ where: { outpoint } }),
]);
logger.debug(`Claim abandoned: ${claimId}`);
logger.debug(`Claim abandoned: ${outpoint}`);
res.status(200).json({
success: true,
message: `Claim with id ${claimId} abandonded`,
message: `Claim with outpoint ${outpoint} abandonded`,
});
} catch (error) {
logger.error('abandon claim error:', error);

View file

@ -1,4 +1,4 @@
const { getClaim } = require('server/lbrynet');
const { getClaim, resolveUri } = require('server/lbrynet');
const { createFileRecordDataAfterGet } = require('server/models/utils/createFileRecordData.js');
const { handleErrorResponse } = require('../../../utils/errorHandlers.js');
const getClaimData = require('server/utils/getClaimData');
@ -6,6 +6,7 @@ const chainquery = require('chainquery').default;
const db = require('server/models');
const logger = require('winston');
const awaitFileSize = require('server/utils/awaitFileSize');
const isBot = require('isbot');
/*
@ -13,14 +14,14 @@ const awaitFileSize = require('server/utils/awaitFileSize');
*/
const claimGet = async ({ ip, originalUrl, params }, res) => {
const claimGet = async ({ ip, originalUrl, params, headers }, res) => {
const name = params.name;
const claimId = params.claimId;
try {
let claimInfo = await chainquery.claim.queries.resolveClaim(name, claimId).catch(() => {});
if (claimInfo) {
logger.info('claim/get: claim resolved in chainquery');
logger.debug(`claim/get: claim resolved in chainquery`);
}
if (!claimInfo) {
claimInfo = await db.Claim.resolveClaim(name, claimId);
@ -28,6 +29,16 @@ const claimGet = async ({ ip, originalUrl, params }, res) => {
if (!claimInfo) {
throw new Error('claim/get: resolveClaim: No matching uri found in Claim table');
}
if (headers && headers['user-agent'] && isBot(headers['user-agent'])) {
logger.info(`Bot GetClaim: claimId: ${claimId}`);
res.status(200).json({
success: true,
message: 'bot',
completed: false,
});
return true;
}
logger.info(`GetClaim: ${claimId} UA: ${headers['user-agent']}`);
let lbrynetResult = await getClaim(`${name}#${claimId}`);
if (!lbrynetResult) {
throw new Error(`claim/get: getClaim Unable to Get ${name}#${claimId}`);

View file

@ -36,7 +36,7 @@ const claimLongId = ({ ip, originalUrl, body, params }, res) => {
return db.Blocked.isNotBlocked(outpoint);
})
.then(() => {
res.status(200).json({success: true, data: claimId});
res.status(200).json({ success: true, data: claimId });
})
.catch(error => {
if (error === NO_CLAIM) {
@ -54,7 +54,8 @@ const claimLongId = ({ ip, originalUrl, body, params }, res) => {
if (error === BLOCKED_CLAIM) {
return res.status(410).json({
success: false,
message: 'In response to a complaint we received under the US Digital Millennium Copyright Act, we have blocked access to this content from our applications. For more details, see https://lbry.io/faq/dmca',
message:
'In response to a complaint we received under the US Digital Millennium Copyright Act, we have blocked access to this content from our applications. For more details, see https://lbry.com/faq/dmca',
});
}
handleErrorResponse(originalUrl, ip, error, res);

View file

@ -33,25 +33,26 @@ const createPublishParams = (
name,
file_path: filePath,
bid: publishing.fileClaimBidAmount,
metadata: {
description,
title,
author: details.title,
language: 'en',
license,
licenseUrl,
nsfw,
},
description,
title,
author: details.title,
languages: ['en'],
license,
license_url: licenseUrl,
tags: [],
claim_address: publishing.primaryClaimAddress,
};
// add thumbnail to channel if video
if (thumbnail) {
publishParams['metadata']['thumbnail'] = thumbnail;
publishParams['thumbnail_url'] = thumbnail;
}
if (nsfw) {
publishParams.tags = ['mature'];
}
// add channel details if publishing to a channel
if (channelName && channelClaimId) {
publishParams['channel_name'] = channelName;
publishParams['channel_id'] = channelClaimId;
publishParams['channel_name'] = channelName;
}
// log params
logger.debug('publish params:', publishParams);

View file

@ -7,19 +7,25 @@ const createThumbnailPublishParams = (thumbnailFilePath, claimName, license, lic
}
logger.debug(`Creating Thumbnail Publish Parameters`);
// create the publish params
if (license === null || license.trim() === '') {
license = ''; // default to empty string
}
// provide default for licenseUrl
if (licenseUrl === null || licenseUrl.trim() === '') {
licenseUrl = ''; // default to empty string
}
return {
name: `${claimName}-thumb`,
file_path: thumbnailFilePath,
bid: publishing.fileClaimBidAmount,
metadata: {
title: `${claimName} thumbnail`,
description: `a thumbnail for ${claimName}`,
author: details.title,
language: 'en',
license,
licenseUrl,
nsfw,
},
title: `${claimName} thumbnail`,
description: `a thumbnail for ${claimName}`,
author: details.title,
languages: ['en'],
license,
license_url: licenseUrl,
claim_address: publishing.primaryClaimAddress,
channel_name: publishing.thumbnailChannel,
channel_id: publishing.thumbnailChannelId,

View file

@ -141,12 +141,12 @@ const claimPublish = ({ body, files, headers, ip, originalUrl, user, tor }, res)
return publish(publishParams, fileName, fileType, filePath);
})
.then(publishResults => {
logger.info('Publish success >', publishResults);
logger.debug('Publish success >', publishResults);
claimData = publishResults;
({ claimId } = claimData);
if (channelName) {
logger.info(`api/claim/publish: claimData.certificateId ${claimData.certificateId}`);
logger.debug(`api/claim/publish: claimData.certificateId ${claimData.certificateId}`);
return chainquery.claim.queries.getShortClaimIdFromLongClaimId(
claimData.certificateId,
channelName

View file

@ -1,8 +1,10 @@
const logger = require('winston');
const db = require('../../../../models');
const { publishClaim } = require('../../../../lbrynet');
const { createFileRecordDataAfterPublish } = require('../../../../models/utils/createFileRecordData.js');
const { createClaimRecordDataAfterPublish } = require('../../../../models/utils/createClaimRecordData.js');
const db = require('server/models');
const { publishClaim } = require('server/lbrynet');
const { createFileRecordDataAfterPublish } = require('server/models/utils/createFileRecordData.js');
const {
createClaimRecordDataAfterPublish,
} = require('server/models/utils/createClaimRecordData.js');
const deleteFile = require('./deleteFile.js');
const publish = async (publishParams, fileName, fileType) => {
@ -10,58 +12,76 @@ const publish = async (publishParams, fileName, fileType) => {
let channel;
let fileRecord;
let newFile = Boolean(publishParams.file_path);
let publishResultsOutput;
try {
publishResults = await publishClaim(publishParams);
logger.info(`Successfully published ${publishParams.name} ${fileName}`, publishResults);
const outpoint = `${publishResults.output.txid}:${publishResults.output.nout}`;
// get the channel information
if (publishParams.channel_name) {
logger.debug(`this claim was published in channel: ${publishParams.channel_name}`);
channel = await db.Channel.findOne({
where: {
channelName: publishParams.channel_name,
},
});
} else {
channel = null;
}
const certificateId = channel ? channel.channelClaimId : null;
const channelName = channel ? channel.channelName : null;
publishResultsOutput = publishResults && publishResults.outputs && publishResults.outputs[0];
const claimRecord = await createClaimRecordDataAfterPublish(certificateId, channelName, fileName, fileType, publishParams, publishResults);
const {claimId} = claimRecord;
const upsertCriteria = {name: publishParams.name, claimId};
logger.verbose(`Successfully published ${publishParams.name} ${fileName}`, publishResults);
const outpoint = `${publishResultsOutput.txid}:${publishResultsOutput.nout}`;
// get the channel information
// if (publishParams.channel_name) {
// logger.debug(`this claim was published in channel: ${publishParams.channel_name}`);
// channel = await db.Channel.findOne({
// where: {
// channelName: publishParams.channel_name,
// },
// });
// } else {
// channel = null;
// }
const certificateId = publishResultsOutput.signing_channel
? publishResultsOutput.signing_channel.claim_id
: null;
const channelName = publishResultsOutput.signing_channel
? publishResultsOutput.signing_channel.name
: null;
const claimRecord = await createClaimRecordDataAfterPublish(
certificateId,
channelName,
fileName,
fileType,
publishParams,
publishResultsOutput
);
const { claimId } = claimRecord;
const upsertCriteria = { name: publishParams.name, claimId };
if (newFile) {
// this is the problem
//
fileRecord = await createFileRecordDataAfterPublish(fileName, fileType, publishParams, publishResults);
fileRecord = await createFileRecordDataAfterPublish(
fileName,
fileType,
publishParams,
publishResultsOutput
);
} else {
fileRecord = await db.File.findOne({where: {claimId}}).then(result => result.dataValues);
fileRecord = await db.File.findOne({ where: { claimId } }).then(result => result.dataValues);
}
const [file, claim] = await Promise.all([
db.upsert(db.File, fileRecord, upsertCriteria, 'File'),
db.upsert(db.Claim, claimRecord, upsertCriteria, 'Claim'),
]);
logger.info(`File and Claim records successfully created (${publishParams.name})`);
logger.debug(`File and Claim records successfully created (${publishParams.name})`);
await Promise.all([
file.setClaim(claim),
claim.setFile(file),
]);
logger.info(`File and Claim records successfully associated (${publishParams.name})`);
await Promise.all([file.setClaim(claim), claim.setFile(file)]);
logger.debug(`File and Claim records successfully associated (${publishParams.name})`);
return Object.assign({}, claimRecord, {outpoint});
return Object.assign({}, claimRecord, { outpoint });
} catch (err) {
// parse daemon response when err is a string
// this needs work
logger.info('publish/publish err:', err);
logger.error('publish/publish err:', err);
const error = typeof err === 'string' ? JSON.parse(err) : err;
if (publishParams.file_path) {
await deleteFile(publishParams.file_path);
}
const message = error.error && error.error.message ? error.error.message : 'Unknown publish error';
const message =
error.error && error.error.message ? error.error.message : 'Unknown publish error';
return {
error: true,
message,

View file

@ -38,7 +38,7 @@ const rando = () => {
const claimUpdate = ({ body, files, headers, ip, originalUrl, user, tor }, res) => {
// logging
logger.info('Claim update request:', {
logger.debug('Claim update request:', {
ip,
headers,
body,
@ -138,7 +138,7 @@ const claimUpdate = ({ body, files, headers, ip, originalUrl, user, tor }, res)
nsfw: claimRecord.nsfw,
license: claimRecord.license,
licenseUrl: claimRecord.license_url,
language: 'en',
languages: ['en'],
author: details.title,
},
updateMetadata({ title, description, nsfw, license, licenseUrl })
@ -149,9 +149,19 @@ const claimUpdate = ({ body, files, headers, ip, originalUrl, user, tor }, res)
claim_address: primaryClaimAddress,
channel_name: channelName,
channel_id: channelId,
metadata,
title,
description,
author: details.title,
languages: ['en'],
license: license || '',
license_url: licenseUrl || '',
tags: [],
};
if (nsfw) {
publishParams.tags = ['mature'];
}
if (files.file) {
if (thumbnailUpdate) {
// publish new thumbnail
@ -185,14 +195,14 @@ const claimUpdate = ({ body, files, headers, ip, originalUrl, user, tor }, res)
if (channelName) {
return chainquery.claim.queries.getShortClaimIdFromLongClaimId(
result.certificateId,
publishResult.certificateId,
channelName
);
} else {
return chainquery.claim.queries
.getShortClaimIdFromLongClaimId(result.claimId, name, result)
.getShortClaimIdFromLongClaimId(publishResult.claimId, name, publishResult)
.catch(() => {
return result.claimId.slice(0, 1);
return publishResult.claimId.slice(0, 1);
});
}
})

View file

@ -1,5 +1,9 @@
const logger = require('winston');
const { handleErrorResponse } = require('../../../utils/errorHandlers.js');
const db = require('../../../../models');
const { getFileListFileByOutpoint } = require('server/lbrynet');
const chainquery = require('chainquery').default;
/*
@ -10,18 +14,24 @@ const db = require('../../../../models');
const fileAvailability = ({ ip, originalUrl, params }, res) => {
const name = params.name;
const claimId = params.claimId;
db.File
.findOne({
where: {
name,
claimId,
},
logger.verbose(`fileAvailability params: name:${name} claimId:${claimId}`);
// TODO: we probably eventually want to check the publishCache for the claimId too,
// and shop the outpoint to file_list.
return chainquery.claim.queries
.resolveClaim(name, claimId)
.then(result => {
return `${result.dataValues.transaction_hash_id}:${result.dataValues.vout}`;
})
.then(outpoint => {
logger.debug(`fileAvailability: outpoint: ${outpoint}`);
return getFileListFileByOutpoint(outpoint);
})
.then(result => {
if (result) {
return res.status(200).json({success: true, data: true});
if (result && result[0]) {
return res.status(200).json({ success: true, data: true });
} else {
res.status(200).json({ success: true, data: false });
}
res.status(200).json({success: true, data: false});
})
.catch(error => {
handleErrorResponse(originalUrl, ip, error, res);

View file

@ -64,18 +64,19 @@ const getClaimIdAndServeAsset = (
claimDataValues.outpoint ||
`${claimDataValues.transaction_hash_id}:${claimDataValues.vout}`;
logger.debug('Outpoint:', outpoint);
return db.Blocked.isNotBlocked(outpoint).then(() => {
return db.Blocked.isNotBlocked(outpoint)
// .then(() => {
// If content was found, is approved, and not blocked - log a view.
if (headers && headers['user-agent'] && /LBRY/.test(headers['user-agent']) === false) {
db.Views.create({
time: Date.now(),
isChannel: false,
claimId: claimDataValues.claim_id || claimDataValues.claimId,
publisherId: claimDataValues.publisher_id || claimDataValues.certificateId,
ip,
});
}
});
// if (headers && headers['user-agent'] && /LBRY/.test(headers['user-agent']) === false) {
// db.Views.create({
// time: Date.now(),
// isChannel: false,
// claimId: claimDataValues.claim_id || claimDataValues.claimId,
// publisherId: claimDataValues.publisher_id || claimDataValues.certificateId,
// ip,
// });
// }
// });
})
.then(() => {
return db.File.findOne({
@ -118,7 +119,7 @@ const getClaimIdAndServeAsset = (
return res.status(451).json({
success: false,
message:
'In response to a complaint we received under the US Digital Millennium Copyright Act, we have blocked access to this content from our applications. For more details, see https://lbry.io/faq/dmca',
'In response to a complaint we received under the US Digital Millennium Copyright Act, we have blocked access to this content from our applications. For more details, see https://lbry.com/faq/dmca',
});
}
if (error === NO_FILE) {

View file

@ -20,10 +20,7 @@ const { setupBlockList } = require('./utils/blockList');
const speechPassport = require('./speechPassport');
const processTrending = require('./utils/processTrending');
const {
logMetricsMiddleware,
setRouteDataInContextMiddleware,
} = require('./middleware/logMetricsMiddleware');
const { setRouteDataInContextMiddleware } = require('./middleware/httpContextMiddleware');
const {
details: { port: PORT, blockListEndpoint },
@ -75,7 +72,7 @@ function Server() {
res
.status(403)
.send(
'<h1>Forbidden</h1>If you are seeing this by mistake, please contact us using <a href="https://chat.lbry.io/">https://chat.lbry.io/</a>'
'<h1>Forbidden</h1>If you are seeing this by mistake, please contact us using <a href="https://chat.lbry.com/">https://chat.lbry.com/</a>'
);
res.end();
} else {
@ -145,7 +142,7 @@ function Server() {
app[routeMethod](
routePath,
logMetricsMiddleware,
// logMetricsMiddleware,
setRouteDataInContextMiddleware(routePath, routeData),
...controllers
);
@ -195,7 +192,7 @@ function Server() {
'Continuing with default LBRY blocklist api endpoint. \n ' +
'(Specify /"blockListEndpoint" : ""/ to disable.'
);
finalBlockListEndpoint = 'https://api.lbry.io/file/list_blocked';
finalBlockListEndpoint = 'https://api.lbry.com/file/list_blocked';
}
}
logger.info(`Peforming updates...`);

View file

@ -73,13 +73,14 @@ module.exports = {
});
});
},
async abandonClaim({ claimId }) {
logger.debug(`lbryApi >> Abandon claim "${claimId}"`);
async abandonClaim({ outpoint }) {
logger.debug(`lbryApi >> Abandon claim "${outpoint}"`);
const gaStartTime = Date.now();
const [txid, nout] = outpoint.split(':');
try {
const abandon = await axios.post(lbrynetUri, {
method: 'claim_abandon',
params: { claim_id: claimId },
method: 'stream_abandon',
params: { txid: txid, nout: Number(nout) },
});
sendGATimingEvent('lbrynet', 'abandonClaim', 'ABANDON_CLAIM', gaStartTime, Date.now());
return abandon.data;
@ -153,7 +154,7 @@ module.exports = {
Date.now()
);
if (data.result) {
resolve(data.result.download_directory);
resolve(data.result.download_dir);
} else {
return new Error(
'Successfully connected to lbry daemon, but unable to retrieve the download directory.'
@ -172,10 +173,10 @@ module.exports = {
return new Promise((resolve, reject) => {
axios
.post(lbrynetUri, {
method: 'channel_new',
method: 'channel_create',
params: {
channel_name: name,
amount: publishing.channelClaimBidAmount,
name: name,
bid: publishing.channelClaimBidAmount,
},
})
.then(response => {

View file

@ -1,28 +1,52 @@
const fs = require('fs');
const logger = require('winston');
const { publishing: { publishingChannelWhitelist } } = require('@config/siteConfig');
const {
publishing: { publishingChannelWhitelist },
} = require('@config/siteConfig');
const ipBanFile = './site/config/ipBan.txt';
const forbiddenMessage = '<h1>Forbidden</h1>If you are seeing this by mistake, please contact us using <a href="https://chat.lbry.io/">https://chat.lbry.io/</a>';
const ipWhitelist = './site/config/ipWhitelist.txt';
const forbiddenMessage =
'<h1>Forbidden</h1>If you are seeing this by mistake, please contact us using <a href="https://chat.lbry.com/">https://chat.lbry.com/</a>';
const maxPublishesInTenMinutes = 20;
let ipCounts = {};
let blockedAddresses = [];
let whitelistedAddresses = [];
if (fs.existsSync(ipBanFile)) {
const lineReader = require('readline').createInterface({
input: require('fs').createReadStream(ipBanFile),
});
lineReader.on('line', (line) => {
lineReader.on('line', line => {
if (line && line !== '') {
blockedAddresses.push(line);
}
});
}
// If a file called ipWhitelist.txt exists
// Please comment above each whitelisted IP why/who/when etc
// # Jim because he's awesome - January 2018
if (fs.existsSync(ipWhitelist)) {
const lineReader = require('readline').createInterface({
input: require('fs').createReadStream(ipWhitelist),
});
lineReader.on('line', line => {
if (line && line !== '' && line[0] !== '#') {
whitelistedAddresses.push(line);
}
});
}
const autoblockPublishMiddleware = (req, res, next) => {
let ip = (req.headers['x-forwarded-for'] || req.connection.remoteAddress).split(/,\s?/)[0];
if (whitelistedAddresses.indexOf(ip) !== -1) {
next();
return;
}
if (blockedAddresses.indexOf(ip) !== -1) {
res.status(403).send(forbiddenMessage);
res.end();
@ -30,7 +54,7 @@ const autoblockPublishMiddleware = (req, res, next) => {
return;
}
let count = ipCounts[ip] = (ipCounts[ip] || 0) + 1;
let count = (ipCounts[ip] = (ipCounts[ip] || 0) + 1);
setTimeout(() => {
if (ipCounts[ip]) {
@ -41,7 +65,7 @@ const autoblockPublishMiddleware = (req, res, next) => {
}
}, 600000 /* 10 minute retainer */);
if (count === 10) {
if (count === maxPublishesInTenMinutes) {
logger.error(`Banning IP: ${ip}`);
blockedAddresses.push(ip);
res.status(403).send(forbiddenMessage);

View file

@ -0,0 +1,13 @@
const httpContext = require('express-http-context');
function setRouteDataInContextMiddleware(routePath, routeData) {
return function(req, res, next) {
httpContext.set('routePath', routePath);
httpContext.set('routeData', routeData);
next();
};
}
module.exports = {
setRouteDataInContextMiddleware,
};

View file

@ -388,7 +388,9 @@ module.exports = (sequelize, { STRING, BOOLEAN, INTEGER, TEXT, DECIMAL }) => {
return new Promise((resolve, reject) => {
this.fetchClaim(name, claimId)
.then(claim => {
logger.info('resolveClaim claims:', claim);
logger.debug(
`resolveClaim: ${name}, ${claimId}, -> certificateId: ${claim && claim.certificateId}`
);
if (
serveOnlyApproved &&
!isApprovedChannel({ longId: claim.certificateId }, approvedChannels)

View file

@ -1,42 +1,42 @@
const db = require('../index.js');
const createClaimRecordDataAfterPublish = (certificateId, channelName, fileName, fileType, publishParams, publishResults) => {
const createClaimRecordDataAfterPublish = (
certificateId,
channelName,
fileName,
fileType,
publishParams,
publishResultsOutput
) => {
const {
name,
metadata: {
title,
description,
thumbnail,
nsfw,
},
title,
description,
thumbnail,
nsfw,
claim_address: address,
bid: amount,
} = publishParams;
const {
claim_id: claimId,
txid,
nout,
} = publishResults;
const { claim_id: claimId, txid, nout } = publishResultsOutput;
return db.Claim.getCurrentHeight()
.then(height => {
return {
name,
claimId,
title,
description,
address,
thumbnail,
outpoint : `${txid}:${nout}`,
height,
contentType: fileType,
nsfw,
amount,
certificateId,
channelName,
};
});
return db.Claim.getCurrentHeight().then(height => {
return {
name,
claimId,
title,
description,
address,
thumbnail,
outpoint: `${txid}:${nout}`,
height,
contentType: fileType,
nsfw,
amount,
certificateId,
channelName,
};
});
};
module.exports = {

View file

@ -1,22 +1,11 @@
const getMediaDimensions = require('../../utils/getMediaDimensions.js');
async function createFileRecordDataAfterGet (resolveResult, getResult) {
const {
name,
claimId,
outpoint,
contentType: fileType,
} = resolveResult;
async function createFileRecordDataAfterGet(resolveResult, getResult) {
const { name, claimId, outpoint, contentType: fileType } = resolveResult;
const {
file_name: fileName,
download_path: filePath,
} = getResult;
const { file_name: fileName, download_path: filePath } = getResult;
const {
height: fileHeight,
width: fileWidth,
} = await getMediaDimensions(fileType, filePath);
const { height: fileHeight, width: fileWidth } = await getMediaDimensions(fileType, filePath);
return {
name,
@ -30,22 +19,17 @@ async function createFileRecordDataAfterGet (resolveResult, getResult) {
};
}
async function createFileRecordDataAfterPublish (fileName, fileType, publishParams, publishResults) {
const {
name,
file_path: filePath,
} = publishParams;
async function createFileRecordDataAfterPublish(
fileName,
fileType,
publishParams,
publishResultsOutput
) {
const { name, file_path: filePath } = publishParams;
const {
claim_id: claimId,
txid,
nout,
} = publishResults;
const { claim_id: claimId, txid, nout } = publishResultsOutput;
const {
height: fileHeight,
width: fileWidth,
} = await getMediaDimensions(fileType, filePath);
const { height: fileHeight, width: fileWidth } = await getMediaDimensions(fileType, filePath);
return {
name,

View file

@ -8,6 +8,7 @@ import createSagaMiddleware from 'redux-saga';
import { call } from 'redux-saga/effects';
import Helmet from 'react-helmet';
import * as httpContext from 'express-http-context';
import logger from 'winston';
import Reducers from '@reducers';
import GAListener from '@components/GAListener';
@ -92,6 +93,7 @@ export default (req, res) => {
const preloadedState = store.getState();
// send the rendered page back to the client
res.send(renderFullPage(helmet, html, preloadedState));
};
@ -121,8 +123,8 @@ export default (req, res) => {
}
if (canonicalUrl && canonicalUrl !== req.originalUrl) {
console.log(`redirecting ${req.originalUrl} to ${canonicalUrl}`);
res.redirect(canonicalUrl);
logger.verbose(`redirecting ${req.originalUrl} to ${canonicalUrl}`);
return res.redirect(canonicalUrl);
}
return renderPage(store);

View file

@ -3,7 +3,7 @@ const path = require('path');
const bundlePath = path.resolve('./public/bundle/bundle.js');
const bundleHash = md5File.sync(bundlePath);
const shortBundleHash = bundleHash.substring(0,4);
const shortBundleHash = bundleHash.substring(0, 4);
module.exports = (helmet, html, preloadedState) => {
// take the html and preloadedState and return the full page
@ -14,6 +14,7 @@ module.exports = (helmet, html, preloadedState) => {
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="google-site-verification" content="U3240KfVplLZSRCcOHxGuDFQO6eVUXKeFsSD2WJvdLo" />
<!--helmet-->
${helmet.title.toString()}
${helmet.meta.toString()}
@ -27,7 +28,10 @@ module.exports = (helmet, html, preloadedState) => {
<body>
<div id="react-app">${html}</div>
<script>
window.__PRELOADED_STATE__ = ${JSON.stringify(preloadedState).replace(/</g, '\\\u003c')}
window.__PRELOADED_STATE__ = ${JSON.stringify(preloadedState).replace(
/</g,
'\\\u003c'
)}
</script>
<script src="/bundle/bundle.js?${shortBundleHash}"></script>
</body>

View file

@ -25,6 +25,7 @@ const publishingConfig = require('../../controllers/api/config/site/publishing')
const getTorList = require('../../controllers/api/tor');
const getBlockedList = require('../../controllers/api/blocked');
const getOEmbedData = require('../../controllers/api/oEmbed');
const cors = require('cors');
export default {
// homepage routes
@ -43,10 +44,10 @@ export default {
'/api/claim/data/:claimName/:claimId' : { controller: [ torCheckMiddleware, claimData ] },
'/api/claim/get/:name/:claimId' : { controller: [ torCheckMiddleware, claimGet ] },
'/api/claim/list/:name' : { controller: [ torCheckMiddleware, claimList ] },
'/api/claim/long-id' : { method: 'post', controller: [ torCheckMiddleware, claimLongId ] }, // note: should be a 'get'
'/api/claim/publish' : { method: 'post', controller: [ torCheckMiddleware, autoblockPublishMiddleware, multipartMiddleware, autoblockPublishBodyMiddleware, claimPublish ] },
'/api/claim/update' : { method: 'post', controller: [ torCheckMiddleware, multipartMiddleware, claimUpdate ] },
'/api/claim/abandon' : { method: 'post', controller: [ torCheckMiddleware, multipartMiddleware, claimAbandon ] },
'/api/claim/long-id' : { method: 'post', controller: [ cors(), torCheckMiddleware, claimLongId ] }, // note: should be a 'get'
'/api/claim/publish' : { method: 'post', controller: [ cors(), torCheckMiddleware, autoblockPublishMiddleware, multipartMiddleware, autoblockPublishBodyMiddleware, claimPublish ] },
'/api/claim/update' : { method: 'post', controller: [ cors(), torCheckMiddleware, multipartMiddleware, claimUpdate ] },
'/api/claim/abandon' : { method: 'post', controller: [ cors(), torCheckMiddleware, multipartMiddleware, claimAbandon ] },
'/api/claim/resolve/:name/:claimId' : { controller: [ torCheckMiddleware, claimResolve ] },
'/api/claim/short-id/:longId/:name' : { controller: [ torCheckMiddleware, claimShortId ] },
'/api/claim/views/:claimId' : { controller: [ torCheckMiddleware, claimViews ] },
@ -55,7 +56,7 @@ export default {
// user routes
'/api/user/password/' : { method: 'put', controller: [ torCheckMiddleware, userPassword ] },
// configs
'/api/config/site/publishing' : { controller: [ torCheckMiddleware, publishingConfig ] },
'/api/config/site/publishing' : { controller: [ cors(), torCheckMiddleware, publishingConfig ] },
// tor
'/api/tor' : { controller: [ torCheckMiddleware, getTorList ] },
// blocked

View file

@ -2,6 +2,6 @@ module.exports = {
...require('./pages').default,
...require('./api').default,
...require('./auth').default,
...require('./assets').default,
// ...require('./assets').default,
...require('./fallback').default,
};

View file

@ -2,7 +2,9 @@ const PassportLocalStrategy = require('passport-local').Strategy;
const { createChannel } = require('../../lbrynet');
const logger = require('winston');
const db = require('../../models');
const { publishing: { closedRegistration } } = require('@config/siteConfig');
const {
publishing: { closedRegistration },
} = require('@config/siteConfig');
module.exports = new PassportLocalStrategy(
{
@ -28,19 +30,23 @@ module.exports = new PassportLocalStrategy(
logger.verbose('userData >', userData);
// create user record
const channelData = {
channelName : `@${username}`,
channelClaimId: tx.claim_id,
channelName: `@${username}`,
channelClaimId: tx.outputs[0].claim_id,
};
logger.verbose('channelData >', channelData);
// create certificate record
const certificateData = {
claimId: tx.claim_id,
name : `@${username}`,
claimId: tx.outputs[0].claim_id,
name: `@${username}`,
// address,
};
logger.verbose('certificateData >', certificateData);
// save user and certificate to db
return Promise.all([db.User.create(userData), db.Channel.create(channelData), db.Certificate.create(certificateData)]);
return Promise.all([
db.User.create(userData),
db.Channel.create(channelData),
db.Certificate.create(certificateData),
]);
})
.then(([newUser, newChannel, newCertificate]) => {
logger.verbose('user and certificate successfully created');
@ -54,7 +60,10 @@ module.exports = new PassportLocalStrategy(
})
.then(() => {
logger.verbose('user and certificate successfully associated');
return db.Certificate.getShortChannelIdFromLongChannelId(userInfo.channelClaimId, userInfo.channelName);
return db.Certificate.getShortChannelIdFromLongChannelId(
userInfo.channelClaimId,
userInfo.channelName
);
})
.then(shortChannelId => {
userInfo['shortChannelId'] = shortChannelId;

View file

@ -13,8 +13,10 @@ const awaitFileSize = (outpoint, size, interval, timeout) => {
function checkFileList() {
logger.debug('checkFileList');
return getFileListFileByOutpoint(outpoint).then(result => {
logger.debug('File List Result', result);
if (result[0]['completed'] === true || result[0]['written_bytes'] > size) {
const { items: fileInfos } = result;
const fileInfo = fileInfos[0];
logger.debug('File List Result', fileInfo);
if (fileInfo.completed === true || fileInfo.written_bytes > size) {
logger.debug('FILE READY');
return 'ready';
} else if (timeout !== 0 && Date.now() - start > timeout) {

View file

@ -3,7 +3,7 @@ const logger = require('winston');
const config = require('@config/loggerConfig');
const { logLevel } = config;
function configureLogging () {
function configureLogging() {
logger.info('configuring winston logger...');
if (!config) {
return logger.warn('No logger config found');
@ -14,12 +14,12 @@ function configureLogging () {
// configure the winston logger
logger.configure({
transports: [
new (logger.transports.Console)({
level : logLevel || 'debug',
timestamp : false,
colorize : true,
prettyPrint : true,
handleExceptions : true,
new logger.transports.Console({
level: logLevel || 'debug',
timestamp: true,
colorize: true,
prettyPrint: true,
handleExceptions: true,
humanReadableUnhandledException: true,
}),
],