Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions .air.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Docs for .air.toml
# https://github.com/cosmtrek/air/blob/master/air_example.toml

root = "."

[build]
cmd = "task build"
full_bin = "task serve"
delay = 100
exclude_dir = ["tmp", "dist", "internal/database/dbgen"]
exclude_file = ["internal/view/static/css/style.css"]
exclude_regex = ["_test.go", "_generated.go", ".sql.go", ".gen.go"]
include_ext = ["go", "sql", "js", "css", "json"]

[log]
main_only = true
# Docs for .air.toml
# https://github.com/cosmtrek/air/blob/master/air_example.toml
root = "."
[build]
cmd = "task build"
full_bin = "task serve"
delay = 100
exclude_dir = ["tmp", "dist", "internal/database/dbgen"]
exclude_file = ["internal/view/static/css/style.css"]
exclude_regex = ["_test.go", "_generated.go", ".sql.go", ".gen.go"]
include_ext = ["go", "sql", "js", "css", "json"]
[log]
main_only = true
28 changes: 14 additions & 14 deletions .env.dev
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
###############################################################################
# ⚠️ Do not use this file in production. This is only for development purposes.
###############################################################################

# This values are configured by default in the compose.yaml file, so you can
# copy this file to .env and use it as is (only for development).

# Encryption key is used to encrypt and decrypt the sensitive data stored
# in the database such as database credentials, secret keys, etc.
PBW_ENCRYPTION_KEY="encryption-key"

# Database connection string for a PostgreSQL database where the pgbackweb
# will store its data.
PBW_POSTGRES_CONN_STRING="postgresql://postgres:password@host.docker.internal:5432/pgbackweb?sslmode=disable"
###############################################################################
# ⚠️ Do not use this file in production. This is only for development purposes.
###############################################################################
# This values are configured by default in the compose.yaml file, so you can
# copy this file to .env and use it as is (only for development).
# Encryption key is used to encrypt and decrypt the sensitive data stored
# in the database such as database credentials, secret keys, etc.
PBW_ENCRYPTION_KEY="encryption-key"
# Database connection string for a PostgreSQL database where the pgbackweb
# will store its data.
PBW_POSTGRES_CONN_STRING="postgresql://postgres:password@host.docker.internal:5432/pgbackweb?sslmode=disable"
14 changes: 7 additions & 7 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Encryption key is used to encrypt and decrypt the sensitive data stored
# in the database such as database credentials, secret keys, etc.
PBW_ENCRYPTION_KEY=""

# Database connection string for a PostgreSQL database where the pgbackweb
# will store its data.
PBW_POSTGRES_CONN_STRING=""
# Encryption key is used to encrypt and decrypt the sensitive data stored
# in the database such as database credentials, secret keys, etc.
PBW_ENCRYPTION_KEY=""
# Database connection string for a PostgreSQL database where the pgbackweb
# will store its data.
PBW_POSTGRES_CONN_STRING=""
58 changes: 29 additions & 29 deletions .github/workflows/lint-test-build.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
name: Lint, test & build

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
run_all:
name: Run all
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Build docker image
run: docker build -t pbw-test -f ./docker/Dockerfile.cicd .

- name: Run linter
run: docker run --rm pbw-test task lint-only

- name: Run tests
run: docker run --rm pbw-test task test-only

- name: Run build
run: docker run --rm pbw-test task build
name: Lint, test & build
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
run_all:
name: Run all
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build docker image
run: docker build -t pbw-test -f ./docker/Dockerfile.cicd .
- name: Run linter
run: docker run --rm pbw-test task lint-only
- name: Run tests
run: docker run --rm pbw-test task test-only
- name: Run build
run: docker run --rm pbw-test task build
48 changes: 24 additions & 24 deletions .github/workflows/sync-docker-hub-readme.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
name: Sync Docker Hub README

on:
push:
branches:
- main
paths:
- README.md
workflow_dispatch:

jobs:
run_sync:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Sync Docker Hub README
uses: ms-jpq/sync-dockerhub-readme@v1
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}
repository: eduardolat/pgbackweb
readme: "./README.md"
name: Sync Docker Hub README
on:
push:
branches:
- main
paths:
- README.md
workflow_dispatch:
jobs:
run_sync:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Sync Docker Hub README
uses: ms-jpq/sync-dockerhub-readme@v1
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}
repository: eduardolat/pgbackweb
readme: "./README.md"
63 changes: 31 additions & 32 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
# Environment
.env
.env.*
!.env.dev
!.env.example

# NodeJS
node_modules/

# Distribution folder
dist/
.idea/

# Temp files/folders
tmp/

# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Go workspace file
go.work
go.work.sum
# Environment
!.env.dev
!.env.example

# NodeJS
node_modules/

# Distribution folder
dist/
.idea/

# Temp files/folders
tmp/

# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Go workspace file
go.work
go.work.sum
config.bat
24 changes: 12 additions & 12 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
run:
timeout: "5m"

linters:
disable-all: true
enable:
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- unused
run:
timeout: "5m"
linters:
disable-all: true
enable:
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- unused
12 changes: 6 additions & 6 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"recommendations": [
"golang.go",
"bradlc.vscode-tailwindcss",
"standard.vscode-standard"
]
{
"recommendations": [
"golang.go",
"bradlc.vscode-tailwindcss",
"standard.vscode-standard"
]
}
66 changes: 33 additions & 33 deletions .vscode/project.code-snippets
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{
"If error return error": {
"prefix": "rerr",
"body": [
"if err != nil {",
"\treturn err",
"}",
""
],
"description": "Inserts code to check for error and return it"
},
"Get request context": {
"prefix": "grcr", // Get Request Context Request
"body": [
"ctx := c.Request().Context()"
],
"description": "Get's the request from echo context"
},
"Get request echo context": {
"prefix": "grce", // Get Request Context Echo
"body": [
"reqCtx := reqctx.GetCtx(c)"
],
"description": "Inserts code to get echo context from a request"
},
"Get both request and echo context": {
"prefix": "grcb", // Get Request Context Both
"body": [
"ctx := c.Request().Context()",
"reqCtx := reqctx.GetCtx(c)"
],
"description": "Inserts code to get both request and echo context"
},
{
"If error return error": {
"prefix": "rerr",
"body": [
"if err != nil {",
"\treturn err",
"}",
""
],
"description": "Inserts code to check for error and return it"
},
"Get request context": {
"prefix": "grcr", // Get Request Context Request
"body": [
"ctx := c.Request().Context()"
],
"description": "Get's the request from echo context"
},
"Get request echo context": {
"prefix": "grce", // Get Request Context Echo
"body": [
"reqCtx := reqctx.GetCtx(c)"
],
"description": "Inserts code to get echo context from a request"
},
"Get both request and echo context": {
"prefix": "grcb", // Get Request Context Both
"body": [
"ctx := c.Request().Context()",
"reqCtx := reqctx.GetCtx(c)"
],
"description": "Inserts code to get both request and echo context"
},
}
Loading