mirror of
https://github.com/fleetbase/fleetbase.git
synced 2026-01-08 15:26:19 +00:00
Compare commits
31 Commits
dev-v0.7.1
...
v0.7.6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8e5b2e1ae3 | ||
|
|
e141d4d3a3 | ||
|
|
ab2e102e28 | ||
|
|
723deff398 | ||
|
|
fd9adc3961 | ||
|
|
4244a04052 | ||
|
|
e3c60a2232 | ||
|
|
1eaeb2c46e | ||
|
|
1d64d18b8b | ||
|
|
1124ecb56c | ||
|
|
672f3d51ca | ||
|
|
cd5af8dfc8 | ||
|
|
1a0073eae0 | ||
|
|
d24b1d6fbe | ||
|
|
ebbc4b2bf8 | ||
|
|
b531c18d65 | ||
|
|
fded8b24df | ||
|
|
98d082c780 | ||
|
|
d905943511 | ||
|
|
5c73b6e76d | ||
|
|
cedf96fc97 | ||
|
|
854fa2e680 | ||
|
|
91b01c8a17 | ||
|
|
a4033db36c | ||
|
|
c54ef7fb30 | ||
|
|
b5ec15f0bb | ||
|
|
1f609dd882 | ||
|
|
01883da5a2 | ||
|
|
d2ab5b8a94 | ||
|
|
dca23f7e3f | ||
|
|
d94dff7fbb |
4
.github/workflows/build-binaries.yml
vendored
4
.github/workflows/build-binaries.yml
vendored
@@ -1,6 +1,7 @@
|
||||
name: Fleetbase Binaries
|
||||
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:
|
||||
|
||||
78
.github/workflows/discord-announcement.yml
vendored
78
.github/workflows/discord-announcement.yml
vendored
@@ -1,39 +1,61 @@
|
||||
name: Discord Announcement
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
workflow_run:
|
||||
workflows: ["Create Release"]
|
||||
types: [completed]
|
||||
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: "Release tag to announce (e.g. v0.7.1)"
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
discord_announcement:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Read release notes
|
||||
id: notes
|
||||
run: |
|
||||
body="$(cat RELEASE.md)"
|
||||
echo "::set-output name=message::$(echo "${body}" | base64 -w0)"
|
||||
- name: Get tag name
|
||||
id: tag
|
||||
run: echo "::set-output name=tag::${GITHUB_REF#refs/tags/}"
|
||||
- name: Decode notes
|
||||
id: decode
|
||||
run: |
|
||||
echo "::set-output name=text::$(echo '${{ steps.notes.outputs.message }}' | base64 --decode)"
|
||||
- name: Send message to Discord
|
||||
uses: tsickert/discord-webhook@v5.3.0
|
||||
with:
|
||||
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
||||
username: Fleetbase
|
||||
content: |
|
||||
@everyone
|
||||
📦 **Fleetbase ${{ steps.tag.outputs.tag }} released!**
|
||||
# 1️⃣ Figure out which tag we’re talking about
|
||||
- id: vars
|
||||
shell: bash
|
||||
run: |
|
||||
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
|
||||
TAG="${{ github.event.inputs.tag }}"
|
||||
else
|
||||
TAG="${{ github.event.workflow_run.head_branch }}"
|
||||
fi
|
||||
echo "TAG=$TAG" >> "$GITHUB_ENV"
|
||||
|
||||
${{ steps.decode.outputs.text }}
|
||||
# 2️⃣ Check out the exact commit for that tag
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ env.TAG }}
|
||||
fetch-depth: 1
|
||||
|
||||
[View full notes on GitHub](https://github.com/fleetbase/fleetbase/releases/tag/${{ steps.tag.outputs.tag }})
|
||||
# 3️⃣ Stash RELEASE.md in an env var (one atomic write → no EOF error)
|
||||
- id: prep-body
|
||||
shell: bash
|
||||
run: |
|
||||
body=$(<RELEASE.md)
|
||||
max=4000
|
||||
[[ ${#body} -gt $max ]] && body="${body:0:$max}…" # add ellipsis if trimmed
|
||||
{
|
||||
echo "body<<EOF"
|
||||
echo "$body"
|
||||
echo "EOF"
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
|
||||
# 4️⃣ Fire the webhook
|
||||
- uses: tsickert/discord-webhook@v5.3.0
|
||||
with:
|
||||
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
||||
username: Fleetbase
|
||||
content: |
|
||||
@everyone
|
||||
📦 **Fleetbase ${{ env.TAG }} released!**
|
||||
<https://github.com/${{ github.repository }}/releases/tag/${{ env.TAG }}>
|
||||
embed-title: "Fleetbase ${{ env.TAG }} — release notes"
|
||||
embed-url: "https://github.com/fleetbase/fleetbase/releases/tag/${{ env.TAG }}"
|
||||
embed-description: ${{ steps.prep-body.outputs.body }}
|
||||
embed-color: 4362730 # 0x4291EA (Fleetbase Blue)
|
||||
29
README.md
29
README.md
@@ -32,10 +32,7 @@ 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
|
||||
@@ -75,10 +72,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 +83,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 +104,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,7 +113,6 @@ 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).
|
||||
@@ -145,9 +149,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
|
||||
|
||||
|
||||
42
RELEASE.md
42
RELEASE.md
@@ -1,21 +1,13 @@
|
||||
# 🚀 Fleetbase v0.7.1 — 2025-05-22
|
||||
# 🚀 Fleetbase v0.7.6 — 2025-06-04
|
||||
|
||||
> “Finally, official docker images and binary builds for the upcoming Omnibus.”
|
||||
> “Minor patches and route optimization overhaul progress”
|
||||
|
||||
---
|
||||
|
||||
## ✨ Highlights
|
||||
- Introduction to Telemetry for improving Fleetbase and setup experiences.
|
||||
- Added runtime config for Fleetbase Console (`./console/fleetbase.config.json`), no more rebuilding the frontend to update config.
|
||||
- Official Fleetbase API and Console docker images published. `docker compose up` now uses the official images for faster setup - no more building.
|
||||
- Performance optimization and improvements to the FleetOps Order API. Faster responses.
|
||||
- Patched waypoint activity flow and proof of delivery QR scanning and photo capture API.
|
||||
- Added ability to view waypoint activity status and labels if no entities attached to order.
|
||||
- Fixed Timezone issues in Navigator app (v2.0.5)
|
||||
- Improved Navigator app performance and UX (v2.0.5) - New "Waypoint Completed" dialog.
|
||||
- Improved socket implementation on FleetOps.
|
||||
- Added two new order activity events for listeners `order.waypoint_activity` and `order.waypoint_completed`
|
||||
- Added Navigator App email verification code fallback if SMS is unable to send (v2.0.5).
|
||||
- Preparing to implement full multi-order/payload route optimization and managed routes.
|
||||
- Patched scheduler to not run in CI environments or without database connection established.
|
||||
- 2 New route optimization extensions published! VROOM & Valhalla
|
||||
|
||||
---
|
||||
|
||||
@@ -24,25 +16,6 @@
|
||||
|
||||
---
|
||||
|
||||
## 🆕 Features
|
||||
- **Navigator App v2.0.5** — Improved Navigator App Performance and UX for better experience.
|
||||
- **Official Docker Images** — Official Docker images on [Docker Hub](https://hub.docker.com/u/fleetbase)
|
||||
- **Binary Builds** — Fleetbase API Binary for both Linux and MacOS - `sh ./fleetbase php-server`
|
||||
- **Telemetry** — opt-in daily ping with anonymized usage stats for system improvements.
|
||||
|
||||
---
|
||||
|
||||
## 🐛 Fixes
|
||||
- Activity flow fixed for waypoints.
|
||||
- Better implementation of socket listeners in console.
|
||||
- Activity events and notifications streamlined.
|
||||
|
||||
## ⚙️ Using the new Console Runtime Config
|
||||
- Open `./console/fleetbase.config.json`
|
||||
- Edit configurable properties in JSON: `API_HOST` - `SOCKETCLUSTER_HOST` - `SOCKETCLUSTER_PORT` - `OSRM_HOST`
|
||||
- Save and reload Fleetbase Console in the browser.
|
||||
- 💥 Boom! Config changes applied at runtime.
|
||||
|
||||
## 🔧 Upgrade Steps
|
||||
```bash
|
||||
# Pull latest version
|
||||
@@ -51,9 +24,8 @@ git pull origin main --no-rebase
|
||||
# Update docker
|
||||
docker compose down && docker compose up -d
|
||||
|
||||
# Run updrade
|
||||
docker exec -ti fleetbase-application-1 bash
|
||||
sh deploy.sh
|
||||
# Run deploy script
|
||||
docker compose exec application bash -c "./deploy.sh"
|
||||
```
|
||||
|
||||
## Need help?
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
"require": {
|
||||
"php": "^8.0",
|
||||
"appstract/laravel-opcache": "^4.0",
|
||||
"fleetbase/core-api": "^1.6.6",
|
||||
"fleetbase/fleetops-api": "^0.6.9",
|
||||
"fleetbase/core-api": "^1.6.12",
|
||||
"fleetbase/fleetops-api": "^0.6.15",
|
||||
"fleetbase/registry-bridge": "^0.0.19",
|
||||
"fleetbase/storefront-api": "^0.3.31",
|
||||
"fleetbase/storefront-api": "^0.4.0",
|
||||
"guzzlehttp/guzzle": "^7.0.1",
|
||||
"laravel/framework": "^10.0",
|
||||
"laravel/octane": "^2.3",
|
||||
|
||||
500
api/composer.lock
generated
500
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'))
|
||||
],
|
||||
|
||||
/*
|
||||
|
||||
@@ -3,7 +3,7 @@ import { tracked } from '@glimmer/tracking';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { action } from '@ember/object';
|
||||
import { isArray } from '@ember/array';
|
||||
import { task } from 'ember-concurrency-decorators';
|
||||
import { task } from 'ember-concurrency';
|
||||
|
||||
export default class MetricComponent extends Component {
|
||||
@service fetch;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Component from '@glimmer/component';
|
||||
import { action } from '@ember/object';
|
||||
import { task } from 'ember-concurrency-decorators';
|
||||
import { task } from 'ember-concurrency';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { tracked } from '@glimmer/tracking';
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import Controller from '@ember/controller';
|
||||
import { tracked } from '@glimmer/tracking';
|
||||
import { action } from '@ember/object';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { task } from 'ember-concurrency-decorators';
|
||||
import { task } from 'ember-concurrency';
|
||||
import getTwoFaMethods from '@fleetbase/console/utils/get-two-fa-methods';
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,7 +2,7 @@ import Controller from '@ember/controller';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { action } from '@ember/object';
|
||||
import { tracked } from '@glimmer/tracking';
|
||||
import { task } from 'ember-concurrency-decorators';
|
||||
import { task } from 'ember-concurrency';
|
||||
import getTwoFaMethods from '@fleetbase/console/utils/get-two-fa-methods';
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,7 +2,7 @@ import Controller from '@ember/controller';
|
||||
import { tracked } from '@glimmer/tracking';
|
||||
import { action } from '@ember/object';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { task } from 'ember-concurrency-decorators';
|
||||
import { task } from 'ember-concurrency';
|
||||
import getTwoFaMethods from '@fleetbase/console/utils/get-two-fa-methods';
|
||||
|
||||
export default class ConsoleSettingsTwoFaController extends Controller {
|
||||
|
||||
@@ -2,7 +2,7 @@ import Controller from '@ember/controller';
|
||||
import { tracked } from '@glimmer/tracking';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { action } from '@ember/object';
|
||||
import { task } from 'ember-concurrency-decorators';
|
||||
import { task } from 'ember-concurrency';
|
||||
|
||||
export default class InstallController extends Controller {
|
||||
@service fetch;
|
||||
|
||||
@@ -14,5 +14,6 @@ export function initialize(application) {
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'load-leaflet',
|
||||
initialize,
|
||||
};
|
||||
|
||||
@@ -67,3 +67,11 @@ body.console-admin-organizations-index-index .next-table-wrapper > table {
|
||||
body[data-theme='dark'] #boot-loader > .loader-container > .loading-message {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/** hotfix: ember-power-select-trigger broken padding after upgrade - @todo move to ember-ui */
|
||||
body.fleetbase-console .ember-power-select-trigger {
|
||||
padding-top: 0.5rem;
|
||||
padding-right: 2.5rem;
|
||||
padding-bottom: 0.5rem;
|
||||
padding-left: 0.75rem;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
{{page-title (t "app.name")}}
|
||||
<ModalsContainer />
|
||||
<NotificationContainer @position="top" @zindex="99999" />
|
||||
<BasicDropdownWormhole />
|
||||
<div id="application-root-wormhole"></div>
|
||||
{{outlet}}
|
||||
@@ -4,6 +4,7 @@
|
||||
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
|
||||
const FleetbaseExtensionsIndexer = require('fleetbase-extensions-indexer');
|
||||
const Funnel = require('broccoli-funnel');
|
||||
const writeFile = require('broccoli-file-creator');
|
||||
const postcssImport = require('postcss-import');
|
||||
const postcssPresetEnv = require('postcss-preset-env');
|
||||
const postcssEach = require('postcss-each');
|
||||
@@ -12,6 +13,7 @@ const postcssConditionals = require('postcss-conditionals-renewed');
|
||||
const postcssAtRulesVariables = require('postcss-at-rules-variables');
|
||||
const autoprefixer = require('autoprefixer');
|
||||
const tailwind = require('tailwindcss');
|
||||
const toBoolean = require('./config/utils/to-boolean');
|
||||
const environment = process.env.EMBER_ENV;
|
||||
|
||||
module.exports = function (defaults) {
|
||||
@@ -61,13 +63,15 @@ module.exports = function (defaults) {
|
||||
});
|
||||
|
||||
let extensions = new FleetbaseExtensionsIndexer();
|
||||
let config;
|
||||
if (environment === 'development') {
|
||||
config = new Funnel('.', {
|
||||
let runtimeConfigTree;
|
||||
if (toBoolean(process.env.DISABLE_RUNTIME_CONFIG)) {
|
||||
runtimeConfigTree = writeFile('fleetbase.config.json', '{}');
|
||||
} else {
|
||||
runtimeConfigTree = new Funnel('.', {
|
||||
files: ['fleetbase.config.json'],
|
||||
destDir: '/',
|
||||
});
|
||||
}
|
||||
|
||||
return app.toTree([extensions, config].filter(Boolean));
|
||||
return app.toTree([extensions, runtimeConfigTree].filter(Boolean));
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@fleetbase/console",
|
||||
"version": "0.7.1",
|
||||
"version": "0.7.6",
|
||||
"private": true,
|
||||
"description": "Modular logistics and supply chain operating system (LSOS)",
|
||||
"repository": "https://github.com/fleetbase/fleetbase",
|
||||
@@ -29,24 +29,23 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@ember/legacy-built-in-components": "^0.4.2",
|
||||
"@fleetbase/dev-engine": "^0.2.9",
|
||||
"@fleetbase/ember-core": "latest",
|
||||
"@fleetbase/ember-ui": "latest",
|
||||
"@fleetbase/fleetops-data": "latest",
|
||||
"@fleetbase/fleetops-engine": "^0.6.9",
|
||||
"@fleetbase/fleetops-engine": "^0.6.15",
|
||||
"@fleetbase/iam-engine": "^0.1.3",
|
||||
"@fleetbase/dev-engine": "^0.2.9",
|
||||
"@fleetbase/leaflet-routing-machine": "^3.2.17",
|
||||
"@fleetbase/registry-bridge-engine": "^0.0.19",
|
||||
"@fleetbase/storefront-engine": "^0.3.31",
|
||||
"@fleetbase/leaflet-routing-machine": "^3.2.16",
|
||||
"@fleetbase/storefront-engine": "^0.4.0",
|
||||
"@fortawesome/ember-fontawesome": "^2.0.0",
|
||||
"ember-changeset": "4.1.2",
|
||||
"ember-changeset-validations": "4.1.2",
|
||||
"ember-composable-helpers": "^5.0.0",
|
||||
"ember-concurrency": "^3.1.1",
|
||||
"ember-concurrency": "^4.0.4",
|
||||
"ember-concurrency-decorators": "^2.0.3",
|
||||
"ember-intl": "6.3.2",
|
||||
"ember-math-helpers": "^2.18.2",
|
||||
"ember-power-select": "^7.2.0",
|
||||
"ember-prism": "^0.13.0",
|
||||
"ember-radio-button": "3.0.0-beta.1",
|
||||
"ember-tag-input": "^3.1.0",
|
||||
@@ -56,13 +55,13 @@
|
||||
"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",
|
||||
"@ember/optional-features": "^2.1.0",
|
||||
"@ember/string": "^3.1.1",
|
||||
"@ember/test-helpers": "^3.3.1",
|
||||
"@embroider/macros": "1.16.12",
|
||||
"@fleetbase/intl-lint": "^0.0.1",
|
||||
"@fortawesome/fontawesome-svg-core": "6.4.0",
|
||||
"@fortawesome/free-brands-svg-icons": "6.4.0",
|
||||
@@ -72,6 +71,7 @@
|
||||
"@tailwindcss/forms": "^0.5.7",
|
||||
"autoprefixer": "^10.4.20",
|
||||
"broccoli-asset-rev": "^3.0.0",
|
||||
"broccoli-file-creator": "^2.1.1",
|
||||
"broccoli-funnel": "^3.0.8",
|
||||
"concurrently": "^8.2.2",
|
||||
"date-fns": "^2.30.0",
|
||||
|
||||
2776
console/pnpm-lock.yaml
generated
2776
console/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -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.1
|
||||
ENV FLEETBASE_VERSION=0.7.6
|
||||
|
||||
# Set environment
|
||||
ARG ENVIRONMENT=production
|
||||
|
||||
Submodule packages/core-api updated: 5e267dc8c7...91d2c56400
Submodule packages/ember-core updated: 996a9358b1...e2206260e4
Submodule packages/ember-ui updated: b5215c9866...db72d9ee29
Submodule packages/fleetops updated: b422dbb309...48e580454d
Submodule packages/storefront updated: 4718080d88...52d37d3e3a
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