Skip to content
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

Merged
merged 3 commits into from
Nov 21, 2024
Merged

Improve docker compose #8637

merged 3 commits into from
Nov 21, 2024

Conversation

FelixMalfait
Copy link
Member

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

Copy link
Contributor

@greptile-apps greptile-apps bot left a 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 to packages/twenty-docker/scripts/ with improved version management and error handling
  • Updated version format in documentation from VERSION=x.y.z to VERSION=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)}
Copy link
Contributor

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
Copy link
Contributor

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

Comment on lines 5 to 7
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"
Copy link
Contributor

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)
Copy link
Contributor

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"
Copy link
Member

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

@FelixMalfait FelixMalfait merged commit 9cb076d into main Nov 21, 2024
15 checks passed
@FelixMalfait FelixMalfait deleted the fix-docker-compose branch November 21, 2024 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants