Skip to content

Modular logistics and supply chain operating system (LSOS)

preparing arch change for extensions implementation

Ronald A. Richardson579a3698882b
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index ee1c22d1..a15bc819 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -13,15 +13,15 @@ We use github to host code, to track issues and feature requests, as well as acc
## We Use [Github Flow](https://guides.github.com/introduction/flow/index.html), So All Code Changes Happen Through Pull Requests
Pull requests are the best way to propose changes to the codebase (we use [Github Flow](https://guides.github.com/introduction/flow/index.html)). We actively welcome your pull requests:
-1. Fork the repo and create your branch from `master`.
+1. Fork the repo and create your branch from `main`.
2. If you've added code that should be tested, add tests.
3. If you've changed APIs, update the documentation.
4. Ensure the test suite passes.
5. Make sure your code lints.
6. Issue that pull request!
-## Any contributions you make will be under the MIT Software License
-In short, when you submit code changes, your submissions are understood to be under the same [MIT License](http://choosealicense.com/licenses/mit/) that covers the project. Feel free to contact the maintainers if that's a concern.
+## Any contributions you make will be under the AGPL v3 Software License
+In short, when you submit code changes, your submissions are understood to be under the same [AGPL v3](https://choosealicense.com/licenses/agpl-3.0/) that covers the project. Feel free to contact the maintainers if that's a concern.
## Report bugs using Github's [issues](https://github.com/fleetbase/fleetbase/issues)
We use GitHub issues to track public bugs. Report a bug by [opening a new issue](https://github.com/fleetbase/fleetbase/issues), it's that easy!
@@ -41,7 +41,7 @@ We use GitHub issues to track public bugs. Report a bug by [opening a new issue]
People *love* thorough bug reports. I'm not even kidding.
## License
-By contributing, you agree that your contributions will be licensed under its MIT License.
+By contributing, you agree that your contributions will be licensed under its AGPL v3 Software License.
## References
This document was adapted from the open-source contribution guidelines for [Facebook's Draft](https://github.com/facebook/draft-js/blob/a9316a723f9e918afde44dea68b5f9f39b7d9b00/CONTRIBUTING.md)
diff --git a/Caddyfile b/Caddyfile
index 1ef2c950..52926937 100644
--- a/Caddyfile
+++ b/Caddyfile
@@ -10,3 +10,10 @@ http://:8000 {
resolve_root_symlink
}
}
+
+http://:4201 {
+ root * /fleetbase/console/dist
+ try_files {path} /
+ encode zstd gzip
+ file_server
+}
diff --git a/console/app/instance-initializers/load-extensions.js b/console/app/instance-initializers/load-extensions.js
index 087b778b..f179654b 100644
--- a/console/app/instance-initializers/load-extensions.js
+++ b/console/app/instance-initializers/load-extensions.js
@@ -1,17 +1,8 @@
-import loadExtensions from '@fleetbase/ember-core/utils/load-extensions';
-
-export function initialize(owner) {
+export function initialize (owner) {
const universe = owner.lookup('service:universe');
-
- loadExtensions().then((extensions) => {
- extensions.forEach((extension) => {
- universe.loadEngine(extension.name).then((engineInstance) => {
- if (engineInstance.base && engineInstance.base.setupExtension) {
- engineInstance.base.setupExtension(owner, engineInstance, universe);
- }
- });
- });
- });
+ if (universe) {
+ universe.bootEngines(owner);
+ }
}
export default {
diff --git a/console/config/environment.js b/console/config/environment.js
index 90dd273d..8c0ccf61 100644
--- a/console/config/environment.js
+++ b/console/config/environment.js
@@ -40,6 +40,10 @@ module.exports = function (environment) {
port: getenv('SOCKETCLUSTER_PORT', 38000),
},
+ stripe: {
+ publishableKey: getenv('STRIPE_KEY')
+ },
+
defaultValues: {
categoryImage: getenv('DEFAULT_CATEGORY_IMAGE', 'https://flb-assets.s3.ap-southeast-1.amazonaws.com/images/fallback-placeholder-1.png'),
placeholderImage: getenv('DEFAULT_PLACEHOLDER_IMAGE', 'https://flb-assets.s3.ap-southeast-1.amazonaws.com/images/fallback-placeholder-2.png'),
diff --git a/docker-compose.yml b/docker-compose.yml
index 5eb1ce3f..85404d3a 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -38,18 +38,9 @@ services:
CACHE_URL: tcp://cache
REDIS_URL: tcp://cache
- console:
- ports:
- - "4200:4200"
- volumes:
- - ./console:/app/console
- build:
- context: .
- dockerfile: console/Dockerfile
- args:
- ENVIRONMENT: development
-
application:
+ ports:
+ - "4201:4201"
build:
context: .
dockerfile: docker/Dockerfile
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 4dd127c6..4da1b914 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -3,7 +3,7 @@
FROM dunglas/frankenphp:1.1.0-php8.2-bookworm as base
# Install packages
-RUN apt-get update && apt-get install -y git bind9-utils mycli nodejs npm \
+RUN apt-get update && apt-get install -y git bind9-utils mycli nodejs npm nano \
&& mkdir -p /root/.ssh \
&& ssh-keyscan github.com >> /root/.ssh/known_hosts
@@ -31,17 +31,25 @@ RUN sed -e 's/^expose_php.*/expose_php = Off/' "$PHP_INI_DIR/php.ini-production"
-e 's/^memory_limit.*/memory_limit = 600M/' "$PHP_INI_DIR/php.ini"
# Install global node modules
-RUN npm install -g chokidar
+RUN npm install -g chokidar ember-cli pnpm
# 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
# Set environment
@@ -57,17 +65,46 @@ COPY --chown=www-data:www-data ./Caddyfile $CADDYFILE_PATH
# Create /fleetbase directory and set correct permissions
RUN mkdir -p /fleetbase/api && chown -R www-data:www-data /fleetbase
+## -- Start Console Setup --
+
+# Set working directory
+WORKDIR /fleetbase/console
+
+# TEMPORARILY ADD REGISTRY BRIDGE AND CORE API
+COPY ./packages/registry-bridge /fleetbase/packages/registry-bridge
+COPY ./packages/core-api /fleetbase/packages/core-api
+
+# Copy pnpm-lock.yaml (or package.json) into the directory /app in the container
+COPY ./console/package.json ./console/pnpm-lock.yaml /fleetbase/console/
+
+# Copy over .npmrc if applicable
+COPY ./console/.npmr[c] /fleetbase/console/
+
+# Install app dependencies
+# RUN pnpm install
+
+# Copy the console directory contents into the container at /app
+COPY ./console /fleetbase/console/
+
+# Build the application
+# RUN pnpm build --environment $ENVIRONMENT
+
+## -- End Console Setup --
+
# Set working directory
WORKDIR /fleetbase/api
# If GITHUB_AUTH_KEY is provided, create auth.json with it
RUN if [ -n "$GITHUB_AUTH_KEY" ]; then echo "{\"github-oauth\": {\"github.com\": \"$GITHUB_AUTH_KEY\"}}" > auth.json; fi
+# 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"
+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
diff --git a/packages/core-api b/packages/core-api
index 4567b4a1..fb2e615b 160000
--- a/packages/core-api
+++ b/packages/core-api
@@ -1 +1 @@
-Subproject commit 4567b4a1933a8c496cfafb06558a3d85b53664a5
+Subproject commit fb2e615b50b9ef8f712835107850fd3c7081d976
diff --git a/packages/ember-core b/packages/ember-core
index 82d2e579..db536b41 160000
--- a/packages/ember-core
+++ b/packages/ember-core
@@ -1 +1 @@
-Subproject commit 82d2e57938a76ea51c7cec1cef07357f24c1a919
+Subproject commit db536b414c6d39a2975e3db671014a519ce1eafd