Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
ce1f8c8
feat: add Docker configuration files and installation script for Surf…
AnishSarkar22 Feb 24, 2026
68be0d8
chore: remove legacy Docker configuration files and initialization sc…
AnishSarkar22 Feb 24, 2026
1ce446e
feat: add Celery worker and beat services to Docker configuration, up…
AnishSarkar22 Feb 24, 2026
211309f
chore: update Docker environment variables for database configuration…
AnishSarkar22 Feb 24, 2026
2958d1c
chore: update Docker configuration to rename frontend to web, adjust …
AnishSarkar22 Feb 24, 2026
0a231ff
chore: update installation script to create a nested scripts director…
AnishSarkar22 Feb 24, 2026
d5be5c6
chore: update docker compose
AnishSarkar22 Feb 24, 2026
d39951e
chore: update docker-compose image; `init-electric-user.sh` is now ex…
AnishSarkar22 Feb 24, 2026
c216c5b
chore: refactor Docker build arguments for web image to separate envi…
AnishSarkar22 Feb 24, 2026
2e0f752
chore: correct file path for Electric SQL user initialization script …
AnishSarkar22 Feb 24, 2026
d7a5486
chore: pinning version for electricsql in both docker-compose files; …
AnishSarkar22 Feb 25, 2026
4ce883b
chore: update Docker images to use repo for testing
AnishSarkar22 Feb 25, 2026
bbbde07
chore: set specific version for testing
AnishSarkar22 Feb 25, 2026
85eabff
chore: update Docker configuration to use new repository and set SURF…
AnishSarkar22 Feb 25, 2026
176dfda
chore: enhance .env.example with restructuring configuration options …
AnishSarkar22 Feb 25, 2026
95c4156
chore: update .env.example
AnishSarkar22 Feb 25, 2026
9ae589b
chore: update documentation for Electric SQL setup and enhance .env.e…
AnishSarkar22 Feb 25, 2026
f311a34
chore: update README and installation documentation to streamline Doc…
AnishSarkar22 Feb 26, 2026
5126403
chore: update Docker Compose files to specify names for volume config…
AnishSarkar22 Feb 26, 2026
b06c70a
chore: update GitHub Actions workflow to trigger on main branch pushe…
AnishSarkar22 Feb 26, 2026
6e2a055
chore: enhance .env.example with additional configuration options for…
AnishSarkar22 Feb 26, 2026
b5874a5
chore: resolve merge conflict by removing legacy all-in-one Docker files
AnishSarkar22 Feb 26, 2026
f4f659e
chore: add Daytona Sandbox configuration options to .env.example and …
AnishSarkar22 Feb 26, 2026
cbff5bd
chore: remove unnecessary comment from .env.example to streamline con…
AnishSarkar22 Feb 26, 2026
91c30db
chore: reorganize comments in .env.example for improved clarity and c…
AnishSarkar22 Feb 26, 2026
f051c19
feat: add database migration script and update installation instructi…
AnishSarkar22 Feb 26, 2026
5030dec
chore: update banner in installation and database migration scripts f…
AnishSarkar22 Feb 26, 2026
025643f
feat: enhance installation and migration scripts to automate legacy d…
AnishSarkar22 Feb 26, 2026
22bd38f
fix: ensure DB credentials are set correctly in migration mode by add…
AnishSarkar22 Feb 26, 2026
bb83ee5
refactor: update version display in installation script and streamlin…
AnishSarkar22 Feb 26, 2026
4f59e2c
chore: remove obsolete .env.example file to declutter configuration a…
AnishSarkar22 Feb 26, 2026
35025bf
chore: update Docker images to new repository and enable Watchtower f…
AnishSarkar22 Feb 26, 2026
71a995d
docs: update installation instructions across multiple languages to i…
AnishSarkar22 Feb 26, 2026
90f18fa
chore: update Docker image references to new repository for backend a…
AnishSarkar22 Feb 26, 2026
2e8e85a
docs: enhance Docker installation and migration documentation with up…
AnishSarkar22 Feb 26, 2026
7d99dbc
docs: update connector documentation to specify adding credentials to…
AnishSarkar22 Feb 26, 2026
32d092b
feat: Add clean GHCR version tags alongside build tags; also update d…
AnishSarkar22 Feb 26, 2026
bc3db01
docs: update SurfSense version comment in .env.example to clarify ver…
AnishSarkar22 Feb 26, 2026
06e6c1c
chore: add healthcheck configuration for backend and update service d…
AnishSarkar22 Feb 26, 2026
232622f
docs: enhance Docker installation documentation with development comp…
AnishSarkar22 Feb 26, 2026
f03a746
chore: update Docker installation script to point to the new reposito…
AnishSarkar22 Feb 26, 2026
233279b
chore: update Docker installation script to use the new repository UR…
AnishSarkar22 Feb 26, 2026
47a2ba0
chore: update Docker image references to use the new repository for b…
AnishSarkar22 Feb 26, 2026
3e29ae3
chore: update SURFSENSE_VERSION in .env.example to 0.0.13.6
AnishSarkar22 Feb 26, 2026
ccae5ff
fix: add error handling for missing dump file in migration script and…
AnishSarkar22 Feb 26, 2026
48ee5e8
chore: updated links to the main branch for production
AnishSarkar22 Feb 26, 2026
4e401fd
feat: enhance installation script to include automatic Watchtower set…
AnishSarkar22 Feb 26, 2026
d6cb41d
docs: update installation instructions across multiple languages to c…
AnishSarkar22 Feb 26, 2026
66d9cd5
fix: suppress benign output during database restoration in installati…
AnishSarkar22 Feb 26, 2026
f419efc
Merge remote-tracking branch 'upstream/dev' into fix/docker
AnishSarkar22 Feb 26, 2026
9124b19
chore: update Docker image references for testing
AnishSarkar22 Feb 27, 2026
fbef820
fix: redirect stdin to /dev/null in Docker commands to suppress unwan…
AnishSarkar22 Feb 27, 2026
494307b
refactor: encapsulate installation script logic in a main function fo…
AnishSarkar22 Feb 27, 2026
6626a02
chore: update Redis and ElectricSQL Docker images to latest versions
AnishSarkar22 Feb 27, 2026
848ad55
chore: update URL links for production
AnishSarkar22 Feb 27, 2026
57a1c71
chore: upgrade Redis to version 8-alpine and ElectricSQL to version 1…
AnishSarkar22 Feb 27, 2026
6e1ca96
feat: add migration completion tracking to installation script
AnishSarkar22 Feb 27, 2026
799b3dc
docs: add note for Windows users to install WSL before running instal…
AnishSarkar22 Feb 28, 2026
d24691a
fix: increase timeout for alembic migrations in entrypoint script to …
AnishSarkar22 Mar 2, 2026
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
41 changes: 0 additions & 41 deletions .env.example

