Skip to content

Commit

Permalink
Merge commit 'a148cde279a18036c186ee20eec1babefcef5c0e' as 'ee/insiders'
Browse files Browse the repository at this point in the history
  • Loading branch information
danh91 committed Nov 22, 2024
2 parents c7ad72f + a148cde commit fe109f7
Show file tree
Hide file tree
Showing 175 changed files with 13,744 additions and 0 deletions.
43 changes: 43 additions & 0 deletions ee/insiders/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# https://editorconfig.org/

root = true

[*]
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = lf
charset = utf-8

# Docstrings and comments use max_line_length = 79
[*.py]
max_line_length = 119

# Use 2 spaces for the HTML files
[*.html]
indent_size = 2

# The JSON files contain newlines inconsistently
[*.json]
indent_size = 2
insert_final_newline = ignore

# Minified JavaScript files shouldn't be changed
[**.min.js]
indent_style = ignore
insert_final_newline = ignore

# Makefiles always use tabs for indentation
[Makefile]
indent_style = tab

# Batch files use tabs for indentation
[*.bat]
indent_style = tab

[docs/**.txt]
max_line_length = 79

[*.yml]
indent_size = 2
39 changes: 39 additions & 0 deletions ee/insiders/.github/workflows/insiders-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Insider CD

on:
push:
branches: ["main"]

jobs:
server-build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
path: "./karrio-insiders"
- uses: actions/checkout@v4
with:
repository: karrioapi/karrio
path: "./karrio"

- id: get_tag
run: |
cat ./karrio/apps/api/karrio/server/VERSION
echo "tag=$(cat ./karrio/apps/api/karrio/server/VERSION)" >> "$GITHUB_ENV"
- name: Build insider server image
working-directory: ./karrio-insiders
run: |
echo 'Build and push karrio-insiders server:${{ env.tag }}...'
echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u USERNAME --password-stdin
./bin/build-server-image ${{ env.tag }} &&
docker push ghcr.io/karrioapi/server:${{ env.tag }} || exit 1
- name: Build insider dashboard image
working-directory: ./karrio-insiders
run: |
echo 'Build and push karrio-insiders dashboard:${{ env.tag }}...'
echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u USERNAME --password-stdin
./bin/build-dashboard-image ${{ env.tag }} &&
docker push ghcr.io/karrioapi/dashboard:${{ env.tag }} || exit 1
124 changes: 124 additions & 0 deletions ee/insiders/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
/pulumi/bin/
/node_modules/
.DS_Store

.build/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

.idea

.DS_Store

# karrio stuff:
.bash_history
*.DS_Store

.idea/
.karrio/
staticfiles/*

!docker/.env
69 changes: 69 additions & 0 deletions ee/insiders/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Karrio Insiders

The enterprise-ready shipping integration platform built on top of [Karrio](https://github.com/karrioapi/karrio).

## Features

Additional features on top of Karrio:
- Multi-Tenancy and team collaboration
- Advanced shipping addons
- Customizable dashboard
- Billing management
- Premium carrier integrations
- Priority support

## Quick Start

### Prerequisites

- Docker and Docker Compose
- GitHub Personal Access Token with `read:packages` scope
- Valid Karrio Insiders subscription

### Authentication

1. Create a GitHub Personal Access Token (PAT) with `read:packages` scope
2. Login to GitHub Container Registry:
```bash
echo YOUR_PAT | docker login ghcr.io -u YOUR_GITHUB_USERNAME --password-stdin
```

### Basic Docker Setup

1. Clone the repository:
```bash
git clone https://github.com/karrioapi/karrio-insiders
cd karrio-insiders/docker
```

2. Start the stack:
```bash
docker compose up -d
```

Access the services at:
- Dashboard: http://localhost:3000
- API: http://localhost:5002

Default login: `admin@example.com` | `demo`

### Docker Deployment

For production deployment, use our insiders deployment script:

```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/karrioapi/karrio-insiders/HEAD/bin/deploy-insiders)"
```

This will:
- Set up SSL certificates
- Configure proper domain routing
- Set up a production-ready PostgreSQL database
- Configure Redis for caching
- Set up proper Docker networking

## Support

For support, please contact:
- Email: support@karrio.io
- Discord: [Karrio Discord Server](https://discord.gg/gS88uE7sEx)
8 changes: 8 additions & 0 deletions ee/insiders/bin/build-dashboard-image
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

echo '> Building karrio dashboard image...'
docker build -t ghcr.io/karrioapi/dashboard:$1 \
--no-cache \
--build-arg VERSION=$1 \
-f ../karrio/docker/dashboard/Dockerfile \
../karrio "${@:2}"
7 changes: 7 additions & 0 deletions ee/insiders/bin/build-nginx-image
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

echo '> Building custom nginx image...'
docker build -f "docker/nginx/Dockerfile" \
-t ghcr.io/karrioapi/nginx:$1 \
--no-cache \
./docker/nginx "${@:2}"
17 changes: 17 additions & 0 deletions ee/insiders/bin/build-server-image
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

rm -rf .build
mkdir .build

cp -r ../karrio/apps/api .build/api
cp -r ../karrio/modules .build/modules
cp -r ./modules/* .build/modules
cp -r ./requirements.txt .build/requirements.txt

echo '> Building karrio insiders image...'
docker build -t ghcr.io/karrioapi/server:$1 \
--no-cache \
-f "docker/insiders/Dockerfile" \
. "${@:2}"

rm -rf .build
6 changes: 6 additions & 0 deletions ee/insiders/bin/deploy-all
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

echo $CR_PAT | docker login ghcr.io -u USERNAME --password-stdin

./bin/build-server-image $1 &&
docker push ghcr.io/karrioapi/server:$1 || exit 1
Loading

0 comments on commit fe109f7

Please sign in to comment.