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

App/sharry #4936

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

App/sharry #4936

wants to merge 13 commits into from

Conversation

falkheiland
Copy link
Contributor

@falkheiland falkheiland commented Sep 23, 2024

Sharry allows to share files with others in a simple way. It is a self-hosted web application. The basic concept is: upload files and get a url back that can then be shared.

https://github.com/eikek/sharry

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced a configuration file for the Sharry application, detailing settings for file sharing.
    • Added a REST server configuration with dynamic URL and authentication settings.
    • Implemented a Docker Compose setup for easy deployment of Sharry with PostgreSQL backend.
    • Created a metadata description file outlining application functionality and admin management.
  • Documentation

    • Added instructions for managing admin accounts and links to project resources.

Copy link
Contributor

coderabbitai bot commented Sep 23, 2024

Walkthrough

The changes introduced in this pull request consist of several new configuration files and templates for the Sharry application, a self-hosted file-sharing platform. These include a main configuration file (config.json), a REST server configuration template (sharry.conf.template), Docker Compose files for service orchestration (docker-compose.json and docker-compose.yml), and a documentation file (description.md). Together, these files define application settings, service dependencies, and provide an overview of the application’s functionality.

Changes

File Path Change Summary
apps/sharry/config.json New configuration file added, defining application metadata, settings, database password requirements, supported architectures, and timestamps.
apps/sharry/data/sharry.conf.template New configuration template for the Sharry REST server, specifying server URL, authentication, JDBC database connection, and user signup settings.
apps/sharry/docker-compose.json New Docker Compose configuration defining two services: sharry (file-sharing application) and db (PostgreSQL database), including image specifications, dependencies, and environment variables.
apps/sharry/docker-compose.yml New Docker Compose YAML configuration with similar service definitions as the JSON file, including network settings and Traefik labels for routing.
apps/sharry/metadata/description.md New documentation file providing an overview of the Sharry application, including functionality, admin account management instructions, and links to the project's GitHub and Docker Hub pages.

Possibly related PRs

  • [App] Metabase #4603: The Metabase PR introduces a new configuration file in JSON format, similar to the Sharry configuration file, both defining essential metadata and operational parameters for their respective applications.
  • Add hoarder #4782: The Hoarder PR also adds a new configuration file in JSON format, which includes metadata and settings for the Hoarder application, paralleling the changes made in the Sharry configuration.
  • app: homer #5171: The Homer PR introduces a new configuration file in JSON format, similar to the Sharry configuration, both containing metadata and settings for their respective applications.

Suggested reviewers

  • meienberger

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

Outside diff range and nitpick comments (9)
apps/sharry/metadata/description.md (3)

1-5: Improve grammar in the introduction

The introduction provides a clear overview of Sharry. However, there's a minor grammatical issue that can be improved.

Consider updating line 5 to improve readability:

-Sharry allows to share files with others in a simple way. It is a self-hosted web application. The basic concept is: upload files and get a url back that can then be shared.
+Sharry allows users to share files with others in a simple way. It is a self-hosted web application. The basic concept is: upload files and get a URL back that can then be shared.

This change adds "users" as the object of "allows" and capitalizes "URL" as it's an acronym.

Tools
LanguageTool

[grammar] ~5-~5: Did you mean “sharing”? Or maybe you should add a pronoun? In active voice, ‘allow’ + ‘to’ takes an object, usually a pronoun.
Context: ...sharing web application. Sharry allows to share files with others in a simple way. It i...

(ALLOW_TO)


7-7: Enhance admin account setup instructions

The instructions for setting up the admin account are clear, but can be improved for better readability and security emphasis.

Consider updating the admin account setup instructions:

-Standard Admin Account is `admin`:`admin`. Go to `Settings (3 lines) -> Accounts` and create a new admin user account. Login with the new account and disable / remove the standard admin account.
+The standard Admin Account is `admin`:`admin`. For security reasons, it's crucial to change this immediately. Go to `Settings (3 lines) -> Accounts` and create a new admin user account. Login with the new account and disable / remove the standard admin account.

This change improves grammar and emphasizes the importance of changing the default admin credentials for security.


9-13: Use Markdown link syntax for URLs

The links provided are useful, but their presentation can be improved using Markdown link syntax.

