Staging #1066
9 changed files with 101 additions and 37 deletions
44
.travis.yml
Normal file
44
.travis.yml
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
sudo: true
|
||||||
|
dist: xenial
|
||||||
|
#addons:
|
||||||
|
# apt:
|
||||||
|
# sources:
|
||||||
|
# - mysql-5.7-trusty
|
||||||
|
# packages:
|
||||||
|
# - mysql-server
|
||||||
|
# - mysql-client
|
||||||
|
language: node_js
|
||||||
|
node_js:
|
||||||
|
- "lts/*"
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- "node_modules"
|
||||||
|
#services:
|
||||||
|
# - mysql
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
include:
|
||||||
|
- stage: "Build"
|
||||||
|
name: "Build and run test environment"
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
# - sudo mysql -e "use mysql; update user set authentication_string=PASSWORD('password') where User='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;"
|
||||||
|
# - sudo mysql_upgrade -u root -ppassword
|
||||||
|
# - sudo service mysql restart
|
||||||
|
# - mysql -u root -ppassword -e 'CREATE DATABASE IF NOT EXISTS lbry;'
|
||||||
|
# - mysql -u root -ppassword -e "CREATE USER 'lbry'@'localhost' IDENTIFIED BY 'lbry';"
|
||||||
|
# - mysql -u root -ppassword -e "GRANT ALL ON lbry.* TO 'lbry'@'localhost';"
|
||||||
|
# - sudo service mysql restart
|
||||||
|
- dpkg --compare-versions `npm -v` ge 6.4.0 || npm i -g npm@^6.4.0
|
||||||
|
|
||||||
|
install:
|
||||||
|
- npm i
|
||||||
|
|
||||||
|
script:
|
||||||
|
- cp ./cli/defaults/* ./site/config/
|
||||||
|
- |
|
||||||
|
echo '{ "sessionKey": "session", "masterPassword": false }' > ./site/private/authConfig.json
|
||||||
|
# - npm run fix
|
||||||
|
- npm run build
|
||||||
|
- npm start &
|
||||||
|
- sleep 10 # Attempt to collect output for 10 seconds
|
|
@ -20,7 +20,7 @@ For a closed, custom-hosted and branded example, check out https://lbry.theantim
|
||||||
#### Get some information ready:
|
#### Get some information ready:
|
||||||
* mysqlusername
|
* mysqlusername
|
||||||
* mysqlpassword
|
* mysqlpassword
|
||||||
* domainname or 'http://localhost'
|
* domainname or 'http://localhost:3000'
|
||||||
* speechport = 3000
|
* speechport = 3000
|
||||||
|
|
||||||
#### Install and Set Up Dependencies
|
#### Install and Set Up Dependencies
|
||||||
|
@ -31,10 +31,10 @@ For a closed, custom-hosted and branded example, check out https://lbry.theantim
|
||||||
* 3333
|
* 3333
|
||||||
* 4444
|
* 4444
|
||||||
* [NodeJS](https://nodejs.org)
|
* [NodeJS](https://nodejs.org)
|
||||||
* [MySQL](https://dev.mysql.com/doc/refman/8.0/en/installing.html)
|
* [MySQL version 5.7 or higher](https://dev.mysql.com/doc/refman/8.0/en/installing.html)
|
||||||
* mysqlusername or root
|
* mysqlusername or root
|
||||||
* mysqlpassword
|
* mysqlpassword
|
||||||
* You may need
|
* Requires mysql_native_password plugin
|
||||||
```
|
```
|
||||||
mysql> `ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'yourpassword';`
|
mysql> `ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'yourpassword';`
|
||||||
```
|
```
|
||||||
|
|
|
@ -9,6 +9,8 @@ import HorizontalSplit from '@components/HorizontalSplit';
|
||||||
import siteConfig from '@config/siteConfig.json';
|
import siteConfig from '@config/siteConfig.json';
|
||||||
import createCanonicalLink from '../../../../utils/createCanonicalLink';
|
import createCanonicalLink from '../../../../utils/createCanonicalLink';
|
||||||
import AssetInfoFooter from '../../components/AssetInfoFooter/index';
|
import AssetInfoFooter from '../../components/AssetInfoFooter/index';
|
||||||
|
import { createPermanentURI } from '@clientutils/createPermanentURI';
|
||||||
|
|
||||||
const { details: { host } } = siteConfig;
|
const { details: { host } } = siteConfig;
|
||||||
|
|
||||||
class AssetInfo extends React.Component {
|
class AssetInfo extends React.Component {
|
||||||
|
@ -121,7 +123,7 @@ class AssetInfo extends React.Component {
|
||||||
content={
|
content={
|
||||||
<ClickToCopy
|
<ClickToCopy
|
||||||
id={'lbry-permanent-url'}
|
id={'lbry-permanent-url'}
|
||||||
value={`${channelName}#${certificateId}/${name}`}
|
value={`${createPermanentURI(asset)}`}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
@ -142,7 +144,7 @@ class AssetInfo extends React.Component {
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
className={'link--primary'}
|
className={'link--primary'}
|
||||||
href={`https://open.lbry.io/${channelName}#${certificateId}/${name}`}
|
href={`https://open.lbry.io/${createPermanentURI(asset)}`}
|
||||||
download={name}
|
download={name}
|
||||||
>
|
>
|
||||||
LBRY URL
|
LBRY URL
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
import {connect} from 'react-redux';
|
import {connect} from 'react-redux';
|
||||||
import View from './view';
|
import View from './view';
|
||||||
import {selectAsset} from '../../selectors/show';
|
import {selectAsset} from '../../selectors/show';
|
||||||
import {buildURI} from '../../utils/buildURI';
|
import {createPermanentURI} from '@clientutils/createPermanentURI';
|
||||||
|
|
||||||
const mapStateToProps = props => {
|
const mapStateToProps = props => {
|
||||||
const { show, publish } = props;
|
const { show, publish } = props;
|
||||||
const asset = selectAsset(show);
|
const asset = selectAsset(show);
|
||||||
let uri;
|
let uri;
|
||||||
if (asset) {
|
if (asset) {
|
||||||
uri = `lbry://${buildURI(asset)}`;
|
uri = `lbry://${createPermanentURI(asset)}`;
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
disabled : publish.disabled,
|
disabled : publish.disabled,
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
export const buildURI = asset => {
|
|
||||||
let channelName, certificateId, name, claimId;
|
|
||||||
if (asset.claimData) {
|
|
||||||
({ channelName, certificateId, name, claimId } = asset.claimData);
|
|
||||||
}
|
|
||||||
if (channelName) {
|
|
||||||
return `${channelName}:${certificateId}/${name}`;
|
|
||||||
}
|
|
||||||
return `${claimId}/${name}`;
|
|
||||||
};
|
|
24
client/src/utils/createPermanentURI.js
Normal file
24
client/src/utils/createPermanentURI.js
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
/*
|
||||||
|
{ channelName, certificateId, name, claimId } = { claimData } = asset
|
||||||
|
|
||||||
|
permanentUrl for a channel
|
||||||
|
@channelName#certificateId
|
||||||
|
|
||||||
|
permanentUrl for an asset in a channel
|
||||||
|
@channelName#certificateId/name
|
||||||
|
|
||||||
|
permanentUrl for an asset published anonymously
|
||||||
|
name#claimId
|
||||||
|
*/
|
||||||
|
|
||||||
|
export const createPermanentURI = asset => {
|
||||||
|
let channelName, certificateId, name, claimId;
|
||||||
|
if (asset.claimData) {
|
||||||
|
({ channelName, certificateId, name, claimId } = asset.claimData);
|
||||||
|
}
|
||||||
|
else return 'Error: unknown asset at createPermanentURI.js';
|
||||||
|
if (channelName) {
|
||||||
|
return `${channelName}#${certificateId}/${name}`;
|
||||||
|
}
|
||||||
|
return `${name}#${claimId}`;
|
||||||
|
};
|
|
@ -6,23 +6,23 @@
|
||||||
* Ability to use SSH (putty + public key for windows users)
|
* Ability to use SSH (putty + public key for windows users)
|
||||||
* Ubuntu 16.04 or 18.04 VPS with root access
|
* Ubuntu 16.04 or 18.04 VPS with root access
|
||||||
* Your login info ready
|
* Your login info ready
|
||||||
|
* Exposed ports: 22, 80, 443, 3333, 4444
|
||||||
* Domain name with @ and www pointed at your VPS IP
|
* Domain name with @ and www pointed at your VPS IP
|
||||||
* alternatively, specify http://localhost
|
* _alternatively, specify http://localhost:3000 as domain during speech configuration_
|
||||||
* Ability to send 5+ LBRY credits to an address
|
* Ability to send 5+ LBRY credits to an address
|
||||||
* Noncommercial use
|
* Noncommercial use
|
||||||
* _(configuration examples for nginx and certbot are included as an alternative)_
|
* _alternative configuration examples for nginx and certbot are [here](https://github.com/lbryio/spee.ch/tree/master/docs/setup/conf/nginx)_
|
||||||
|
|
||||||
## You'll be installing:
|
## You'll be installing:
|
||||||
* MySQL DB
|
* MySQL DB version 5.7 or higher
|
||||||
* Default Port 3306
|
* Default Port 3306
|
||||||
|
* mysql_native_password plugin
|
||||||
* NodeJS v8+
|
* NodeJS v8+
|
||||||
* Https proxy server
|
* Caddy - https reverse proxy server
|
||||||
* Caddy for personal use
|
* automatically obtains tls certificate
|
||||||
* Exposed ports: 22, 80, 443, 3333, 4444
|
* Redirects 80 (http) to 443 (https) to Speech on 3000
|
||||||
* Reverse proxies 80 redirected to 443 to App on 3000
|
|
||||||
* Spee.ch started on port 3000
|
|
||||||
* Lbrynet DAEMON started on ports 3333 and 4444
|
* Lbrynet DAEMON started on ports 3333 and 4444
|
||||||
|
* Spee.ch started on port 3000
|
||||||
|
|
||||||
# 1. Setup OS and install dependencies
|
# 1. Setup OS and install dependencies
|
||||||
## OS
|
## OS
|
||||||
|
@ -184,15 +184,13 @@ tmux allows you to run multiple things in different sessions. Useful for manuall
|
||||||
## Detatch tmux session
|
## Detatch tmux session
|
||||||
`Control + b`, then `d`
|
`Control + b`, then `d`
|
||||||
|
|
||||||
<<<<<<< Updated upstream
|
|
||||||
* `tmux` if you want to get back into tmux
|
* `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
|
* `Control+b`, then `)` while in tmux session to cycle back to your lbrynet session to see output
|
||||||
=======
|
|
||||||
`tmux`
|
`tmux`
|
||||||
|
|
||||||
_note: `Control+b`, then `)` while in tmux session to cycle back to your lbrynet session to see output_
|
_note: `Control+b`, then `)` while in tmux session to cycle back to your lbrynet session to see output_
|
||||||
>>>>>>> Stashed changes
|
|
||||||
|
|
||||||
## Display wallet address to which to send 5+ LBC.
|
## Display wallet address to which to send 5+ LBC.
|
||||||
|
|
||||||
|
@ -227,19 +225,17 @@ tmux allows you to run multiple things in different sessions. Useful for manuall
|
||||||
|
|
||||||
`npm run configure`
|
`npm run configure`
|
||||||
|
|
||||||
<<<<<<< Updated upstream
|
|
||||||
=======
|
|
||||||
(once your wallet balance has cleared)
|
(once your wallet balance has cleared)
|
||||||
|
|
||||||
`npm run configure`
|
`npm run configure`
|
||||||
|
|
||||||
>>>>>>> Stashed changes
|
|
||||||
* Database: lbry
|
* Database: lbry
|
||||||
* Username: root
|
* Username: root
|
||||||
* Password: your_mysql_password
|
* Password: your_mysql_password
|
||||||
* Port: 3000
|
* Port: 3000
|
||||||
* Site Title: Your Site Name
|
* Site Title: Your Site Name
|
||||||
* Enter your site's domain name: https://example.com or http://localhost
|
* 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/lbry/Uploads)
|
||||||
|
|
||||||
`npm run start`
|
`npm run start`
|
||||||
|
@ -255,7 +251,7 @@ tmux allows you to run multiple things in different sessions. Useful for manuall
|
||||||
npm install -g pm2
|
npm install -g pm2
|
||||||
```
|
```
|
||||||
|
|
||||||
### 7 Maintenance Proceedures
|
### 7 Maintenance Procedures
|
||||||
|
|
||||||
#### Change daemon
|
#### Change daemon
|
||||||
* backup wallet (private keys!) to a safe place
|
* backup wallet (private keys!) to a safe place
|
||||||
|
|
|
@ -6,8 +6,10 @@ const serveFile = ({ filePath, fileType }, res) => {
|
||||||
}
|
}
|
||||||
const sendFileOptions = {
|
const sendFileOptions = {
|
||||||
headers: {
|
headers: {
|
||||||
'X-Content-Type-Options': 'nosniff',
|
'X-Content-Type-Options' : 'nosniff',
|
||||||
'Content-Type' : fileType,
|
'Content-Type' : fileType,
|
||||||
|
'Access-Control-Allow-Origin' : '*',
|
||||||
|
'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
logger.debug(`fileOptions for ${filePath}:`, sendFileOptions);
|
logger.debug(`fileOptions for ${filePath}:`, sendFileOptions);
|
||||||
|
|
|
@ -34,6 +34,11 @@ module.exports = () => {
|
||||||
moduleAliases['@config'] = resolve('site/config');
|
moduleAliases['@config'] = resolve('site/config');
|
||||||
moduleAliases['@private'] = resolve('site/private');
|
moduleAliases['@private'] = resolve('site/private');
|
||||||
|
|
||||||
|
// aliases for utils
|
||||||
|
moduleAliases['@globalutils'] = resolve('utils');
|
||||||
|
moduleAliases['@clientutils'] = resolve(`${DEFAULT_ROOT}/utils`);
|
||||||
|
// moduleAliases['@serverutils'] = resolve('server/utils');
|
||||||
|
|
||||||
// create specific aliases for locally defined components in the following folders
|
// create specific aliases for locally defined components in the following folders
|
||||||
moduleAliases = addAliasesForCustomComponentFolder('containers', moduleAliases);
|
moduleAliases = addAliasesForCustomComponentFolder('containers', moduleAliases);
|
||||||
moduleAliases = addAliasesForCustomComponentFolder('components', moduleAliases);
|
moduleAliases = addAliasesForCustomComponentFolder('components', moduleAliases);
|
||||||
|
@ -48,6 +53,7 @@ module.exports = () => {
|
||||||
moduleAliases['@sagas'] = resolve(`${DEFAULT_ROOT}/sagas`);
|
moduleAliases['@sagas'] = resolve(`${DEFAULT_ROOT}/sagas`);
|
||||||
moduleAliases['@app'] = resolve(`${DEFAULT_ROOT}/app.js`);
|
moduleAliases['@app'] = resolve(`${DEFAULT_ROOT}/app.js`);
|
||||||
|
|
||||||
|
|
||||||
// return finished aliases
|
// return finished aliases
|
||||||
return moduleAliases;
|
return moduleAliases;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue