mirror of
https://github.com/fleetbase/fleetbase.git
synced 2026-01-10 16:29:07 +00:00
Compare commits
34 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5d0ae16cfd | ||
|
|
1d003ee31e | ||
|
|
9c9f3a994e | ||
|
|
b0ae302e81 | ||
|
|
205fcf1480 | ||
|
|
23bf7c5ac8 | ||
|
|
ada7e0df92 | ||
|
|
f3bc42ace5 | ||
|
|
b91cbed080 | ||
|
|
9870b11a71 | ||
|
|
1d62dbca6b | ||
|
|
db3bf46a02 | ||
|
|
ec053f1d13 | ||
|
|
030ec2494d | ||
|
|
fe56bcac85 | ||
|
|
8b118d1ad9 | ||
|
|
724c1b49ab | ||
|
|
8e5b2e1ae3 | ||
|
|
e141d4d3a3 | ||
|
|
ab2e102e28 | ||
|
|
723deff398 | ||
|
|
fd9adc3961 | ||
|
|
4244a04052 | ||
|
|
e3c60a2232 | ||
|
|
1eaeb2c46e | ||
|
|
1d64d18b8b | ||
|
|
1124ecb56c | ||
|
|
672f3d51ca | ||
|
|
cd5af8dfc8 | ||
|
|
1a0073eae0 | ||
|
|
d24b1d6fbe | ||
|
|
ebbc4b2bf8 | ||
|
|
b531c18d65 | ||
|
|
fded8b24df |
2
.github/workflows/build-binaries.yml
vendored
2
.github/workflows/build-binaries.yml
vendored
@@ -1,6 +1,7 @@
|
||||
name: Build Fleetbase Binaries
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
workflow_run:
|
||||
workflows: ["Create Release"]
|
||||
types: [completed]
|
||||
@@ -10,6 +11,7 @@ permissions:
|
||||
|
||||
env:
|
||||
DIST_DIR: builds/dist
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
jobs:
|
||||
build-linux:
|
||||
|
||||
80
.github/workflows/publish-docker-images.yml
vendored
80
.github/workflows/publish-docker-images.yml
vendored
@@ -1,50 +1,50 @@
|
||||
name: Fleetbase Docker Images
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
branch:
|
||||
description: 'Branch to build from'
|
||||
required: false
|
||||
default: 'main'
|
||||
version:
|
||||
description: 'Image version tag (e.g., v0.7.1-beta)'
|
||||
required: false
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
branch:
|
||||
description: 'Branch to build from'
|
||||
required: false
|
||||
default: 'main'
|
||||
version:
|
||||
description: 'Image version tag (e.g., v0.7.1-beta)'
|
||||
required: false
|
||||
|
||||
jobs:
|
||||
docker-release:
|
||||
name: Build and Push Docker Images
|
||||
runs-on: ubuntu-latest
|
||||
docker-release:
|
||||
name: Build and Push Docker Images
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
env:
|
||||
REGISTRY: fleetbase
|
||||
VERSION: ${{ github.event.inputs.version || (github.ref_type == 'tag' && startsWith(github.ref_name, 'v') && github.ref_name) || 'manual' }}
|
||||
env:
|
||||
REGISTRY: fleetbase
|
||||
VERSION: ${{ github.event.inputs.version || (github.ref_type == 'tag' && startsWith(github.ref_name, 'v') && github.ref_name) || 'manual' }}
|
||||
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ github.event.inputs.branch || github.ref_name }}
|
||||
submodules: recursive
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ github.event.inputs.branch || github.ref_name }}
|
||||
submodules: recursive
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
||||
|
||||
- name: Build and Push Console & API Images
|
||||
uses: docker/bake-action@v2
|
||||
with:
|
||||
push: true
|
||||
targets: |
|
||||
fleetbase-console
|
||||
fleetbase-api
|
||||
files: |
|
||||
./docker-bake.hcl
|
||||
- name: Build and Push Console & API Images
|
||||
uses: docker/bake-action@v2
|
||||
with:
|
||||
push: true
|
||||
targets: |
|
||||
fleetbase-console
|
||||
fleetbase-api
|
||||
files: |
|
||||
./docker-bake.hcl
|
||||
|
||||
67
README.md
67
README.md
@@ -7,11 +7,11 @@
|
||||
<p align="center" dir="auto">
|
||||
Modular logistics and supply chain operating system
|
||||
<br>
|
||||
<a href="https://docs.fleetbase.io/" rel="nofollow">Documentation</a>
|
||||
<a href="https://docs.fleetbase.io/" rel="nofollow" target="_fleetbase_docs">Documentation</a>
|
||||
·
|
||||
<a href="https://console.fleetbase.io" rel="nofollow">Cloud Version</a>
|
||||
<a href="https://console.fleetbase.io" rel="nofollow" target="_fleetbase_console">Cloud Version</a>
|
||||
·
|
||||
<a href="https://fleetbase.apichecker.com" target="_api_status" rel="nofollow">API Status</a>
|
||||
<a href="https://console.fleetbase.io/aws-marketplace" rel="nofollow" target="_aws_marketplace">Deploy on AWS</a>
|
||||
·
|
||||
<a href="https://tally.so/r/3NBpAW" rel="nofollow">Book a Demo</a>
|
||||
·
|
||||
@@ -32,16 +32,14 @@ Fleetbase is a modular logistics and supply chain operating system designed to s
|
||||
|
||||
```bash
|
||||
git clone git@github.com:fleetbase/fleetbase.git
|
||||
cd fleetbase
|
||||
docker-compose up -d
|
||||
docker exec -ti fleetbase-application-1 bash
|
||||
sh deploy.sh
|
||||
cd fleetbase && ./scripts/docker-install.sh
|
||||
```
|
||||
|
||||
## 📖 Table of contents
|
||||
|
||||
- [Features](#-features)
|
||||
- [Install](#-install)
|
||||
- [Deploy on AWS](#-deploy-on-aws-in-one-click)
|
||||
- [Extensions](#-extensions)
|
||||
- [Apps](#-apps)
|
||||
- [Roadmap](#-roadmap)
|
||||
@@ -75,10 +73,7 @@ Make sure you have both the latest versions of docker and docker-compose install
|
||||
|
||||
```bash
|
||||
git clone git@github.com:fleetbase/fleetbase.git
|
||||
cd fleetbase
|
||||
docker-compose up -d
|
||||
docker exec -ti fleetbase-application-1 bash
|
||||
sh deploy.sh
|
||||
cd fleetbase && ./scripts/docker-install.sh
|
||||
```
|
||||
|
||||
### Accessing Fleetbase
|
||||
@@ -89,7 +84,17 @@ Fleetbase API: http://localhost:8000
|
||||
|
||||
### Additional Configurations
|
||||
|
||||
**CORS:** If you’re installing directly on a server you may need to add your IP address or domain to the `api/config/cors.php` file in the `allowed_hosts` array.
|
||||
**CORS:** If you’re installing directly on a server you will need to configure the environment variables to the application container:
|
||||
```
|
||||
CONSOLE_HOST=http://{yourhost}:4200
|
||||
```
|
||||
If you have additional applications or frontends you can use the environment variable `FRONTEND_HOSTS` to add a comma delimited list of additioal frontend hosts.
|
||||
|
||||
**Application Key** If you get an issue about a missing application key just run:
|
||||
```bash
|
||||
docker compose exec application bash -c "php artisan key:generate --show"
|
||||
```
|
||||
Next copy this value to the `APP_KEY` environment variable in the application container and restart.
|
||||
|
||||
**Routing:** Fleetbase ships with a default OSRM server hosted by `[router.project-osrm.org](https://router.project-osrm.org)` but you’re able to use your own or any other OSRM compatible server. You can modify this in the `console/environments` directory by modifying the .env file of the environment you’re deploying and setting the `OSRM_HOST` to the OSRM server for Fleetbase to use.
|
||||
|
||||
@@ -100,6 +105,7 @@ version: “3.8”
|
||||
services:
|
||||
application:
|
||||
environment:
|
||||
CONSOLE_HOST: http://localhost:4200
|
||||
MAIL_MAILER: (ses, smtp, mailgun, postmark, sendgrid)
|
||||
OSRM_HOST: https://router.project-osrm.org
|
||||
IPINFO_API_KEY:
|
||||
@@ -108,11 +114,40 @@ services:
|
||||
TWILIO_SID:
|
||||
TWILIO_TOKEN:
|
||||
TWILIO_FROM:
|
||||
CONSOLE_HOST: http://localhost:4200
|
||||
```
|
||||
|
||||
You can learn more about full installation, and configuration in the [official documentation](https://docs.fleetbase.io/getting-started/install).
|
||||
|
||||
## 🚀 Deploy on AWS in One Click
|
||||
|
||||
Deploy your complete Fleetbase logistics platform on AWS with enterprise-grade security, scalability, and reliability. No DevOps expertise required!
|
||||
|
||||
[](https://console.fleetbase.io/aws-marketplace)
|
||||
|
||||
### ✨ What You Get
|
||||
|
||||
- **Complete AWS Infrastructure**: ECS Fargate, RDS MySQL, ElastiCache Redis, S3, CloudFront, and more
|
||||
- **25-Minute Setup**: From zero to production-ready logistics platform
|
||||
- **Enterprise Security**: VPC isolation, encrypted storage, secrets management
|
||||
- **Auto-Scaling**: Handle traffic spikes with ECS Fargate auto-scaling
|
||||
- **High Availability**: Multi-AZ deployment with 99.9% uptime SLA
|
||||
- **Cost Optimized**: Pay-as-you-use with optimized resource allocation
|
||||
|
||||
### 🏗️ Infrastructure Included
|
||||
|
||||
Your AWS deployment includes a complete, production-ready infrastructure stack:
|
||||
|
||||
- **Compute**: ECS Fargate cluster with auto-scaling services
|
||||
- **Database**: RDS MySQL 8.0 with automated backups and Multi-AZ support
|
||||
- **Cache**: ElastiCache Redis for high-performance caching
|
||||
- **Storage**: S3 object storage with CloudFront CDN for global distribution
|
||||
- **Networking**: VPC with private subnets, NAT gateways, and security groups
|
||||
- **Load Balancing**: Application Load Balancer with SSL certificates
|
||||
- **Monitoring**: CloudWatch logs, container insights, and health monitoring
|
||||
- **Messaging**: SQS message queues for background job processing
|
||||
|
||||
[**🚀 Deploy Now**](https://console.fleetbase.io/aws-marketplace) | [**📖 Learn More**](https://docs.fleetbase.io/category/deploying/aws)
|
||||
|
||||
# 🧩 Extensions
|
||||
|
||||
Extensions are modular components that enhance the functionality of your Fleetbase instance. They allow you to add new features, customize existing behavior, or integrate with external systems.
|
||||
@@ -145,9 +180,8 @@ Fleetbase offers a few open sourced apps which are built on Fleetbase which can
|
||||
## 🛣️ Roadmap
|
||||
1. **Inventory and Warehouse Management** ~ Pallet will be Fleetbase’s first official extension for WMS & Inventory.
|
||||
2. **Accounting and Invoicing** ~ Ledger will be Fleetbase’s first official extension accounting and invoicing.
|
||||
3. **Binary Builds** ~ Run Fleetbase from a single binary.
|
||||
4. **Fleetbase for Desktop** ~ Desktop builds for OSX and Windows.
|
||||
5. **Custom Maps and Routing Engines** ~ Feature to enable easy integrations with custom maps and routing engines like Google Maps or Mapbox etc…
|
||||
3. **Fleetbase for Desktop** ~ Desktop builds for OSX and Windows.
|
||||
4. **Custom Maps and Routing Engines** ~ Feature to enable easy integrations with custom maps and routing engines like Google Maps or Mapbox etc…
|
||||
|
||||
## 🪲 Bugs and 💡 Feature Requests
|
||||
|
||||
@@ -183,3 +217,4 @@ Get updates on Fleetbase's development and chat with the project maintainers and
|
||||
# License & Copyright
|
||||
|
||||
Fleetbase is made available under the terms of the <a href="https://www.gnu.org/licenses/agpl-3.0.html" target="_blank">GNU Affero General Public License 3.0 (AGPL 3.0)</a>. For other licenses <a href="mailto:hello@fleetbase.io" target="_blank">contact us</a>.
|
||||
|
||||
|
||||
18
RELEASE.md
18
RELEASE.md
@@ -1,12 +1,16 @@
|
||||
# 🚀 Fleetbase v0.7.3 — 2025-05-24
|
||||
# 🚀 Fleetbase v0.7.9 — 2025-08-13
|
||||
|
||||
> “Hotfix: route optimization without driver, fleetbase seeder command”
|
||||
> “Template variable resolver + patch vehicle update on order via API”
|
||||
|
||||
---
|
||||
|
||||
## 🐛 Fixes
|
||||
- Improved the Fleetbase seeder command
|
||||
- Patched route optimization to work without driver as starting position
|
||||
## ✨ Highlights
|
||||
- Patched vehicle assignment update on orders via API
|
||||
- Added ability to use variables in order config activity objects for the `status` and `details` properties
|
||||
- Tigher data retention time by maintenance scripts
|
||||
|
||||
### Variable Usage
|
||||
Now in your activity status and details fields you can do things like "Driver completed {waypoint.type}" or "{capitalize waypoint.type} has been completed". These use of variables will then be resolved, say "waypoint.type" = "pickup", then in the inserted activity status those examples would resolve to "Driver completed pickup", and "Pickup has been completed".
|
||||
|
||||
---
|
||||
|
||||
@@ -21,11 +25,11 @@
|
||||
git pull origin main --no-rebase
|
||||
|
||||
# Update docker
|
||||
docker compose pull
|
||||
docker compose down && docker compose up -d
|
||||
|
||||
# Run deploy script
|
||||
docker exec -ti fleetbase-application-1 bash
|
||||
sh deploy.sh
|
||||
docker compose exec application bash -c "./deploy.sh"
|
||||
```
|
||||
|
||||
## Need help?
|
||||
|
||||
@@ -40,7 +40,6 @@ class Kernel extends HttpKernel
|
||||
],
|
||||
|
||||
'api' => [
|
||||
// \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
|
||||
'throttle:api',
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
],
|
||||
|
||||
@@ -2,10 +2,8 @@
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Cache\RateLimiting\Limit;
|
||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\RateLimiter;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
class RouteServiceProvider extends ServiceProvider
|
||||
@@ -17,17 +15,15 @@ class RouteServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
$this->configureRateLimiting();
|
||||
|
||||
$this->routes(
|
||||
function () {
|
||||
Route::get(
|
||||
'/status',
|
||||
function () {
|
||||
'/health',
|
||||
function (Request $request) {
|
||||
return response()->json(
|
||||
[
|
||||
'status' => 'ok',
|
||||
'time' => microtime(true) - LARAVEL_START
|
||||
'time' => microtime(true) - $request->attributes->get('request_start_time')
|
||||
]
|
||||
);
|
||||
}
|
||||
@@ -35,19 +31,4 @@ class RouteServiceProvider extends ServiceProvider
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the rate limiters for the application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function configureRateLimiting()
|
||||
{
|
||||
RateLimiter::for(
|
||||
'api',
|
||||
function (Request $request) {
|
||||
return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
"require": {
|
||||
"php": "^8.0",
|
||||
"appstract/laravel-opcache": "^4.0",
|
||||
"fleetbase/core-api": "^1.6.9",
|
||||
"fleetbase/fleetops-api": "^0.6.11",
|
||||
"fleetbase/core-api": "^1.6.15",
|
||||
"fleetbase/fleetops-api": "^0.6.17",
|
||||
"fleetbase/registry-bridge": "^0.0.19",
|
||||
"fleetbase/storefront-api": "^0.4.0",
|
||||
"guzzlehttp/guzzle": "^7.0.1",
|
||||
@@ -21,6 +21,7 @@
|
||||
"league/flysystem-aws-s3-v3": "^3.0",
|
||||
"maatwebsite/excel": "^3.1",
|
||||
"phpoffice/phpspreadsheet": "^1.28",
|
||||
"maennchen/zipstream-php": "3.1.2",
|
||||
"predis/predis": "^2.1",
|
||||
"psr/http-factory-implementation": "*",
|
||||
"resend/resend-php": "^0.14.0",
|
||||
|
||||
1810
api/composer.lock
generated
1810
api/composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Fleetbase\Support\Utils;
|
||||
use Laravel\Octane\Contracts\OperationTerminated;
|
||||
use Laravel\Octane\Events\RequestHandled;
|
||||
use Laravel\Octane\Events\RequestReceived;
|
||||
@@ -192,6 +193,7 @@ return [
|
||||
'routes',
|
||||
'composer.lock',
|
||||
'.env',
|
||||
...Utils::arrayFrom(env('OCTANE_WATCH_DIRS'))
|
||||
],
|
||||
|
||||
/*
|
||||
|
||||
@@ -122,7 +122,7 @@ export CMAKE_OSX_ARCHITECTURES=arm64
|
||||
STATIC_PHP_CLI_DIR="$OSX_DIR/frankenphp/dist/static-php-cli"
|
||||
if [ ! -d "$STATIC_PHP_CLI_DIR" ]; then
|
||||
log "Cloning static-php-cli into dist/..."
|
||||
git clone https://github.com/crazywhalecc/static-php-cli.git "$STATIC_PHP_CLI_DIR"
|
||||
git clone --depth 1 --branch 2.5.2 https://github.com/crazywhalecc/static-php-cli.git "$STATIC_PHP_CLI_DIR"
|
||||
else
|
||||
log_warn "static-php-cli already exists in dist/. Skipping clone."
|
||||
fi
|
||||
|
||||
@@ -14,5 +14,6 @@ export function initialize(application) {
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'load-leaflet',
|
||||
initialize,
|
||||
};
|
||||
|
||||
@@ -23,6 +23,7 @@ export default class UserModel extends Model {
|
||||
@attr('string') timezone;
|
||||
@attr('string') country;
|
||||
@attr('string') ip_address;
|
||||
@attr('string') aws_customer_id;
|
||||
@attr('string') slug;
|
||||
@attr('string') role_name;
|
||||
@attr('string') type;
|
||||
|
||||
@@ -35,4 +35,8 @@
|
||||
<Button @icon="check" @iconPrefix="fas" @type="primary" @size="lg" @text={{t "onboard.index.continue-button-text"}} @isLoading={{this.isLoading}} @disabled={{this.readyToSubmit}} @onClick={{this.startOnboard}} />
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<RegistryYield @registry="onboard" as |YieldedComponent ctx|>
|
||||
<YieldedComponent @context={{ctx}} />
|
||||
</RegistryYield>
|
||||
</div>
|
||||
@@ -53,7 +53,7 @@ module.exports = function (defaults) {
|
||||
},
|
||||
filter: {
|
||||
enabled: true,
|
||||
plugins: [postcssAtRulesVariables, postcssMixins, postcssEach, postcssConditionals, tailwind('./tailwind.js')],
|
||||
plugins: [postcssAtRulesVariables, postcssMixins, postcssEach, postcssConditionals, tailwind('./tailwind.config.js')],
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@fleetbase/console",
|
||||
"version": "0.7.3",
|
||||
"version": "0.7.9",
|
||||
"private": true,
|
||||
"description": "Modular logistics and supply chain operating system (LSOS)",
|
||||
"repository": "https://github.com/fleetbase/fleetbase",
|
||||
@@ -33,9 +33,9 @@
|
||||
"@fleetbase/ember-core": "latest",
|
||||
"@fleetbase/ember-ui": "latest",
|
||||
"@fleetbase/fleetops-data": "latest",
|
||||
"@fleetbase/fleetops-engine": "^0.6.11",
|
||||
"@fleetbase/fleetops-engine": "^0.6.17",
|
||||
"@fleetbase/iam-engine": "^0.1.3",
|
||||
"@fleetbase/leaflet-routing-machine": "^3.2.16",
|
||||
"@fleetbase/leaflet-routing-machine": "^3.2.17",
|
||||
"@fleetbase/registry-bridge-engine": "^0.0.19",
|
||||
"@fleetbase/storefront-engine": "^0.4.0",
|
||||
"@fortawesome/ember-fontawesome": "^2.0.0",
|
||||
|
||||
3754
console/pnpm-lock.yaml
generated
3754
console/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,19 +1,21 @@
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
darkMode: ['class', '[data-theme="dark"]'],
|
||||
content: [
|
||||
'./app/**/*.{hbs,js}',
|
||||
'./node_modules/@fleetbase/ember-ui/addon/**/*.{hbs,js}',
|
||||
'./node_modules/@fleetbase/ember-ui/addon/templates/*.{hbs,js}',
|
||||
'./node_modules/@fleetbase/ember-ui/addon/templates/**/*.{hbs,js}',
|
||||
'./node_modules/@fleetbase/ember-ui/addon/components/*.{hbs,js}',
|
||||
'./node_modules/@fleetbase/ember-ui/addon/components/**/*.{hbs,js}',
|
||||
'./node_modules/@fleetbase/ember-core/addon/**/*.{hbs,js}',
|
||||
'./node_modules/@fleetbase/fleetops-engine/addon/**/*.{hbs,js}',
|
||||
'./node_modules/@fleetbase/storefront-engine/addon/**/*.{hbs,js}',
|
||||
'./node_modules/@fleetbase/*-engine/addon/**/*.{hbs,js}',
|
||||
'./node_modules/**/*-engine/addon/**/*.{hbs,js}',
|
||||
'../packages/*-engine/addon/**/*.{hbs,js}',
|
||||
content: {
|
||||
relative: true,
|
||||
files: [
|
||||
'./app/**/*.{hbs,js}',
|
||||
'./node_modules/.pnpm/@fleetbase+*/**/addon/**/*.{hbs,js}',
|
||||
'./node_modules/@fleetbase+*/addon/**/*.{hbs,js}',
|
||||
'./node_modules/@fleetbase/ember-ui/addon/templates/**/*.{hbs,js}',
|
||||
'./node_modules/@fleetbase/ember-ui/addon/components/**/*.{hbs,js}',
|
||||
'./node_modules/**/*-engine/addon/**/*.{hbs,js}'
|
||||
],
|
||||
},
|
||||
safelist: [
|
||||
{
|
||||
pattern: /(py|px|mx|my|gap)-[1-9][0-9]?/,
|
||||
},
|
||||
],
|
||||
theme: {
|
||||
extend: {
|
||||
@@ -94,7 +96,22 @@ module.exports = {
|
||||
86: '30rem',
|
||||
},
|
||||
spacing: {
|
||||
70: '18rem',
|
||||
6: '1.5rem',
|
||||
8: '2rem',
|
||||
10: '2.5rem',
|
||||
12: '3rem',
|
||||
16: '4rem',
|
||||
20: '5rem',
|
||||
24: '6rem',
|
||||
32: '8rem',
|
||||
40: '10rem',
|
||||
44: '11rem',
|
||||
48: '12rem',
|
||||
52: '13rem',
|
||||
56: '14rem',
|
||||
60: '15rem',
|
||||
64: '16rem',
|
||||
72: '18rem',
|
||||
74: '22rem',
|
||||
78: '26rem',
|
||||
82: '28rem',
|
||||
|
||||
@@ -57,7 +57,7 @@ target "app-httpd" {
|
||||
target "fleetbase-console" {
|
||||
context = "./console"
|
||||
dockerfile = "Dockerfile"
|
||||
platforms = ["linux/amd64"]
|
||||
platforms = ["linux/amd64", "linux/arm64"]
|
||||
|
||||
tags = notequal("", REGISTRY) ? formatlist(
|
||||
"${REGISTRY}/fleetbase-console:%s",
|
||||
@@ -69,7 +69,7 @@ target "fleetbase-api" {
|
||||
context = "./"
|
||||
dockerfile = "docker/Dockerfile"
|
||||
target = "app-release"
|
||||
platforms = ["linux/amd64"]
|
||||
platforms = ["linux/amd64", "linux/arm64"]
|
||||
|
||||
tags = notequal("", REGISTRY) ? formatlist(
|
||||
"${REGISTRY}/fleetbase-api:%s",
|
||||
|
||||
@@ -41,6 +41,9 @@ services:
|
||||
CACHE_PATH: /fleetbase/api/storage/framework/cache
|
||||
CACHE_URL: tcp://cache
|
||||
REDIS_URL: tcp://cache
|
||||
depends_on:
|
||||
- database
|
||||
- cache
|
||||
|
||||
queue:
|
||||
image: fleetbase/fleetbase-api:latest
|
||||
@@ -57,6 +60,9 @@ services:
|
||||
CACHE_PATH: /fleetbase/api/storage/framework/cache
|
||||
CACHE_URL: tcp://cache
|
||||
REDIS_URL: tcp://cache
|
||||
depends_on:
|
||||
- database
|
||||
- cache
|
||||
|
||||
console:
|
||||
image: fleetbase/fleetbase-console:latest
|
||||
@@ -67,6 +73,8 @@ services:
|
||||
|
||||
application:
|
||||
image: fleetbase/fleetbase-api:latest
|
||||
volumes:
|
||||
- ./api/.env:/fleetbase/api/.env
|
||||
environment:
|
||||
ENVIRONMENT: development
|
||||
DATABASE_URL: "mysql://root@database/fleetbase"
|
||||
|
||||
@@ -75,7 +75,7 @@ ENV QUEUE_CONNECTION=redis
|
||||
ENV CADDYFILE_PATH=/fleetbase/Caddyfile
|
||||
ENV CONSOLE_PATH=/fleetbase/console
|
||||
ENV OCTANE_SERVER=frankenphp
|
||||
ENV FLEETBASE_VERSION=0.7.3
|
||||
ENV FLEETBASE_VERSION=0.7.9
|
||||
|
||||
# Set environment
|
||||
ARG ENVIRONMENT=production
|
||||
|
||||
2
docs
2
docs
Submodule docs updated: 61704f4855...5fffa79744
Submodule packages/core-api updated: 63f68ae083...f43861411d
Submodule packages/ember-core updated: 7dd79663d3...e2206260e4
Submodule packages/ember-ui updated: af6ff8e1eb...c7c9cd5300
Submodule packages/fleetops updated: 7c8e38204d...9a59f18780
170
scripts/docker-install.sh
Executable file
170
scripts/docker-install.sh
Executable file
@@ -0,0 +1,170 @@
|
||||
#!/usr/bin/env bash
|
||||
# scripts/docker-install.sh
|
||||
# Fleetbase Docker installer (dev / prod aware)
|
||||
# --------------------------------------------
|
||||
set -euo pipefail
|
||||
|
||||
###############################################################################
|
||||
# 1. Ask for host (default: localhost)
|
||||
###############################################################################
|
||||
read -rp "Enter host or IP address to bind to [localhost]: " HOST_INPUT
|
||||
HOST=${HOST_INPUT:-localhost}
|
||||
echo "➜ Using host: $HOST"
|
||||
|
||||
###############################################################################
|
||||
# 2. Ask for environment (development | production)
|
||||
###############################################################################
|
||||
while true; do
|
||||
read -rp "Choose environment (development / production) [development]: " ENV_INPUT
|
||||
ENV_INPUT=$(echo "$ENV_INPUT" | tr '[:upper:]' '[:lower:]')
|
||||
case "$ENV_INPUT" in
|
||||
""|d|dev|development) ENVIRONMENT=development; break ;;
|
||||
p|prod|production) ENVIRONMENT=production; break ;;
|
||||
*) echo "Please type either 'development' or 'production'." ;;
|
||||
esac
|
||||
done
|
||||
echo "➜ Environment: $ENVIRONMENT"
|
||||
|
||||
USE_HTTPS=false
|
||||
APP_DEBUG=true
|
||||
SC_SECURE=false
|
||||
if [[ "$ENVIRONMENT" == "production" ]]; then
|
||||
USE_HTTPS=true
|
||||
APP_DEBUG=false
|
||||
SC_SECURE=true
|
||||
fi
|
||||
|
||||
###############################################################################
|
||||
# 3. Determine project root no matter where script is called from
|
||||
###############################################################################
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
PROJECT_ROOT="$( cd "$SCRIPT_DIR/.." && pwd )"
|
||||
cd "$PROJECT_ROOT"
|
||||
|
||||
###############################################################################
|
||||
# 4. Generate a fresh Laravel APP_KEY
|
||||
###############################################################################
|
||||
if ! command -v openssl >/dev/null 2>&1; then
|
||||
echo "✖ openssl is required but not found. Install it and retry." >&2
|
||||
exit 1
|
||||
fi
|
||||
APP_KEY="base64:$(openssl rand -base64 32 | tr -d '\n')"
|
||||
echo "✔ Generated APP_KEY"
|
||||
|
||||
###############################################################################
|
||||
# 5. Ensure docker‑compose.override.yml is present & updated
|
||||
###############################################################################
|
||||
OVERRIDE_FILE="docker-compose.override.yml"
|
||||
|
||||
# url helpers
|
||||
SCHEME_API=$([[ "$USE_HTTPS" == true ]] && echo "https" || echo "http")
|
||||
SCHEME_CONSOLE=$([[ "$USE_HTTPS" == true ]] && echo "https" || echo "http")
|
||||
|
||||
update_override_with_yq() {
|
||||
yq -i "
|
||||
.services.application.environment.APP_KEY = \"$APP_KEY\" |
|
||||
.services.application.environment.CONSOLE_HOST = \"$SCHEME_CONSOLE://$HOST:4200\" |
|
||||
.services.application.environment.ENVIRONMENT = \"$ENVIRONMENT\" |
|
||||
.services.application.environment.APP_DEBUG = \"$APP_DEBUG\"
|
||||
" "$OVERRIDE_FILE"
|
||||
echo "✔ $OVERRIDE_FILE updated (yq)"
|
||||
}
|
||||
|
||||
create_override() {
|
||||
cat > "$OVERRIDE_FILE" <<YML
|
||||
services:
|
||||
application:
|
||||
environment:
|
||||
APP_KEY: "$APP_KEY"
|
||||
CONSOLE_HOST: "$SCHEME_CONSOLE://$HOST:4200"
|
||||
ENVIRONMENT: "$ENVIRONMENT"
|
||||
APP_DEBUG: "$APP_DEBUG"
|
||||
YML
|
||||
echo "✔ $OVERRIDE_FILE written"
|
||||
}
|
||||
|
||||
if [[ -f "$OVERRIDE_FILE" ]]; then
|
||||
if command -v yq >/dev/null 2>&1; then
|
||||
update_override_with_yq
|
||||
else
|
||||
cp "$OVERRIDE_FILE" "${OVERRIDE_FILE}.bak.$(date +%Y%m%d%H%M%S)"
|
||||
echo "ℹ︎ Existing $OVERRIDE_FILE backed up (no yq found — recreating)"
|
||||
create_override
|
||||
fi
|
||||
else
|
||||
create_override
|
||||
fi
|
||||
|
||||
###############################################################################
|
||||
# 6. Write console/fleetbase.config.json atomically
|
||||
###############################################################################
|
||||
CONFIG_DIR="console"
|
||||
CONFIG_PATH="$CONFIG_DIR/fleetbase.config.json"
|
||||
mkdir -p "$CONFIG_DIR"
|
||||
|
||||
cat > "${CONFIG_PATH}.tmp" <<JSON
|
||||
{
|
||||
"API_HOST": "$SCHEME_API://$HOST:8000",
|
||||
"SOCKETCLUSTER_HOST": "$HOST",
|
||||
"SOCKETCLUSTER_PORT": "38000",
|
||||
"SOCKETCLUSTER_SECURE": "$SC_SECURE"
|
||||
}
|
||||
JSON
|
||||
mv -f "${CONFIG_PATH}.tmp" "$CONFIG_PATH"
|
||||
echo "✔ $CONFIG_PATH updated"
|
||||
|
||||
###############################################################################
|
||||
# 7. Start stack, wait for DB, then run deploy
|
||||
###############################################################################
|
||||
echo "⏳ Starting Fleetbase containers..."
|
||||
docker compose up -d
|
||||
|
||||
###############################################################################
|
||||
# 7a. Wait for the database container to be ready
|
||||
###############################################################################
|
||||
DB_SERVICE="database" # ← change if your docker‑compose uses a different name
|
||||
DB_WAIT_TIMEOUT=60 # seconds
|
||||
|
||||
echo "⏳ Waiting for “$DB_SERVICE” to become ready (timeout: ${DB_WAIT_TIMEOUT}s)…"
|
||||
DB_CONTAINER=$(docker compose ps -q "$DB_SERVICE")
|
||||
|
||||
if [ -z "$DB_CONTAINER" ]; then
|
||||
echo "✖ Cannot find a running container for service \"$DB_SERVICE\". Check docker‑compose.yml."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# If the service defines a HEALTHCHECK we can rely on it…
|
||||
if docker inspect -f '{{.State.Health.Status}}' "$DB_CONTAINER" &>/dev/null; then
|
||||
SECONDS=0
|
||||
until [ "$(docker inspect -f '{{.State.Health.Status}}' "$DB_CONTAINER")" = "healthy" ]; do
|
||||
if [ "$SECONDS" -ge "$DB_WAIT_TIMEOUT" ]; then
|
||||
echo "✖ Timed out waiting for the database to become healthy."
|
||||
exit 1
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
sleep 12
|
||||
else
|
||||
# Fallback: use mysqladmin ping (works for MySQL / MariaDB)
|
||||
SECONDS=0
|
||||
until docker compose exec "$DB_SERVICE" sh -c "mysqladmin --silent --wait=1 -uroot -h127.0.0.1 ping" &>/dev/null; do
|
||||
if [ "$SECONDS" -ge "$DB_WAIT_TIMEOUT" ]; then
|
||||
echo "✖ Timed out waiting for the database to accept connections."
|
||||
exit 1
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
fi
|
||||
echo "✔ Database is ready."
|
||||
|
||||
###############################################################################
|
||||
# 7b. Run the deploy script inside the application container
|
||||
###############################################################################
|
||||
echo "⏳ Running deploy script inside the application container..."
|
||||
docker compose exec application bash -c "./deploy.sh"
|
||||
docker compose up -d
|
||||
|
||||
echo
|
||||
echo "🏁 Fleetbase is up!"
|
||||
printf " API → %s://%s:8000\n" "$SCHEME_API" "$HOST"
|
||||
printf " Console → %s://%s:4200\n\n" "$SCHEME_CONSOLE" "$HOST"
|
||||
@@ -1,55 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Find the root directory of your repository
|
||||
root_dir=$(git rev-parse --show-toplevel)
|
||||
|
||||
# Check if the packages directory exists
|
||||
packages_dir="$root_dir/packages"
|
||||
if [ ! -d "$packages_dir" ]; then
|
||||
echo "Packages directory not found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Initialize flags
|
||||
remove_lock=false
|
||||
remove_modules=false
|
||||
|
||||
for arg in "$@"
|
||||
do
|
||||
case $arg in
|
||||
--remove-lock)
|
||||
remove_lock=true
|
||||
;;
|
||||
--remove-modules)
|
||||
remove_modules=true
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Navigate to the packages directory
|
||||
cd "$packages_dir"
|
||||
|
||||
# Find all child directories and run pnpm install if package.json exists
|
||||
for dir in */; do
|
||||
if [[ -f "${dir}package.json" ]]; then
|
||||
echo "Running pnpm install in $dir"
|
||||
|
||||
# Remove pnpm-lock.yaml if the option is set
|
||||
if [ "$remove_lock" = true ] && [ -f "${dir}pnpm-lock.yaml" ]; then
|
||||
echo "Removing pnpm-lock.yaml in $dir"
|
||||
rm "${dir}pnpm-lock.yaml"
|
||||
fi
|
||||
|
||||
# Remove ./node_modules if the option is set
|
||||
if [ "$remove_modules" = true ] && [ -d "${dir}node_modules" ]; then
|
||||
echo "Removing /node_modules in $dir"
|
||||
rm -rf "${dir}node_modules"
|
||||
fi
|
||||
|
||||
cd "$dir"
|
||||
pnpm install
|
||||
cd "$packages_dir" # Go back to the packages directory
|
||||
else
|
||||
echo "No package.json found in $dir, skipping..."
|
||||
fi
|
||||
done
|
||||
@@ -1,22 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Exit the script as soon as a command fails
|
||||
set -e
|
||||
|
||||
echo "Switching to the main branch..."
|
||||
# git checkout main
|
||||
|
||||
echo "Updating submodules..."
|
||||
git submodule update --init --recursive
|
||||
|
||||
echo "Updating console..."
|
||||
cd console
|
||||
git checkout main
|
||||
git pull
|
||||
cd ..
|
||||
|
||||
echo "Building Docker images..."
|
||||
docker-compose build console
|
||||
docker-compose build application
|
||||
|
||||
echo "Update completed. Run \`docker-compose up -d\` to launch!"
|
||||
Reference in New Issue
Block a user