Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

using sqlite dummy db for selfhosted

Blue Mouse6217673a15ba
diff --git a/src/app.module.ts b/src/app.module.ts
index 5e708276c..d09e99fa8 100644
--- a/src/app.module.ts
+++ b/src/app.module.ts
@@ -15,17 +15,18 @@ import { ActionToken } from './action-tokens/action-token.entity'
import { TaskManagerModule } from './task-manager/task-manager.module'
import { WebhookModule } from './webhook/webhook.module'
import { PingModule } from './ping/ping.module'
+import { isSelfhosted } from './common/constants'
@Module({
imports: [
ConfigModule.forRoot({ envFilePath: '.env' }),
TypeOrmModule.forRoot({
- type: 'mysql',
- host: process.env.MYSQL_HOST,
- port: 3306,
- username: process.env.MYSQL_USER,
- password: process.env.MYSQL_ROOT_PASSWORD,
- database: process.env.MYSQL_DATABASE,
+ type: isSelfhosted ? 'mysql' : 'sqlite',
+ host: isSelfhosted && process.env.MYSQL_HOST,
+ port: isSelfhosted && 3306,
+ username: isSelfhosted && process.env.MYSQL_USER,
+ password: isSelfhosted && process.env.MYSQL_ROOT_PASSWORD,
+ database: isSelfhosted ? process.env.MYSQL_DATABASE : './dummy.sql',
synchronize: false,
entities: [User, ActionToken, Project],
}),
diff --git a/src/dummy.sql b/src/dummy.sql
new file mode 100644
index 000000000..e69de29bb