1
0
mirror of https://github.com/mgerb/classic-wow-forums synced 2026-01-10 09:02:50 +00:00

client - add error message if user account does not have battletag

This commit is contained in:
2018-01-27 17:26:47 -06:00
parent da738c5535
commit b90860f251
6 changed files with 79 additions and 9 deletions

View File

@@ -77,6 +77,8 @@ mix local.hex
- Check out `.exguard.exs` for configuration. - Check out `.exguard.exs` for configuration.
# Postgres setup # Postgres setup
[Setup on Centos7](https://linode.com/docs/databases/postgresql/how-to-install-postgresql-relational-databases-on-centos-7/)
Change password to postgres user Change password to postgres user
``` ```
sudo -u user_name psql db_name sudo -u user_name psql db_name
@@ -120,3 +122,55 @@ https://localhost {
} }
} }
``` ```
# Hosting on Vultr
### Centos setup from scratch
[Enable private networking](https://www.vultr.com/docs/configuring-private-network)
```
/etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=static
IPADDR=<ip>
NETMASK=<netmask>
IPV6INIT=no
MTU=1450
```
Disable firewalld (make sure firewall is enabled in vultr config)
```
systemctl disable firewalld
```
Install and start postgresql
```
sudo yum install postgresql-server postgresql-contrib
sudo postgresql-setup initdb
sudo systemctl start postgresql
sudo systemctl enable postgresql
```
Configure user
```
sudo passwd postgres
su postgres
psql -d template1 -c "ALTER USER postgres WITH PASSWORD 'newpassword';"
```
Allow connections on all interfaces
```
/var/lib/pgsql/data/postgresql.conf
listen_address='*'
```
```
/var/lib/pgsql/data/pg_hba.conf
host all all 0.0.0.0/0 md5
```

4
client/.gitignore vendored
View File

@@ -1,4 +1,6 @@
.vscode .vscode
node_modules node_modules
yarn-error* yarn-error*
dist dist
prod_ssh_key
copy_build_prod.sh

View File

@@ -1,13 +1,22 @@
import React from 'react'; import React from 'react';
import { RouteComponentProps } from 'react-router-dom'; import { RouteComponentProps } from 'react-router-dom';
import { parse } from 'query-string'; import { parse } from 'query-string';
import { ContentContainer } from '../../components';
import { UserService } from '../../services'; import { UserService } from '../../services';
interface Props extends RouteComponentProps<any> {} interface Props extends RouteComponentProps<any> {}
interface State {} interface State {
errorMessage?: string;
}
export class Oauth extends React.Component<Props, State> { export class Oauth extends React.Component<Props, State> {
constructor(props: Props) {
super(props);
this.state = {};
}
componentDidMount() { componentDidMount() {
this.login(this.props.location.search); this.login(this.props.location.search);
} }
@@ -17,14 +26,19 @@ export class Oauth extends React.Component<Props, State> {
const code = parse(queryString).code; const code = parse(queryString).code;
await UserService.authorize(code); await UserService.authorize(code);
window.opener.location.reload(); window.opener.location.reload();
// TODO: this doesn't work on mobile currently
window.close(); window.close();
} catch (e) { } catch (e) {
console.error(e); this.setState({
errorMessage: 'Unable to log in. Your account may not be in the right region, or you may not have set a battletag.',
});
} }
} }
render() { render() {
return <div />; return (
<ContentContainer style={{ minHeight: '500px', padding: '50px', textAlign: 'center' }}>
<b>{this.state.errorMessage}</b>
</ContentContainer>
);
} }
} }

View File

@@ -198,9 +198,8 @@ export class UserAccount extends React.Component<Props, State> {
{noCharacters && {noCharacters &&
<div> <div>
<p>Unable to fetch your characters. <p>Unable to fetch your characters.</p>
<a onClick={() => this.setState({ region: 'eu' }, () => this.getCharacters())}>EU account?</a> <a onClick={() => this.setState({ region: 'eu' }, () => this.getCharacters())}>EU account?</a>
</p>
</div> </div>
} }

View File

@@ -14,6 +14,7 @@ config :myapp, MyAppWeb.Endpoint,
# Configure your database # Configure your database
config :myapp, MyApp.Repo, config :myapp, MyApp.Repo,
adapter: Ecto.Adapters.Postgres, adapter: Ecto.Adapters.Postgres,
hostnamae: "localhost",
username: "postgres", username: "postgres",
password: "postgres", password: "postgres",
database: "myapp_prod", database: "myapp_prod",

View File

@@ -6,6 +6,6 @@ build-client:
cd client && yarn install && yarn run build cd client && yarn install && yarn run build
build-server: build-server:
mix deps.get && MIX_ENV=prod mix release --env=prod MIX_ENV=prod mix deps.get && MIX_ENV=prod mix release --env=prod
all: clean build-client build-server all: clean build-client build-server