main: initial app rewrite

This commit is contained in:
Gary 2024-02-21 15:21:08 -08:00
parent b983b23e7e
commit a2a2a69eb8
23 changed files with 74 additions and 67 deletions

View File

@ -1,8 +1,6 @@
_____ _ _ __
/ ____| | (_)/ _|
| | ___ ___ | |_| |_ _ _
| | / _ \ / _ \| | | _| | | |
| |___| (_) | (_) | | | | | |_| |
\_____\___/ \___/|_|_|_| \__, |
__/ |
|___/
__ _ __ __ _
/ /__ _______ _______ (_)____ / //_/(_)___ ____ _
__ / / _ \/ ___/ / / / ___/ / / ___/ / ,< / / __ \/ __ `/
/ /_/ / __(__ ) /_/ (__ ) / (__ ) / /| |/ / / / / /_/ /
\____/\___/____/\__,_/____/ /_/____/ /_/ |_/_/_/ /_/\__, /
/____/

View File

@ -53,9 +53,9 @@ public function submit()
'content' => "User: `" . auth()->user()?->email . "` with subject: `" . $this->subject . "` has the following problem: `" . $this->description . "`"
]);
} else {
send_user_an_email($mail, auth()->user()?->email, 'hi@coollabs.io');
send_user_an_email($mail, auth()->user()?->email, 'support@lasthourhosting.org');
}
$this->dispatch('success', 'Feedback sent.', 'We will get in touch with you as soon as possible.');
$this->dispatch('success', 'Feedback sent.', 'Thank you! We will get in touch with you as soon as possible.');
} catch (\Throwable $e) {
return handleError($e, $this);
}

View File

@ -47,7 +47,7 @@ public function testConnection(bool $shouldSave = false)
$this->is_usable = false;
if ($this->unusable_email_sent === false && is_transactional_emails_active()) {
$mail = new MailMessage();
$mail->subject('Coolify: S3 Storage Connection Error');
$mail->subject('Last Hour: S3 Storage Connection Error');
$mail->view('emails.s3-connection-error', ['name' => $this->name, 'reason' => $e->getMessage(), 'url' => route('team.storage.show', ['storage_uuid' => $this->uuid])]);
$users = collect([]);
$members = $this->team->members()->get();

View File

@ -93,7 +93,7 @@ public function sendVerificationEmail()
$mail->view('emails.email-verification', [
'url' => $url,
]);
$mail->subject('Coolify: Verify your email.');
$mail->subject('Last Hour: Verify your email.');
send_user_an_email($mail, $this->email);
}
public function sendPasswordResetNotification($token): void

View File

@ -52,10 +52,10 @@ public function toMail(): MailMessage
$pull_request_id = data_get($this->preview, 'pull_request_id', 0);
$fqdn = $this->fqdn;
if ($pull_request_id === 0) {
$mail->subject('Coolify: Deployment failed of ' . $this->application_name . '.');
$mail->subject('Last Hour: Deployment failed of ' . $this->application_name . '.');
} else {
$fqdn = $this->preview->fqdn;
$mail->subject('Coolify: Deployment failed of pull request #' . $this->preview->pull_request_id . ' of ' . $this->application_name . '.');
$mail->subject('Last Hour: Deployment failed of pull request #' . $this->preview->pull_request_id . ' of ' . $this->application_name . '.');
}
$mail->view('emails.application-deployment-failed', [
'name' => $this->application_name,
@ -69,10 +69,10 @@ public function toMail(): MailMessage
public function toDiscord(): string
{
if ($this->preview) {
$message = 'Coolify: Pull request #' . $this->preview->pull_request_id . ' of **' . $this->application_name . '** (' . $this->preview->fqdn . ') deployment failed: ';
$message = 'Last Hour: Pull request #' . $this->preview->pull_request_id . ' of **' . $this->application_name . '** (' . $this->preview->fqdn . ') deployment failed: ';
$message .= '[View Deployment Logs](' . $this->deployment_url . ')';
} else {
$message = 'Coolify: Deployment failed of **' . $this->application_name . '** (' . $this->fqdn . '): ';
$message = 'Last Hour: Deployment failed of **' . $this->application_name . '** (' . $this->fqdn . '): ';
$message .= '[View Deployment Logs](' . $this->deployment_url . ')';
}
return $message;
@ -80,9 +80,9 @@ public function toDiscord(): string
public function toTelegram(): array
{
if ($this->preview) {
$message = 'Coolify: Pull request #' . $this->preview->pull_request_id . ' of **' . $this->application_name . '** (' . $this->preview->fqdn . ') deployment failed: ';
$message = 'Last Hour: Pull request #' . $this->preview->pull_request_id . ' of **' . $this->application_name . '** (' . $this->preview->fqdn . ') deployment failed: ';
} else {
$message = 'Coolify: Deployment failed of **' . $this->application_name . '** (' . $this->fqdn . '): ';
$message = 'Last Hour: Deployment failed of **' . $this->application_name . '** (' . $this->fqdn . '): ';
}
$buttons[] = [
"text" => "Deployment logs",

View File

@ -52,10 +52,10 @@ public function toMail(): MailMessage
$pull_request_id = data_get($this->preview, 'pull_request_id', 0);
$fqdn = $this->fqdn;
if ($pull_request_id === 0) {
$mail->subject("Coolify: New version is deployed of {$this->application_name}");
$mail->subject("Last Hour: New version is deployed of {$this->application_name}");
} else {
$fqdn = $this->preview->fqdn;
$mail->subject("Coolify: Pull request #{$pull_request_id} of {$this->application_name} deployed successfully");
$mail->subject("Last Hour: Pull request #{$pull_request_id} of {$this->application_name} deployed successfully");
}
$mail->view('emails.application-deployment-success', [
'name' => $this->application_name,
@ -69,7 +69,7 @@ public function toMail(): MailMessage
public function toDiscord(): string
{
if ($this->preview) {
$message = 'Coolify: New PR' . $this->preview->pull_request_id . ' version successfully deployed of ' . $this->application_name . '
$message = 'Last Hour: New PR' . $this->preview->pull_request_id . ' version successfully deployed of ' . $this->application_name . '
';
if ($this->preview->fqdn) {
@ -77,7 +77,7 @@ public function toDiscord(): string
}
$message .= '[Deployment logs](' . $this->deployment_url . ')';
} else {
$message = 'Coolify: New version successfully deployed of ' . $this->application_name . '
$message = 'Last Hour: New version successfully deployed of ' . $this->application_name . '
';
if ($this->fqdn) {
@ -90,7 +90,7 @@ public function toDiscord(): string
public function toTelegram(): array
{
if ($this->preview) {
$message = 'Coolify: New PR' . $this->preview->pull_request_id . ' version successfully deployed of ' . $this->application_name . '';
$message = 'Last Hour: New PR' . $this->preview->pull_request_id . ' version successfully deployed of ' . $this->application_name . '';
if ($this->preview->fqdn) {
$buttons[] = [
"text" => "Open Application",

View File

@ -43,7 +43,7 @@ public function toMail(): MailMessage
{
$mail = new MailMessage();
$fqdn = $this->fqdn;
$mail->subject("Coolify: {$this->resource_name} has been stopped");
$mail->subject("Last Hour: {$this->resource_name} has been stopped");
$mail->view('emails.application-status-changes', [
'name' => $this->resource_name,
'fqdn' => $fqdn,
@ -54,20 +54,20 @@ public function toMail(): MailMessage
public function toDiscord(): string
{
$message = 'Coolify: ' . $this->resource_name . ' has been stopped.
$message = 'Last Hour: ' . $this->resource_name . ' has been stopped.
';
$message .= '[Open Application in Coolify](' . $this->resource_url . ')';
$message .= '[Open Application in Last Hour](' . $this->resource_url . ')';
return $message;
}
public function toTelegram(): array
{
$message = 'Coolify: ' . $this->resource_name . ' has been stopped.';
$message = 'Last Hour: ' . $this->resource_name . ' has been stopped.';
return [
"message" => $message,
"buttons" => [
[
"text" => "Open Application in Coolify",
"text" => "Open Application in Last Hour",
"url" => $this->resource_url
]
],

View File

@ -27,7 +27,7 @@ public function via(object $notifiable): array
public function toMail(): MailMessage
{
$mail = new MailMessage();
$mail->subject("Coolify: A resource ({$this->name}) has been restarted automatically on {$this->server->name}");
$mail->subject("Last Hour: A resource ({$this->name}) has been restarted automatically on {$this->server->name}");
$mail->view('emails.container-restarted', [
'containerName' => $this->name,
'serverName' => $this->server->name,
@ -38,12 +38,12 @@ public function toMail(): MailMessage
public function toDiscord(): string
{
$message = "Coolify: A resource ({$this->name}) has been restarted automatically on {$this->server->name}";
$message = "Last Hour: A resource ({$this->name}) has been restarted automatically on {$this->server->name}";
return $message;
}
public function toTelegram(): array
{
$message = "Coolify: A resource ({$this->name}) has been restarted automatically on {$this->server->name}";
$message = "Last Hour: A resource ({$this->name}) has been restarted automatically on {$this->server->name}";
$payload = [
"message" => $message,
];
@ -51,7 +51,7 @@ public function toTelegram(): array
$payload['buttons'] = [
[
[
"text" => "Check Proxy in Coolify",
"text" => "Check Proxy in Last Hour",
"url" => $this->url
]
]

View File

@ -26,7 +26,7 @@ public function via(object $notifiable): array
public function toMail(): MailMessage
{
$mail = new MailMessage();
$mail->subject("Coolify: A resource has been stopped unexpectedly on {$this->server->name}");
$mail->subject("Last Hour: A resource has been stopped unexpectedly on {$this->server->name}");
$mail->view('emails.container-stopped', [
'containerName' => $this->name,
'serverName' => $this->server->name,
@ -37,12 +37,12 @@ public function toMail(): MailMessage
public function toDiscord(): string
{
$message = "Coolify: A resource ($this->name) has been stopped unexpectedly on {$this->server->name}";
$message = "Last Hour: A resource ($this->name) has been stopped unexpectedly on {$this->server->name}";
return $message;
}
public function toTelegram(): array
{
$message = "Coolify: A resource ($this->name) has been stopped unexpectedly on {$this->server->name}";
$message = "Last Hour: A resource ($this->name) has been stopped unexpectedly on {$this->server->name}";
$payload = [
"message" => $message,
];
@ -50,7 +50,7 @@ public function toTelegram(): array
$payload['buttons'] = [
[
[
"text" => "Open Application in Coolify",
"text" => "Open Application in Last Hour",
"url" => $this->url
]
]

View File

@ -33,7 +33,7 @@ public function via(object $notifiable): array
public function toMail(): MailMessage
{
$mail = new MailMessage();
$mail->subject("Coolify: [ACTION REQUIRED] Backup FAILED for {$this->database->name}");
$mail->subject("Last Hour: [ACTION REQUIRED] Backup FAILED for {$this->database->name}");
$mail->view('emails.backup-failed', [
'name' => $this->name,
'frequency' => $this->frequency,
@ -44,11 +44,11 @@ public function toMail(): MailMessage
public function toDiscord(): string
{
return "Coolify: Database backup for {$this->name} with frequency of {$this->frequency} was FAILED.\n\nReason: {$this->output}";
return "Last Hour: Database backup for {$this->name} with frequency of {$this->frequency} was FAILED.\n\nReason: {$this->output}";
}
public function toTelegram(): array
{
$message = "Coolify: Database backup for {$this->name} with frequency of {$this->frequency} was FAILED.\n\nReason: {$this->output}";
$message = "Last Hour: Database backup for {$this->name} with frequency of {$this->frequency} was FAILED.\n\nReason: {$this->output}";
return [
"message" => $message,
];

View File

@ -30,7 +30,7 @@ public function via(object $notifiable): array
public function toMail(): MailMessage
{
$mail = new MailMessage();
$mail->subject("Coolify: Backup successfully done for {$this->database->name}");
$mail->subject("Last Hour: Backup successfully done for {$this->database->name}");
$mail->view('emails.backup-success', [
'name' => $this->name,
'frequency' => $this->frequency,
@ -40,11 +40,11 @@ public function toMail(): MailMessage
public function toDiscord(): string
{
return "Coolify: Database backup for {$this->name} with frequency of {$this->frequency} was successful.";
return "Last Hour: Database backup for {$this->name} with frequency of {$this->frequency} was successful.";
}
public function toTelegram(): array
{
$message = "Coolify: Database backup for {$this->name} with frequency of {$this->frequency} was successful.";
$message = "Last Hour: Database backup for {$this->name} with frequency of {$this->frequency} was successful.";
return [
"message" => $message,
];

View File

@ -42,7 +42,7 @@ public function via(object $notifiable): array
public function toMail(): MailMessage
{
$mail = new MailMessage();
$mail->subject("Coolify: Server ({$this->server->name}) high disk usage detected!");
$mail->subject("Last Hour: Server ({$this->server->name}) high disk usage detected!");
$mail->view('emails.high-disk-usage', [
'name' => $this->server->name,
'disk_usage' => $this->disk_usage,
@ -53,13 +53,13 @@ public function toMail(): MailMessage
public function toDiscord(): string
{
$message = "Coolify: Server '{$this->server->name}' high disk usage detected!\nDisk usage: {$this->disk_usage}%. Threshold: {$this->cleanup_after_percentage}%.\nPlease cleanup your disk to prevent data-loss.\nHere are some tips: https://coolify.io/docs/automated-cleanup.";
$message = "Last Hour: Server '{$this->server->name}' high disk usage detected!\nDisk usage: {$this->disk_usage}%. Threshold: {$this->cleanup_after_percentage}%.\nPlease cleanup your disk to prevent data-loss.\nHere are some tips: https://coolify.io/docs/automated-cleanup.";
return $message;
}
public function toTelegram(): array
{
return [
"message" => "Coolify: Server '{$this->server->name}' high disk usage detected!\nDisk usage: {$this->disk_usage}%. Threshold: {$this->cleanup_after_percentage}%.\nPlease cleanup your disk to prevent data-loss.\nHere are some tips: https://coolify.io/docs/automated-cleanup."
"message" => "Last Hour: Server '{$this->server->name}' high disk usage detected!\nDisk usage: {$this->disk_usage}%. Threshold: {$this->cleanup_after_percentage}%.\nPlease cleanup your disk to prevent data-loss.\nHere are some tips: https://coolify.io/docs/automated-cleanup."
];
}
}

View File

@ -45,7 +45,7 @@ public function via(object $notifiable): array
public function toMail(): MailMessage
{
$mail = new MailMessage();
$mail->subject("Coolify: Server ({$this->server->name}) revived.");
$mail->subject("Last Hour: Server ({$this->server->name}) revived.");
$mail->view('emails.server-revived', [
'name' => $this->server->name,
]);
@ -54,13 +54,13 @@ public function toMail(): MailMessage
public function toDiscord(): string
{
$message = "Coolify: Server '{$this->server->name}' revived. All automations & integrations are turned on again!";
$message = "Last Hour: Server '{$this->server->name}' revived. All automations & integrations are turned on again!";
return $message;
}
public function toTelegram(): array
{
return [
"message" => "Coolify: Server '{$this->server->name}' revived. All automations & integrations are turned on again!"
"message" => "Last Hour: Server '{$this->server->name}' revived. All automations & integrations are turned on again!"
];
}
}

View File

@ -43,7 +43,7 @@ public function via(object $notifiable): array
public function toMail(): MailMessage
{
$mail = new MailMessage();
$mail->subject("Coolify: Your server ({$this->server->name}) is unreachable.");
$mail->subject("Last Hour: Your server ({$this->server->name}) is unreachable.");
$mail->view('emails.server-lost-connection', [
'name' => $this->server->name,
]);
@ -52,13 +52,13 @@ public function toMail(): MailMessage
public function toDiscord(): string
{
$message = "Coolify: Your server '{$this->server->name}' is unreachable. All automations & integrations are turned off! Please check your server! IMPORTANT: We automatically try to revive your server and turn on all automations & integrations.";
$message = "Last Hour: Your server '{$this->server->name}' is unreachable. All automations & integrations are turned off! Please check your server! IMPORTANT: We automatically try to revive your server and turn on all automations & integrations.";
return $message;
}
public function toTelegram(): array
{
return [
"message" => "Coolify: Your server '{$this->server->name}' is unreachable. All automations & integrations are turned off! Please check your server! IMPORTANT: We automatically try to revive your server and turn on all automations & integrations."
"message" => "Last Hour: Your server '{$this->server->name}' is unreachable. All automations & integrations are turned off! Please check your server! IMPORTANT: We automatically try to revive your server and turn on all automations & integrations."
];
}
}

View File

@ -24,14 +24,14 @@ public function via(object $notifiable): array
public function toMail(): MailMessage
{
$mail = new MailMessage();
$mail->subject("Coolify: Test Email");
$mail->subject("Last Hour: Test Email");
$mail->view('emails.test');
return $mail;
}
public function toDiscord(): string
{
$message = 'Coolify: This is a test Discord notification from Coolify.';
$message = 'Last Hour: This is a test Discord notification from Last Hour.';
$message .= "\n\n";
$message .= '[Go to your dashboard](' . base_url() . ')';
return $message;
@ -39,7 +39,7 @@ public function toDiscord(): string
public function toTelegram(): array
{
return [
"message" => 'Coolify: This is a test Telegram notification from Coolify.',
"message" => 'Last Hour: This is a test Telegram notification from Last Hour.',
"buttons" => [
[
"text" => "Go to your dashboard",

View File

@ -30,7 +30,7 @@ public function toMail(): MailMessage
$invitation_team = Team::find($invitation->team->id);
$mail = new MailMessage();
$mail->subject('Coolify: Invitation for ' . $invitation_team->name);
$mail->subject('Last Hour: Invitation for ' . $invitation_team->name);
$mail->view('emails.invitation-link', [
'team' => $invitation_team->name,
'email' => $this->user->email,

View File

@ -50,7 +50,7 @@ public function toMail($notifiable)
protected function buildMailMessage($url)
{
$mail = new MailMessage();
$mail->subject('Coolify: Reset Password');
$mail->subject('Last Hour: Reset Password');
$mail->view('emails.reset-password', ['url' => $url, 'count' => config('auth.passwords.' . config('auth.defaults.passwords') . '.expire')]);
return $mail;
}

View File

@ -25,7 +25,7 @@ public function via(): array
public function toMail(): MailMessage
{
$mail = new MailMessage();
$mail->subject('Coolify: Test Email');
$mail->subject('Last Hour: Test Email');
$mail->view('emails.test');
return $mail;
}

View File

@ -1,4 +1,4 @@
version: '3.8'
version: "3.8"
services:
coolify:
image: "ghcr.io/coollabsio/coolify:${LATEST_IMAGE:-latest}"
@ -7,11 +7,20 @@ services:
source: /data/coolify/source/.env
target: /var/www/html/.env
read_only: true
- /data/coolify/ssh:/var/www/html/storage/app/ssh
- /data/coolify/applications:/var/www/html/storage/app/applications
- /data/coolify/databases:/var/www/html/storage/app/databases
- /data/coolify/services:/var/www/html/storage/app/services
- /data/coolify/backups:/var/www/html/storage/app/backups
- /data/coolify/storage/app/ssh:/var/www/html/storage/app/ssh
- /data/coolify/storage/app/applications:/var/www/html/storage/app/applications
- /data/coolify/storage/app/databases:/var/www/html/storage/app/databases
- /data/coolify/storage/app/services:/var/www/html/storage/app/services
- /data/coolify/storage/app/backups:/var/www/html/storage/app/backups
- /data/coolify/public:/var/www/html/public
- /data/coolify/app/Notifications:/var/www/html/app/Notifications
- /data/coolify/app/Models:/var/www/html/app/Models
- /data/coolify/app/Livewire/Team/Storage:/var/www/html/app/Livewire/Team/Storage
- /data/coolify/app/Livewire/Project/New:/var/www/html/app/Livewire/Project/New
- /data/coolify/app/Livewire:/var/www/html/app/Livewire
- /data/coolify/.coolify-logo:/var/www/html/.coolify-logo
- /data/coolify/tailwind/tailwind.config.js:/var/www/html/tailwind.config.js
environment:
- APP_ID
- APP_ENV=production
@ -106,7 +115,7 @@ services:
"CMD-SHELL",
"pg_isready -U ${DB_USERNAME:-coolify}",
"-d",
"${DB_DATABASE:-coolify}"
"${DB_DATABASE:-coolify}",
]
interval: 5s
retries: 10

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 141 KiB

After

Width:  |  Height:  |  Size: 70 KiB

View File

@ -1,8 +1,8 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./vendor/wire-elements/modal/resources/views/*.blade.php',
'./storage/framework/views/*.php',
"./vendor/wire-elements/modal/resources/views/*.blade.php",
"./storage/framework/views/*.php",
"./resources/**/*.blade.php",
"./app/**/*.php",
"./resources/**/*.js",
@ -34,7 +34,7 @@ module.exports = {
coollabs: {
primary: "#202020",
"primary-focus": "#242424",
secondary: "#6B16ED",
secondary: "#00bcf3",
accent: "#4338ca",
neutral: "#1B1D1D",
"base-100": "#101010",