mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
Compare commits
11
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
75120c0a56 | ||
|
|
33f1ef3bb3 | ||
|
|
b6e742333c | ||
|
|
9f8c66fc20 | ||
|
|
3e950652e8 | ||
|
|
98e40466a0 | ||
|
|
324d80a735 | ||
|
|
6770be63b6 | ||
|
|
89aa33ebd8 | ||
|
|
619c32f09d | ||
|
|
c471423775 |
Binary file not shown.
|
After Width: | Height: | Size: 35 KiB |
@@ -0,0 +1,63 @@
|
|||||||
|
name: Docker Publish
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
image_name:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: 'solucetechnologies/portabase'
|
||||||
|
add_latest:
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
target:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: 'prod'
|
||||||
|
dockerfile:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: './docker/dockerfile/Dockerfile'
|
||||||
|
secrets:
|
||||||
|
DOCKER_USERNAME:
|
||||||
|
required: true
|
||||||
|
DOCKER_PASSWORD:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
packages: write
|
||||||
|
contents: read
|
||||||
|
steps:
|
||||||
|
- name: Check out the repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Log in to Docker Hub
|
||||||
|
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Set tags
|
||||||
|
id: set-tags
|
||||||
|
run: |
|
||||||
|
REF_NAME=${GITHUB_REF#refs/tags/}
|
||||||
|
TAGS="${{ inputs.image_name }}:$REF_NAME"
|
||||||
|
if [[ "${{ inputs.add_latest }}" == "true" ]]; then
|
||||||
|
TAGS="$TAGS,${{ inputs.image_name }}:latest"
|
||||||
|
fi
|
||||||
|
echo "tags=$TAGS" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ${{ inputs.dockerfile }}
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.set-tags.outputs.tags }}
|
||||||
|
target: ${{ inputs.target }}
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
name: GitHub Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
prerelease:
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
make_latest:
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
discord_title:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
discord_color:
|
||||||
|
required: true
|
||||||
|
type: number
|
||||||
|
discord_footer:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
secrets:
|
||||||
|
DISCORD_WEBHOOK:
|
||||||
|
required: true
|
||||||
|
GH_TOKEN:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
create-release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
steps:
|
||||||
|
- name: Check out the repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Build Changelog
|
||||||
|
id: build_changelog
|
||||||
|
uses: mikepenz/release-changelog-builder-action@v5
|
||||||
|
with:
|
||||||
|
mode: "COMMIT"
|
||||||
|
configurationJson: |
|
||||||
|
{
|
||||||
|
"template": "#{{CHANGELOG}}",
|
||||||
|
"categories": [
|
||||||
|
{
|
||||||
|
"title": "## Feature",
|
||||||
|
"labels": ["feat", "feature"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "## Fix",
|
||||||
|
"labels": ["fix", "bug"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "## Other",
|
||||||
|
"labels": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"label_extractor": [
|
||||||
|
{
|
||||||
|
"pattern": "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([\w\-\.]+\))?(!)?: ([\w ])+([\s\S]*)",
|
||||||
|
"on_property": "title",
|
||||||
|
"target": "$1"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||||
|
|
||||||
|
- name: Create GitHub Release
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
generate_release_notes: false
|
||||||
|
body: ${{ steps.build_changelog.outputs.changelog }}
|
||||||
|
prerelease: ${{ inputs.prerelease }}
|
||||||
|
make_latest: ${{ inputs.make_latest }}
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||||
|
|
||||||
|
- name: Send Discord Notification
|
||||||
|
env:
|
||||||
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
|
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||||
|
run: |
|
||||||
|
RELEASE_INFO=$(gh release view "${{ github.ref_name }}" -R ${{ github.repository }} --json name,url,body,author)
|
||||||
|
|
||||||
|
RELEASE_TITLE=$(echo "$RELEASE_INFO" | jq -r .name)
|
||||||
|
if [ -z "$RELEASE_TITLE" ] || [ "$RELEASE_TITLE" = "null" ]; then RELEASE_TITLE="${{ github.ref_name }}"; fi
|
||||||
|
|
||||||
|
RELEASE_URL=$(echo "$RELEASE_INFO" | jq -r .url)
|
||||||
|
RELEASE_BODY=$(echo "$RELEASE_INFO" | jq -r .body)
|
||||||
|
|
||||||
|
AUTHOR_NAME="Portabase"
|
||||||
|
AUTHOR_ICON="https://github.com/Portabase.png"
|
||||||
|
|
||||||
|
PAYLOAD=$(jq -n \
|
||||||
|
--arg title "$RELEASE_TITLE" \
|
||||||
|
--arg description "$RELEASE_BODY" \
|
||||||
|
--arg url "$RELEASE_URL" \
|
||||||
|
--arg author "$AUTHOR_NAME" \
|
||||||
|
--arg icon "$AUTHOR_ICON" \
|
||||||
|
--arg discord_title "${{ inputs.discord_title }}" \
|
||||||
|
--arg discord_footer "${{ inputs.discord_footer }}" \
|
||||||
|
--argjson discord_color ${{ inputs.discord_color }} \
|
||||||
|
'{
|
||||||
|
content: $discord_title,
|
||||||
|
embeds: [{
|
||||||
|
title: $title,
|
||||||
|
url: $url,
|
||||||
|
description: $description,
|
||||||
|
color: $discord_color,
|
||||||
|
author: {
|
||||||
|
name: $author,
|
||||||
|
icon_url: $icon
|
||||||
|
},
|
||||||
|
footer: {
|
||||||
|
text: $discord_footer
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
}'
|
||||||
|
)
|
||||||
|
|
||||||
|
curl -H "Content-Type: application/json" \
|
||||||
|
-d "$PAYLOAD" \
|
||||||
|
"$DISCORD_WEBHOOK"
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
name: Publish Docker image for release candidate
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*-rc*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker_publish:
|
||||||
|
uses: ./.github/workflows/docker.yml
|
||||||
|
with:
|
||||||
|
add_latest: false
|
||||||
|
secrets:
|
||||||
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
|
github_release:
|
||||||
|
needs: docker_publish
|
||||||
|
uses: ./.github/workflows/github.yml
|
||||||
|
with:
|
||||||
|
prerelease: true
|
||||||
|
make_latest: false
|
||||||
|
discord_title: "||@release-dashboard|| New release candidate published"
|
||||||
|
discord_color: 16776960
|
||||||
|
discord_footer: "Portabase"
|
||||||
|
secrets:
|
||||||
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -1,50 +1,29 @@
|
|||||||
name: Publish Docker image for release
|
name: Publish Docker image for release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
push:
|
||||||
types: [published]
|
tags:
|
||||||
|
- '*.*.*'
|
||||||
|
- '!*-*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
push_to_registry:
|
docker_publish:
|
||||||
name: Push Docker image to Docker Hub
|
uses: ./.github/workflows/docker.yml
|
||||||
runs-on: ubuntu-latest
|
with:
|
||||||
permissions:
|
add_latest: true
|
||||||
packages: write
|
secrets:
|
||||||
contents: read
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||||
attestations: write
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
id-token: write
|
|
||||||
steps:
|
|
||||||
- name: Check out the repo
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Log in to Docker Hub
|
github_release:
|
||||||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
|
needs: docker_publish
|
||||||
with:
|
uses: ./.github/workflows/github.yml
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
with:
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
prerelease: false
|
||||||
|
make_latest: true
|
||||||
- name: Extract metadata (tags, labels) for Docker
|
discord_title: "||@release-dashboard|| New release published"
|
||||||
id: meta
|
discord_color: 5814783
|
||||||
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
|
discord_footer: "Portabase"
|
||||||
with:
|
secrets:
|
||||||
images: solucetechnologies/portabase
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Set tags
|
|
||||||
id: set-tags
|
|
||||||
run: |
|
|
||||||
echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
|
||||||
TAGS="solucetechnologies/portabase:${GITHUB_REF#refs/tags/}"
|
|
||||||
if [ "${{ github.event.release.target_commitish }}" = "main" ]; then
|
|
||||||
TAGS="$TAGS,solucetechnologies/portabase:latest"
|
|
||||||
fi
|
|
||||||
echo "tags=$TAGS" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Build and push Docker image
|
|
||||||
id: push
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ./docker/dockerfile/Dockerfile
|
|
||||||
push: true
|
|
||||||
tags: ${{ steps.set-tags.outputs.tags }}
|
|
||||||
target: prod
|
|
||||||
Binary file not shown.
@@ -1,2 +0,0 @@
|
|||||||
nodeLinker: node-modules
|
|
||||||
|
|
||||||
@@ -1,23 +1,18 @@
|
|||||||
<br />
|
<br />
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<a href="https://portabase.io">
|
<a href="https://portabase.io">
|
||||||
<img src="/public/images/logo.png" alt="Logo" width="80" height="80">
|
<img src="/.github/assets/logo.png" alt="Logo" width="80" height="80">
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<h3 align="center">Portabase</h3>
|
<h3 align="center">Portabase</h3>
|
||||||
<p>
|
|
||||||
Take full control of your databases with Portabase — the self-hosted, open-source platform
|
<p align="center" style="margin-top: 20px; font-style: italic;">
|
||||||
for automated backup, restoration, and operational management. Powered by the <strong>Portabase Agent</strong>,
|
<i>Portabase is a tool designed to simplify the backup and restoration of your database instances. It integrates seamlessly with <a href="https://github.com/Portabase/agent">Portabase agents</a> for managing operations securely and efficiently.</i>
|
||||||
every database in your infrastructure can be monitored, backed up, and managed in real time,
|
|
||||||
with zero reliance on third-party services.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Secure, lightweight, and deployable anywhere — on Docker, Kubernetes, or directly on your servers.
|
|
||||||
Designed for teams, DevOps, and enterprises who demand control, reliability, and automation at scale.
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
[](LICENSE)
|
[](LICENSE)
|
||||||
[](https://hub.docker.com/r/Portabase/portabase)
|
[](https://hub.docker.com/r/solucetechnologies/portabase)
|
||||||
[](https://github.com/Portabase/portabase)
|
[](https://github.com/Portabase/portabase)
|
||||||
|
|
||||||
[](https://www.postgresql.org/)
|
[](https://www.postgresql.org/)
|
||||||
@@ -27,11 +22,18 @@
|
|||||||
[](https://github.com/Portabase/portabase)
|
[](https://github.com/Portabase/portabase)
|
||||||
|
|
||||||
|
|
||||||
|
[![NextJS][NextJS]][NextJS-url]
|
||||||
|
[![BetterAuth][BetterAuth]][BetterAuth-url]
|
||||||
|
[![Drizzle][Drizzle]][Drizzle-url]
|
||||||
|
[![ShadcnUI][ShadcnUI]][ShadcnUI-url]
|
||||||
|
[![Docker][Docker]][Docker-url]
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<strong>
|
<strong>
|
||||||
<a href="https://portabase.io">Documentation</a> •
|
<a href="https://portabase.io">Website</a> •
|
||||||
|
<a href="https://portabase.io/docs">Documentation</a> •
|
||||||
<a href="https://www.youtube.com/watch?v=hvLbX5LN1UE">Demo</a> •
|
<a href="https://www.youtube.com/watch?v=hvLbX5LN1UE">Demo</a> •
|
||||||
<a href="#installation">Installation</a> •
|
<a href="https://portabase.io/docs/dashboard/setup">Installation</a> •
|
||||||
<a href="https://github.com/Portabase/portabase/issues/new?labels=bug&template=bug-report---.md">Report Bug</a> •
|
<a href="https://github.com/Portabase/portabase/issues/new?labels=bug&template=bug-report---.md">Report Bug</a> •
|
||||||
<a href="https://github.com/Portabase/portabase/issues/new?labels=enhancement&template=feature-request---.md">Request Feature</a>
|
<a href="https://github.com/Portabase/portabase/issues/new?labels=enhancement&template=feature-request---.md">Request Feature</a>
|
||||||
</strong>
|
</strong>
|
||||||
@@ -42,257 +44,28 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
---
|
## Installation
|
||||||
|
|
||||||
## ✨ About The Project
|
You have 4 ways to install Portabase:
|
||||||
|
|
||||||
**Portabase** is a server dashboard tool designed to simplify the backup and restoration of your database instances. It
|
- Automated CLI (recommended) - [details](https://portabase.io/docs/dashboard/setup#cli)
|
||||||
integrates seamlessly with [Portabase agents](https://github.com/Portabase/agent-portabase) for managing operations
|
- Docker Compose setup - [details](https://portabase.io/docs/dashboard/setup#docker)
|
||||||
securely and efficiently.
|
|
||||||
|
|
||||||
### 🔧 Built With
|
|
||||||
|
|
||||||
- [![NextJS][NextJS]][NextJS-url]
|
|
||||||
- [![Drizzle][Drizzle]][Drizzle-url]
|
|
||||||
- [![ShadcnUI][ShadcnUI]][ShadcnUI-url]
|
|
||||||
- [![BetterAuth][BetterAuth]][BetterAuth-url]
|
|
||||||
- [![Docker][Docker]][Docker-url]
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 📦 Features
|
|
||||||
|
|
||||||
### 🗄️ Supported databases
|
|
||||||
|
|
||||||
- PostgreSQL
|
|
||||||
- MySQL
|
|
||||||
- MariaDB
|
|
||||||
|
|
||||||
### ⏱️ Scheduled backups
|
|
||||||
|
|
||||||
- Cron-based scheduling for full control
|
|
||||||
- Manual trigger support for on-demand backups
|
|
||||||
|
|
||||||
### 💾 Storage backends
|
|
||||||
|
|
||||||
- On-premise storage: Backups are stored directly on your VPS or server
|
|
||||||
- Cloud storage: S3-compatible backends
|
|
||||||
supported ([documentation](https://portabase.io/docs/dashboard/advanced/storage/s3))
|
|
||||||
- Full data ownership: No third-party access — your data stays under your control
|
|
||||||
|
|
||||||
### 🔔 Smart notifications
|
|
||||||
|
|
||||||
- Multi-channel delivery: Email, Slack, Discord, webhooks
|
|
||||||
- Real-time alerts: Immediate feedback on success and failure
|
|
||||||
- Custom alert policies: Database-level notification rules
|
|
||||||
- Team-ready: Designed for DevOps, on-call, and incident workflows
|
|
||||||
|
|
||||||
### 👥 Built for team environments
|
|
||||||
|
|
||||||
- Workspaces: Organize databases, notification channels, and storage backends by organization and project
|
|
||||||
- Access control: Fine-grained, role-based permissions on all resources
|
|
||||||
- Role management: Member, admin, and owner roles at both system and organization levels
|
|
||||||
|
|
||||||
### 🐳 Self-hosted & secure
|
|
||||||
|
|
||||||
- Containerized deployment: Docker-based setup for predictable installation and operations
|
|
||||||
- Privacy by design: All data remains within your own infrastructure
|
|
||||||
- Open source: Apache 2.0 licensed — fully auditable codebase
|
|
||||||
|
|
||||||
### 🤖 Portabase Agent ([details](https://github.com/Portabase/agent-portabase))
|
|
||||||
|
|
||||||
- Headless architecture: Runs locally on your infrastructure to manage backups and database operations
|
|
||||||
- Multi-target support: Single agent can connect to multiple databases across different servers
|
|
||||||
- Lightweight & efficient: Minimal resource footprint while providing full operational control
|
|
||||||
- Secure communication: Encrypted channels between agent and central dashboard
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 🚀 Getting Started
|
|
||||||
|
|
||||||
### Installation
|
|
||||||
|
|
||||||
You have 3 ways to install **Portabase**:
|
|
||||||
|
|
||||||
- Automated CLI (recommended) - [details](https://portabase.io/docs/cli)
|
|
||||||
- Docker Compose setup - [details](https://portabase.io/docs/dashboard/setup)
|
|
||||||
- Kubernetes with Helm (soon)
|
- Kubernetes with Helm (soon)
|
||||||
|
- Development setup - [details](https://portabase.io/docs/dashboard/setup#development)
|
||||||
|
|
||||||
Ensure Docker is installed on your machine before getting started.
|
**Ensure Docker is installed on your machine before getting started.**
|
||||||
|
|
||||||
### Docker Compose Setup
|
|
||||||
|
|
||||||
Create a `docker-compose.yml` file with the following configuration:
|
|
||||||
|
|
||||||
```yaml
|
## Contributors
|
||||||
name: portabase
|
|
||||||
|
|
||||||
services:
|
|
||||||
|
|
||||||
portabase:
|
|
||||||
image: solucetechnologies/portabase:latest
|
|
||||||
env_file:
|
|
||||||
- .env
|
|
||||||
ports:
|
|
||||||
- '8887:80'
|
|
||||||
environment:
|
|
||||||
- TZ="Europe/Paris"
|
|
||||||
volumes:
|
|
||||||
- portabase-private:/app/private
|
|
||||||
depends_on:
|
|
||||||
db:
|
|
||||||
condition: service_healthy
|
|
||||||
container_name: portabase-app
|
|
||||||
|
|
||||||
db:
|
|
||||||
image: postgres:17-alpine
|
|
||||||
ports:
|
|
||||||
- "5433:5432"
|
|
||||||
volumes:
|
|
||||||
- postgres-data:/var/lib/postgresql/data
|
|
||||||
environment:
|
|
||||||
- POSTGRES_DB=<your_database>
|
|
||||||
- POSTGRES_USER=<database_user>
|
|
||||||
- POSTGRES_PASSWORD=<database_password>
|
|
||||||
healthcheck:
|
|
||||||
test: [ "CMD-SHELL", "pg_isready -U <database_user> -d <your_database>" ]
|
|
||||||
interval: 10s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 5
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
postgres-data:
|
|
||||||
portabase-private:
|
|
||||||
```
|
|
||||||
|
|
||||||
Then run:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker compose up -d
|
|
||||||
```
|
|
||||||
|
|
||||||
If you use reverse proxy like
|
|
||||||
Traefik : [Check this link](https://portabase.io/docs/dashboard/advanced/reverse-proxy)
|
|
||||||
|
|
||||||
#### Environment Variables
|
|
||||||
|
|
||||||
```yml
|
|
||||||
# Environment
|
|
||||||
NODE_ENV=production
|
|
||||||
|
|
||||||
# Database
|
|
||||||
DATABASE_URL=postgresql://devuser:changeme@db:5432/devdb?schema=public
|
|
||||||
|
|
||||||
# Project Info
|
|
||||||
PROJECT_NAME="Portabase"
|
|
||||||
PROJECT_DESCRIPTION="Portabase is a powerful database manager"
|
|
||||||
PROJECT_URL=http://app.portabase.io
|
|
||||||
PROJECT_SECRET=
|
|
||||||
|
|
||||||
# SMTP (Email)
|
|
||||||
SMTP_HOST=
|
|
||||||
SMTP_PORT=587
|
|
||||||
SMTP_USER=
|
|
||||||
SMTP_PASSWORD=
|
|
||||||
SMTP_FROM=
|
|
||||||
|
|
||||||
# Google OAuth
|
|
||||||
AUTH_GOOGLE_ID=
|
|
||||||
AUTH_GOOGLE_SECRET=
|
|
||||||
AUTH_GOOGLE_METHOD=
|
|
||||||
|
|
||||||
# S3/MinIO Configuration
|
|
||||||
S3_ENDPOINT=http://app.s3.portabase.io
|
|
||||||
S3_ACCESS_KEY=
|
|
||||||
S3_SECRET_KEY=
|
|
||||||
S3_BUCKET_NAME=portabase
|
|
||||||
S3_PORT=9000
|
|
||||||
S3_USE_SSL=true
|
|
||||||
|
|
||||||
# Storage Backend: 'local' or 's3'
|
|
||||||
STORAGE_TYPE=local
|
|
||||||
|
|
||||||
# Retention
|
|
||||||
RETENTION_CRON="* * * * *"
|
|
||||||
```
|
|
||||||
|
|
||||||
To get more information about env variables, check
|
|
||||||
that [link](https://portabase.io/docs/dashboard/advanced/environment)
|
|
||||||
|
|
||||||
### Locally (Development)
|
|
||||||
|
|
||||||
1. Clone the repository:
|
|
||||||
```bash
|
|
||||||
git clone https://github.com/Portabase/portabase
|
|
||||||
cd portabase
|
|
||||||
```
|
|
||||||
2. Start the development database for Portabase service:
|
|
||||||
```bash
|
|
||||||
docker compose up
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Start the Next.js app:
|
|
||||||
```bash
|
|
||||||
make up
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 🛠️ Usage
|
|
||||||
|
|
||||||
Once the installation process is done, follow the steps to configure your instance.
|
|
||||||
|
|
||||||
### Dashboard configuration process
|
|
||||||
|
|
||||||
1. **Access the dashboard** – Open `http://localhost:8887` in your browser.
|
|
||||||
2. **Sign up** – Register the first user, who will automatically have the **Admin** role in the default workspace.
|
|
||||||
3. **Add your first agent** – Follow [this guide](https://github.com/Portabase/agent-portabase) for setup
|
|
||||||
instructions.
|
|
||||||
4. **Create organizations and projects** – Link your databases to projects to enable backups and restores.
|
|
||||||
5. **Configure backup policies** – Define schedules (hourly, daily, weekly, or monthly) and retention rules.
|
|
||||||
6. **Choose a storage provider** – Select where backups will be stored (local, S3, etc.).
|
|
||||||
7. **Save and start** – Portabase validates your configuration and starts automated backups based on your defined
|
|
||||||
policies.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 🤝 Contributing
|
|
||||||
|
|
||||||
Contributions are welcome and appreciated! Here's how to get started:
|
|
||||||
|
|
||||||
1. Fork the repository
|
|
||||||
2. Create a new branch:
|
|
||||||
```bash
|
|
||||||
git checkout -b features/your-feature
|
|
||||||
```
|
|
||||||
3. Commit your changes:
|
|
||||||
```bash
|
|
||||||
git commit -m "Add YourFeature"
|
|
||||||
```
|
|
||||||
4. Push to the branch:
|
|
||||||
```bash
|
|
||||||
git push origin features/your-feature
|
|
||||||
```
|
|
||||||
5. Open a pull request
|
|
||||||
|
|
||||||
### Top Contributors
|
|
||||||
|
|
||||||
[](https://github.com/Portabase/portabase/graphs/contributors)
|
[](https://github.com/Portabase/portabase/graphs/contributors)
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 📄 License
|
## License
|
||||||
|
|
||||||
Distributed under the Apache License. See `LICENSE.txt` for more details.
|
Distributed under the Apache License. See `LICENSE.txt` for more details.
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 🙏 Acknowledgments
|
|
||||||
|
|
||||||
Thanks to all contributors and the open-source community!
|
|
||||||
|
|
||||||
Give the project a ⭐ if you like it!
|
|
||||||
|
|
||||||
|
|
||||||
[Docker]: https://img.shields.io/badge/Docker-2496ED?logo=docker&logoColor=fff&style=for-the-badge
|
[Docker]: https://img.shields.io/badge/Docker-2496ED?logo=docker&logoColor=fff&style=for-the-badge
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import {Page, PageActions, PageContent, PageHeader, PageTitle} from "@/features/
|
|||||||
import {notFound} from "next/navigation";
|
import {notFound} from "next/navigation";
|
||||||
import {db} from "@/db";
|
import {db} from "@/db";
|
||||||
import * as drizzleDb from "@/db";
|
import * as drizzleDb from "@/db";
|
||||||
import {eq, not} from "drizzle-orm";
|
import {desc, eq, not} from "drizzle-orm";
|
||||||
import {EmptyStatePlaceholder} from "@/components/wrappers/common/empty-state-placeholder";
|
import {EmptyStatePlaceholder} from "@/components/wrappers/common/empty-state-placeholder";
|
||||||
import {Metadata} from "next";
|
import {Metadata} from "next";
|
||||||
|
|
||||||
@@ -21,7 +21,8 @@ export default async function RoutePage(props: PageParams<{}>) {
|
|||||||
where: not(eq(drizzleDb.schemas.agent.isArchived, true)),
|
where: not(eq(drizzleDb.schemas.agent.isArchived, true)),
|
||||||
with: {
|
with: {
|
||||||
databases: true
|
databases: true
|
||||||
}
|
},
|
||||||
|
orderBy: (fields) => desc(fields.createdAt),
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(agents);
|
console.log(agents);
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ export async function POST(
|
|||||||
|
|
||||||
if (status === "success") {
|
if (status === "success") {
|
||||||
const file = formData.get("file") as File | null;
|
const file = formData.get("file") as File | null;
|
||||||
|
const extension = formData.get("extension") as string | null;
|
||||||
if (!aesKeyHex || !ivHex) {
|
if (!aesKeyHex || !ivHex) {
|
||||||
return NextResponse.json({error: "Missing fields"}, {status: 400});
|
return NextResponse.json({error: "Missing fields"}, {status: 400});
|
||||||
}
|
}
|
||||||
@@ -118,12 +118,13 @@ export async function POST(
|
|||||||
{status: 400}
|
{status: 400}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
const fileExtension = getFileExtension(database.dbms)
|
const fileSizeBytes = file.size;
|
||||||
|
// const fileExtension = '.' + (file.name.split('.').pop()?.toLowerCase() || '');
|
||||||
|
const fileExtension = extension ? extension : getFileExtension(database.dbms)
|
||||||
const decryptedFile = await decryptedDump(file, aesKeyHex, ivHex, fileExtension);
|
const decryptedFile = await decryptedDump(file, aesKeyHex, ivHex, fileExtension);
|
||||||
const uuid = uuidv4();
|
const uuid = uuidv4();
|
||||||
const fileName = `${uuid}${fileExtension}`;
|
const fileName = `${uuid}${fileExtension}`;
|
||||||
const buffer = Buffer.from(await decryptedFile.arrayBuffer());
|
const buffer = Buffer.from(await decryptedFile.arrayBuffer());
|
||||||
|
|
||||||
const [settings] = await db.select().from(drizzleDb.schemas.setting).where(eq(drizzleDb.schemas.setting.name, "system")).limit(1);
|
const [settings] = await db.select().from(drizzleDb.schemas.setting).where(eq(drizzleDb.schemas.setting.name, "system")).limit(1);
|
||||||
if (!settings) {
|
if (!settings) {
|
||||||
throw new Error("System settings not found.");
|
throw new Error("System settings not found.");
|
||||||
@@ -149,6 +150,7 @@ export async function POST(
|
|||||||
.update(drizzleDb.schemas.backup)
|
.update(drizzleDb.schemas.backup)
|
||||||
.set(withUpdatedAt({
|
.set(withUpdatedAt({
|
||||||
file: fileName,
|
file: fileName,
|
||||||
|
fileSize: fileSizeBytes,
|
||||||
status: 'success',
|
status: 'success',
|
||||||
}))
|
}))
|
||||||
.where(eq(drizzleDb.schemas.backup.id, backup.id));
|
.where(eq(drizzleDb.schemas.backup.id, backup.id));
|
||||||
|
|||||||
@@ -1,45 +1,37 @@
|
|||||||
FROM node:22-alpine AS base
|
FROM node:22-alpine AS base
|
||||||
|
|
||||||
ENV YARN_VERSION=4.9.1
|
|
||||||
|
|
||||||
RUN apk add --update --no-cache \
|
RUN apk add --update --no-cache \
|
||||||
tzdata \
|
|
||||||
build-base \
|
|
||||||
libc6-compat \
|
libc6-compat \
|
||||||
openssl \
|
openssl \
|
||||||
make \
|
tzdata
|
||||||
|
|
||||||
|
FROM base AS build-env
|
||||||
|
|
||||||
|
RUN apk add --update --no-cache \
|
||||||
|
build-base \
|
||||||
g++ \
|
g++ \
|
||||||
jpeg-dev \
|
make \
|
||||||
cairo-dev \
|
|
||||||
giflib-dev \
|
|
||||||
pango-dev \
|
|
||||||
libtool \
|
libtool \
|
||||||
autoconf \
|
autoconf \
|
||||||
automake \
|
automake
|
||||||
libpng
|
|
||||||
|
|
||||||
RUN corepack enable && corepack prepare yarn@${YARN_VERSION}
|
RUN corepack enable && corepack prepare pnpm@latest --activate
|
||||||
RUN yarn set version ${YARN_VERSION}
|
|
||||||
|
|
||||||
|
|
||||||
FROM base AS deps
|
|
||||||
|
|
||||||
|
FROM build-env AS deps
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY .yarn ./.yarn
|
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
||||||
COPY .yarnrc.yml ./
|
|
||||||
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
|
RUN pnpm i --frozen-lockfile
|
||||||
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
if [ -f yarn.lock ]; then yarn; \
|
|
||||||
elif [ -f package-lock.json ]; then npm ci; \
|
|
||||||
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i --frozen-lockfile; \
|
|
||||||
else echo "Lockfile not found." && exit 1; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
FROM base AS dev
|
FROM build-env AS dev
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
@@ -52,8 +44,11 @@ RUN chmod +x /app/docker/entrypoints/app-dev-entrypoint.sh
|
|||||||
ENTRYPOINT ["sh","/app/docker/entrypoints/app-dev-entrypoint.sh"]
|
ENTRYPOINT ["sh","/app/docker/entrypoints/app-dev-entrypoint.sh"]
|
||||||
|
|
||||||
|
|
||||||
# Rebuild the source code only when needed
|
|
||||||
FROM base AS builder
|
|
||||||
|
|
||||||
|
|
||||||
|
FROM build-env AS builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=deps /app/node_modules ./node_modules
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
@@ -61,12 +56,11 @@ COPY . .
|
|||||||
|
|
||||||
ENV NEXT_TELEMETRY_DISABLED=1
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
|
|
||||||
RUN \
|
RUN pnpm run build
|
||||||
if [ -f yarn.lock ]; then yarn run build; \
|
|
||||||
elif [ -f package-lock.json ]; then npm run build; \
|
|
||||||
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm run build; \
|
|
||||||
else echo "Lockfile not found." && exit 1; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
FROM base AS prod
|
FROM base AS prod
|
||||||
@@ -109,5 +103,3 @@ ENV HOSTNAME="0.0.0.0"
|
|||||||
USER nextjs
|
USER nextjs
|
||||||
|
|
||||||
ENTRYPOINT ["sh","/app/app-prod-entrypoint.sh"]
|
ENTRYPOINT ["sh","/app/app-prod-entrypoint.sh"]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
echo "▶ Running Drizzle codegen..."
|
echo "▶ Running Drizzle codegen..."
|
||||||
npx drizzle-kit generate
|
pnpm drizzle-kit generate
|
||||||
|
|
||||||
echo "▶ Applying migrations..."
|
echo "▶ Applying migrations..."
|
||||||
npx drizzle-kit migrate
|
pnpm drizzle-kit migrate
|
||||||
|
|
||||||
echo "▶ Starting Next.js dev server..."
|
echo "▶ Starting Next.js dev server..."
|
||||||
exec npm run dev
|
exec pnpm dev
|
||||||
+4
-2
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "portabase",
|
"name": "portabase",
|
||||||
"version": "1.1.7",
|
"version": "1.1.8",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev --turbopack -p 8887",
|
"dev": "next dev --turbopack -p 8887",
|
||||||
@@ -97,6 +97,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@iconify/react": "^6.0.0",
|
"@iconify/react": "^6.0.0",
|
||||||
"@react-email/preview-server": "4.3.2",
|
"@react-email/preview-server": "4.3.2",
|
||||||
|
"@react-email/render": "^2.0.1",
|
||||||
"@tailwindcss/postcss": "^4.1.7",
|
"@tailwindcss/postcss": "^4.1.7",
|
||||||
"@types/eslint-plugin-tailwindcss": "^3.17.0",
|
"@types/eslint-plugin-tailwindcss": "^3.17.0",
|
||||||
"@types/node": "^22.15.18",
|
"@types/node": "^22.15.18",
|
||||||
@@ -111,6 +112,7 @@
|
|||||||
"eslint": "^9.39.0",
|
"eslint": "^9.39.0",
|
||||||
"eslint-config-next": "^16.0.1",
|
"eslint-config-next": "^16.0.1",
|
||||||
"eslint-plugin-tailwindcss": "^3.18.0",
|
"eslint-plugin-tailwindcss": "^3.18.0",
|
||||||
|
"framer-motion": "^12.24.7",
|
||||||
"postcss": "^8.5.3",
|
"postcss": "^8.5.3",
|
||||||
"tailwindcss": "^4.1.7",
|
"tailwindcss": "^4.1.7",
|
||||||
"tsx": "^4.19.4",
|
"tsx": "^4.19.4",
|
||||||
@@ -118,5 +120,5 @@
|
|||||||
"typescript": "^5.8.3",
|
"typescript": "^5.8.3",
|
||||||
"zenstack": "2.14.2"
|
"zenstack": "2.14.2"
|
||||||
},
|
},
|
||||||
"packageManager": "yarn@4.9.1"
|
"packageManager": "pnpm@10.27.0"
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+14158
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,2 @@
|
|||||||
|
onlyBuiltDependencies:
|
||||||
|
- zenstack
|
||||||
@@ -42,6 +42,7 @@ export const uploadBackupAction = userAction
|
|||||||
|
|
||||||
const arrayBuffer = await file.arrayBuffer();
|
const arrayBuffer = await file.arrayBuffer();
|
||||||
|
|
||||||
|
const fileSize = file.size;
|
||||||
const uuid = uuidv4();
|
const uuid = uuidv4();
|
||||||
const fileName = `imported_${uuid}${fileExtension}`;
|
const fileName = `imported_${uuid}${fileExtension}`;
|
||||||
const buffer = Buffer.from(arrayBuffer);
|
const buffer = Buffer.from(arrayBuffer);
|
||||||
@@ -85,6 +86,7 @@ export const uploadBackupAction = userAction
|
|||||||
status: 'success',
|
status: 'success',
|
||||||
databaseId: database.id,
|
databaseId: database.id,
|
||||||
file: fileName,
|
file: fileName,
|
||||||
|
fileSize: fileSize,
|
||||||
})
|
})
|
||||||
.returning();
|
.returning();
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE "backups" ADD COLUMN "file_size" integer;
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -113,6 +113,13 @@
|
|||||||
"when": 1766426190521,
|
"when": 1766426190521,
|
||||||
"tag": "0015_absurd_next_avengers",
|
"tag": "0015_absurd_next_avengers",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 16,
|
||||||
|
"version": "7",
|
||||||
|
"when": 1767363779637,
|
||||||
|
"tag": "0016_broken_morgan_stark",
|
||||||
|
"breakpoints": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -38,6 +38,7 @@ export const backup = pgTable(
|
|||||||
id: uuid("id").primaryKey().defaultRandom(),
|
id: uuid("id").primaryKey().defaultRandom(),
|
||||||
status: statusEnum("status").default("waiting").notNull(),
|
status: statusEnum("status").default("waiting").notNull(),
|
||||||
file: text("file"),
|
file: text("file"),
|
||||||
|
fileSize: integer("file_size"),
|
||||||
databaseId: uuid("database_id")
|
databaseId: uuid("database_id")
|
||||||
.notNull()
|
.notNull()
|
||||||
.references(() => database.id, {onDelete: "cascade"}),
|
.references(() => database.id, {onDelete: "cascade"}),
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import {cn} from "@/lib/utils";
|
|||||||
import {Tooltip, TooltipContent, TooltipProvider, TooltipTrigger} from "@/components/ui/tooltip";
|
import {Tooltip, TooltipContent, TooltipProvider, TooltipTrigger} from "@/components/ui/tooltip";
|
||||||
import {MemberWithUser} from "@/db/schema/03_organization";
|
import {MemberWithUser} from "@/db/schema/03_organization";
|
||||||
import {formatLocalizedDate} from "@/utils/date-formatting";
|
import {formatLocalizedDate} from "@/utils/date-formatting";
|
||||||
import {isImportedFilename} from "@/utils/text";
|
import {formatBytes, isImportedFilename} from "@/utils/text";
|
||||||
|
|
||||||
|
|
||||||
export function backupColumns(
|
export function backupColumns(
|
||||||
@@ -73,6 +73,14 @@ export function backupColumns(
|
|||||||
return isImported ? `${reference} (imported)` : `${reference}`
|
return isImported ? `${reference} (imported)` : `${reference}`
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "fileSize",
|
||||||
|
header: "Size",
|
||||||
|
cell: ({row}) => {
|
||||||
|
console.log(row.original.fileSize)
|
||||||
|
return formatBytes(row.getValue("fileSize"))
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
accessorKey: "createdAt",
|
accessorKey: "createdAt",
|
||||||
header: "Created At",
|
header: "Created At",
|
||||||
|
|||||||
@@ -16,3 +16,13 @@ export function isUUID(str: string) {
|
|||||||
export function isImportedFilename(name: string): boolean {
|
export function isImportedFilename(name: string): boolean {
|
||||||
return name.startsWith("imported_");
|
return name.startsWith("imported_");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function formatBytes(bytes: number | null, decimals = 2): string {
|
||||||
|
if (!bytes) return "N/A";
|
||||||
|
if (bytes === 0) return "0 Bytes";
|
||||||
|
const k = 1024;
|
||||||
|
const dm = decimals < 0 ? 0 : decimals;
|
||||||
|
const sizes = ["Bytes", "KB", "MB", "GB", "TB"];
|
||||||
|
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||||
|
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + " " + sizes[i];
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user