Skip to content

Commit ff976a1

Browse files
committed
Merge remote-tracking branch 'origin/next' into api-sensitive-data-scrubber
2 parents 9a2c432 + 3324999 commit ff976a1

136 files changed

Lines changed: 6101 additions & 1692 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.development.example

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@ DB_PORT=5432
2727
# DB_WRITE_PASSWORD=
2828
# DB_STICKY=true
2929

30-
# Ray Configuration
31-
# Set to true to enable Ray
32-
RAY_ENABLED=false
33-
# Set custom ray port
34-
# RAY_PORT=
35-
3630
# Enable Laravel Telescope for debugging
3731
TELESCOPE_ENABLED=false
3832

.env.production

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ ROOT_USERNAME=
1515
ROOT_USER_EMAIL=
1616
ROOT_USER_PASSWORD=
1717

18-
REGISTRY_URL=ghcr.io
18+
REGISTRY_URL=docker.io

.github/ISSUE_TEMPLATE/01_BUG_REPORT.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: 🐞 Bug Report
22
description: "File a new bug report."
33
title: "[Bug]: "
4-
labels: ["🐛 Bug", "🔍 Triage"]
4+
labels: ["🔍 Triage"]
55
body:
66
- type: markdown
77
attributes:
@@ -11,10 +11,22 @@ body:
1111
1212
- type: textarea
1313
attributes:
14-
label: Error Message and Logs
14+
label: Description and Error Message
1515
description: Provide a detailed description of the error or exception you encountered, along with any relevant log output.
1616
validations:
1717
required: true
18+
19+
- type: textarea
20+
attributes:
21+
label: Expected Behavior
22+
description: Please describe what you expected to happen instead of the issue. Be as detailed as possible.
23+
value: |
24+
1.
25+
2.
26+
3.
27+
4.
28+
validations:
29+
required: true
1830

1931
- type: textarea
2032
attributes:
@@ -37,7 +49,7 @@ body:
3749
attributes:
3850
label: Coolify Version
3951
description: Please provide the Coolify version you are using. This can be found in the top left corner of your Coolify dashboard.
40-
placeholder: "v4.0.0-beta.335"
52+
placeholder: "v4.1.2"
4153
validations:
4254
required: true
4355

@@ -55,6 +67,12 @@ body:
5567
label: Operating System and Version (self-hosted)
5668
description: Run `cat /etc/os-release` or `lsb_release -a` in your terminal and provide the operating system and version.
5769
placeholder: "Ubuntu 22.04"
70+
71+
- type: textarea
72+
attributes:
73+
label: Screenshots / Visuals
74+
description: If possible, provide screenshots, screen recordings, or diagrams to help illustrate the issue.
75+
placeholder: "Attach images or provide links to recordings demonstrating the problem."
5876

5977
- type: textarea
6078
attributes:

CONTRIBUTING.md

Lines changed: 160 additions & 218 deletions
Large diffs are not rendered by default.

