Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
6ad60b5
Update FetchGoat name in support-project-v1.json
eduardolat Feb 22, 2025
ada595e
💖 Update FetchGoat sponsorship details in support-project-v1.json
eduardolat Feb 22, 2025
db60518
Add Hetzner logo to assets
eduardolat Mar 14, 2025
c32c485
Add Hetzner referral link
eduardolat Mar 14, 2025
8054b12
Update Hetzner logo in support-project-v1.json and add new horizontal…
eduardolat Mar 14, 2025
06aead0
Merge branch 'main' into develop
eduardolat Sep 27, 2025
2e0447d
Adds support for path prefix configuration
PatrikScully Oct 3, 2025
e91d202
Refactors pathutil test suite for better isolation
PatrikScully Oct 3, 2025
6965e14
Supports subdirectory deployment with configurable path prefix
PatrikScully Oct 3, 2025
7658e21
Refactors URL paths using pathutil.BuildPath function
PatrikScully Oct 3, 2025
7b81f8a
Standardizes URL path formatting in dashboard components
PatrikScully Oct 3, 2025
f39598d
Refactors URL handling with pathutil.BuildPath
PatrikScully Oct 3, 2025
173697b
Merge branch 'main' into develop
eduardolat Oct 5, 2025
1374c4e
Merge pull request #139 from PatrikScully/feature/path-prefix
eduardolat Oct 5, 2025
fd58d41
Refactor README.md for improved readability and consistency
eduardolat Oct 5, 2025
d93b5db
Refactor path prefix handling in router and main functions
eduardolat Oct 5, 2025
6a44880
Add pathutil import to backups and webhooks packages
eduardolat Oct 5, 2025
eeabd31
Refactor prefixImagePath function to clarify path validation logic
eduardolat Oct 5, 2025
a4adc07
Inject path prefix as a global JavaScript variable in commonHead func…
eduardolat Oct 5, 2025
6a8784d
Remove SweetAlert2 script from common layout and update Tailwind CSS …
eduardolat Oct 5, 2025
79356c3
Rename swalAlert and swalConfirm functions to customAlert and customC…
eduardolat Oct 6, 2025
b3813db
Add autofocus to input fields in createFirstUser and login pages
eduardolat Oct 6, 2025
ccaa48a
Add path prefix configuration to .env.example for routing
eduardolat Oct 6, 2025
82e199d
Refactor server address and local URL logging for improved readability
eduardolat Oct 6, 2025
af4b05b
Update PostgreSQL image version from 17 to 18 in Docker configuration
eduardolat Oct 6, 2025
6013c66
Add GitHub Actions workflow for documentation deployment to Cloudflar…
eduardolat Oct 6, 2025
c103df6
Add initial documentation files for UFO Backup project
eduardolat Oct 6, 2025
4577b6d
Update community link in dashboard header to point to the new communi…
eduardolat Oct 6, 2025
8282d9b
Update README to reflect project name change to UFO Backup and invite…
eduardolat Oct 6, 2025
9a2b0e2
Update deployment command for docs directory
eduardolat Oct 6, 2025
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
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ PBW_LISTEN_HOST=""
# The port on which the pgbackweb will listen for incoming HTTP requests.
PBW_LISTEN_PORT=""

# Path prefix to use for all routes. If you set this to e.g. "/pgbackweb",
# the web interface will be available at http://<host>:<port>/pgbackweb
PBW_PATH_PREFIX=""

# Your timezone, this impacts logging, backup filenames and default timezone
# in the web interface.
TZ=""
28 changes: 28 additions & 0 deletions .github/workflows/docs-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deploy Documentation

on:
push:
branches:
- main
paths:
- "docs/**"

jobs:
deploy:
name: Deploy to Cloudflare Pages
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Deploy
uses: cloudflare/wrangler-action@v3
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
command: pages deploy ./docs --project-name=ufobackup
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
internal/view/static/libs/
internal/view/static/build/
91 changes: 36 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
🐘 Effortless PostgreSQL backups with a user-friendly web interface! 🌐💾
</p>
</p>

<p align="center">
<a href="https://github.com/eduardolat/pgbackweb/actions/workflows/ci.yaml?query=branch%3Amain">
<img src="https://github.com/eduardolat/pgbackweb/actions/workflows/ci.yaml/badge.svg" alt="CI Status"/>
Expand All @@ -28,45 +29,40 @@
</a>
</p>

> [!NOTE]
> **We're growing! New name, bigger future**
>
> PG Back Web is becoming **UFO Backup**! The new name reflects a future where the project expands beyond PostgreSQL, making powerful backups simple and accessible for everyone
>
> Curious about the roadmap or want to shape the project's future? Join the [community](https://ufobackup.uforg.dev/r/community) to discuss ideas and influence decisions, everyone's input is welcome!

