Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9dcaa1ad39 | |||
| c9871c817a | |||
| 0fe1e00737 |
@@ -9,6 +9,7 @@ steps:
|
||||
- name: docker-sock
|
||||
path: /var/run/docker.sock
|
||||
commands:
|
||||
- docker-compose down -v --remove-orphans -t0
|
||||
- docker-compose build
|
||||
- docker-compose --profile tests build
|
||||
- docker-compose run --rm db-migrations
|
||||
@@ -36,6 +37,7 @@ steps:
|
||||
- name: docker-sock
|
||||
path: /var/run/docker.sock
|
||||
commands:
|
||||
- docker-compose down -v --remove-orphans -t0
|
||||
- docker-compose build
|
||||
- docker-compose --profile tests build
|
||||
- docker-compose run --rm db-migrations
|
||||
|
||||
@@ -22,6 +22,10 @@ The account field "role" is a bit special, in that if it contains "admin" as one
|
||||
|
||||
Run integration tests (Requires migrated database and started API): `docker-compose run --rm tests`
|
||||
|
||||
## Deploy a new version
|
||||
|
||||
Everytime a push is done, tests are ran on [Drone](https://drone.larvit.se/pwrpln/auth-api). To deploy a new version to [Dockerhub](https://hub.docker.com/repository/docker/lilleman/auth-api), create a new tag (USE SEMVER!!!).
|
||||
|
||||
## Some useful cURLs
|
||||
|
||||
Obtain an admin GWT: `curl -d '"api-key-goes-here"' -H "Content-Type: application/json" -i http://localhost:4000/auth/api-key`
|
||||
|
||||
@@ -5,7 +5,7 @@ services:
|
||||
image: postgres:14.2-alpine3.15
|
||||
environment:
|
||||
- POSTGRES_USER=postgres
|
||||
- POSTGRES_PASSWORD=puIleHgcpsvDr360ttUo
|
||||
- POSTGRES_PASSWORD=prutt
|
||||
- POSTGRES_DB=auth
|
||||
|
||||
db-migrations:
|
||||
@@ -13,7 +13,7 @@ services:
|
||||
context: .
|
||||
dockerfile: Dockerfile.migrations
|
||||
environment:
|
||||
- DATABASE_URL=postgres://postgres:puIleHgcpsvDr360ttUo@postgres:5432/auth?sslmode=disable
|
||||
- DATABASE_URL=postgres://postgres:prutt@postgres:5432/auth?sslmode=disable
|
||||
command: ["--wait", "up"]
|
||||
profiles: ["migrations"]
|
||||
depends_on:
|
||||
@@ -23,7 +23,7 @@ services:
|
||||
build: .
|
||||
environment:
|
||||
- ADMIN_API_KEY=hihi
|
||||
- DATABASE_URL=postgres://postgres:puIleHgcpsvDr360ttUo@postgres:5432/auth?sslmode=disable
|
||||
- DATABASE_URL=postgres://postgres:prutt@postgres:5432/auth?sslmode=disable
|
||||
- JWT_SHARED_SECRET=hihi
|
||||
- WEB_BIND_HOST=:4000
|
||||
depends_on:
|
||||
|
||||
@@ -143,6 +143,8 @@ func (h Handlers) AccountAuthPassword(c *fiber.Ctx) error {
|
||||
if err != nil {
|
||||
if err.Error() == "no rows in result set" {
|
||||
return c.Status(403).JSON([]ResJSONError{{Error: "Invalid name or password"}})
|
||||
} else {
|
||||
h.Log.Error("unknown error when resolving account", "err", err.Error())
|
||||
}
|
||||
|
||||
return c.Status(500).JSON([]ResJSONError{{Error: err.Error()}})
|
||||
|
||||
Reference in New Issue
Block a user