Removing SSL config - non HTTPS can't use SSL anyway
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -98,7 +98,7 @@
|
|||||||
|
|
||||||
// Release details
|
// Release details
|
||||||
// These are automatically injected to built HTML
|
// These are automatically injected to built HTML
|
||||||
var build = "1538553793";
|
var build = "1538593142";
|
||||||
var version = "3.27.1";
|
var version = "3.27.1";
|
||||||
|
|
||||||
// Construct the script tag
|
// Construct the script tag
|
||||||
|
|||||||
@ -89,12 +89,29 @@ class App extends React.Component{
|
|||||||
|
|
||||||
// Check for url-parsed configuration values
|
// Check for url-parsed configuration values
|
||||||
var url_vars = this.props.location.query;
|
var url_vars = this.props.location.query;
|
||||||
if (url_vars !== undefined && url_vars.host !== undefined && url_vars.port !== undefined){
|
if (url_vars){
|
||||||
this.props.mopidyActions.set({
|
var has_values = false;
|
||||||
host: url_vars.host,
|
var values = {};
|
||||||
port: url_vars.port
|
if (url_vars.host !== undefined){
|
||||||
});
|
has_values = true;
|
||||||
hashHistory.push(global.baseURL);
|
values.host = url_vars.host;
|
||||||
|
}
|
||||||
|
if (url_vars.port !== undefined){
|
||||||
|
has_values = true;
|
||||||
|
values.port = url_vars.port;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (has_values){
|
||||||
|
this.props.mopidyActions.set(values);
|
||||||
|
|
||||||
|
// Allow 100ms for the action above to complete before we re-route
|
||||||
|
setTimeout(
|
||||||
|
() => {
|
||||||
|
hashHistory.push(global.baseURL);
|
||||||
|
},
|
||||||
|
100
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// show initial setup if required
|
// show initial setup if required
|
||||||
|
|||||||
@ -207,13 +207,15 @@ const MopidyMiddleware = (function(){
|
|||||||
switch(action.type){
|
switch(action.type){
|
||||||
|
|
||||||
case 'MOPIDY_CONNECT':
|
case 'MOPIDY_CONNECT':
|
||||||
|
if (socket != null){
|
||||||
|
socket.close();
|
||||||
|
}
|
||||||
|
|
||||||
if (socket != null) socket.close();
|
|
||||||
store.dispatch({ type: 'MOPIDY_CONNECTING'});
|
store.dispatch({ type: 'MOPIDY_CONNECTING'});
|
||||||
var state = store.getState();
|
var state = store.getState();
|
||||||
|
|
||||||
socket = new Mopidy({
|
socket = new Mopidy({
|
||||||
webSocketUrl: 'ws'+(state.mopidy.ssl ? 's' : '')+'://'+state.mopidy.host+':'+state.mopidy.port+'/mopidy/ws/',
|
webSocketUrl: 'ws'+(window.location.protocol === 'https:' ? 's' : '')+'://'+state.mopidy.host+':'+state.mopidy.port+'/mopidy/ws/',
|
||||||
callingConvention: 'by-position-or-by-name'
|
callingConvention: 'by-position-or-by-name'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -171,8 +171,6 @@ const PusherMiddleware = (function(){
|
|||||||
switch(action.type){
|
switch(action.type){
|
||||||
|
|
||||||
case 'PUSHER_CONNECT':
|
case 'PUSHER_CONNECT':
|
||||||
|
|
||||||
// Stagnant socket, close it first
|
|
||||||
if (socket != null){
|
if (socket != null){
|
||||||
socket.close();
|
socket.close();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,7 +28,6 @@ class Settings extends React.Component {
|
|||||||
this.state = {
|
this.state = {
|
||||||
mopidy_host: this.props.mopidy.host,
|
mopidy_host: this.props.mopidy.host,
|
||||||
mopidy_port: this.props.mopidy.port,
|
mopidy_port: this.props.mopidy.port,
|
||||||
mopidy_ssl: this.props.mopidy.ssl,
|
|
||||||
mopidy_library_artists_uri: this.props.mopidy.library_artists_uri,
|
mopidy_library_artists_uri: this.props.mopidy.library_artists_uri,
|
||||||
mopidy_library_albums_uri: this.props.mopidy.library_albums_uri,
|
mopidy_library_albums_uri: this.props.mopidy.library_albums_uri,
|
||||||
pusher_username: this.props.pusher.username,
|
pusher_username: this.props.pusher.username,
|
||||||
@ -67,8 +66,7 @@ class Settings extends React.Component {
|
|||||||
|
|
||||||
this.props.mopidyActions.set({
|
this.props.mopidyActions.set({
|
||||||
host: this.state.mopidy_host,
|
host: this.state.mopidy_host,
|
||||||
port: this.state.mopidy_port,
|
port: this.state.mopidy_port
|
||||||
ssl: this.state.mopidy_ssl
|
|
||||||
});
|
});
|
||||||
|
|
||||||
window.location.reload(true);
|
window.location.reload(true);
|
||||||
@ -103,8 +101,7 @@ class Settings extends React.Component {
|
|||||||
|
|
||||||
renderApplyButton(){
|
renderApplyButton(){
|
||||||
if (this.props.mopidy.host == this.state.mopidy_host &&
|
if (this.props.mopidy.host == this.state.mopidy_host &&
|
||||||
this.props.mopidy.port == this.state.mopidy_port &&
|
this.props.mopidy.port == this.state.mopidy_port){
|
||||||
this.props.mopidy.ssl == this.state.mopidy_ssl){
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -227,22 +224,6 @@ class Settings extends React.Component {
|
|||||||
value={ this.state.mopidy_port } />
|
value={ this.state.mopidy_port } />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="field checkbox">
|
|
||||||
<div className="name">Encryption</div>
|
|
||||||
<div className="input">
|
|
||||||
<label>
|
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
name="ssl"
|
|
||||||
checked={this.state.mopidy_ssl}
|
|
||||||
onChange={e => this.setState({mopidy_ssl: !this.state.mopidy_ssl})} />
|
|
||||||
<span className="label tooltip">
|
|
||||||
Enable SSL
|
|
||||||
<span className="tooltip__content">Requires SSL proxy</span>
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{this.renderApplyButton()}
|
{this.renderApplyButton()}
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|||||||
@ -10,6 +10,8 @@ import TrackList from '../../components/TrackList'
|
|||||||
import GridItem from '../../components/GridItem'
|
import GridItem from '../../components/GridItem'
|
||||||
import DropdownField from '../../components/Fields/DropdownField'
|
import DropdownField from '../../components/Fields/DropdownField'
|
||||||
import Icon from '../../components/Icon'
|
import Icon from '../../components/Icon'
|
||||||
|
import URILink from '../../components/URILink'
|
||||||
|
import ErrorBoundary from '../../components/ErrorBoundary'
|
||||||
|
|
||||||
import * as helpers from '../../helpers'
|
import * as helpers from '../../helpers'
|
||||||
import * as uiActions from '../../services/ui/actions'
|
import * as uiActions from '../../services/ui/actions'
|
||||||
@ -63,6 +65,45 @@ class LibraryBrowse extends React.Component{
|
|||||||
this.props.uiActions.hideContextMenu();
|
this.props.uiActions.hideContextMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
renderBreadcrumbs(){
|
||||||
|
|
||||||
|
if (this.props.params.uri){
|
||||||
|
var parent_uri = this.props.params.uri;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (parent_uri.startsWith('file://')){
|
||||||
|
|
||||||
|
var uri = parent_uri.replace('file:///','');
|
||||||
|
var uri_elements = uri.split('/');
|
||||||
|
|
||||||
|
return (
|
||||||
|
<h4>
|
||||||
|
{uri_elements.map((uri_element, index) => {
|
||||||
|
|
||||||
|
// Reconstruct a URL to this element
|
||||||
|
var uri = "file://";
|
||||||
|
for (var i = 0; i <= index; i++){
|
||||||
|
uri += "/"+uri_elements[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<span key={uri}>
|
||||||
|
{index > 0 ? <span> <Icon type="fontawesome" name="angle-right" /> </span> : null}
|
||||||
|
<URILink type="browse" uri={uri}>
|
||||||
|
{uri_element}
|
||||||
|
</URILink>
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</h4>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
renderSubdirectories(subdirectories){
|
renderSubdirectories(subdirectories){
|
||||||
if (this.props.view == 'list'){
|
if (this.props.view == 'list'){
|
||||||
return (
|
return (
|
||||||
@ -152,15 +193,19 @@ class LibraryBrowse extends React.Component{
|
|||||||
{title}
|
{title}
|
||||||
</Header>
|
</Header>
|
||||||
<section className="content-wrapper">
|
<section className="content-wrapper">
|
||||||
|
<ErrorBoundary>
|
||||||
|
|
||||||
{subdirectories ? this.renderSubdirectories(subdirectories) : null}
|
{this.renderBreadcrumbs()}
|
||||||
|
|
||||||
{tracks ? <TrackList
|
{subdirectories ? this.renderSubdirectories(subdirectories) : null}
|
||||||
tracks={this.props.directory.tracks}
|
|
||||||
uri={"iris:browse:"+this.props.params.uri}
|
|
||||||
className="library-local-track-list"
|
|
||||||
/> : null }
|
|
||||||
|
|
||||||
|
{tracks ? <TrackList
|
||||||
|
tracks={this.props.directory.tracks}
|
||||||
|
uri={"iris:browse:"+this.props.params.uri}
|
||||||
|
className="library-local-track-list"
|
||||||
|
/> : null }
|
||||||
|
|
||||||
|
</ErrorBoundary>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@ -230,20 +275,22 @@ class LibraryBrowse extends React.Component{
|
|||||||
</Header>
|
</Header>
|
||||||
<section className="content-wrapper">
|
<section className="content-wrapper">
|
||||||
<div className="grid category-grid">
|
<div className="grid category-grid">
|
||||||
{
|
<ErrorBoundary>
|
||||||
grid_items.map(
|
{
|
||||||
(item, index) => {
|
grid_items.map(
|
||||||
return (
|
(item, index) => {
|
||||||
<GridItem
|
return (
|
||||||
item={item}
|
<GridItem
|
||||||
key={index}
|
item={item}
|
||||||
type="category"
|
key={index}
|
||||||
onClick={e => hashHistory.push(item.link)}
|
type="category"
|
||||||
/>
|
onClick={e => hashHistory.push(item.link)}
|
||||||
)
|
/>
|
||||||
}
|
)
|
||||||
)
|
}
|
||||||
}
|
)
|
||||||
|
}
|
||||||
|
</ErrorBoundary>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -24,8 +24,7 @@ class InitialSetup extends React.Component{
|
|||||||
username: this.props.username,
|
username: this.props.username,
|
||||||
allow_reporting: this.props.allow_reporting,
|
allow_reporting: this.props.allow_reporting,
|
||||||
host: this.props.host,
|
host: this.props.host,
|
||||||
port: this.props.port,
|
port: this.props.port
|
||||||
ssl: this.props.ssl
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,8 +45,7 @@ class InitialSetup extends React.Component{
|
|||||||
});
|
});
|
||||||
this.props.mopidyActions.set({
|
this.props.mopidyActions.set({
|
||||||
host: this.state.host,
|
host: this.state.host,
|
||||||
port: this.state.port,
|
port: this.state.port
|
||||||
ssl: this.state.ssl
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.setState({saving: true});
|
this.setState({saving: true});
|
||||||
@ -56,7 +54,7 @@ class InitialSetup extends React.Component{
|
|||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
|
|
||||||
// We've changed a connection setting, so need to reload
|
// We've changed a connection setting, so need to reload
|
||||||
if (self.state.host !== self.props.host || self.state.port !== self.props.port || self.state.ssl !== self.props.ssl){
|
if (self.state.host !== self.props.host || self.state.port !== self.props.port){
|
||||||
|
|
||||||
window.location = global.baseURL;
|
window.location = global.baseURL;
|
||||||
|
|
||||||
@ -108,21 +106,6 @@ class InitialSetup extends React.Component{
|
|||||||
value={ this.state.port } />
|
value={ this.state.port } />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="field checkbox">
|
|
||||||
<div className="input">
|
|
||||||
<label>
|
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
name="ssl"
|
|
||||||
checked={this.state.ssl}
|
|
||||||
onChange={e => this.setState({ssl: !this.state.ssl})} />
|
|
||||||
<span className="label tooltip">
|
|
||||||
Enable SSL
|
|
||||||
<span className="tooltip__content">Requires SSL proxy</span>
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{helpers.isHosted() ? null : <div className="field checkbox">
|
{helpers.isHosted() ? null : <div className="field checkbox">
|
||||||
<div className="input">
|
<div className="input">
|
||||||
@ -157,8 +140,7 @@ const mapStateToProps = (state, ownProps) => {
|
|||||||
allow_reporting: state.ui.allow_reporting,
|
allow_reporting: state.ui.allow_reporting,
|
||||||
username: (state.pusher && state.pusher.username ? state.pusher.username : 'Anonymous'),
|
username: (state.pusher && state.pusher.username ? state.pusher.username : 'Anonymous'),
|
||||||
host: state.mopidy.host,
|
host: state.mopidy.host,
|
||||||
port: state.mopidy.port,
|
port: state.mopidy.port
|
||||||
ssl: state.mopidy.ssl
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user