Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/v0.29.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
yknl committed Jun 25, 2018
2 parents 4b90a3a + 8e44769 commit 98a5650
Show file tree
Hide file tree
Showing 56 changed files with 8,709 additions and 330 deletions.
17 changes: 0 additions & 17 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,4 @@ tests/utils/a*
tests/utils/e*
tests/utils/n*

!app/js/profiles/store/*
!app/js/profiles/Default*
!app/js/profiles/ProfilesApp*
!app/js/profiles/Reg*
!app/js/profiles/View
app/js/profiles/components/EditAccount*
app/js/profiles/components/EditPGP*
app/js/profiles/components/EditSocialAccountItem*
app/js/profiles/components/PGPAccountItem*
app/js/profiles/components/ProfileCompletion*
app/js/profiles/components/SearchBar*
app/js/profiles/components/SearchItem*
app/js/profiles/components/SocialAccountItem*
app/js/profiles/components/VerificationInfo*
!app/js/profiles/components/Ident*
!app/js/profiles/components/registration*
!app/js/profiles/store/registration*
!app/js/profiles/store/identity*
21 changes: 0 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,8 @@ The Blockstack Browser allows you to explore the Blockstack internet.

## Developing

Blockstack Browser requires a local instance of Blockstack Core to run. To get started, first install Blockstack Core and then proceed with the installation of Blockstack Browser.

### macOS

Blockstack for macOS contains a Blockstack Core API endpoint & a CORS proxy.

*Please note these instructions have only been tested on macOS 10.13*

1. Download and install the [latest release of Blockstack for Mac](https://github.com/blockstack/blockstack-browser/releases).
Expand Down Expand Up @@ -65,23 +61,6 @@ parameter. If it starts with any number of `/` characters, remove them and
reload the page. For example, if your `auth=` query looks like
`auth=///abcdef...`, then you will need to change it to `auth=abcdef...`.

### Windows

*Note: The installation instructions below are for setting up a development environment on Windows 10. If you are using Blockstack for the first time or are looking to try Blockstack out, please go to our [downloads page](https://blockstack.org/install) and install the version there.*

The Blockstack API and the Blockstack Browser run best in Docker. There is a provided CLI to help you build and launch `docker` images if you are not comfortable with `docker`:`launcher`. The CLI will pull down the images from our [Quay image repository](https://quay.io/organization/blockstack).

1. Download the [launcher script](https://raw.githubusercontent.com/blockstack/packaging/master/browser-core-docker/launcher) from our packaging repository.

2. In order to use the launcher script, you must have Docker installed and setup on your machine. Our [Windows installer](http://packages.blockstack.com/repositories/windows/) sets up Docker for you and uses the launcher script to start Blockstack Browser automatically. The same Windows installer can be found on the [Installing Blockstack README](https://github.com/blockstack/blockstack-core#installing-blockstack).

3. Run `./launcher pull`. This will fetch the latest docker images from our image repository.

4. Start the Blockstack Core API using `./launcher start`

5. When you are done, you can clean up your environment: `./launcher stop`


## Building for macOS

1. Make sure you have a working installation of Xcode 9 or higher & valid Mac Developer signing certificate
Expand Down
Binary file modified app/images/app-icon-misthos-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/images/app-icon-misthos-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/app-icon-travelstack-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/app-icon-travelstack-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 15 additions & 2 deletions app/js/account/BackupAccountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import PropTypes from 'prop-types'
import React, { Component } from 'react'
import { connect } from 'react-redux'
import { bindActionCreators } from 'redux'
import bip39 from 'bip39'
import { HDNode } from 'bitcoinjs-lib'

import Alert from '@components/Alert'
import InputGroup from '@components/InputGroup'
Expand Down Expand Up @@ -35,7 +37,8 @@ class BackupAccountPage extends Component {
this.state = {
decryptedBackupPhrase: null,
password: '',
alerts: []
alerts: [],
keychain: null
}

this.onChange = this.onChange.bind(this)
Expand Down Expand Up @@ -68,9 +71,12 @@ class BackupAccountPage extends Component {
plaintextBuffer => {
logger.debug('Keychain phrase successfully decrypted')
this.updateAlert('success', 'Keychain phrase decrypted')
const seed = bip39.mnemonicToSeed(plaintextBuffer.toString())
const keychain = HDNode.fromSeedBuffer(seed)
this.props.displayedRecoveryCode()
this.setState({
decryptedBackupPhrase: plaintextBuffer.toString()
decryptedBackupPhrase: plaintextBuffer.toString(),
keychain
})
},
() => {
Expand Down Expand Up @@ -110,6 +116,13 @@ class BackupAccountPage extends Component {
<p className="card-text">{this.state.decryptedBackupPhrase}</p>
</div>
</div>

<div className="card m-t-20">
<div className="card-header">Private Key (WIF)</div>
<div className="card-block backup-phrase-container">
<p className="card-text">{this.state.keychain.keyPair.toWIF()}</p>
</div>
</div>
</div>
</div>
</div>
Expand Down
18 changes: 14 additions & 4 deletions app/js/account/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import { connectToGaiaHub, uploadToGaiaHub } from 'blockstack'

import { getTokenFileUrlFromZoneFile } from '@utils/zone-utils'

import log4js from 'log4js'
const logger = log4js.getLogger('account/utils/index.js')

export const BLOCKSTACK_INC = 'gaia-hub'
const DEFAULT_PROFILE_FILE_NAME = 'profile.json'

function getProfileUploadLocation(identity: any, hubConfig: GaiaHubConfig) {
if (identity.zoneFile) {
Expand All @@ -15,7 +19,7 @@ function getProfileUploadLocation(identity: any, hubConfig: GaiaHubConfig) {
} else {
// aaron-debt: this should call a function in blockstack.js to get
// the read url
return `${hubConfig.url_prefix}${hubConfig.address}/profile.json`
return `${hubConfig.url_prefix}${hubConfig.address}/${DEFAULT_PROFILE_FILE_NAME}`
}
}

Expand Down Expand Up @@ -58,15 +62,18 @@ export function uploadPhoto(
} else {
throw new Error(`Cannot determine photo location based on profile location ${uploadPrefix}`)
}
const urlToWrite = `${uploadPrefix}/avatar-${photoIndex}`
const photoFilename = `avatar-${photoIndex}`
const urlToWrite = `${uploadPrefix}/${photoFilename}`
let uploadAttempt = tryUpload(urlToWrite, photoFile, identityHubConfig, undefined)
if (uploadAttempt === null) {
uploadAttempt = tryUpload(urlToWrite, photoFile, globalHubConfig, undefined)
}

// if still null, we don't know the write gaia-hub-config to write the file.
if (uploadAttempt === null) {
throw new Error(`Wanted to write to ${urlToWrite} but I don't know how.`)
logger.error(`Wanted to write to ${urlToWrite} but I don't know how.` +
' Uploading to the default path on the configured hub.')
uploadAttempt = uploadToGaiaHub(photoFilename, photoFile, identityHubConfig, undefined)
}

return uploadAttempt
Expand Down Expand Up @@ -101,7 +108,10 @@ export function uploadProfile(

// if still null, we don't know the write gaia-hub-config to write the file.
if (uploadAttempt === null) {
throw new Error(`Wanted to write to ${urlToWrite} but I don't know how.`)
logger.error(`Wanted to write to ${urlToWrite} but I don't know how.` +
' Uploading to the default path on the configured hub.')
uploadAttempt = uploadToGaiaHub(DEFAULT_PROFILE_FILE_NAME, signedProfileTokenData,
identityHubConfig, 'application/json')
}

return uploadAttempt
Expand Down
2 changes: 1 addition & 1 deletion app/js/components/ui/components/shell/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled, { css } from 'styled-components'
import { animated } from 'react-spring/dist/react-spring.umd'
import { animated } from 'react-spring'
import { spacing } from '@ui/common/constants'
import { Buttons } from '@components/ui/components/button'

Expand Down
2 changes: 1 addition & 1 deletion app/js/components/ui/containers/shell-parent.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
import memoize from 'memoize-one'
import { Shell } from '@ui/containers/shell'
import { Header } from '@ui/containers/headers'
import { Transition } from 'react-spring/dist/react-spring.umd'
import { Transition } from 'react-spring'
import { WindowSize } from 'react-fns'
const ShellContext = React.createContext()

Expand Down
15 changes: 14 additions & 1 deletion app/js/data/apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ const apps = {
website: 'https://www.misthos.io',
launchLink: 'https://www.misthos.io',
developer: 'Justin Carter',
status: 'in_progress',
status: 'user_ready',
storageRequired: true
}, {
name: 'Stealthy',
Expand Down Expand Up @@ -452,6 +452,19 @@ const apps = {
developer: 'Postly',
status: 'user_ready_chat',
storageRequired: true
}, {
name: 'Travelstack',
displayName: 'Travelstack',
description: 'Decentralized photo diary and social network for travelers.',
version: '1.0.0',
appIcon: {
small: 'app-icon-travelstack-256x256.png',
large: 'app-icon-travelstack-512x512.png'
},
website: 'http://www.travelstack.club',
launchLink: 'http://www.travelstack.club',
developer: 'Tiago Alves',
status: 'in_progress'
}
]
}
Expand Down
85 changes: 43 additions & 42 deletions app/js/profiles/components/EditAccount.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import PropTypes from 'prop-types'
import React, { Component } from 'react'
import { Link } from 'react-router'
import { connect } from 'react-redux'
import InputGroup from '@components/InputGroup'

Expand All @@ -17,7 +16,8 @@ class EditAccount extends Component {
service: PropTypes.string,
identifier: PropTypes.string,
api: PropTypes.object.isRequired,
onDoneButtonClick: PropTypes.func
onDoneButtonClick: PropTypes.func,
verified: PropTypes.bool
}

constructor(props) {
Expand All @@ -39,7 +39,7 @@ class EditAccount extends Component {
let accountUrl = `http://${this.props.service}.com/${this.props.identifier}`
if (webAccountTypes.hasOwnProperty(this.props.service)) {
if (webAccountTypes[this.props.service].hasOwnProperty('urlTemplate')) {
let urlTemplate = webAccountTypes[this.props.service].urlTemplate
const urlTemplate = webAccountTypes[this.props.service].urlTemplate
if (urlTemplate) {
accountUrl = urlTemplate.replace('{identifier}', this.props.identifier)
}
Expand All @@ -60,27 +60,27 @@ class EditAccount extends Component {
getIdentifier = () => {
let identifier = this.state.identifier
if (identifier.length >= 40) {
identifier = identifier.slice(0, 40) + '...'
identifier = `${identifier.slice(0, 40)}...`
}
return identifier
}

onIdentifierChange = (event) => {
let identifier = event.target.value
const identifier = event.target.value
this.setState({
identifier: identifier
identifier
})
}

getIdentifierType = (service) => {
if(service === 'bitcoin' || service === 'ethereum') {
return "address"
return 'address'
}
else if (service === 'pgp' || service === 'ssh') {
return "key"
return 'key'
}
else {
return "account"
return 'account'
}
}

Expand Down Expand Up @@ -108,46 +108,47 @@ class EditAccount extends Component {
}
}

capitalize = (string) => {
return string.charAt(0).toUpperCase() + string.slice(1);
}
capitalize = (string) => string.charAt(0).toUpperCase() + string.slice(1)

render() {
const webAccountTypes = getWebAccountTypes(this.props.api)
const verifiedClass = this.props.verified ? "verified" : (this.state.collapsed ? "pending" : "")
let webAccountType = webAccountTypes[this.props.service]
const unverifiedClass = (this.state.collapsed ? 'pending' : '')
const verifiedClass = this.props.verified ? 'verified' : unverifiedClass
const webAccountType = webAccountTypes[this.props.service]

if (webAccountType) {
let accountServiceName = webAccountType.label
return (
<div>
<div className={`profile-account ${verifiedClass}`}
onClick={this.handleClick}>
<div className="heading m-b-30">
<i className={`fa fa-fw fa-lg ${this.getIconClass()}`} />
{this.getPlaceholderText(this.props.service)}
</div>

<div>
<InputGroup
key="input-group-identifier"
name="identifier"
placeholder={this.capitalize(this.getIdentifierType(this.props.service))}
data={this.state}
stopClickPropagation={true}
onChange={this.onIdentifierChange}
/>

</div>
return (
<div>
<div
className={`profile-account ${verifiedClass}`}
onClick={this.handleClick}
>
<div className='heading m-b-30'>
<i className={`fa fa-fw fa-lg ${this.getIconClass()}`} />
{this.getPlaceholderText(this.props.service)}
</div>

<div>
<InputGroup
key='input-group-identifier'
name='identifier'
placeholder={this.capitalize(this.getIdentifierType(this.props.service))}
data={this.state}
stopClickPropagation
onChange={this.onIdentifierChange}
/>

</div>
<button
className="btn btn-verify btn-block m-t-15"
onClick={e => this.props.onDoneButtonClick(this.props.service,
this.state.identifier)}>
Save
</button>
</div>
)
<button
className='btn btn-verify btn-block m-t-15'
onClick={() => this.props.onDoneButtonClick(this.props.service,
this.state.identifier)}
>
Save
</button>
</div>
)
} else {
return (
<span>
Expand Down
Loading

0 comments on commit 98a5650

Please sign in to comment.