Skip to content

Commit 796013f

Browse files
authored
Merge pull request #1 from eduardolat/main
Update pgbackweb
2 parents 43d8aff + 70e0d9e commit 796013f

100 files changed

Lines changed: 4212 additions & 1296 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,20 @@ alias la='ls -A'
1111
alias l='ls -CF'
1212
alias ..='cd ..'
1313
alias c='clear'
14-
echo "[OK] aliases set"
1514

1615
# Set the user file-creation mode mask to 000, which allows all
1716
# users read, write, and execute permissions for newly created files.
1817
umask 000
19-
echo "[OK] umask set"
2018

2119
# Run the 'fixperms' task that fixes the permissions of the files and
2220
# directories in the project.
2321
task fixperms
24-
echo "[OK] permissions fixed"
2522

2623
# Configure Git to ignore ownership and file mode changes.
2724
git config --global --add safe.directory '*'
2825
git config --global core.fileMode false
2926
git config --unset core.fileMode
3027
git config core.fileMode false
31-
echo "[OK] git configured"
3228

3329
echo "
3430
───────────────────────────────────────────────

.devcontainer/devcontainer.json

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"extensions": [
88
"golang.go",
99
"bradlc.vscode-tailwindcss",
10-
"denoland.vscode-deno",
10+
"esbenp.prettier-vscode",
1111
"mhutchie.git-graph",
1212
"mutantdino.resourcemonitor",
1313
"Compile-TomaszKasperczyk.copy-to-llm"
@@ -18,59 +18,47 @@
1818
/////
1919
"editor.formatOnSave": true,
2020
"editor.foldingStrategy": "indentation",
21-
"editor.rulers": [
22-
80
23-
],
21+
"editor.rulers": [80],
2422
"files.eol": "\n",
2523
/////
2624
// Language specific settings
2725
/////
2826
"[json]": {
29-
"editor.defaultFormatter": "denoland.vscode-deno"
27+
"editor.defaultFormatter": "esbenp.prettier-vscode"
3028
},
3129
"[jsonc]": {
32-
"editor.defaultFormatter": "denoland.vscode-deno"
30+
"editor.defaultFormatter": "esbenp.prettier-vscode"
3331
},
3432
"[typescript]": {
35-
"editor.defaultFormatter": "denoland.vscode-deno"
33+
"editor.defaultFormatter": "esbenp.prettier-vscode"
3634
},
3735
"[javascript]": {
38-
"editor.defaultFormatter": "denoland.vscode-deno"
36+
"editor.defaultFormatter": "esbenp.prettier-vscode"
3937
},
4038
"[css]": {
41-
"editor.defaultFormatter": "denoland.vscode-deno"
39+
"editor.defaultFormatter": "esbenp.prettier-vscode"
4240
},
4341
"[html]": {
44-
"editor.defaultFormatter": "denoland.vscode-deno"
42+
"editor.defaultFormatter": "esbenp.prettier-vscode"
4543
},
4644
"[markdown]": {
47-
"editor.defaultFormatter": "denoland.vscode-deno"
45+
"editor.defaultFormatter": "esbenp.prettier-vscode"
4846
},
4947
// Go & Golangci-lint
5048
"[go]": {
5149
"editor.defaultFormatter": "golang.go"
5250
},
5351
"go.lintTool": "golangci-lint",
54-
"go.lintFlags": [
55-
"--fast"
56-
],
57-
// Deno
58-
"deno.enable": true,
52+
"go.lintFlags": ["--fast"],
5953
/////
6054
// Tailwind CSS + NodX
6155
/////
6256
"tailwindCSS.includeLanguages": {
6357
"go": "go"
6458
},
6559
"tailwindCSS.experimental.classRegex": [
66-
[
67-
"Class\\(([^)]*)\\)",
68-
"[\"`]([^\"`]*)[\"`]"
69-
], // Class("...") or Class(`...`)
70-
[
71-
"ClassMap\\{([^)]*)\\}",
72-
"[\"`]([^\"`]*)[\"`]"
73-
] // ClassMap{"..."} or ClassMap{`...`}
60+
["Class\\(([^)]*)\\)", "[\"`]([^\"`]*)[\"`]"], // Class("...") or Class(`...`)
61+
["ClassMap\\{([^)]*)\\}", "[\"`]([^\"`]*)[\"`]"] // ClassMap{"..."} or ClassMap{`...`}
7462
]
7563
}
7664
}

.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ PBW_LISTEN_HOST=""
1212
# The port on which the pgbackweb will listen for incoming HTTP requests.
1313
PBW_LISTEN_PORT=""
1414

15+
# Path prefix to use for all routes. If you set this to e.g. "/pgbackweb",
16+
# the web interface will be available at http://<host>:<port>/pgbackweb
17+
PBW_PATH_PREFIX=""
18+
1519
# Your timezone, this impacts logging, backup filenames and default timezone
1620
# in the web interface.
1721
TZ=""
Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Lint, test, and build
1+
name: CI (Lint, Test, Build)
22
on:
33
workflow_dispatch:
44
push:
@@ -11,13 +11,14 @@ on:
1111
- develop
1212

