Compare commits

..

22 Commits

Author SHA1 Message Date
Ronald A. Richardson
62a69b2dcc Fullstack docker image 2025-05-01 08:55:26 +08:00
Ron
313b5ea3ba Merge pull request #374 from fleetbase/dev-v0.6.8
Some checks failed
Fleetbase CI / Build and Start Docker Services (push) Has been cancelled
v0.6.8 ~ View Proof of Delivery in FleetOps + API to get POD
2025-04-14 16:10:34 +08:00
Ronald A. Richardson
698f5979b1 v0.6.8 ~ View Proof of Delivery in FleetOps + API to get POD 2025-04-14 16:05:10 +08:00
Ron
f6f6899650 Merge pull request #373 from fleetbase/dev-v0.6.7
Some checks failed
Fleetbase CI / Build and Start Docker Services (push) Has been cancelled
Fix iOS Push Notifications for Production Environments
2025-04-11 12:51:25 +08:00
Ronald A. Richardson
83a7ab7338 Fix iOS Push Notifications for Production Environments 2025-04-11 12:43:09 +08:00
Ron
acf7b209af Merge pull request #372 from fleetbase/dev-v0.6.6
Patched Join Organization + Chat Push Notifications Added
2025-04-11 10:09:40 +08:00
Ronald A. Richardson
5c048a8238 Patched Join Organization + Chat Push Notifications Added 2025-04-11 10:02:33 +08:00
Ron
de00ad31db Merge pull request #371 from fleetbase/dev-v0.6.5
Some checks are pending
Fleetbase CI / Build and Start Docker Services (push) Waiting to run
🤖 Patched Navigator App Instance Linking for Android
2025-04-10 13:44:34 +08:00
Ronald A. Richardson
8fe52c6157 🤖 Patched Navigator App Instance Linking for Android + Navigator App Identifier Configurable 2025-04-10 13:34:42 +08:00
Ron
a371e055ca Merge pull request #370 from fleetbase/dev-v0.6.4
Some checks are pending
Fleetbase CI / Build and Start Docker Services (push) Waiting to run
Upgraded FleetOps to v0.6.3
2025-04-09 19:34:52 +08:00
Ronald A. Richardson
bbec73fcef Upgraded FleetOps to v0.6.3 2025-04-09 19:03:42 +08:00
Ron
838a829a11 Merge pull request #367 from fleetbase/dev-v0.6.3
Some checks failed
Fleetbase CI / Build and Start Docker Services (push) Has been cancelled
Patched AdHoc Pinging & Push Notifications
2025-04-01 21:17:49 +08:00
Ronald A. Richardson
dbb7bc793a removed console logs 2025-04-01 21:06:16 +08:00
Ronald A. Richardson
f0fa867ef9 Patched AdHoc Pinging & Push Notifications 2025-04-01 21:02:51 +08:00
Ron
3cc64913ca Merge pull request #366 from fleetbase/hotfix/php-geos-404
Some checks failed
Fleetbase CI / Build and Start Docker Services (push) Has been cancelled
hotfix php-geos install replace broken url with github mirror
2025-03-31 11:13:35 +08:00
Ronald A. Richardson
d034c4ad03 hotfix php-geos install replace broken url with github mirror 2025-03-31 11:05:47 +08:00
Ron
b740cf035e Merge pull request #365 from fleetbase/dev-v0.6.1
Some checks failed
Fleetbase CI / Build and Start Docker Services (push) Has been cancelled
v0.6.1 ~ new driver online/offline toggle endpoint, improvements to tracker data api
2025-03-27 21:27:50 +08:00
Ronald A. Richardson
cc42779efc new driver online/offline toggle endpoint, improvements to tracker data api 2025-03-27 21:25:50 +08:00
Ron
4a5422e357 Merge pull request #364 from fleetbase/dev-v0.6.0
Some checks are pending
Fleetbase CI / Build and Start Docker Services (push) Waiting to run
v0.6.0 - Navigator App Refactor Support Release & Patches + Improvements
2025-03-26 22:14:02 +08:00
Ronald A. Richardson
21a0808b99 v0.6.0 - Navigator App Refactor Support Release & Patches + Improvements 2025-03-26 21:54:48 +08:00
Ron
f6cb850219 Merge pull request #358 from fleetbase/dev-v0.5.30
Some checks failed
Fleetbase CI / Build and Start Docker Services (push) Has been cancelled
🏁 Consumable API Patches, Perf Improvements
2025-02-26 20:22:51 +08:00
Ronald A. Richardson
80707774ac 🏁 Consumable API Patches, Perf Improvements 2025-02-26 20:03:09 +08:00
20 changed files with 2154 additions and 1798 deletions