This file was deleted.

169 changes: 79 additions & 90 deletions .github/workflows/docker_build.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
name: Build and Push Docker Image
name: Build and Push Docker Images

on:
push:
branches:
- main
paths:
- 'surfsense_backend/**'
- 'surfsense_web/**'
workflow_dispatch:
inputs:
branch:
description: 'Branch to build from (leave empty for default branch)'
required: false
default: ''

concurrency:
group: docker-build
cancel-in-progress: false

permissions:
contents: write
packages: write
Expand All @@ -28,33 +38,28 @@ jobs:
- name: Read app version and calculate next Docker build version
id: tag_version
run: |
# Read version from pyproject.toml
APP_VERSION=$(grep -E '^version = ' surfsense_backend/pyproject.toml | sed 's/version = "\(.*\)"/\1/')
echo "App version from pyproject.toml: $APP_VERSION"

if [ -z "$APP_VERSION" ]; then
echo "Error: Could not read version from surfsense_backend/pyproject.toml"
exit 1
fi

# Fetch all tags

git fetch --tags

# Find the latest docker build tag for this app version (format: APP_VERSION.BUILD_NUMBER)
# Tags follow pattern: 0.0.11.1, 0.0.11.2, etc.

LATEST_BUILD_TAG=$(git tag --list "${APP_VERSION}.*" --sort='-v:refname' | head -n 1)

