3 Commits
0.3.4 ... 0.3.6

Author SHA1 Message Date
9dcaa1ad39 Added some more logging and documented deploy procedures 2022-04-22 11:09:40 +02:00
c9871c817a Testing to clean up docker stuff before running tests
All checks were successful
continuous-integration/drone/push Build is passing
2022-02-27 20:11:41 +01:00
0fe1e00737 Testing another postgres password
Some checks failed
continuous-integration/drone/push Build is failing
2022-02-27 19:29:56 +01:00
4 changed files with 11 additions and 3 deletions

View File

@@ -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

View File

@@ -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`

View File

@@ -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:

View File

@@ -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()}})