## Why PG Back Web?

PG Back Web isn't just another backup tool. It's your trusted ally in ensuring
the security and availability of your PostgreSQL data:
PG Back Web isn't just another backup tool. It's your trusted ally in ensuring the security and availability of your PostgreSQL data:

- 🎯 **Designed for everyone**: From individual developers to teams.
- ⏱️ **Save time**: Automate your backups and forget about manual tasks.
- ⚡ **Plug and play**: Don't waste time with complex configurations.

## Features

- 📦 **Intuitive web interface**: Manage your backups with ease, no database
expertise required.
- 📅 **Scheduled backups**: Set it and forget it. PG Back Web takes care of the
rest.
- 📈 **Backup monitoring**: Visualize the status of your backups with execution
logs.
- 📤 **Instant download & restore**: Restore and download your backups when you
need them, directly from the web interface.
- 🖥 **Multi-version support**: Compatible with PostgreSQL 13, 14, 15, 16,
17, and 18.
- 📁 **Local & S3 storage**: Store backups locally or add as many S3 buckets as
you want for greater flexibility.
- ❤️‍🩹 **Health checks**: Automatically check the health of your databases and
destinations.
- 🔔 **Webhooks**: Get notified when a backup finishes, failed, health check
fails, or other events.
- 📦 **Intuitive web interface**: Manage your backups with ease, no database expertise required.
- 📅 **Scheduled backups**: Set it and forget it. PG Back Web takes care of the rest.
- 📈 **Backup monitoring**: Visualize the status of your backups with execution logs.
- 📤 **Instant download & restore**: Restore and download your backups when you need them, directly from the web interface.
- 🖥 **Multi-version support**: Compatible with PostgreSQL 13, 14, 15, 16, 17, and 18.
- 📁 **Local & S3 storage**: Store backups locally or add as many S3 buckets as you want for greater flexibility.
- ❤️‍🩹 **Health checks**: Automatically check the health of your databases and destinations.
- 🔔 **Webhooks**: Get notified when a backup finishes, failed, health check fails, or other events.
- 🔒 **Security first**: PGP encryption to protect your sensitive information.
- 🛡️ **Open-source trust**: Open-source code under AGPL v3 license, backed by the
robust pg_dump tool.
- 🛡️ **Open-source trust**: Open-source code under AGPL v3 license, backed by the robust pg_dump tool.
- 🌚 **Dark mode**: Because we all love dark mode.

## Installation

PG Back Web is available as a Docker image. You just need to set 3 environment
variables and you're good to go!
PG Back Web is available as a Docker image. You just need to set 3 environment variables and you're good to go!

Here's an example of how you can run PG Back Web with Docker Compose, feel free
to adapt it to your needs:
Here's an example of how you can run PG Back Web with Docker Compose, feel free to adapt it to your needs:

```yaml
services:
Expand All @@ -77,15 +73,15 @@ services:
volumes:
- ./backups:/backups # If you only use S3 destinations, you don't need this volume
environment:
# Optional environment variables are ignored, see the configuration section below for more details
PBW_ENCRYPTION_KEY: "my_secret_key" # Change this to a strong key
PBW_POSTGRES_CONN_STRING: "postgresql://postgres:password@postgres:5432/pgbackweb?sslmode=disable"
TZ: "America/Guatemala" # Set your timezone, optional
depends_on:
postgres:
condition: service_healthy

postgres:
image: postgres:17
image: postgres:18
environment:
POSTGRES_USER: postgres
POSTGRES_DB: pgbackweb
Expand All @@ -101,61 +97,49 @@ services:
retries: 5
```