if [ -z "$LATEST_BUILD_TAG" ]; then
echo "No previous Docker build tag found for version ${APP_VERSION}. Starting with ${APP_VERSION}.1"
NEXT_VERSION="${APP_VERSION}.1"
else
echo "Latest Docker build tag found: $LATEST_BUILD_TAG"
# Extract the build number (4th component)
BUILD_NUMBER=$(echo "$LATEST_BUILD_TAG" | rev | cut -d. -f1 | rev)
NEXT_BUILD=$((BUILD_NUMBER + 1))
NEXT_VERSION="${APP_VERSION}.${NEXT_BUILD}"
fi

echo "Calculated next Docker version: $NEXT_VERSION"
echo "next_version=$NEXT_VERSION" >> $GITHUB_OUTPUT

Expand All @@ -78,67 +83,35 @@ jobs:
git ls-remote --tags origin | grep "refs/tags/${{ steps.tag_version.outputs.next_version }}" || (echo "Tag push verification failed!" && exit 1)
echo "Tag successfully pushed."

# Build for AMD64 on native x64 runner
build_amd64:
runs-on: ubuntu-latest
build:
needs: tag_release
runs-on: ${{ matrix.os }}
permissions:
packages: write
contents: read
outputs:
digest: ${{ steps.build.outputs.digest }}
strategy:
fail-fast: false
matrix:
platform: [linux/amd64, linux/arm64]
image: [backend, web]
include:
- platform: linux/amd64
suffix: amd64
os: ubuntu-latest
- platform: linux/arm64
suffix: arm64
os: ubuntu-24.04-arm
- image: backend
name: surfsense-backend
context: ./surfsense_backend
file: ./surfsense_backend/Dockerfile
- image: web
name: surfsense-web
context: ./surfsense_web
file: ./surfsense_web/Dockerfile
env:
REGISTRY_IMAGE: ghcr.io/${{ github.repository_owner }}/surfsense
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set lowercase image name
id: image
run: echo "name=${REGISTRY_IMAGE,,}" >> $GITHUB_OUTPUT

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Free up disk space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/boost
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
docker system prune -af
REGISTRY_IMAGE: ghcr.io/${{ github.repository_owner }}/${{ matrix.name }}

- name: Build and push AMD64 image
id: build
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile.allinone
push: true
tags: ${{ steps.image.outputs.name }}:${{ needs.tag_release.outputs.new_tag }}-amd64
platforms: linux/amd64
cache-from: type=gha,scope=amd64
cache-to: type=gha,mode=max,scope=amd64
provenance: false

# Build for ARM64 on native arm64 runner (no QEMU emulation!)
build_arm64:
runs-on: ubuntu-24.04-arm
needs: tag_release
permissions:
packages: write
contents: read
outputs:
digest: ${{ steps.build.outputs.digest }}
env:
REGISTRY_IMAGE: ghcr.io/${{ github.repository_owner }}/surfsense
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -165,28 +138,41 @@ jobs:
sudo rm -rf "$AGENT_TOOLSDIRECTORY" || true
docker system prune -af