1313
jobs:
14-
lint-test-build:
14+
ci:
1515
strategy:
1616
matrix:
17-
vars: [
18-
{ os: ubuntu-24.04, platform: linux/amd64 },
19-
{ os: ubuntu-24.04-arm, platform: linux/arm64 },
20-
]
17+
vars:
18+
[
19+
{ os: ubuntu-24.04, platform: linux/amd64 },
20+
{ os: ubuntu-24.04-arm, platform: linux/arm64 },
21+
]
2122

2223
name: Lint, test, and build the code
2324
runs-on: ${{ matrix.vars.os }}
@@ -41,14 +42,4 @@ jobs:
4142
--file docker/Dockerfile.dev .
4243
4344
- name: Run lint, test, and build
44-
run: >
45-
docker run --rm -v $PWD:/app pgbackweb:latest /bin/bash -c "
46-
cd /app &&
47-
deno install &&
48-
go mod download &&
49-
task fixperms &&
50-
task check-deps &&
51-
task lint-only &&
52-
task test-only &&
53-
task build
54-
"
45+
run: docker run --rm -v $PWD:/app pgbackweb:latest /bin/bash -c "cd /app && task ci"

.github/workflows/docs-deploy.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "docs/**"
9+
10+
jobs:
11+
deploy:
12+
name: Deploy to Cloudflare Pages
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
deployments: write
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Deploy
23+
uses: cloudflare/wrangler-action@v3
24+
with:
25+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
26+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
27+
command: pages deploy ./docs --project-name=ufobackup
28+
gitHubToken: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/publish-docker-image.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
required: true
99
default: main
1010
tag:
11-
description: The version tag for the Docker image (e.g., 1.0.0)
11+
description: The version tag for the Docker image (e.g., 1.0.0) ⚠️ Without v prefix ⚠️
1212
required: true
1313
latest:
1414
description: Choose "yes" to also tag the image as "latest" in Docker Hub
@@ -22,10 +22,11 @@ jobs:
2222
build-and-push-images:
2323
strategy:
2424
matrix:
25-
vars: [
26-
{ os: ubuntu-24.04, platform: amd64 },
27-
{ os: ubuntu-24.04-arm, platform: arm64 },
28-
]
25+
vars:
26+
[
27+
{ os: ubuntu-24.04, platform: amd64 },
28+
{ os: ubuntu-24.04-arm, platform: arm64 },
29+
]
2930

3031
name: Build and push images
3132
runs-on: ${{ matrix.vars.os }}
@@ -37,6 +38,9 @@ jobs:
3738
with:
3839
ref: ${{ github.event.inputs.commit }}
3940

41+
- name: Set tag version
42+
run: chmod +x ./scripts/set-version.sh && ./scripts/set-version.sh v${{ github.event.inputs.tag }}
43+
4044
- name: Login to Docker Hub
4145
uses: docker/login-action@v3
4246
with:

.golangci.yaml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
1-
run:
2-
timeout: "5m"
3-
1+
version: "2"
42
linters:
5-
disable-all: true
3+
default: none
64
enable:
75
- errcheck
8-
- gosimple
96
- govet
107
- ineffassign
118
- staticcheck
129
- unused
10+
exclusions:
11+
generated: lax
12+
presets:
13+
- comments
14+
- common-false-positives
15+
- legacy
16+
- std-error-handling
17+
paths:
18+
- third_party$
19+
- builtin$
20+
- examples$
21+
formatters:
22+
exclusions:
23+
generated: lax
24+
paths:
25+
- third_party$
26+
- builtin$
27+
- examples$

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
internal/view/static/libs/
2+
internal/view/static/build/

.prettierrc

Whitespace-only changes.

.vscode/project.code-snippets

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,22 @@
11
{
22
"If error return error": {
33
"prefix": "rerr",
4-
"body": [
5-
"if err != nil {",
6-
"\treturn err",
7-
"}",
8-
""
9-
],
10-
"description": "Inserts code to check for error and return it"
4+
"body": ["if err != nil {", "\treturn err", "}", ""],
5+
"description": "Inserts code to check for error and return it",
116
},
127
"Get request context": {
138
"prefix": "grcr", // Get Request Context Request
14-
"body": [
15-
"ctx := c.Request().Context()"
16-
],
17-
"description": "Get's the request from echo context"
9+
"body": ["ctx := c.Request().Context()"],
10+
"description": "Get's the request from echo context",
1811
},
1912
"Get request echo context": {
2013
"prefix": "grce", // Get Request Context Echo
21-
"body": [
22-
"reqCtx := reqctx.GetCtx(c)"
23-
],
24-
"description": "Inserts code to get echo context from a request"
14+
"body": ["reqCtx := reqctx.GetCtx(c)"],
15+
"description": "Inserts code to get echo context from a request",
2516
},
2617
"Get both request and echo context": {
2718
"prefix": "grcb", // Get Request Context Both
28-
"body": [
29-
"ctx := c.Request().Context()",
30-
"reqCtx := reqctx.GetCtx(c)"
31-
],
32-
"description": "Inserts code to get both request and echo context"
19+
"body": ["ctx := c.Request().Context()", "reqCtx := reqctx.GetCtx(c)"],
20+
"description": "Inserts code to get both request and echo context",
3321
},
34-
}
22+
}

0 commit comments

Comments
 (0)