-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve docker compose #8637
Improve docker compose #8637
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
Improved Docker Compose setup with enhanced security and version management through new installation scripts and documentation updates.
- Removed Redis port exposure (6379) in
packages/twenty-docker/docker-compose.yml
for improved security - Added
packages/twenty-docker/scripts/1-click.sh
proxy script to handle version-specific installations - Relocated
install.sh
topackages/twenty-docker/scripts/
with improved version management and error handling - Updated version format in documentation from
VERSION=x.y.z
toVERSION=vx.y.z
for consistency with release tags - Added platform-specific handling for file editing commands between macOS and Linux in install script
4 file(s) reviewed, 4 comment(s)
Edit PR Review Bot Settings | Greptile
@@ -0,0 +1,8 @@ | |||
version=${VERSION:-$(curl -s https://api.github.com/repos/twentyhq/twenty/releases/latest | grep '"tag_name":' | cut -d '"' -f 4)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Consider adding error handling if the GitHub API call fails
version=${VERSION:-$(curl -s https://api.github.com/repos/twentyhq/twenty/releases/latest | grep '"tag_name":' | cut -d '"' -f 4)} | ||
branch=${BRANCH:-$version} | ||
|
||
if [[ "$version" == "v0.32.4" || "$version" > "v0.32.4" || -n "$branch" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: The condition -n "$branch"
will always be true here since branch is set on line 2, making the version check redundant
curl -sL "https://raw.githubusercontent.com/twentyhq/twenty/$branch/packages/twenty-docker/scripts/install.sh" | bash -s -- "$version" "$branch" | ||
else | ||
curl -sL "https://raw.githubusercontent.com/twentyhq/twenty/$branch/install.sh" | bash -s -- "$version" "$branch" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Piping curl directly to bash can be a security risk if the source is compromised. Consider downloading the file first and verifying its contents
@@ -31,7 +31,7 @@ bash <(curl -sL https://git.new/20) | |||
|
|||
To install a specific version or branch: | |||
```bash | |||
VERSION=x.y.z BRANCH=branch-name bash <(curl -sL https://git.new/20) | |||
VERSION=vx.y.z BRANCH=branch-name bash <(curl -sL https://git.new/20) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: The example shows vx.y.z
but the instruction below still says to 'Replace x.y.z'. Update the instruction to say 'Replace vx.y.z' for consistency.
branch=${BRANCH:-$version} | ||
|
||
if [[ "$version" == "v0.32.4" || "$version" > "v0.32.4" || -n "$branch" ]]; then | ||
curl -sL "https://raw.githubusercontent.com/twentyhq/twenty/$branch/packages/twenty-docker/scripts/install.sh" | bash -s -- "$version" "$branch" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try to find the script in new location and if not found in previous location instead
Add a proxy script to use the right install.sh branch/version matching the docker-compose
Also stop exposing redis publicly as it's not necessary