View File

@@ -10,10 +10,10 @@
"require": {
"php": "^8.0",
"appstract/laravel-opcache": "^4.0",
"fleetbase/core-api": "^1.5.31",
"fleetbase/fleetops-api": "^0.5.24",
"fleetbase/core-api": "^1.6.2",
"fleetbase/fleetops-api": "^0.6.5",
"fleetbase/registry-bridge": "^0.0.18",
"fleetbase/storefront-api": "^0.3.28",
"fleetbase/storefront-api": "^0.3.30",
"guzzlehttp/guzzle": "^7.0.1",
"laravel/framework": "^10.0",
"laravel/octane": "^2.3",

734
api/composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -16,7 +16,7 @@
{{/if}}
</InputGroup>
<InputGroup @wrapperClass="mb-0i">
<Checkbox @label="APN Production" @value={{this.apn.production}} @onToggle={{fn (mut this.apn.production)}} @disabled={{this.isLoading}} />
<Checkbox @label="APN Production" @value={{this.apn.production}} @onToggle={{this.toggleApnProduction}} />
</InputGroup>
</ContentPanel>

View File

@@ -32,6 +32,13 @@ export default class ConfigureNotificationChannelsComponent extends Component {
this.loadConfigValues();
}
@action toggleApnProduction(checked) {
this.apn = {
...this.apn,
production: checked,
};
}
@action removeApnFile() {
const apnConfig = this.apn;
apnConfig.private_key_file = null;

View File

@@ -22,7 +22,12 @@
</head>
<body>
{{content-for "body"}}
<div id="boot-loader" class="overloader">
<div class="loader-container">
<span class="fleetbase-loader" width="16" height="16"></span>
<div class="loading-message">Starting up...</div>
</div>
</div>
<script src="{{rootURL}}assets/vendor.js"></script>
<script src="{{rootURL}}assets/@fleetbase/console.js"></script>

View File

@@ -4,6 +4,7 @@ import { inject as service } from '@ember/service';
import { action } from '@ember/object';
import isElectron from '@fleetbase/ember-core/utils/is-electron';
import pathToRoute from '@fleetbase/ember-core/utils/path-to-route';
import removeBootLoader from '../utils/remove-boot-loader';
export default class ApplicationRoute extends Route {
@service session;
@@ -88,6 +89,17 @@ export default class ApplicationRoute extends Route {
}
}
/**
* Remove boot loader if not authenticated.
*
* @memberof ApplicationRoute
*/
afterModel() {
if (!this.session.isAuthenticated) {
removeBootLoader();
}
}
/**
* Initializes the application's theme settings, applying necessary class names and default theme configurations.
*

View File

@@ -1,6 +1,7 @@
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
import { action } from '@ember/object';
import removeBootLoader from '../utils/remove-boot-loader';
import '@fleetbase/leaflet-routing-machine';
export default class ConsoleRoute extends Route {
@@ -37,6 +38,7 @@ export default class ConsoleRoute extends Route {
*/
async afterModel(model, transition) {
this.universe.callHooks('console:after-model', this.session, this.router, model, transition);
removeBootLoader();
}
/**

View File

@@ -38,3 +38,32 @@ body[data-theme='dark'] .two-fa-enforcement-alert button#two-fa-setup-button.btn
body.console-admin-organizations-index-index .next-table-wrapper > table {
table-layout: auto;
}
#boot-loader {
position: absolute;
z-index: 9999999999;
inset: 0;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
}
#boot-loader > .loader-container {
display: flex;
align-items: center;
justify-content: center;
text-align: center;
}
#boot-loader > .loader-container > .loading-message {
margin-left: 0.5rem;
font-weight: 600;
font-size: 0.875rem;
}
body[data-theme='dark'] #boot-loader > .loader-container > .loading-message {
color: #fff;
}

View File

@@ -0,0 +1,6 @@
export default function removeBootLoader() {
const bootLoaderElement = document.getElementById('boot-loader');
if (bootLoaderElement && typeof bootLoaderElement.remove === 'function') {
bootLoaderElement.remove();
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@fleetbase/console",
"version": "0.5.29",
"version": "0.6.8",
"private": true,
"description": "Modular logistics and supply chain operating system (LSOS)",
"repository": "https://github.com/fleetbase/fleetbase",
@@ -33,14 +33,14 @@
"@fleetbase/ember-core": "latest",
"@fleetbase/ember-ui": "latest",
"@fleetbase/fleetops-data": "latest",
"@fleetbase/fleetops-engine": "^0.5.24",
"@fleetbase/fleetops-engine": "^0.6.5",
"@fleetbase/iam-engine": "^0.1.3",
"@fleetbase/leaflet-routing-machine": "^3.2.16",
"@fleetbase/registry-bridge-engine": "^0.0.18",
"@fleetbase/storefront-engine": "^0.3.28",
"@fleetbase/storefront-engine": "^0.3.30",
"@fortawesome/ember-fontawesome": "^2.0.0",
"ember-changeset": "^4.1.2",
"ember-changeset-validations": "^4.1.1",
"ember-changeset": "4.1.2",
"ember-changeset-validations": "4.1.2",
"ember-composable-helpers": "^5.0.0",
"ember-concurrency": "^3.1.1",
"ember-concurrency-decorators": "^2.0.3",
@@ -56,6 +56,7 @@
"postcss-nth-list": "^1.0.2"
},
"devDependencies": {
"@embroider/macros": "1.16.12",
"@babel/core": "^7.25.2",
"@babel/eslint-parser": "^7.25.1",
"@babel/plugin-proposal-decorators": "^7.24.7",
@@ -127,7 +128,7 @@
"stylelint-prettier": "^4.1.0",
"tailwindcss": "^3.4.10",
"tracked-built-ins": "^3.3.0",
"webpack": "^5.94.0"
"webpack": "^5.98.0"
},
"engines": {
"node": ">= 18"

2885
console/pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,10 @@
import removeBootLoader from '@fleetbase/console/utils/remove-boot-loader';
import { module, test } from 'qunit';
module('Unit | Utility | remove-boot-loader', function () {
// TODO: Replace this with your real tests.
test('it works', function (assert) {
let result = removeBootLoader();
assert.ok(result);
});
});

View File

@@ -1,6 +1,6 @@
# syntax = docker/dockerfile:1.2
# Base stage
FROM dunglas/frankenphp:1.2.3-php8.2-bookworm as base
FROM dunglas/frankenphp:1.5.0-php8.2-bookworm as base
# Install packages
RUN apt-get update && apt-get install -y git bind9-utils mycli nodejs npm nano \
@@ -20,11 +20,35 @@ RUN install-php-extensions \
opcache \
memcached \
imagick \
geos \
# geos \
sockets \
pcntl \
@composer
# Install build dependencies for GEOS
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
pkg-config \
libgeos-dev \
libgeos++-dev \
autoconf \
build-essential \
unzip \
&& rm -rf /var/lib/apt/lists/*
# Download, extract, compile, and enable the php-geos extension
RUN curl -fsSL -o php-geos.zip \
https://github.com/libgeos/php-geos/archive/dfe1ab17b0f155cc315bc13c75689371676e02e1.zip \
&& unzip php-geos.zip \
&& rm php-geos.zip \
&& cd php-geos-* \
&& ./autogen.sh \
&& ./configure \
&& make -j"$(nproc)" install \
&& docker-php-ext-enable geos \
&& cd .. \
&& rm -rf php-geos-*
# Update PHP configurations
RUN sed -e 's/^expose_php.*/expose_php = Off/' "$PHP_INI_DIR/php.ini-production" > "$PHP_INI_DIR/php.ini" \
&& sed -i -e 's/^upload_max_filesize.*/upload_max_filesize = 600M/' -e 's/^post_max_size.*/post_max_size = 0/' \

154
docker/Dockerfile.fullstack Normal file
View File

@@ -0,0 +1,154 @@
# syntax = docker/dockerfile:1.2
# Base stage
FROM dunglas/frankenphp:1.5.0-php8.2-bookworm AS base
# Install packages
RUN apt-get update && apt-get install -y git bind9-utils mycli nodejs npm nano mariadb-server redis-server \
&& mkdir -p /root/.ssh \
&& ssh-keyscan github.com >> /root/.ssh/known_hosts
# Install PHP Extensions
RUN install-php-extensions \
pdo_mysql \
gd \
bcmath \
redis \
intl \
zip \
gmp \
apcu \
opcache \
memcached \
imagick \
# geos \
sockets \
pcntl \
@composer
# Install build dependencies for GEOS
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
pkg-config \
libgeos-dev \
libgeos++-dev \
autoconf \
build-essential \
unzip \
&& rm -rf /var/lib/apt/lists/*
# Download, extract, compile, and enable the php-geos extension
RUN curl -fsSL -o php-geos.zip \
https://github.com/libgeos/php-geos/archive/dfe1ab17b0f155cc315bc13c75689371676e02e1.zip \
&& unzip php-geos.zip \
&& rm php-geos.zip \
&& cd php-geos-* \
&& ./autogen.sh \
&& ./configure \
&& make -j"$(nproc)" install \
&& docker-php-ext-enable geos \
&& cd .. \
&& rm -rf php-geos-*
# Update PHP configurations
RUN sed -e 's/^expose_php.*/expose_php = Off/' "$PHP_INI_DIR/php.ini-production" > "$PHP_INI_DIR/php.ini" \
&& sed -i -e 's/^upload_max_filesize.*/upload_max_filesize = 600M/' -e 's/^post_max_size.*/post_max_size = 0/' \
-e 's/^memory_limit.*/memory_limit = 600M/' "$PHP_INI_DIR/php.ini"
# Install global node modules
RUN npm install -g chokidar pnpm socketcluster ember-cli npm-cli-login
# Create application directory
RUN mkdir -p /fleetbase
# Setup Console
COPY --chown=www-data:www-data ./console /fleetbase/console
WORKDIR /fleetbase/console
RUN pnpm install && pnpm build
# Setup SocketCluster
RUN socketcluster create /fleetbase/socketcluster
# Install ssm-parent
COPY --from=ghcr.io/springload/ssm-parent:1.8 /usr/bin/ssm-parent /sbin/ssm-parent
# Create the pnpm directory and set the PNPM_HOME environment variable
RUN mkdir -p ~/.pnpm
ENV PNPM_HOME=/root/.pnpm
# Add the pnpm global bin to the PATH
ENV PATH=/root/.pnpm/bin:$PATH
# Set some build ENV variables
ENV LOG_CHANNEL=stdout
ENV CACHE_DRIVER=null
ENV BROADCAST_DRIVER=socketcluster
ENV QUEUE_CONNECTION=redis
ENV CADDYFILE_PATH=/fleetbase/Caddyfile
ENV CONSOLE_PATH=/fleetbase/console
ENV OCTANE_SERVER=frankenphp
ENV DB_CONNECTION=mysql
ENV DB_HOST=127.0.0.1
ENV DB_PORT=3306
ENV DB_DATABASE=fleetbase
ENV DB_USERNAME=root
ENV DB_PASSWORD=secret
ENV REDIS_HOST=127.0.0.1
ENV REDIS_PORT=6379
ENV REDIS_CLIENT=phpredis
# Set environment
ARG ENVIRONMENT=production
ENV APP_ENV=$ENVIRONMENT
# Setup github auth
ARG GITHUB_AUTH_KEY
# Copy Caddyfile
COPY --chown=www-data:www-data ./Caddyfile $CADDYFILE_PATH
# Create /fleetbase directory and set correct permissions
RUN mkdir -p /fleetbase/api && mkdir -p /fleetbase/console && chown -R www-data:www-data /fleetbase
# Set working directory
WORKDIR /fleetbase/api
# Prepare composer cache directory
RUN mkdir -p /var/www/.cache/composer && chown -R www-data:www-data /var/www/.cache/composer
# Optimize Composer Dependency Installation
COPY --chown=www-data:www-data ./api/composer.json ./api/composer.lock /fleetbase/api/
# Pre-install Composer dependencies
RUN su www-data -s /bin/sh -c "composer install --no-scripts --optimize-autoloader --no-dev --no-cache"
# Setup application
COPY --chown=www-data:www-data ./api /fleetbase/api
# Dump autoload
RUN su www-data -s /bin/sh -c "composer dumpautoload"
# Setup composer root directory
RUN mkdir -p /root/.composer
RUN mkdir -p /fleetbase/api/.composer && chown www-data:www-data /fleetbase/api/.composer
# Setup logging
RUN mkdir -p /fleetbase/api/storage/logs/ && touch /fleetbase/api/storage/logs/laravel-$(date +'%Y-%m-%d').log
RUN chown -R www-data:www-data /fleetbase/api/storage
RUN chmod -R 755 /fleetbase/api/storage
# Set permissions and run deploy script
RUN chmod +x /fleetbase/api/deploy.sh
# RUN sh ./fleetbase/api/deploy.sh
# Install go-crond
RUN curl -L https://github.com/webdevops/go-crond/releases/download/23.12.0/go-crond.linux.amd64 > /usr/local/bin/go-crond && chmod +x /usr/local/bin/go-crond
COPY docker/crontab ./crontab
RUN chmod 0600 ./crontab
# Expose ports
EXPOSE 8000 4200 3800 3306 6379
# Execute
COPY ./docker/fullstack-entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

View File

@@ -0,0 +1,47 @@
#!/usr/bin/env bash
set -e
echo "🚀 Fleetbase Fullstack Container Starting..."
# Graceful shutdown handler
trap 'echo "🛑 Caught termination signal, shutting down..."; kill $(jobs -p); wait' SIGTERM SIGINT
echo "🔧 Starting MySQL service..."
service mysql start
echo "🗄️ Configuring MySQL database and user..."
mysql --user=root <<-EOSQL
CREATE DATABASE IF NOT EXISTS fleetbase;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'secret';
FLUSH PRIVILEGES;
EOSQL
echo "🧠 Waiting for MySQL to become ready..."
until mysqladmin ping --silent; do
echo "⏳ Waiting for MySQL..."
sleep 1
done
echo "✅ MySQL is ready."
echo "🔧 Starting Redis service..."
service redis-server start
echo "🧠 Waiting for Redis to become ready..."
until redis-cli ping | grep -q PONG; do
echo "⏳ Waiting for Redis..."
sleep 1
done
echo "✅ Redis is ready."
echo "📡 Launching SocketCluster on port 3800..."
node /fleetbase/socketcluster/index.js &
echo "🖥️ Serving Ember frontend on port 4200..."
npx serve -l 4200 /fleetbase/console/dist &
echo "📦 Running Fleetbase deploy script..."
sh /fleetbase/api/deploy.sh
echo "🧬 Starting Laravel API (FrankenPHP Octane) on port 8000..."
cd /fleetbase/api
exec php artisan octane:frankenphp --port=8000 --host=0.0.0.0