Consider updating the links section as follows:

 ## Links

-https://github.com/eikek/sharry
+[GitHub Repository](https://github.com/eikek/sharry)

-https://hub.docker.com/r/eikek0/sharry
+[Docker Hub](https://hub.docker.com/r/eikek0/sharry)

This change improves readability and follows Markdown best practices for formatting links.

Tools
Markdownlint

11-11: null
Bare URL used

(MD034, no-bare-urls)


13-13: null
Bare URL used

(MD034, no-bare-urls)

apps/sharry/docker-compose.json (2)

3-20: Consider adding external port mapping for the Sharry service.

The Sharry service is configured with an internal port of 9090, but there's no external port mapping specified. This means the service won't be directly accessible from outside the Docker network.

Consider adding an external port mapping if you want to access Sharry directly. For example:

"ports": [
  {
    "published": 8080,
    "target": 9090
  }
]

This would make Sharry accessible on port 8080 of the host machine.


1-38: Overall structure is good, with some security considerations.

The Docker Compose configuration is well-structured and follows best practices. However, there are a few areas where security and clarity could be improved:

  1. Consider using Docker secrets for sensitive information, as mentioned earlier.
  2. The ${APP_DATA_DIR} environment variable is used throughout the configuration. Ensure this variable is properly set and documented.
  3. There's no explicit network configuration. While Docker Compose creates a default network, you might want to consider creating a custom network for better isolation and control.

To improve network isolation, you could add a custom network configuration:

"networks": [
  {
    "name": "sharry_network",
    "driver": "bridge"
  }
],

And then add a networks key to each service to specify which network they should join.

Also, consider adding a .env file to your project to define the APP_DATA_DIR and other environment variables used in this configuration. This can help with clarity and ease of deployment.

apps/sharry/config.json (2)

1-10: LGTM! Consider adding a comment about the port number.

The basic configuration looks good. The schema reference, availability settings, and version are all well-defined.

Consider adding a comment explaining why port 8681 was chosen, as it's a non-standard port. This can help prevent potential conflicts and provide context for future maintainers.


27-33: LGTM! Consider adding a human-readable date format.

The supported architectures and timestamps are correctly defined.

Consider adding a comment with a human-readable date format alongside the Unix timestamps. This can improve readability for maintainers. For example:

"created_at": 1727099286000, // 2024-09-23T12:34:46Z
"updated_at": 1727099286000  // 2024-09-23T12:34:46Z
apps/sharry/docker-compose.yml (2)

1-39: LGTM! Minor indentation fix needed.

The sharry service configuration looks good overall. It correctly sets up dependencies, mounts the configuration file, exposes the necessary port, and configures Traefik for routing and HTTPS.

There's a minor indentation issue on line 4. Please adjust the indentation to match the rest of the file:

  sharry:
    depends_on:
-     - db
+      - db
Tools
yamllint

[warning] 4-4: wrong indentation: expected 6 but found 5

(indentation)


51-51: Add a newline at the end of the file.

To comply with YAML best practices and resolve the yamllint warning, add a newline at the end of the file.

Add a newline after the last line of the file.

Tools
yamllint

[error] 51-51: no new line character at the end of file

(new-line-at-end-of-file)

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a946f67 and ddf22c3.

Files ignored due to path filters (1)
  • apps/sharry/metadata/logo.jpg is excluded by !**/*.jpg
Files selected for processing (5)
  • apps/sharry/config.json (1 hunks)
  • apps/sharry/data/sharry.conf.template (1 hunks)
  • apps/sharry/docker-compose.json (1 hunks)
  • apps/sharry/docker-compose.yml (1 hunks)
  • apps/sharry/metadata/description.md (1 hunks)
Additional context used
yamllint
apps/sharry/docker-compose.yml

[warning] 4-4: wrong indentation: expected 6 but found 5

(indentation)


[error] 51-51: no new line character at the end of file

(new-line-at-end-of-file)

LanguageTool
apps/sharry/metadata/description.md

[grammar] ~5-~5: Did you mean “sharing”? Or maybe you should add a pronoun? In active voice, ‘allow’ + ‘to’ takes an object, usually a pronoun.
Context: ...sharing web application. Sharry allows to share files with others in a simple way. It i...

(ALLOW_TO)


[uncategorized] ~6-~6: You might be missing the article “the” here.
Context: ...et a url back that can then be shared. Standard Admin Account is admin:admin. Go to...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

Markdownlint
apps/sharry/metadata/description.md

11-11: null
Bare URL used

(MD034, no-bare-urls)


13-13: null
Bare URL used

(MD034, no-bare-urls)

Additional comments not posted (9)
apps/sharry/data/sharry.conf.template (3)

3-3: LGTM: Flexible base URL configuration

The use of the {{APP_DOMAIN}} placeholder in the base URL configuration allows for easy customization across different deployment environments. This approach aligns with best practices for configuration management.


5-8: Verify network security for the binding configuration

The server is configured to bind to all network interfaces (0.0.0.0) on port 9090. While this allows for flexible deployment, it may expose the server to unauthorized access if not properly secured.

Please ensure that:

  1. The server is behind a properly configured firewall or reverse proxy.
  2. Access to port 9090 is restricted to trusted networks only.
  3. Consider using environment-specific binding configurations for different deployment scenarios (e.g., localhost for development, specific IP for production).

20-24: Verify signup configuration and provide more context

The current signup configuration allows open registration, which may not be suitable for all deployment scenarios.

Please consider the following:

  1. Verify if open signup aligns with the security requirements of the intended deployment environment.
  2. Document the implications of the "open" signup mode in the project README or deployment guide.
  3. Consider making the signup mode configurable (e.g., using a placeholder like {{SIGNUP_MODE}}) to allow easy adjustment for different environments.
  4. Provide more context or documentation about the "generate-invite" setting for the invite password. Its purpose and security implications are not immediately clear.

Example of a more flexible configuration:

signup {
  mode = "{{SIGNUP_MODE}}"
  invite-time = "{{INVITE_EXPIRATION_TIME}}"
  invite-password = "{{INVITE_PASSWORD_METHOD}}"
}
apps/sharry/metadata/description.md (1)

1-13: Overall approval of the description file

The description.md file provides a concise and informative overview of Sharry, including its main functionality, admin account setup instructions, and relevant links. The content is well-structured and covers the essential information users need to get started with Sharry.

With the suggested minor improvements in grammar and formatting, this file will serve as an excellent introduction to Sharry for users of the Runtipi App Store.

Tools
LanguageTool

[grammar] ~5-~5: Did you mean “sharing”? Or maybe you should add a pronoun? In active voice, ‘allow’ + ‘to’ takes an object, usually a pronoun.
Context: ...sharing web application. Sharry allows to share files with others in a simple way. It i...

(ALLOW_TO)


[uncategorized] ~6-~6: You might be missing the article “the” here.
Context: ...et a url back that can then be shared. Standard Admin Account is admin:admin. Go to...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

Markdownlint

11-11: null
Bare URL used

(MD034, no-bare-urls)


13-13: null
Bare URL used

(MD034, no-bare-urls)

apps/sharry/docker-compose.json (2)

8-13: Verify the content of the Sharry configuration file.

The Sharry service is configured to use a specific configuration file mounted from the host system.

To ensure proper configuration, please verify the content of the ${APP_DATA_DIR}/data/sharry.conf file. It should contain necessary settings for Sharry, including database connection details. You may want to provide a template or documentation for this configuration file.


23-23: Consider long-term support for PostgreSQL version.

You're using PostgreSQL 16.4-alpine, which is a recent version. This is good for having the latest features and security updates.

However, keep in mind that major version upgrades in databases can sometimes introduce breaking changes. Ensure you have a strategy for managing database upgrades and migrations as new versions are released.

apps/sharry/config.json (2)

11-18: LGTM! Comprehensive metadata provided.

The category, descriptions, and links are well-defined and provide valuable information about the application. The inclusion of both a detailed description and a short description is particularly useful for different contexts.


1-33: Overall, excellent configuration file for Sharry.

The config.json file is well-structured, comprehensive, and follows good practices for application configuration. It includes all necessary metadata, security considerations, and deployment information for the Sharry application.

The minor suggestions provided in the review comments above can further enhance the clarity and completeness of the configuration, but they are not critical issues. Great job on setting up this configuration file!

apps/sharry/docker-compose.yml (1)

5-5: Consider updating to the latest stable version.

The current image version is v1.14.0. It's good that you've pinned the version, but you might want to check if there's a newer stable version available for potential bug fixes and improvements.

To check for the latest version, you can run:

If a newer version is available, consider updating the image tag.

apps/sharry/data/sharry.conf.template Show resolved Hide resolved
apps/sharry/data/sharry.conf.template Outdated Show resolved Hide resolved
apps/sharry/docker-compose.json Show resolved Hide resolved
apps/sharry/config.json Show resolved Hide resolved
apps/sharry/docker-compose.yml Outdated Show resolved Hide resolved
apps/sharry/docker-compose.yml Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between ddf22c3 and f27fc6d.

📒 Files selected for processing (1)
  • apps/sharry/docker-compose.yml (1 hunks)
🧰 Additional context used
🪛 yamllint
apps/sharry/docker-compose.yml

[warning] 4-4: wrong indentation: expected 6 but found 5

(indentation)


[error] 53-53: no new line character at the end of file

(new-line-at-end-of-file)

apps/sharry/docker-compose.yml Outdated Show resolved Hide resolved
apps/sharry/docker-compose.yml Outdated Show resolved Hide resolved
apps/sharry/docker-compose.yml Show resolved Hide resolved
apps/sharry/docker-compose.yml Outdated Show resolved Hide resolved
apps/sharry/docker-compose.yml Outdated Show resolved Hide resolved
apps/sharry/docker-compose.yml Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Outside diff range and nitpick comments (1)
apps/sharry/docker-compose.yml (1)

13-14: Consider network isolation improvements.

While both services are correctly on the tipi_main_network, consider creating a dedicated network for Sharry's internal communication to improve security isolation.

Add a new network specifically for Sharry:

networks:
  sharry_internal:
    driver: bridge
  tipi_main_network:
    external: true

Then update both services to use both networks:

     networks:
       - tipi_main_network
+      - sharry_internal

This ensures that:

  1. Internal communication between Sharry and its database is isolated
  2. Only the Sharry application needs access to the database
  3. Other services on tipi_main_network cannot access the database

Also applies to: 52-53

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between f27fc6d and bf8c61e.

📒 Files selected for processing (2)
  • apps/sharry/data/sharry.conf.template (1 hunks)
  • apps/sharry/docker-compose.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/sharry/data/sharry.conf.template
🔇 Additional comments (1)
apps/sharry/docker-compose.yml (1)

9-10: Verify the configuration file path and permissions.

The configuration file is mounted at /opt/sharry.conf, but we need to ensure:

  1. The source file exists in the host's ${APP_DATA_DIR}/data/ directory
  2. The file has appropriate read permissions for the container's user
✅ Verification successful

Let me gather more information about the configuration setup by checking related files in the repository.


Let me check the content of the template file we discovered and any related documentation that might explain the configuration setup.


Configuration file setup is properly structured and verified

The verification reveals that:

  1. The configuration template exists at apps/sharry/data/sharry.conf.template
  2. The template contains valid configuration with proper syntax and necessary settings
  3. The Docker Compose setup correctly mounts this configuration at /opt/sharry.conf
  4. The configuration includes essential settings like database connection, authentication, and network bindings

The configuration setup follows the expected pattern and should work correctly when the template variables (like {{APP_DOMAIN}} and {{DB_PASS}}) are properly substituted during deployment.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if the configuration template exists and verify its content
if [ -f "apps/sharry/sharry.conf.template" ]; then
    echo "Template exists. Checking content..."
    cat apps/sharry/sharry.conf.template
else
    echo "Warning: sharry.conf.template not found"
fi

Length of output: 134


Script:

#!/bin/bash
# Search for any configuration related files in the sharry directory
fd . apps/sharry

# Check if there are any documentation files that might mention configuration
rg -i "configuration|config|sharry.conf" apps/sharry -A 3

Length of output: 1331


Script:

#!/bin/bash
# Check the content of the template file
cat apps/sharry/data/sharry.conf.template

# Check if there's any documentation about configuration
cat apps/sharry/metadata/description.md

Length of output: 1051

apps/sharry/docker-compose.yml Show resolved Hide resolved
apps/sharry/docker-compose.yml Show resolved Hide resolved
apps/sharry/docker-compose.yml Show resolved Hide resolved
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