Skip to content

Commit a0abd22

Browse files
author
Katie Harris
committed
Remove Sign Up button and let users use username instead of email. Update Dockerfile
1 parent 2d4e038 commit a0abd22

2 files changed

Lines changed: 25 additions & 12 deletions

File tree

Dockerfile

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,22 @@ COPY --from=build /sqlpad/docker-entrypoint /
7272
COPY --from=build /sqlpad/server .
7373

7474
ENV NODE_ENV production
75-
ENV SQLPAD_DB_PATH /var/lib/sqlpad
76-
ENV SQLPAD_PORT 3000
77-
EXPOSE 3000
75+
ENV SQLPAD_DB_PATH=/var/lib/sqlpad
76+
ENV SQLPAD_PORT=3030
77+
ENV SQLPAD_ADMIN=${SQLPAD_USER}
78+
ENV SQLPAD_ADMIN_PASSWORD=${SQLPAD_PASSWORD}
79+
ENV SQLPAD_TRUST_PROXY="true"
80+
ENV SQLPAD_BASE_URL="/dbadmin"
81+
ENV SQLPAD_PASSPHRASE=${SQLPAD_PASSWORD}-${SQLPAD_USER}-passphrase
82+
ENV SQLPAD_CONNECTIONS__postgres__name="Connected PostgreSQL DB"
83+
ENV SQLPAD_CONNECTIONS__postgres__driver=postgres
84+
ENV SQLPAD_CONNECTIONS__postgres__port="5432"
85+
ENV SQLPAD_CONNECTIONS__postgres__host=${POSTGRES_HOST}
86+
ENV SQLPAD_CONNECTIONS__postgres__database=${POSTGRES_DB}
87+
ENV SQLPAD_CONNECTIONS__postgres__username=${POSTGRES_USER}
88+
ENV SQLPAD_CONNECTIONS__postgres__password=${POSTGRES_PASSWORD}
89+
90+
EXPOSE 3030
7891
ENTRYPOINT ["/docker-entrypoint"]
7992

8093
# Things to think about for future docker builds

client/src/pages/SignIn.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { api } from '../utilities/api';
1111
import useAppContext from '../utilities/use-app-context';
1212

1313
function SignIn() {
14-
const [email, setEmail] = useState('');
14+
const [username, setUsername] = useState('');
1515
const [password, setPassword] = useState('');
1616
const history = useHistory();
1717
const { config } = useAppContext();
@@ -23,7 +23,7 @@ function SignIn() {
2323
const signIn = async (e: React.FormEvent) => {
2424
e.preventDefault();
2525

26-
const json = await api.post('/api/signin', { email, password });
26+
const json = await api.post('/api/signin', { username, password });
2727
if (json.error) {
2828
return message.error('Username or password incorrect');
2929
}
@@ -37,21 +37,21 @@ function SignIn() {
3737

3838
let placeholderText = '';
3939
if (config.ldapConfigured && config.localAuthConfigured) {
40-
placeholderText = 'username or email address';
40+
placeholderText = 'username';
4141
} else if (config.ldapConfigured) {
4242
placeholderText = 'username';
4343
} else if (config.localAuthConfigured) {
44-
placeholderText = 'email address';
44+
placeholderText = 'username';
4545
}
4646

4747
const localLdapForm = (
4848
<form onSubmit={signIn}>
4949
<Input
50-
name="email"
51-
type="email"
50+
name="username"
51+
type="text"
5252
placeholder={placeholderText}
5353
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
54-
setEmail(e.target.value)
54+
setUsername(e.target.value)
5555
}
5656
required
5757
/>
@@ -76,7 +76,7 @@ function SignIn() {
7676
</Button>
7777
<Spacer />
7878

79-
{config.localAuthConfigured && (
79+
{/* {config.localAuthConfigured && (
8080
<Link
8181
style={{
8282
display: 'inline-block',
@@ -87,7 +87,7 @@ function SignIn() {
8787
>
8888
Sign Up
8989
</Link>
90-
)}
90+
)} */}
9191
</form>
9292
);
9393

0 commit comments

Comments
 (0)