- name: Build and push ARM64 image
- name: Build and push ${{ matrix.name }} (${{ matrix.suffix }})
id: build
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile.allinone
context: ${{ matrix.context }}
file: ${{ matrix.file }}
push: true
tags: ${{ steps.image.outputs.name }}:${{ needs.tag_release.outputs.new_tag }}-arm64
platforms: linux/arm64
cache-from: type=gha,scope=arm64
cache-to: type=gha,mode=max,scope=arm64
tags: ${{ steps.image.outputs.name }}:${{ needs.tag_release.outputs.new_tag }}-${{ matrix.suffix }}
platforms: ${{ matrix.platform }}
cache-from: type=gha,scope=${{ matrix.image }}-${{ matrix.suffix }}
cache-to: type=gha,mode=max,scope=${{ matrix.image }}-${{ matrix.suffix }}
provenance: false
build-args: |
${{ matrix.image == 'web' && 'NEXT_PUBLIC_FASTAPI_BACKEND_URL=__NEXT_PUBLIC_FASTAPI_BACKEND_URL__' || '' }}
${{ matrix.image == 'web' && 'NEXT_PUBLIC_FASTAPI_BACKEND_AUTH_TYPE=__NEXT_PUBLIC_FASTAPI_BACKEND_AUTH_TYPE__' || '' }}
${{ matrix.image == 'web' && 'NEXT_PUBLIC_ETL_SERVICE=__NEXT_PUBLIC_ETL_SERVICE__' || '' }}
${{ matrix.image == 'web' && 'NEXT_PUBLIC_ELECTRIC_URL=__NEXT_PUBLIC_ELECTRIC_URL__' || '' }}
${{ matrix.image == 'web' && 'NEXT_PUBLIC_ELECTRIC_AUTH_MODE=__NEXT_PUBLIC_ELECTRIC_AUTH_MODE__' || '' }}
${{ matrix.image == 'web' && 'NEXT_PUBLIC_DEPLOYMENT_MODE=__NEXT_PUBLIC_DEPLOYMENT_MODE__' || '' }}

# Create multi-arch manifest combining both platform images
create_manifest:
runs-on: ubuntu-latest
needs: [tag_release, build_amd64, build_arm64]
needs: [tag_release, build]
permissions:
packages: write
contents: read
strategy:
fail-fast: false
matrix:
include:
- name: surfsense-backend
- name: surfsense-web
env:
REGISTRY_IMAGE: ghcr.io/${{ github.repository_owner }}/surfsense
REGISTRY_IMAGE: ghcr.io/${{ github.repository_owner }}/${{ matrix.name }}

steps:
- name: Set lowercase image name
id: image
Expand All @@ -203,28 +189,31 @@ jobs:
run: |
VERSION_TAG="${{ needs.tag_release.outputs.new_tag }}"
IMAGE="${{ steps.image.outputs.name }}"

# Create manifest for version tag
APP_VERSION=$(echo "$VERSION_TAG" | rev | cut -d. -f2- | rev)

docker manifest create ${IMAGE}:${VERSION_TAG} \
${IMAGE}:${VERSION_TAG}-amd64 \
${IMAGE}:${VERSION_TAG}-arm64

docker manifest push ${IMAGE}:${VERSION_TAG}

# Create/update latest tag if on default branch

if [[ "${{ github.ref }}" == "refs/heads/${{ github.event.repository.default_branch }}" ]] || [[ "${{ github.event.inputs.branch }}" == "${{ github.event.repository.default_branch }}" ]]; then
docker manifest create ${IMAGE}:${APP_VERSION} \
${IMAGE}:${VERSION_TAG}-amd64 \
${IMAGE}:${VERSION_TAG}-arm64

docker manifest push ${IMAGE}:${APP_VERSION}

docker manifest create ${IMAGE}:latest \
${IMAGE}:${VERSION_TAG}-amd64 \
${IMAGE}:${VERSION_TAG}-arm64

docker manifest push ${IMAGE}:latest
fi

- name: Clean up architecture-specific tags (optional)
continue-on-error: true
- name: Summary
run: |
# Note: GHCR doesn't support tag deletion via API easily
# The arch-specific tags will remain but users should use the main tags
echo "Multi-arch manifest created successfully!"
echo "Users should pull: ${{ steps.image.outputs.name }}:${{ needs.tag_release.outputs.new_tag }}"
echo "Or for latest: ${{ steps.image.outputs.name }}:latest"
echo "Multi-arch manifest created for ${{ matrix.name }}!"
echo "Versioned: ${{ steps.image.outputs.name }}:${{ needs.tag_release.outputs.new_tag }}"
echo "App version: ${{ steps.image.outputs.name }}:$(echo '${{ needs.tag_release.outputs.new_tag }}' | rev | cut -d. -f2- | rev)"
echo "Latest: ${{ steps.image.outputs.name }}:latest"
Loading
Loading