Compare commits

..

13 Commits

Author SHA1 Message Date
github-actions[bot] fe1d74945f chore: release 1.18.4 2026-07-25 14:03:12 +00:00
Charles GTE 424a646385 Merge pull request #92 from Portabase/fix/windows-build
fix: windows-build
2026-07-25 16:00:57 +02:00
Charles GTE 0ef4bba5d7 fix: docker-compose.yml 2026-07-25 15:45:56 +02:00
Charles GTE 6548140eaf fix: windows build 2026-07-25 15:19:46 +02:00
github-actions[bot] c9725c381e chore: release 1.18.3 2026-07-24 16:46:51 +00:00
Charles GTE 03695b1897 Merge pull request #91 from Portabase/fix/firebird
fix: firebird
2026-07-24 18:44:20 +02:00
charles-gauthereau 80b1c0dac0 fix: firebird with -g for gbak 2026-07-24 18:29:04 +02:00
charles-gauthereau 5ededb3764 Merge branch 'main' into dev 2026-07-24 17:45:46 +02:00
charles-gauthereau 034912b176 Merge branch 'main' into dev 2026-07-23 18:24:18 +02:00
charles-gauthereau a93054518a Merge branch 'main' into dev 2026-07-22 00:06:17 +02:00
charles-gauthereau c186d57105 fix: ghcr publish agent image 2026-07-21 23:10:40 +02:00
charles-gauthereau 37b4c1fe6d fix: backup folder name 2026-07-21 23:05:59 +02:00
Antonin Jousson 92a3324ca2 fix: support configurable backup file prefix (#83) 2026-07-21 21:50:11 +02:00
11 changed files with 344 additions and 100 deletions
+13
View File
@@ -118,11 +118,24 @@ jobs:
secrets:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-windows:
needs: create-release
if: ${{ needs.create-release.result == 'success' }}
uses: ./.github/workflows/windows-release.yml
with:
version: ${{ needs.create-release.outputs.version }}
ref: ${{ needs.create-release.outputs.version }}
draft_tag: ${{ needs.create-release.outputs.draft_tag }}
secrets:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
finalize-release:
needs:
- create-release
- publish-docker
- publish-docker-ghcr
- publish-helm
- build-windows
runs-on: ubuntu-latest
outputs:
release_tag: ${{ steps.publish_release_step.outputs.release_tag }}
+52 -48
View File
@@ -1,14 +1,30 @@
name: Build Windows release
on:
workflow_call:
inputs:
version:
description: 'Release version (git tag), e.g. 1.18.4'
type: string
required: false
ref:
description: 'Git ref to check out and build'
type: string
required: false
draft_tag:
description: 'Draft GitHub release tag to attach the asset to (e.g. untagged-xxxx). Empty = skip upload.'
type: string
required: false
secrets:
GH_TOKEN:
required: false
workflow_dispatch:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
branches:
- main
- master
inputs:
ref:
description: 'Git ref to check out and build'
type: string
required: false
jobs:
build-windows:
@@ -17,80 +33,68 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
- name: Set up Rust toolchain (MSVC)
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable-x86_64-pc-windows-msvc
profile: minimal
override: true
targets: x86_64-pc-windows-msvc
- name: Install vcpkg and OpenSSL (x64)
- name: Cache cargo build
uses: Swatinem/rust-cache@v2
- name: Cache vcpkg installed packages
uses: actions/cache@v4
with:
path: C:\vcpkg\installed
key: vcpkg-openssl-x64-windows-v1
- name: Install OpenSSL (x64) via vcpkg
shell: pwsh
run: |
# Install vcpkg and the prebuilt OpenSSL package
git clone https://github.com/microsoft/vcpkg C:\vcpkg
C:\vcpkg\bootstrap-vcpkg.bat
C:\vcpkg\vcpkg install openssl:x64-windows
# Export variables for subsequent steps
# windows-latest ships vcpkg preinstalled; the install is a no-op when the
# package is restored from cache.
& "$env:VCPKG_INSTALLATION_ROOT\vcpkg.exe" install openssl:x64-windows
'VCPKG_ROOT=C:\vcpkg' | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
'OPENSSL_DIR=C:\vcpkg\installed\x64-windows' | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Build (cargo release)
shell: pwsh
env:
# Cargo / openssl-sys will pick up OPENSSL_DIR from the environment
OPENSSL_DIR: ${{ env.OPENSSL_DIR }}
run: |
# Ensure the environment variable is present for this step
if (-Not $env:OPENSSL_DIR) { Write-Host "OPENSSL_DIR not set, printing env for debugging"; Get-ChildItem Env: | ForEach-Object { Write-Host $_ } }
# Build the declared bin target explicitly (Cargo.toml [[bin]] name = "app")
cargo build --release --bin app
run: cargo build --release --bin app
- name: Prepare artifact zip
id: prepare_artifact
shell: pwsh
env:
RELEASE_TAG: ${{ github.ref_name }}
RELEASE_VERSION: ${{ inputs.version }}
run: |
$tag = $env:RELEASE_TAG
$tag = $env:RELEASE_VERSION
if (-not $tag) { $tag = $env:GITHUB_SHA }
# Package the declared bin target deterministically (Cargo.toml [[bin]] name = "app")
$exe = "target\release\app.exe"
if (-not (Test-Path $exe)) { Write-Error "Built binary $exe not found in target/release"; exit 1 }
$outDir = "artifact"
New-Item -ItemType Directory -Path $outDir -Force | Out-Null
# Ship under the package name, not the internal bin name "app"
# Ship under the package name, not the internal bin name "app".
Copy-Item -Path $exe -Destination "$outDir\portabase-agent.exe"
$zipName = "windows-release-$tag.zip"
if (Test-Path $zipName) { Remove-Item $zipName }
Compress-Archive -Path "$outDir\*" -DestinationPath $zipName -Force
Write-Host "ZIP=$zipName"
Write-Output "zip=$zipName" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
"zip=$zipName" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: windows-release
path: windows-release-*.zip
path: ${{ steps.prepare_artifact.outputs.zip }}
- name: Create GitHub Release
if: startsWith(github.ref, 'refs/tags/')
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name }}
- name: Attach asset to draft release
if: ${{ inputs.draft_tag != '' }}
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload release asset
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: windows-release-${{ github.ref_name }}.zip
asset_name: windows-release-${{ github.ref_name }}.zip
asset_content_type: application/zip
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
gh release upload "${{ inputs.draft_tag }}" "${{ steps.prepare_artifact.outputs.zip }}" --clobber
+1 -1
View File
@@ -27,5 +27,5 @@ keywords:
- self-hosted
- portabase
license: Apache-2.0
version: 1.18.2
version: 1.18.4
date-released: '2026-02-24'
Generated
+1 -1
View File
@@ -3503,7 +3503,7 @@ dependencies = [
[[package]]
name = "portabase-agent"
version = "1.18.2"
version = "1.18.4"
dependencies = [
"aes",
"aes-gcm",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "portabase-agent"
version = "1.18.2"
version = "1.18.4"
edition = "2024"
[dependencies]
+6 -47
View File
@@ -1,13 +1,14 @@
services:
rust-app:
# build:
# context: .
# dockerfile: docker/Dockerfile
# target: prod
image: portabase/agent:latest
build:
context: .
dockerfile: docker/Dockerfile
target: prod
# image: portabase/agent:latest
container_name: rust-prod
volumes:
- ./databases.json:/config/config.json
- /var/run/docker.sock:/var/run/docker.sock
environment:
LOG: info
TZ: "Europe/Paris"
@@ -18,48 +19,6 @@ services:
networks:
- portabase
db-mongodb-auth:
container_name: db-mongodb-auth
image: mongo:latest
ports:
- "27082:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: rootpassword
MONGO_INITDB_DATABASE: testdbauth
command: mongod --auth
networks:
- portabase
volumes:
- mongodb-data-auth:/data/db
healthcheck:
test: [ "CMD", "mongo", "--eval", "db.adminCommand('ping')" ]
interval: 5s
timeout: 5s
retries: 10
db-mongodb:
container_name: db-mongodb
image: mongo:latest
ports:
- "27083:27017"
volumes:
- mongodb-data:/data/db
healthcheck:
test: [ "CMD", "mongosh", "--eval", "db.adminCommand('ping')" ]
interval: 5s
timeout: 5s
retries: 10
environment:
MONGO_INITDB_DATABASE: testdb
networks:
- portabase
volumes:
mongodb-data:
mongodb-data-auth:
networks:
portabase:
name: portabase_network
+1 -1
View File
@@ -21,7 +21,7 @@ services:
LOG: debug
TZ: "Europe/Paris"
# TMPDIR: /scratch
EDGE_KEY: "eyJzZXJ2ZXJVcmwiOiJodHRwOi8vbG9jYWxob3N0Ojg4ODciLCJhZ2VudElkIjoiNmM4NWE3ODQtODRkMi00YzUyLTgzYmUtZTc2MDZkZjg2YjM5IiwibWFzdGVyS2V5QjY0IjoiMUh0djdtWCtYVkJxL0IzUEV2WDlZZjlQeUdVZW5oRHlXemo5THRqNW90WT0ifQ=="
EDGE_KEY: "eyJzZXJ2ZXJVcmwiOiJodHRwOi8vbG9jYWxob3N0Ojg4ODciLCJhZ2VudElkIjoiODY1Mjk2NDgtYmQ0Zi00MWMxLWFmNDItNGM1MzE3ZDEzY2JhIiwibWFzdGVyS2V5QjY0IjoiQlhWM1hvbEM2NTZTVjdkTmdjV1BHUWxrKytycExJNmxHRGk3Q1BCNWllbz0ifQ=="
#CHUNK_SIZE_MB: "1"
#POOLING: 1
#DATABASES_CONFIG_FILE: "config.toml"
+8
View File
@@ -45,6 +45,14 @@ seed-firebird:
echo "SELECT RDB\$RELATION_NAME FROM RDB\$RELATIONS WHERE RDB\$SYSTEM_FLAG = 0 AND RDB\$VIEW_BLR IS NULL;" \
| docker exec -i db-firebird isql -user alice -password fake_password /var/lib/firebird/data/mirror.fdb
seed-firebird-large:
echo "Seeding Firebird..."
docker exec -i db-firebird isql -user alice -password fake_password /var/lib/firebird/data/mirror.fdb < ./scripts/firebird/seed-large.sql
echo "Verifying Firebird tables..."
echo "SELECT RDB\$RELATION_NAME FROM RDB\$RELATIONS WHERE RDB\$SYSTEM_FLAG = 0 AND RDB\$VIEW_BLR IS NULL;" \
| docker exec -i db-firebird isql -user alice -password fake_password /var/lib/firebird/data/mirror.fdb
seed-mssql:
echo "Seeding MSSQL..."
docker exec -i rust-dev sqlcmd -S "db-mssql,1433" -U sa -P "$MSSQL_SA_PASSWORD" -N disable -i /app/scripts/mssql/seed.sql
+259
View File
@@ -0,0 +1,259 @@
SET SQL DIALECT 3;
SET BAIL ON;
SET AUTODDL OFF;
CREATE TABLE users (
id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
email VARCHAR(255) NOT NULL UNIQUE,
name VARCHAR(255),
payload BLOB SUB_TYPE TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
COMMIT;
INSERT INTO users (email, name, payload)
VALUES ('alice@example.com', 'Alice', 'Alice seed data');
INSERT INTO users (email, name, payload)
VALUES ('bob@example.com', 'Bob', 'Bob seed data');
COMMIT;
/*
* Each procedure call generates approximately 128 MiB:
*
* 128 rows
* × 128 chunks per row
* × 8191 bytes per chunk
* = approximately 128 MiB
*
* 40 calls = approximately 5 GiB.
*/
SET TERM ^;
CREATE PROCEDURE seed_users_batch (
p_rows INTEGER,
p_chunks_per_row INTEGER
)
AS
DECLARE VARIABLE v_row_index INTEGER;
DECLARE VARIABLE v_chunk_index INTEGER;
DECLARE VARIABLE v_uuid VARCHAR(36);
DECLARE VARIABLE v_chunk VARCHAR(8191);
DECLARE VARIABLE v_payload BLOB SUB_TYPE TEXT;
BEGIN
v_row_index = 0;
WHILE (v_row_index < p_rows) DO
BEGIN
v_payload = NULL;
v_chunk_index = 0;
WHILE (v_chunk_index < p_chunks_per_row) DO
BEGIN
/*
* Generate a different chunk to avoid producing a completely
* uniform BLOB.
*/
v_chunk = RPAD(
UUID_TO_CHAR(GEN_UUID()),
8191,
UUID_TO_CHAR(GEN_UUID())
);
v_payload = BLOB_APPEND(v_payload, v_chunk);
v_chunk_index = v_chunk_index + 1;
END
v_uuid = UUID_TO_CHAR(GEN_UUID());
INSERT INTO users (
email,
name,
payload
)
VALUES (
:v_uuid || '@example.test',
'Seed User ' || :v_uuid,
:v_payload
);
v_row_index = v_row_index + 1;
END
END^
SET TERM ;^
/* Batch 01 — approximately 128 MiB */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 02 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 03 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 04 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 05 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 06 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 07 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 08 — approximately 1 GiB total */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 09 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 10 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 11 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 12 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 13 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 14 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 15 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 16 — approximately 2 GiB total */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 17 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 18 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 19 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 20 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 21 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 22 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 23 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 24 — approximately 3 GiB total */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 25 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 26 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 27 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 28 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 29 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 30 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 31 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 32 — approximately 4 GiB total */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 33 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 34 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 35 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 36 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 37 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 38 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 39 */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
/* Batch 40 — approximately 5 GiB total */
EXECUTE PROCEDURE seed_users_batch(128, 128);
COMMIT;
DROP PROCEDURE seed_users_batch;
COMMIT;
SELECT
COUNT(*) AS user_count,
CAST(SUM(OCTET_LENGTH(payload)) / 1073741824.0 AS DECIMAL(18, 2))
AS payload_size_gib
FROM users;
COMMIT;
+1 -1
View File
@@ -15,7 +15,7 @@ pub const EPHEMERAL_LABEL: &str = "io.portabase.ephemeral";
const HELPER_MOUNT: &str = "/vol";
pub fn client() -> Result<Docker> {
Docker::connect_with_unix_defaults().context("Failed to connect to Docker daemon socket")
Docker::connect_with_defaults().context("Failed to connect to Docker daemon socket")
}
pub fn parse_container_id(mountinfo: &str, cgroup: &str) -> Option<String> {
+1
View File
@@ -23,6 +23,7 @@ pub async fn run(
let start = Instant::now();
let output = Command::new("gbak")
.arg("-b")
.arg("-g")
.arg("-v")
.arg("-user").arg(&cfg.username)
.arg("-password").arg(&cfg.password)