You can watch [this youtube video](https://www.youtube.com/watch?v=vf7SLrSO8sw)
to see how easy it is to set up PG Back Web.
You can watch [this youtube video](https://www.youtube.com/watch?v=vf7SLrSO8sw) to see how easy it is to set up PG Back Web.

## Configuration

You only need to configure the following environment variables:

- `PBW_ENCRYPTION_KEY`: Your encryption key. Generate a strong one and store it
in a safe place, as PG Back Web uses it to encrypt sensitive data.
- `PBW_ENCRYPTION_KEY`: Your encryption key. Generate a strong random one and store it in a safe place, as PG Back Web uses it to encrypt sensitive data.

- `PBW_POSTGRES_CONN_STRING`: The connection string for the PostgreSQL database that will store PG Back Web data.

- `PBW_POSTGRES_CONN_STRING`: The connection string for the PostgreSQL database
that will store PG Back Web data.
- `PBW_LISTEN_HOST`: Optional. Host for the server to listen on, default 0.0.0.0

- `PBW_LISTEN_HOST`: Host for the server to listen on, default 0.0.0.0
(optional)
- `PBW_LISTEN_PORT`: Optional. Port for the server to listen on, default 8085

- `PBW_LISTEN_PORT`: Port for the server to listen on, default 8085 (optional)
- `PBW_PATH_PREFIX`: Optional. Path prefix for the application URL. Use this when you want to serve the application under a subpath (e.g., `/pgbackweb`). Must start with `/` and not end with `/`. Default is empty.

- `TZ`: Your
[timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List)
(optional). Default is `UTC`. This impacts logging, backup filenames and
default timezone in the web interface.
- `TZ`: Optional. Your [timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List). Default is `UTC`. This impacts logging, backup filenames and default timezone in the web interface.

## Screenshot

<img src="https://raw.githubusercontent.com/eduardolat/pgbackweb/main/assets/screenshot.png" />
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add alt text to the screenshot image.

The screenshot image is missing alternative text, which affects accessibility for screen reader users.

Apply this diff to add descriptive alt text:

-<img src="https://raw.githubusercontent.com/eduardolat/pgbackweb/main/assets/screenshot.png" />
+<img src="https://raw.githubusercontent.com/eduardolat/pgbackweb/main/assets/screenshot.png" alt="PG Back Web dashboard interface showing backup management features" />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<img src="https://raw.githubusercontent.com/eduardolat/pgbackweb/main/assets/screenshot.png" />
<img src="https://raw.githubusercontent.com/eduardolat/pgbackweb/main/assets/screenshot.png" alt="PG Back Web dashboard interface showing backup management features" />
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

120-120: Images should have alternate text (alt text)

(MD045, no-alt-text)

🤖 Prompt for AI Agents
In README.md around line 120 the screenshot <img> tag lacks alt text which harms
accessibility; update the tag to include a concise, descriptive alt attribute
(for example: alt="pgbackweb web UI showing dashboard and navigation with
database list and query results") so screen readers can convey the image
content.


## Reset password

You can reset your PG Back Web password by running the following command in the
server where PG Back Web is running:
You can reset your PG Back Web password by running the following command in the server where PG Back Web is running:

```bash
docker exec -it <container_name_or_id> sh -c change-password
```

You should replace `<container_name_or_id>` with the name or ID of the PG Back
Web container, then just follow the instructions.
You should replace `<container_name_or_id>` with the name or ID of the PG Back Web container, then just follow the instructions.

## Next steps

In this link you can see a list of features that have been confirmed for future
updates:
In this link you can see a list of features that have been confirmed for future updates:

<a href="https://github.com/eduardolat/pgbackweb/issues?q=is%3Aissue+is%3Aopen+label%3A%22confirmed+next+step%22">
Next steps ⏭️
</a>

## Sponsors

🙏 Thank you to the incredible sponsors for supporting this project! Your
contributions help keep PG Back Web running and growing. If you'd like to join
and become a sponsor, please visit the
[sponsorship page](https://buymeacoffee.com/eduardolat) and be part of something
great! 🚀
🙏 Thank you to the incredible sponsors for supporting this project! Your contributions help keep PG Back Web running and growing. If you'd like to join and become a sponsor, please visit the [sponsorship page](https://buymeacoffee.com/eduardolat) and be part of something great! 🚀

### 🥇 Gold Sponsors

Expand Down Expand Up @@ -208,15 +192,12 @@ great! 🚀

## Join the Community

Got ideas to improve PG Back Web? Contribute to the project! Every suggestion
and pull request is welcome.
Got ideas to improve PG Back Web? Contribute to the project! Every suggestion and pull request is welcome.

## License

This project is 100% open source and is licensed under the AGPL v3 License - see the [LICENSE](LICENSE) file for details.

---

💖 **Love PG Back Web?** Give us a ⭐ on GitHub and share the project with your
colleagues. Together, we can make PostgreSQL backups more accessible to
everyone!
💖 **Love PG Back Web?** Give us a ⭐ on GitHub and share the project with your colleagues. Together, we can make PostgreSQL backups more accessible to everyone!
Binary file added assets/logos/hetzner-horizontal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/logos/hetzner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 11 additions & 5 deletions assets/support-project-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
"link": "https://app.hapi.trade/rewards?code=LUIJER5",
"description": "Join Hapi to easily buy stocks and crypto! Enjoy a 100% chance to win-win up to $500 in crypto rewards in your first deposit!"
},
{
"name": "Hetzner",
"logo": "https://raw.githubusercontent.com/eduardolat/pgbackweb/refs/heads/develop/assets/logos/hetzner-horizontal.png",
"link": "https://hetzner.cloud/?ref=TdOypLgK8yGR",
"description": "Get started with Hetzner Cloud today and enjoy €20 in free credits just for signing up through this link! Their powerful cloud servers offer excellent performance at competitive prices. After you spend your first €10, I'll receive €10 in credits too, making it a win-win for both of us!"
Comment on lines +11 to +13
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Avoid hotlinking logos from a mutable GitHub branch

Both the Hetzner and FetchGoat logos point to raw.githubusercontent.com/.../refs/heads/develop/.... Those URLs rely on the branch name existing forever and will 404 or change unexpectedly if the branch is renamed, deleted, or the repo reorganizes assets—breaking the images in production. Please add the logo files to the deployed static assets (as you do with other logos) or pin the URLs to an immutable location (e.g., a tagged release or CDN).

Also applies to: 45-46

🤖 Prompt for AI Agents
In assets/support-project-v1.json around lines 11-13 (also apply same change to
lines 45-46), the logo URLs hotlink to raw.githubusercontent.com with a branch
ref which can break if the branch is renamed or removed; replace those fragile
external links by either (A) adding the Hetzner and FetchGoat logo files into
the project's deployed static assets folder and updating the JSON to point to
the local/static asset paths, or (B) pinning the external URLs to an immutable
location (e.g., a tagged release URL or a CDN/GitHub release asset URL) so the
links won’t change; ensure you add the files to the repo, update the JSON
entries, and verify the assets are included in the build/deploy pipeline.

},
{
"name": "Digital Ocean",
"logo": "/images/third-party/digital-ocean.png",
Expand All @@ -29,15 +35,15 @@
}
],
"silver": [
{
"name": "FetchGoat - Simplifying Logistics",
"logo": "https://raw.githubusercontent.com/eduardolat/pgbackweb/refs/heads/develop/assets/sponsors/FetchGoat.png",
"link": "https://fetchgoat.com?utm_source=pgbackweb&utm_medium=referral&utm_campaign=sponsorship"
},
{
"name": "Become a silver sponsor",
"logo": "/images/plus.png",
"link": "https://buymeacoffee.com/eduardolat"
},
{
"name": "FetchGoat - Simplifying Logistics",
"logo": "https://raw.githubusercontent.com/eduardolat/pgbackweb/refs/heads/develop/assets/sponsors/FetchGoat.png",
"link": "https://fetchgoat.com?utm_source=pgbackweb&utm_medium=referral&utm_campaign=sponsorship"
}
],
"bronze": [
Expand Down
10 changes: 8 additions & 2 deletions cmd/app/main.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
package main

import (
"fmt"

"github.com/eduardolat/pgbackweb/internal/config"
"github.com/eduardolat/pgbackweb/internal/cron"
"github.com/eduardolat/pgbackweb/internal/database"
"github.com/eduardolat/pgbackweb/internal/database/dbgen"
"github.com/eduardolat/pgbackweb/internal/integration"
"github.com/eduardolat/pgbackweb/internal/logger"
"github.com/eduardolat/pgbackweb/internal/service"
"github.com/eduardolat/pgbackweb/internal/util/pathutil"
"github.com/eduardolat/pgbackweb/internal/view"
"github.com/labstack/echo/v4"
)
Expand All @@ -18,6 +21,8 @@ func main() {
logger.FatalError("error getting environment variables", logger.KV{"error": err})
}

pathutil.SetPathPrefix(env.PBW_PATH_PREFIX)

cr, err := cron.New()
if err != nil {
logger.FatalError("error initializing cron scheduler", logger.KV{"error": err})
Expand Down Expand Up @@ -46,8 +51,9 @@ func main() {
app.HidePort = true
view.MountRouter(app, servs)

address := env.PBW_LISTEN_HOST + ":" + env.PBW_LISTEN_PORT
logger.Info("server started at http://localhost:"+env.PBW_LISTEN_PORT, logger.KV{
address := fmt.Sprintf("%s:%s", env.PBW_LISTEN_HOST, env.PBW_LISTEN_PORT)
localURL := fmt.Sprintf("http://localhost:%s%s", env.PBW_LISTEN_PORT, pathutil.GetPathPrefix())
logger.Info("server started at "+localURL, logger.KV{
"listenHost": env.PBW_LISTEN_HOST,
"listenPort": env.PBW_LISTEN_PORT,
})
Expand Down
15 changes: 15 additions & 0 deletions docs/_redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Project links
/r/community https://ufobackup.uforg.dev
/r/discord https://discord.gg/BmAwq29UZ8
/r/reddit https://www.reddit.com/r/ufobackup
/r/twitter https://x.com/eduardoolat
/r/x https://x.com/eduardoolat
/r/github https://github.com/eduardolat/pgbackweb
/r/gh https://github.com/eduardolat/pgbackweb

# Author links
/r/author/web https://eduardo.lat
/r/author/gh https://eduardo.lat/github
/r/author/linkedin https://eduardo.lat/linkedin
/r/author/twitter https://x.com/eduardoolat
/r/author/x https://x.com/eduardoolat
Loading