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

Commit 6805a07

Browse files
committed
Merge branch 'release/v0.35.4'
2 parents 5953c70 + da32d57 commit 6805a07

File tree

26 files changed

+4392
-4663
lines changed

26 files changed

+4392
-4663
lines changed

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,15 @@ tmp
3636
.idea
3737
.swp
3838
yarn.lock
39+
native/windows/.vs/
40+
native/windows/BlockstackBrowser/bin/
41+
native/windows/BlockstackBrowser/obj/
42+
native/windows/ProtocolHandler/bin/
43+
native/windows/ProtocolHandler/obj/
44+
native/windows/BlockstackBrowser/Resources/node.exe
45+
native/windows/BlockstackBrowser/Resources/cors-proxy/corsproxy.js
46+
native/windows/BlockstackSetup/obj/
47+
native/windows/BlockstackSetup/bin/
48+
native/macos/Blockstack/Blockstack/server/corsproxy.js
49+
native/macos/Blockstack/Blockstack/server/blockstackProxy.js
50+
native/macos/Blockstack/Blockstack/server/node

README.md

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ The Blockstack Browser allows you to explore the Blockstack internet.
77
- [Releases](#releases)
88
- [Developing](#developing)
99
- [Building for macOS](#building-for-macos)
10+
- [Building for Windows](#building-for-windows)
1011
- [Building for the Web](#building-for-the-web)
1112
- [Contributing](#contributing)
1213
- [Logging](#logging)
@@ -59,21 +60,17 @@ reload the page. For example, if your `auth=` query looks like
5960

6061
## Building for macOS
6162

62-
1. Make sure you have a working installation of Xcode 9 or higher & valid Mac Developer signing certificate
63-
1. Make sure you have an OpenSSL ready for bottling by homebrew by running `brew install openssl --build-bottle`
64-
1. Make sure you have `hg` installed by running `brew install hg`
65-
1. Run `npm install nexe -g` to install the "node to native" binary tool globally
66-
1. Open the Blockstack macOS project in Xcode and configure your code signing development team (You only need to do this once)
67-
1. Run `npm run mac` to build a debug release signed with your Mac Developer certificate
68-
69-
*Note: You only need to run `nexe` once but the first build will take a while as `nexe` downloads and compiles a source copy of node. Then it creates and copies the needed proxy binaries into place and copies a built version of the browser web app into the source tree.*
63+
1. Make sure you have a working installation of Xcode >=9 and Node.js >=10.
64+
1. Run `npm run mac:release:dev` to build an unsigned application bundle.
65+
1. The output bundle is located at `native/macos/export/Blockstack.app`.
7066

7167
*Note: This has only been tested on macOS High Sierra 10.13*
7268

7369
### Building a macOS release for distribution
7470

7571
1. Ensure you have valid Developer ID signing credentials in your Keychain. (See https://developer.apple.com/developer-id/ for more information)
76-
1. Follow the instructions in the above section for building for macOS.
72+
1. Open the Blockstack macOS project in Xcode and configure your code signing development team (You only need to do this once)
73+
1. Make sure you have an OpenSSL ready for bottling by homebrew by running `brew install openssl --build-bottle`
7774
1. Open the Blockstack macOS project in Xcode.
7875
1. Select the Product menu and click Archive.
7976
1. When the archive build completes, the Organizer window will open. Select your new build.
@@ -83,6 +80,24 @@ reload the page. For example, if your `auth=` query looks like
8380
1. Click "Export" and select the location to which you would like to save the signed build.
8481

8582

83+
## Building for Windows
84+
85+
Prerequisites:
86+
* Wix Toolset v3.11.1 (download and run wix311.exe from https://github.com/wixtoolset/wix3/releases/tag/wix3111rtm)
87+
* Visual Studio 2017 (https://visualstudio.microsoft.com/downloads/)
88+
89+
Run `npm run win32`.
90+
91+
This will:
92+
* Run the webpack build.
93+
* Setup the resources used by msbuild and the WiX msi project.
94+
* Run msbuild to compile the native app and create the msi installation file.
95+
96+
The output file can be found at `native\windows\BlockstackSetup\bin\Release\en-us\BlockstackSetup.msi`.
97+
98+
This does not perform any code or installer file signing.
99+
100+
86101
## Building for the Web
87102

88103
1. Make sure you've cloned the repo and installed all npm assets (as shown above)

app/js/App.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
setOrUnsetUrlsToRegTest,
1313
getRegTestModeFromURL
1414
} from './utils/api-utils'
15-
import SupportButton from './components/SupportButton'
1615
import { SanityActions } from './store/sanity'
1716
import { CURRENT_VERSION } from './store/reducers'
1817
import { isCoreEndpointDisabled } from './utils/window-utils'

app/js/account/StorageProvidersPage.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ class StorageProvidersPage extends Component {
159159
<a
160160
href="https://github.com/blockstack/gaia/tree/master/hub"
161161
className="btn btn-primary btn-storage btn-lg btn-block"
162+
target="_blank"
163+
rel="noopener noreferrer"
162164
>
163165
Run your own Gaia storage hub
164166
</a>

app/js/auth/index.js

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@ import { Initial, LegacyGaia } from './views'
55
import { bindActionCreators } from 'redux'
66
import { connect } from 'react-redux'
77
import { AuthActions } from './store/auth'
8+
import { IdentityActions } from '../profiles/store/identity'
89
import { decodeToken } from 'jsontokens'
910
import { parseZoneFile } from 'zone-file'
11+
import queryString from 'query-string'
1012
import {
1113
makeAuthResponse,
1214
getAuthRequestFromURL,
1315
redirectUserToApp,
1416
getAppBucketUrl,
15-
isLaterVersion
17+
isLaterVersion,
18+
updateQueryStringParameter
1619
} from 'blockstack'
1720
import { AppsNode } from '@utils/account-utils'
1821
import {
@@ -79,7 +82,7 @@ function mapStateToProps(state) {
7982
}
8083

8184
function mapDispatchToProps(dispatch) {
82-
const actions = Object.assign({}, AuthActions)
85+
const actions = Object.assign({}, AuthActions, IdentityActions)
8386
return bindActionCreators(actions, dispatch)
8487
}
8588

@@ -106,7 +109,8 @@ class AuthPage extends React.Component {
106109
email: PropTypes.string,
107110
noCoreSessionToken: PropTypes.func.isRequired,
108111
addresses: PropTypes.array.isRequired,
109-
publicKeychain: PropTypes.string.isRequired
112+
publicKeychain: PropTypes.string.isRequired,
113+
refreshIdentities: PropTypes.func.isRequired
110114
}
111115

112116
constructor(props) {
@@ -115,11 +119,13 @@ class AuthPage extends React.Component {
115119
this.state = {
116120
currentIdentityIndex: this.props.defaultIdentity,
117121
authRequest: null,
122+
echoRequestId: null,
118123
appManifest: null,
119124
coreSessionToken: null,
120125
decodedToken: null,
121126
storageConnected: this.props.api.storageConnected,
122127
processing: false,
128+
refreshingIdentities: true,
123129
invalidScopes: false,
124130
sendEmail: false,
125131
blockchainId: null,
@@ -137,12 +143,16 @@ class AuthPage extends React.Component {
137143
}
138144

139145
componentWillMount() {
146+
const queryDict = queryString.parse(location.search)
147+
const echoRequestId = queryDict.echo
148+
140149
const authRequest = getAuthRequestFromURL()
141150
const decodedToken = decodeToken(authRequest)
142151
const { scopes } = decodedToken.payload
143152

144153
this.setState({
145154
authRequest,
155+
echoRequestId,
146156
decodedToken,
147157
scopes: {
148158
...this.state.scopes,
@@ -152,10 +162,34 @@ class AuthPage extends React.Component {
152162
})
153163

154164
this.props.verifyAuthRequestAndLoadManifest(authRequest)
165+
166+
this.getFreshIdentities()
155167
}
156168

169+
redirectUserToEchoReply() {
170+
let redirectURI = this.state.decodedToken.payload.redirect_uri
171+
if (redirectURI) {
172+
// Get the current localhost authentication url that the app will redirect back to,
173+
// and remove the 'echo' param from it.
174+
const authContinuationURI = updateQueryStringParameter(window.location.href, 'echo', '')
175+
redirectURI = updateQueryStringParameter(redirectURI, 'echoReply', this.state.echoRequestId)
176+
redirectURI = updateQueryStringParameter(redirectURI, 'authContinuation', encodeURIComponent(authContinuationURI))
177+
} else {
178+
throw new Error('Invalid redirect echo reply URI')
179+
}
180+
this.setState({ responseSent: true })
181+
window.location = redirectURI
182+
}
183+
157184
componentWillReceiveProps(nextProps) {
185+
158186
if (!this.state.responseSent) {
187+
188+
if (this.state.echoRequestId) {
189+
this.redirectUserToEchoReply()
190+
return
191+
}
192+
159193
const storageConnected = this.props.api.storageConnected
160194
this.setState({
161195
storageConnected
@@ -230,7 +264,7 @@ class AuthPage extends React.Component {
230264

231265
const gaiaBucketAddress = nextProps.identityKeypairs[0].address
232266
const identityAddress = nextProps.identityKeypairs[identityIndex].address
233-
const gaiaUrlBase = 'https://gaia.blockstack.org/hub'
267+
const gaiaUrlBase = nextProps.api.gaiaHubConfig.url_prefix
234268

235269
if (!profileUrlPromise) {
236270
profileUrlPromise = fetchProfileLocations(
@@ -323,6 +357,14 @@ class AuthPage extends React.Component {
323357
}
324358
}
325359

360+
getFreshIdentities = async () => {
361+
await this.props.refreshIdentities(
362+
this.props.api,
363+
this.props.addresses
364+
)
365+
this.setState({ refreshingIdentities: false })
366+
}
367+
326368
completeAuthResponse = (
327369
privateKey,
328370
blockchainId,
@@ -556,6 +598,7 @@ class AuthPage extends React.Component {
556598
deny: () => console.log('go back to app'),
557599
accounts: this.props.localIdentities,
558600
processing: this.state.processing,
601+
refreshingIdentities: this.state.refreshingIdentities,
559602
selectedIndex: this.state.currentIdentityIndex,
560603
disableBackOnView: 0
561604
}

app/js/auth/views/initial.js

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ const basicInfo = 'read your basic info'
66
const readEmail = 'read your email address'
77
const publishData = 'publish data stored for this app'
88

9-
const Accounts = ({ list, handleClick, processing, selectedIndex }) => {
9+
const Accounts = ({ list, handleClick, processing, refreshingIdentities, selectedIndex }) => {
10+
let loadingMessage = null
11+
if (processing) {
12+
loadingMessage = 'Signing in...'
13+
} else if (refreshingIdentities) {
14+
loadingMessage = 'Loading...'
15+
}
1016
if (list.length) {
1117
return list.map(({ username, ownerAddress, profile, ...account }, i) => {
1218
const person = new Person(profile)
@@ -17,9 +23,9 @@ const Accounts = ({ list, handleClick, processing, selectedIndex }) => {
1723
id={ownerAddress}
1824
avatarUrl={person.avatarUrl()}
1925
onClick={() => handleClick(i)}
20-
loading={processing && i === selectedIndex}
21-
disabled={processing}
22-
placeholder="Signing in..."
26+
loading={refreshingIdentities || (processing && i === selectedIndex)}
27+
disabled={refreshingIdentities || processing}
28+
placeholder={loadingMessage}
2329
style={{ transform: 'translate3d(0,0,0)' }}
2430
hideID
2531
/>
@@ -75,6 +81,7 @@ const InitialScreen = ({
7581
processing,
7682
selectedIndex,
7783
login,
84+
refreshingIdentities,
7885
...rest
7986
}) => {
8087
const generatePermissionsList = () => {
@@ -108,6 +115,7 @@ const InitialScreen = ({
108115
list={accounts}
109116
handleClick={login}
110117
processing={processing}
118+
refreshingIdentities={refreshingIdentities}
111119
selectedIndex={selectedIndex}
112120
/>
113121
</Buttons>
@@ -134,13 +142,15 @@ InitialScreen.propTypes = {
134142
permissions: PropTypes.array,
135143
processing: PropTypes.bool,
136144
selectedIndex: PropTypes.number,
137-
login: PropTypes.func
145+
login: PropTypes.func,
146+
refreshingIdentities: PropTypes.bool
138147
}
139148
Accounts.propTypes = {
140149
list: PropTypes.array.isRequired,
141150
handleClick: PropTypes.func,
142151
processing: PropTypes.bool,
143-
selectedIndex: PropTypes.number
152+
selectedIndex: PropTypes.number,
153+
refreshingIdentities: PropTypes.bool
144154
}
145155

146156
PermissionsList.propTypes = {

app/js/components/ui/containers/shell-parent.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ class ShellParent extends React.Component {
8787

8888
const internalBackLabel = backLabel !== '' ? backLabel : 'Back'
8989
const defaultBackLabel = isFirstView ? backLabel : internalBackLabel
90-
const label = isFirstView && app ? `Back to ${app.name}` : defaultBackLabel
90+
const label =
91+
backLabel === '' && isFirstView && app
92+
? ``
93+
: defaultBackLabel
9194

9295
const Component = views[view]
9396

0 commit comments

Comments
 (0)