mirror of
https://github.com/fleetbase/fleetbase.git
synced 2026-01-01 20:07:09 +00:00
Compare commits
22 Commits
v0.5.29
...
feature/fu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
62a69b2dcc | ||
|
|
313b5ea3ba | ||
|
|
698f5979b1 | ||
|
|
f6f6899650 | ||
|
|
83a7ab7338 | ||
|
|
acf7b209af | ||
|
|
5c048a8238 | ||
|
|
de00ad31db | ||
|
|
8fe52c6157 | ||
|
|
a371e055ca | ||
|
|
bbec73fcef | ||
|
|
838a829a11 | ||
|
|
dbb7bc793a | ||
|
|
f0fa867ef9 | ||
|
|
3cc64913ca | ||
|
|
d034c4ad03 | ||
|
|
b740cf035e | ||
|
|
cc42779efc | ||
|
|
4a5422e357 | ||
|
|
21a0808b99 | ||
|
|
f6cb850219 | ||
|
|
80707774ac |
@@ -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
734
api/composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -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>
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
6
console/app/utils/remove-boot-loader.js
Normal file
6
console/app/utils/remove-boot-loader.js
Normal file
@@ -0,0 +1,6 @@
|
||||
export default function removeBootLoader() {
|
||||
const bootLoaderElement = document.getElementById('boot-loader');
|
||||
if (bootLoaderElement && typeof bootLoaderElement.remove === 'function') {
|
||||
bootLoaderElement.remove();
|
||||
}
|
||||
}
|
||||
@@ -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
2885
console/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
10
console/tests/unit/utils/remove-boot-loader-test.js
Normal file
10
console/tests/unit/utils/remove-boot-loader-test.js
Normal 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);
|
||||
});
|
||||
});
|
||||
@@ -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
154
docker/Dockerfile.fullstack
Normal 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"]
|
||||
47
docker/fullstack-entrypoint.sh
Normal file
47
docker/fullstack-entrypoint.sh
Normal 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
|
||||
Submodule packages/core-api updated: 4bc6f0fe67...416078f32a
Submodule packages/ember-ui updated: eab5966713...551a42982c
Submodule packages/fleetops updated: 226acb7914...267edc52de
Submodule packages/fleetops-data updated: 748cb40dfc...5d9cc9d759
Submodule packages/storefront updated: 1f9e0f0090...71b094313f
Reference in New Issue
Block a user