Documentation

AWS S3 Integration for Perfex CRM

If you have any questions beyond the scope of this help file, feel free to email us at support@maniss.dev.


How it works

Watch this video to understand how the module works.


Installation

Follow the steps below to set up the module:

  1. Unzip the downloaded file from CodeCanyon. You'll get aws_integration.zip and the documentation folder.
  2. Go to your Perfex admin and navigate to Setup > Modules.
  3. Upload aws_integration.zip and click Install.
  4. If everything is correct, you should see the module name, description, and two buttons: Activate & Uninstall.
  5. Click Activate, and that's pretty much it.

Credentials

Before using the module, you need to obtain AWS Credentials. Please follow the instructions carefully; otherwise, the module won't function properly.

  • Go to the AWS IAM Console.
  • Create User Group

    1. On the left sidebar, click User Groups, then click Create group.
    2. Specify a name for the group and scroll down to Attach permissions policies.
    3. Search for S3FullAccess and select it.
    4. Select S3FullAccess
    5. Click Create user group.

    Create User

    1. On the left sidebar, click Users, then click Create user.
    2. Specify a name for the user and click Next.
    3. Select Add user to group and choose the group created in the previous step.
    4. Select user group
    5. Click Next and then click Create user.
    6. Go back to Users and click on the user you created.
    7. In Summary, locate Access key 1 and click Create access key.
    8. Select Third-party service, check I understand the above, and click Next.
    9. Select third-party service
    10. Skip the description field and click Create access key.
    11. Copy the Access keys by clicking the copy icon, and save them somewhere safe. Click Show to view the Secret access key.
    12. Retrieve access keys

    Note: You must copy the access keys at this step; otherwise, there will be no other way to retrieve them. Ensure you save them in a secure place, as Amazon AWS will not display the secret access key again.


    Create S3 Bucket

    1. Go to the AWS S3 Console.
    2. Click Create bucket.
    3. Specify a unique name for the bucket.
    4. Create bucket
    5. Scroll to Block Public Access, uncheck Block all public access, and check I acknowledge.
    6. Public access
    7. Ignore the remaining settings and click Create bucket.
    8. Click on the bucket name you created and locate Permissions.
    9. Scroll to Bucket policy and click Edit.
    10. Paste the following code into the policy, replace bucketnamehere with your bucket name, and click Save changes.
    11. 
      {
        "Version": "2012-10-17",
        "Id": "Policy1692807538499",
        "Statement": [
          {
            "Sid": "Stmt1692807537432",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:*",
            "Resource": "arn:aws:s3:::bucketnamehere"
          }
        ]
      }
                      
      Bucket policy
    12. Scroll to Access control list (ACL) and click Edit.
    13. Note: If you can't click Edit, click bucket owner enforced, select ACLs enabled, check I acknowledge, and then click Save changes.

      bucket owner enforced ACL enabled
    14. Return to Access control list (ACL) and click Edit again.
    15. Find Everyone (public access) and select List and Read. Check I understand and click Save changes.
    16. Public access list and read
    17. Finally, scroll to Cross-origin resource sharing (CORS) and click Edit.
    18. Paste the following code and click Save changes.
    19. 
      [
        {
          "AllowedHeaders": [],
          "AllowedMethods": [
            "GET",
            "PUT",
            "POST",
            "DELETE"
          ],
          "AllowedOrigins": [
            "*"
          ]
        }
      ]
                      
      CORS

    Module Settings

    Now for the easy part: adding the credentials to the module settings in Perfex CRM.

    1. Go to Setup > AWS S3 Integration.
    2. Enable AWS S3 Integration.
      Add the Access key ID and Secret Access key from the previous steps.
      Add the Default Region (where you created your bucket). In this example, I used us-east-1.
      Finally, add the S3 Bucket Name.
    3. Click Save, and that's it. You can test the module by uploading a file, for example, to Project Files.
    4. Module settings

    Use Other S3-Compatible Storage

    The AWS S3 module now supports other S3-compatible storage platforms, such as Wasabi or Minio, without requiring code modifications. Simply go to the settings, add the endpoint, enable "Use Path Style Endpoint," and you're all set.

    Use Other S3-Compatible Storage

    Custom Hooks

    Custom hooks is a new functionality that allows you to extend Perfex. We use them in the AWS S3 module to support new features such as Project Discussion Comment Attachments and to enhance file deletion from S3.

    Note: To properly set up the custom hooks, your hosting server must have file write permissions enabled.

    Once you install the module, the custom hooks will be set up automatically.

    However, if you update Perfex to a new version or modify the core files, the module may not function properly because the custom hooks will be removed.

    If this happens, an announcement will appear in the admin panel, informing you to set up the hooks before using the AWS S3 module. Simply click "Setup Hooks," and the hooks will be re-added.

    Custom hook announcement

    Features

    • Uploading files to AWS S3
    • Downloading files from AWS S3
    • Deleting files from AWS S3

    Supported areas:

    • All areas are now supported in version 1.1

    Support

    If you have any questions, issues, or suggestions, please contact us at: support@maniss.dev


    Changelog

    Version 1.1 (25 December, 2024)

    Added: Support for using other S3-compatible storage platforms.
    Added: Ability to attach files to project discussion comments.
    Added: Ability to attach files to project file comments.
    Added: Image preview functionality in customer files.
    Added: Custom hooks for extending functionality and enhancing file deletion processes.
    Improved: File deletion workflow for S3 storage.
    Fixed: Issues with downloading expenses and other files.

    Version 1.0 (27 August, 2024)

    Initial Release