mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-09 23:48:36 +01:00
adjust args
This commit is contained in:
@@ -47,4 +47,5 @@ LICENSE
|
||||
readme.md
|
||||
SECURITY.md
|
||||
steps
|
||||
docker-compose.yml
|
||||
docker-compose.yml
|
||||
docker-compose.admin.yml
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,4 +1,5 @@
|
||||
steps
|
||||
PROCESS_EVENT
|
||||
docker
|
||||
dev
|
||||
dev
|
||||
docker-compose.admin.yml
|
||||
@@ -17,6 +17,9 @@ COPY --link dashboard/ ./
|
||||
|
||||
COPY --link shared/ /home/shared
|
||||
|
||||
ARG GOOGLE_AUTH_CLIENT_ID
|
||||
ENV GOOGLE_AUTH_CLIENT_ID=$GOOGLE_AUTH_CLIENT_ID
|
||||
|
||||
RUN npm run build
|
||||
RUN npm prune
|
||||
|
||||
|
||||
@@ -22,28 +22,56 @@ export default defineEventHandler(async event => {
|
||||
const existingUserProjects = await ProjectModel.countDocuments({ owner: userData.id });
|
||||
if (existingUserProjects >= maxProjects) return setResponseStatus(event, 400, 'Already have max number of projects');
|
||||
|
||||
const customer = await StripeService.createCustomer(userData.user.email);
|
||||
if (!customer) return setResponseStatus(event, 400, 'Error creating customer');
|
||||
if (StripeService.isDisabled()) {
|
||||
|
||||
const subscription = await StripeService.createFreeSubscription(customer.id);
|
||||
if (!subscription) return setResponseStatus(event, 400, 'Error creating subscription');
|
||||
const project = await ProjectModel.create({
|
||||
owner: userData.id,
|
||||
name: newProjectName,
|
||||
premium: false,
|
||||
premium_type: 0,
|
||||
customer_id: 'DISABLED_MODE',
|
||||
subscription_id: "DISABLED_MODE",
|
||||
premium_expire_at: new Date(3000, 1, 1)
|
||||
});
|
||||
|
||||
const project = await ProjectModel.create({
|
||||
owner: userData.id,
|
||||
name: newProjectName,
|
||||
premium: false,
|
||||
premium_type: 0,
|
||||
customer_id: customer.id,
|
||||
subscription_id: subscription.id,
|
||||
premium_expire_at: subscription.current_period_end * 1000
|
||||
});
|
||||
|
||||
await ProjectCountModel.create({
|
||||
project_id: project._id,
|
||||
events: 0,
|
||||
visits: 0
|
||||
});
|
||||
await ProjectCountModel.create({
|
||||
project_id: project._id,
|
||||
events: 0,
|
||||
visits: 0
|
||||
});
|
||||
|
||||
return project.toJSON() as TProject;
|
||||
|
||||
} else {
|
||||
|
||||
const customer = await StripeService.createCustomer(userData.user.email);
|
||||
if (!customer) return setResponseStatus(event, 400, 'Error creating customer');
|
||||
|
||||
const subscription = await StripeService.createFreeSubscription(customer.id);
|
||||
if (!subscription) return setResponseStatus(event, 400, 'Error creating subscription');
|
||||
|
||||
const project = await ProjectModel.create({
|
||||
owner: userData.id,
|
||||
name: newProjectName,
|
||||
premium: false,
|
||||
premium_type: 0,
|
||||
customer_id: customer.id,
|
||||
subscription_id: subscription.id,
|
||||
premium_expire_at: subscription.current_period_end * 1000
|
||||
});
|
||||
|
||||
|
||||
await ProjectCountModel.create({
|
||||
project_id: project._id,
|
||||
events: 0,
|
||||
visits: 0
|
||||
});
|
||||
|
||||
return project.toJSON() as TProject;
|
||||
|
||||
}
|
||||
|
||||
|
||||
return project.toJSON() as TProject;
|
||||
|
||||
});
|
||||
@@ -86,9 +86,9 @@ services:
|
||||
|
||||
|
||||
# Optional - Used to register / login
|
||||
|
||||
# NUXT_GOOGLE_AUTH_CLIENT_ID: ""
|
||||
# NUXT_GOOGLE_AUTH_CLIENT_SECRET: ""
|
||||
|
||||
NUXT_GOOGLE_AUTH_CLIENT_ID: ""
|
||||
NUXT_GOOGLE_AUTH_CLIENT_SECRET: ""
|
||||
|
||||
|
||||
# Optional - Used for tests
|
||||
@@ -104,6 +104,11 @@ services:
|
||||
|
||||
build:
|
||||
dockerfile: ./dashboard/Dockerfile
|
||||
args:
|
||||
|
||||
# Optional - Used to register / login
|
||||
|
||||
GOOGLE_AUTH_CLIENT_ID: ""
|
||||
|
||||
volumes:
|
||||
mongo-data:
|
||||
|
||||
Reference in New Issue
Block a user