DEVELOPMENT.md

Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
# Contributing to Coolify
2+
> "First, thanks for considering contributing to my project. It really means a lot!" - [@andrasbacsai](https://github.com/andrasbacsai)
3+
4+
You can ask for guidance anytime on our [Discord server](https://coollabs.io/discord) in the `#contribute` channel.
5+
6+
To understand the tech stack, please refer to the [Tech Stack](TECH_STACK.md) document.
7+
8+
9+
## Table of Contents
10+
1. [Setup Development Environment](#1-setup-development-environment)
11+
2. [Verify Installation](#2-verify-installation-optional)
12+
3. [Fork and Setup Local Repository](#3-fork-and-setup-local-repository)
13+
4. [Set up Environment Variables](#4-set-up-environment-variables)
14+
5. [Start Coolify](#5-start-coolify)
15+
6. [Start Development](#6-start-development)
16+
7. [Create a Pull Request](#7-create-a-pull-request)
17+
8. [Development Notes](#development-notes)
18+
9. [Resetting Development Environment](#resetting-development-environment)
19+
10. [Additional Contribution Guidelines](#additional-contribution-guidelines)
20+
21+
22+
## 1. Setup Development Environment
23+
Follow the steps below for your operating system:
24+
25+
<details>
26+
<summary><strong>Windows</strong></summary>
27+
28+
1. Install `docker-ce`, Docker Desktop (or similar):
29+
- Docker CE (recommended):
30+
- Install Windows Subsystem for Linux v2 (WSL2) by following this guide: [Install WSL](https://learn.microsoft.com/en-us/windows/wsl/install?ref=coolify)
31+
- After installing WSL2, install Docker CE for your Linux distribution by following this guide: [Install Docker Engine](https://docs.docker.com/engine/install/?ref=coolify)
32+
- Make sure to choose the appropriate Linux distribution (e.g., Ubuntu) when following the Docker installation guide
33+
- Install Docker Desktop (easier):
34+
- Download and install [Docker Desktop for Windows](https://docs.docker.com/desktop/install/windows-install/?ref=coolify)
35+
- Ensure WSL2 backend is enabled in Docker Desktop settings
36+
37+
2. Install Spin:
38+
- Follow the instructions to install Spin on Windows from the [Spin documentation](https://serversideup.net/open-source/spin/docs/installation/install-windows#download-and-install-spin-into-wsl2?ref=coolify)
39+
40+
</details>
41+
42+
<details>
43+
<summary><strong>MacOS</strong></summary>
44+
45+
1. Install Orbstack, Docker Desktop (or similar):
46+
- Orbstack (recommended, as it is a faster and lighter alternative to Docker Desktop):
47+
- Download and install [Orbstack](https://docs.orbstack.dev/quick-start#installation?ref=coolify)
48+
- Docker Desktop:
49+
- Download and install [Docker Desktop for Mac](https://docs.docker.com/desktop/install/mac-install/?ref=coolify)
50+
51+
2. Install Spin:
52+
- Follow the instructions to install Spin on MacOS from the [Spin documentation](https://serversideup.net/open-source/spin/docs/installation/install-macos/#download-and-install-spin?ref=coolify)
53+
54+
</details>
55+
56+
<details>
57+
<summary><strong>Linux</strong></summary>
58+
59+
1. Install Docker Engine, Docker Desktop (or similar):
60+
- Docker Engine (recommended, as there is no VM overhead):
61+
- Follow the official [Docker Engine installation guide](https://docs.docker.com/engine/install/?ref=coolify) for your Linux distribution
62+
- Docker Desktop:
63+
- If you want a GUI, you can use [Docker Desktop for Linux](https://docs.docker.com/desktop/install/linux-install/?ref=coolify)
64+
65+
2. Install Spin:
66+
- Follow the instructions to install Spin on Linux from the [Spin documentation](https://serversideup.net/open-source/spin/docs/installation/install-linux#configure-docker-permissions?ref=coolify)
67+
68+
</details>
69+
70+
71+
## 2. Verify Installation (Optional)
72+
After installing Docker (or Orbstack) and Spin, verify the installation:
73+
74+
1. Open a terminal or command prompt
75+
2. Run the following commands:
76+
```bash
77+
docker --version
78+
spin --version
79+
```
80+
You should see version information for both Docker and Spin.
81+
82+
83+
## 3. Fork and Setup Local Repository
84+
1. Fork the [Coolify](https://github.com/coollabsio/coolify) repository to your GitHub account.
85+
86+
2. Install a code editor on your machine (choose one):
87+
88+
| Editor | Platform | Download Link |
89+
|--------|----------|---------------|
90+
| Visual Studio Code (recommended free) | Windows/macOS/Linux | [Download](https://code.visualstudio.com/download?ref=coolify) |
91+
| Cursor (recommended but paid) | Windows/macOS/Linux | [Download](https://www.cursor.com/?ref=coolify) |
92+
| Zed (very fast) | Windows/macOS/Linux | [Download](https://zed.dev/download?ref=coolify) |
93+
94+
3. Clone the Coolify Repository from your fork to your local machine
95+
- Use `git clone` in the command line, or
96+
- Use GitHub Desktop (recommended):
97+
- Download and install from [https://desktop.github.com/](https://desktop.github.com/?ref=coolify)
98+
- Open GitHub Desktop and login with your GitHub account
99+
- Click on `File` -> `Clone Repository` select `github.com` as the repository location, then select your forked Coolify repository, choose the local path and then click `Clone`
100+
101+
4. Open the cloned Coolify Repository in your chosen code editor.
102+
103+
104+
## 4. Set up Environment Variables
105+
1. In the Code Editor, locate the `.env.development.example` file in the root directory of your local Coolify repository.
106+
2. Duplicate the `.env.development.example` file and rename the copy to `.env`.
107+
3. Open the new `.env` file and review its contents. Adjust any environment variables as needed for your development setup.
108+
4. If you encounter errors during database migrations, update the database connection settings in your `.env` file. Use the IP address or hostname of your PostgreSQL database container. You can find this information by running `docker ps` after executing `spin up`.
109+
5. Save the changes to your `.env` file.
110+
111+
112+
## 5. Start Coolify
113+
1. Open a terminal in the local Coolify directory.
114+
2. Run the following command in the terminal (leave that terminal open):
115+
```bash
116+
spin up
117+
```
118+
119+
> [!NOTE]
120+
> You may see some errors, but don't worry; this is expected.
121+
122+
3. If you encounter permission errors, especially on macOS, use:
123+
```bash
124+
sudo spin up
125+
```
126+
127+
> [!NOTE]
128+
> If you change environment variables afterwards or anything seems broken, press Ctrl + C to stop the process and run `spin up` again.
129+
130+
131+
## 6. Start Development
132+
1. Access your Coolify instance:
133+
- URL: `http://localhost:8000`
134+
- Login: `test@example.com`
135+
- Password: `password`
136+
137+
2. Additional development tools:
138+
139+
| Tool | URL | Note |
140+
|------|-----|------|
141+
| Laravel Horizon (scheduler) | `http://localhost:8000/horizon` | Only accessible when logged in as root user |
142+
| Mailpit (email catcher) | `http://localhost:8025` | |
143+
| Telescope (debugging tool) | `http://localhost:8000/telescope` | Disabled by default |
144+
145+
> [!NOTE]
146+
> To enable Telescope, add the following to your `.env` file:
147+
> ```env
148+
> TELESCOPE_ENABLED=true
149+
> ```
150+
151+
152+
## Development Notes
153+
When working on Coolify, keep the following in mind:
154+
155+
1. **Database Migrations**: After switching branches or making changes to the database structure, always run migrations:
156+
```bash
157+
docker exec -it coolify php artisan migrate
158+
```
159+
160+
2. **Resetting Development Setup**: To reset your development setup to a clean database with default values:
161+
```bash
162+
docker exec -it coolify php artisan migrate:fresh --seed
163+
```
164+
165+
3. **Troubleshooting**: If you encounter unexpected behavior, ensure your database is up-to-date with the latest migrations and if possible reset the development setup to eliminate any environment-specific issues.
166+
167+
> [!IMPORTANT]
168+
> Forgetting to migrate the database can cause problems, so make it a habit to run migrations after pulling changes or switching branches.
169+
170+
171+
## Resetting Development Environment
172+
If you encounter issues or break your database or something else, follow these steps to start from a clean slate (works since `v4.0.0-beta.342`):
173+
174+
1. Stop all running containers `ctrl + c`.
175+
176+
2. Remove all Coolify containers:
177+
```bash
178+
docker rm coolify coolify-db coolify-redis coolify-realtime coolify-testing-host coolify-minio coolify-vite-1 coolify-mail
179+
```
180+
181+
3. Remove Coolify volumes (it is possible that the volumes have no `coolify` prefix on your machine, in that case remove the prefix from the command):
182+
```bash
183+
docker volume rm coolify_dev_backups_data coolify_dev_postgres_data coolify_dev_redis_data coolify_dev_coolify_data coolify_dev_minio_data
184+
```
185+
186+
4. Remove unused images:
187+
```bash
188+
docker image prune -a
189+
```
190+
191+
5. Start Coolify again:
192+
```bash
193+
spin up
194+
```
195+
196+
6. Run database migrations and seeders:
197+
```bash
198+
docker exec -it coolify php artisan migrate:fresh --seed
199+
```
200+
201+
After completing these steps, you'll have a fresh development setup.
202+
203+
> [!IMPORTANT]
204+
> Always run database migrations and seeders after switching branches or pulling updates to ensure your local database structure matches the current codebase and includes necessary seed data.
205+
206+
207+
## Additional Development Guidelines
208+
### Adding a New Service
209+
To add a new service to Coolify, please refer to our documentation: [Adding a New Service](https://coolify.io/docs/get-started/contribute/service)
210+
211+
### Development for Documentation
212+
To contribute to the Coolify documentation, please refer to this guide: [Contributing to the Coolify Documentation](https://coolify.io/docs/get-started/contribute/documentation)

app/Actions/Database/StartDatabaseProxy.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,6 @@ public function handle(StandaloneRedis|StandalonePostgresql|StandaloneMongodb|St
143143
)
144144
);
145145

146-
ray("Database proxy for {$database->name} disabled due to non-transient error: {$e->getMessage()}");
147-
148146
return;
149147
}
150148

app/Actions/Server/CleanupDocker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function handle(Server $server, bool $deleteUnusedVolumes = false, bool $
2020
$realtimeImageWithoutPrefixVersion = "coollabsio/coolify-realtime:$realtimeImageVersion";
2121

2222
$helperImageVersion = getHelperVersion();
23-
$helperImage = config('constants.coolify.helper_image');
23+
$helperImage = coolifyHelperImage();
2424
$helperImageWithVersion = "$helperImage:$helperImageVersion";
2525
$helperImageWithoutPrefix = 'coollabsio/coolify-helper';
2626
$helperImageWithoutPrefixVersion = "coollabsio/coolify-helper:$helperImageVersion";

app/Actions/Server/DeleteServer.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,14 @@ public function handle(int $serverId, bool $deleteFromHetzner = false, ?int $het
2626
);
2727
}
2828

29-
ray($server ? 'Deleting server from Coolify' : 'Server already deleted from Coolify, skipping Coolify deletion');
30-
3129
// If server is already deleted from Coolify, skip this part
3230
if (! $server) {
3331
return; // Server already force deleted from Coolify
3432
}
3533

36-
ray('force deleting server from Coolify', ['server_id' => $server->id]);
37-
3834
try {
3935
$server->forceDelete();
4036
} catch (\Throwable $e) {
41-
ray('Failed to force delete server from Coolify', [
42-
'error' => $e->getMessage(),
43-
'server_id' => $server->id,
44-
]);
4537
logger()->error('Failed to force delete server from Coolify', [
4638
'error' => $e->getMessage(),
4739
'server_id' => $server->id,
@@ -66,27 +58,14 @@ private function deleteFromHetznerById(int $hetznerServerId, ?int $cloudProvider
6658
}
6759

6860
if (! $token) {
69-
ray('No Hetzner token found for team, skipping Hetzner deletion', [
70-
'team_id' => $teamId,
71-
'hetzner_server_id' => $hetznerServerId,
72-
]);
7361

7462
return;
7563
}
7664

7765
$hetznerService = new HetznerService($token->token);
7866
$hetznerService->deleteServer($hetznerServerId);
7967

80-
ray('Deleted server from Hetzner', [
81-
'hetzner_server_id' => $hetznerServerId,
82-
'team_id' => $teamId,
83-
]);
8468
} catch (\Throwable $e) {
85-
ray('Failed to delete server from Hetzner', [
86-
'error' => $e->getMessage(),
87-
'hetzner_server_id' => $hetznerServerId,
88-
'team_id' => $teamId,
89-
]);
9069

9170
// Log the error but don't prevent the server from being deleted from Coolify
9271
logger()->error('Failed to delete server from Hetzner', [

app/Actions/Server/StartSentinel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function handle(Server $server, bool $restart = false, ?string $latestVer
2626
$endpoint = data_get($server, 'settings.sentinel_custom_url');
2727
$debug = data_get($server, 'settings.is_sentinel_debug_enabled');
2828
$mountDir = '/data/coolify/sentinel';
29-
$image = config('constants.coolify.registry_url').'/coollabsio/sentinel:'.$version;
29+
$image = coolifyRegistryUrl().'/coollabsio/sentinel:'.$version;
3030
if (! $endpoint) {
3131
throw new \RuntimeException('You should set FQDN in Instance Settings.');
3232
}

app/Actions/Server/UpdateCoolify.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,14 @@ private function update()
118118
{
119119
$latestHelperImageVersion = getHelperVersion();
120120
$upgradeScriptUrl = config('constants.coolify.upgrade_script_url');
121+
$registryUrl = coolifyRegistryUrl();
121122

122123
remote_process([
123124
"curl -fsSL {$upgradeScriptUrl} -o /data/coolify/source/upgrade.sh",
124-
"bash /data/coolify/source/upgrade.sh $this->latestVersion $latestHelperImageVersion",
125+
'bash /data/coolify/source/upgrade.sh '.
126+
escapeshellarg($this->latestVersion).' '.
127+
escapeshellarg($latestHelperImageVersion).' '.
128+
escapeshellarg($registryUrl),
125129
], $this->server);
126130
}
127131
}

0 commit comments

Comments
 (0)