Skip to content

Commit 871195f

Browse files
authored
docs: update CONTRIBUTING.md for macOS installation instructions (#1893)
## What kind of change does this PR introduce? Docs update: Add macOS installation instructions to the CONTRIBUTING.md file. Fixes #1685. ## What is the current behavior? The current CONTRIBUTING.md does not include specific installation instructions, which may lead to confusion during setup. ## What is the new behavior? This PR updates outdated instructions in the CONTRIBUTING.md file. ensuring a smoother setup experience for contributors.
1 parent a3cbe6a commit 871195f

File tree

1 file changed

+33
-57
lines changed

1 file changed

+33
-57
lines changed

CONTRIBUTING.md

+33-57
Original file line numberDiff line numberDiff line change
@@ -61,39 +61,37 @@ Therefore, to contribute to Auth you will need to install these tools.
6161

6262
- Install [Go](https://go.dev) 1.22
6363

64-
```terminal
65-
# Via Homebrew on OSX
64+
```zsh
65+
# Via Homebrew on macOS
6666
brew install [email protected]
6767

68-
# Set the GOPATH environment variable in the ~/.zshrc file
69-
export GOPATH="$HOME/go"
70-
71-
# Add the GOPATH to your path
72-
echo 'export PATH="$GOPATH/bin:$PATH"' >> ~/.zshrc
68+
# Set the environment variable in the ~/.zshrc file
69+
echo 'export PATH="/opt/homebrew/opt/[email protected]/bin:$PATH"' >> ~/.zshrc
7370
```
7471

7572
- Install [Docker](https://www.docker.com/get-started)
7673

77-
```terminal
78-
# Via Homebrew on OSX
74+
```zsh
75+
# Via Homebrew on macOS
7976
brew install docker
8077
```
8178

8279
Or, if you prefer, download [Docker Desktop](https://www.docker.com/get-started).
8380

8481
- Install [Soda CLI](https://gobuffalo.io/en/docs/db/toolbox)
8582

83+
```zsh
84+
# Via Homebrew on macOS
85+
brew install gobuffalo/tap/pop
86+
```
87+
8688
If you are on macOS Catalina you may [run into issues installing Soda with Brew](https://github.com/gobuffalo/homebrew-tap/issues/5). Do check your `GOPATH` and run
8789

8890
`go build -o /bin/soda github.com/gobuffalo/pop/soda` to resolve.
8991

90-
```
91-
go install github.com/gobuffalo/pop/soda@latest
92-
```
93-
9492
- Clone the Auth [repository](https://github.com/supabase/auth)
9593

96-
```
94+
```zsh
9795
git clone https://github.com/supabase/auth
9896
```
9997

@@ -116,67 +114,44 @@ To complete installation, you will:
116114
1. Start Docker
117115
2. To install the PostgreSQL Docker image, run:
118116

119-
```
117+
```zsh
120118
# Builds the postgres image
121119
docker-compose -f docker-compose-dev.yml build postgres
122120

123121
# Runs the postgres container
124122
docker-compose -f docker-compose-dev.yml up postgres
125123
```
126124

127-
You may see a message like:
128-
129-
```
130-
Unable to find image 'postgres:14' locally
131-
```
132-
133-
And then
134-
135-
```
136-
Pulling from library/postgres
137-
```
138-
139-
as Docker installs the image:
140-
141-
```
142-
Unable to find image 'postgres:14' locally
143-
13: Pulling from library/postgres
144-
968621624b32: Pull complete
145-
9ef9c0761899: Pull complete
146-
effb6e89256d: Pull complete
147-
e19a7fe239e0: Pull complete
148-
7f97626b93ac: Pull complete
149-
ecc35a9a2c7c: Pull complete
150-
b749e660435b: Pull complete
151-
457ea4f6253a: Pull complete
152-
722af21d2ec3: Pull complete
153-
899eee526623: Pull complete
154-
746f304547aa: Pull complete
155-
2d4dfc6819e6: Pull complete
156-
c99864ddd548: Pull complete
157-
Digest: sha256:3c6d1cef78fe0c84a79c76f0907aed29895dff661fecd45103f7afe2a055078e
158-
Status: Downloaded newer image for postgres:14
159-
f709b97d83fddc3b099e4f2ddc4cb2fbf68052e7a8093332bec57672f38cfa36
160-
```
161-
162125
You should then see in Docker that `auth_postgresql` is running on `port: 5432`.
163126

164127
> **Important** If you happen to already have a local running instance of Postgres running on the port `5432` because you
165-
> may have installed via [homebrew on OSX](https://formulae.brew.sh/formula/postgresql) then be certain to stop the process using:
128+
> may have installed via [homebrew on macOS](https://formulae.brew.sh/formula/postgresql) then be certain to stop the process using:
166129
>
167130
> - `brew services stop postgresql`
168131
>
169132
> If you need to run the test environment on another port, you will need to modify several configuration files to use a different custom port.
170133
171134
3. Next compile the Auth binary:
172135

136+
When you fork a repository, GitHub does not automatically copy all the tags (tags are not included by default). To ensure the correct tag is set before building the binary, you need to fetch the tags from the upstream repository and push them to your fork. Follow these steps:
137+
138+
```zsh
139+
# Fetch the tags from the upstream repository
140+
git fetch upstream --tags
141+
142+
# Push the tags to your fork
143+
git push origin --tags
173144
```
145+
146+
Then build the binary by running:
147+
148+
```zsh
174149
make build
175150
```
176151

177152
4. To setup the database schema via Soda, run:
178153

179-
```
154+
```zsh
180155
make migrate_test
181156
```
182157

@@ -200,7 +175,8 @@ Version Name Status
200175

201176
That lists each migration that was applied. Note: there may be more migrations than those listed.
202177

203-
4. Create a `.env` file in the root of the project and copy the following config in [example.env](example.env)
178+
4. Create a `.env` file in the root of the project and copy the following config in [example.env](example.env). Set the values to GOTRUE_SMS_TEST_OTP_VALID_UNTIL in the `.env` file.
179+
204180
5. In order to have Auth connect to your PostgreSQL database running in Docker, it is important to set a connection string like:
205181

206182
```
@@ -216,13 +192,13 @@ DATABASE_URL="postgres://supabase_auth_admin:root@localhost:5432/postgres"
216192

217193
Start Auth by running the executable:
218194

219-
```
195+
```zsh
220196
./auth
221197
```
222198

223199
This command will re-run migrations and then indicate that Auth has started:
224200

225-
```
201+
```zsh
226202
INFO[0000] Auth API started on: localhost:9999
227203
```
228204

@@ -425,7 +401,7 @@ The response from `/admin/users` should return all users:
425401

426402
If you need to run any new migrations:
427403

428-
```
404+
```zsh
429405
make migrate_test
430406
```
431407

@@ -489,7 +465,7 @@ export GOTRUE_DB_DATABASE_URL="postgres://supabase_auth_admin:root@localhost:743
489465
container_name: auth_postgres
490466
```
491467

492-
```
468+
```zsh
493469
# Command line into bash on the PostgreSQL container
494470
docker exec -it auth_postgres bash
495471

0 commit comments

Comments
 (0)