mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 14:20:31 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1372a1f0a8 | ||
|
|
571a332658 | ||
|
|
b44c318a5d | ||
|
|
bd9717f4dc | ||
|
|
f48aea8e5a | ||
|
|
0ac3a5dea9 |
@@ -25,6 +25,10 @@
|
|||||||
<img src="https://img.shields.io/twitter/follow/bigcapitalhq?style=social" alt="twitter" />
|
<img src="https://img.shields.io/twitter/follow/bigcapitalhq?style=social" alt="twitter" />
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://app.bigcapital.ly">Bigcapital Cloud</a>
|
||||||
|
</p>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
# What's Bigcapital?
|
# What's Bigcapital?
|
||||||
|
|||||||
@@ -21,16 +21,12 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- server
|
- server
|
||||||
- webapp
|
- webapp
|
||||||
deploy:
|
restart: on-failure
|
||||||
restart_policy:
|
|
||||||
condition: unless-stopped
|
|
||||||
|
|
||||||
webapp:
|
webapp:
|
||||||
container_name: bigcapital-webapp
|
container_name: bigcapital-webapp
|
||||||
image: ghcr.io/bigcapitalhq/webapp:latest
|
image: ghcr.io/bigcapitalhq/webapp:latest
|
||||||
deploy:
|
restart: on-failure
|
||||||
restart_policy:
|
|
||||||
condition: unless-stopped
|
|
||||||
|
|
||||||
server:
|
server:
|
||||||
container_name: bigcapital-server
|
container_name: bigcapital-server
|
||||||
@@ -45,9 +41,7 @@ services:
|
|||||||
- mysql
|
- mysql
|
||||||
- mongo
|
- mongo
|
||||||
- redis
|
- redis
|
||||||
deploy:
|
restart: on-failure
|
||||||
restart_policy:
|
|
||||||
condition: unless-stopped
|
|
||||||
environment:
|
environment:
|
||||||
# Mail
|
# Mail
|
||||||
- MAIL_HOST=${MAIL_HOST}
|
- MAIL_HOST=${MAIL_HOST}
|
||||||
@@ -92,6 +86,12 @@ services:
|
|||||||
- GOTENBERG_URL=${GOTENBERG_URL}
|
- GOTENBERG_URL=${GOTENBERG_URL}
|
||||||
- GOTENBERG_DOCS_URL=${GOTENBERG_DOCS_URL}
|
- GOTENBERG_DOCS_URL=${GOTENBERG_DOCS_URL}
|
||||||
|
|
||||||
|
# Lemon Squeez
|
||||||
|
- LEMONSQUEEZY_API_KEY=${LEMONSQUEEZY_API_KEY}
|
||||||
|
- LEMONSQUEEZY_STORE_ID=${LEMONSQUEEZY_STORE_ID}
|
||||||
|
- LEMONSQUEEZY_WEBHOOK_SECRET=${LEMONSQUEEZY_WEBHOOK_SECRET}
|
||||||
|
- HOSTED_ON_BIGCAPITAL_CLOUD=${HOSTED_ON_BIGCAPITAL_CLOUD}
|
||||||
|
|
||||||
database_migration:
|
database_migration:
|
||||||
container_name: bigcapital-database-migration
|
container_name: bigcapital-database-migration
|
||||||
build:
|
build:
|
||||||
@@ -111,9 +111,7 @@ services:
|
|||||||
|
|
||||||
mysql:
|
mysql:
|
||||||
container_name: bigcapital-mysql
|
container_name: bigcapital-mysql
|
||||||
deploy:
|
restart: on-failure
|
||||||
restart_policy:
|
|
||||||
condition: unless-stopped
|
|
||||||
build:
|
build:
|
||||||
context: ./docker/mariadb
|
context: ./docker/mariadb
|
||||||
environment:
|
environment:
|
||||||
@@ -128,9 +126,7 @@ services:
|
|||||||
|
|
||||||
mongo:
|
mongo:
|
||||||
container_name: bigcapital-mongo
|
container_name: bigcapital-mongo
|
||||||
deploy:
|
restart: on-failure
|
||||||
restart_policy:
|
|
||||||
condition: unless-stopped
|
|
||||||
build: ./docker/mongo
|
build: ./docker/mongo
|
||||||
expose:
|
expose:
|
||||||
- '27017'
|
- '27017'
|
||||||
@@ -139,9 +135,7 @@ services:
|
|||||||
|
|
||||||
redis:
|
redis:
|
||||||
container_name: bigcapital-redis
|
container_name: bigcapital-redis
|
||||||
deploy:
|
restart: on-failure
|
||||||
restart_policy:
|
|
||||||
condition: unless-stopped
|
|
||||||
build:
|
build:
|
||||||
context: ./docker/redis
|
context: ./docker/redis
|
||||||
expose:
|
expose:
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ export class LemonSqueezyWebhooks {
|
|||||||
const variantId = attributes.variant_id as string;
|
const variantId = attributes.variant_id as string;
|
||||||
|
|
||||||
// We assume that the Plan table is up to date.
|
// We assume that the Plan table is up to date.
|
||||||
const plan = await Plan.query().findOne('slug', 'essentials-yearly');
|
const plan = await Plan.query().findOne('slug', 'early-adaptor');
|
||||||
|
|
||||||
if (!plan) {
|
if (!plan) {
|
||||||
throw new Error(`Plan with variantId ${variantId} not found.`);
|
throw new Error(`Plan with variantId ${variantId} not found.`);
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
exports.up = function (knex) {
|
||||||
|
return knex.seed.run({
|
||||||
|
specific: 'seed_tenants_free_subscription.js',
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.down = function (knex) {};
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
exports.seed = (knex) => {
|
||||||
|
// Deletes ALL existing entries
|
||||||
|
return knex('subscription_plan_subscriptions')
|
||||||
|
.then(async () => {
|
||||||
|
const tenants = await knex('tenants');
|
||||||
|
|
||||||
|
for (const tenant of tenants) {
|
||||||
|
const existingSubscription = await knex('subscription_plan_subscriptions')
|
||||||
|
.where('tenantId', tenant.id)
|
||||||
|
.first();
|
||||||
|
|
||||||
|
if (!existingSubscription) {
|
||||||
|
const freePlan = await knex('subscription_plans').where('slug', 'free').first();
|
||||||
|
|
||||||
|
await knex('subscription_plan_subscriptions').insert({
|
||||||
|
tenantId: tenant.id,
|
||||||
|
planId: freePlan.id,
|
||||||
|
slug: 'main',
|
||||||
|
startsAt: knex.fn.now(),
|
||||||
|
endsAt: null,
|
||||||
|
createdAt: knex.fn.now(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
1
packages/server/storage/.gitignore
vendored
1
packages/server/storage/.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
*
|
*
|
||||||
!pdf/
|
!pdf/
|
||||||
|
!imports/
|
||||||
!.gitignore
|
!.gitignore
|
||||||
2
packages/server/storage/imports/.gitignore
vendored
Normal file
2
packages/server/storage/imports/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
*
|
||||||
|
!.gitignore
|
||||||
Reference in New Issue
Block a user