feat: add arch to database
This commit is contained in:
		
							parent
							
								
									681fcb5a0e
								
							
						
					
					
						commit
						003a8e4554
					
				| @ -0,0 +1,2 @@ | |||||||
|  | -- AlterTable | ||||||
|  | ALTER TABLE "Setting" ADD COLUMN "arch" TEXT; | ||||||
| @ -13,6 +13,7 @@ model Setting { | |||||||
|   fqdn                  String?  @unique |   fqdn                  String?  @unique | ||||||
|   ipv4                  String? |   ipv4                  String? | ||||||
|   ipv6                  String? |   ipv6                  String? | ||||||
|  |   arch                  String? | ||||||
|   isRegistrationEnabled Boolean  @default(false) |   isRegistrationEnabled Boolean  @default(false) | ||||||
|   dualCerts             Boolean  @default(false) |   dualCerts             Boolean  @default(false) | ||||||
|   minPort               Int      @default(9000) |   minPort               Int      @default(9000) | ||||||
|  | |||||||
| @ -24,7 +24,8 @@ async function main() { | |||||||
| 			data: { | 			data: { | ||||||
| 				isRegistrationEnabled: true, | 				isRegistrationEnabled: true, | ||||||
| 				proxyPassword: encrypt(generatePassword()), | 				proxyPassword: encrypt(generatePassword()), | ||||||
| 				proxyUser: cuid() | 				proxyUser: cuid(), | ||||||
|  | 				arch: process.arch | ||||||
| 			} | 			} | ||||||
| 		}); | 		}); | ||||||
| 	} else { | 	} else { | ||||||
|  | |||||||
| @ -130,6 +130,7 @@ fastify.listen({ port, host }, async (err: any, address: any) => { | |||||||
| 			if (!scheduler.workers.has('deployApplication')) await scheduler.start('deployApplication'); | 			if (!scheduler.workers.has('deployApplication')) await scheduler.start('deployApplication'); | ||||||
| 		} | 		} | ||||||
| 	}); | 	}); | ||||||
|  | 	await getArch(); | ||||||
| 	await getIPAddress(); | 	await getIPAddress(); | ||||||
| }); | }); | ||||||
| async function getIPAddress() { | async function getIPAddress() { | ||||||
| @ -153,5 +154,13 @@ async function initServer() { | |||||||
| 		await asyncExecShell(`docker network create --attachable coolify`); | 		await asyncExecShell(`docker network create --attachable coolify`); | ||||||
| 	} catch (error) { } | 	} catch (error) { } | ||||||
| } | } | ||||||
|  | async function getArch() { | ||||||
|  | 	try { | ||||||
|  | 		const settings = await prisma.setting.findFirst({}) | ||||||
|  | 		if (settings && !settings.arch) { | ||||||
|  | 			await prisma.setting.update({ where: { id: settings.id }, data: { arch: process.arch } }) | ||||||
|  | 		} | ||||||
|  | 	} catch (error) { } | ||||||
|  | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user