Documentation


S3Konnect - AWS S3 Storage Integration Addon

Thank you so much for purchasing our item from CodeCanyon.


  • Created: 11 November, 2024
  • Updated: 02 January, 2025

If you have any questions that are beyond the scope of this help file, please feel free to email via Item Support Page.


Things You Must Have:

These are prerequisites for S3Konnect.

  • Background Queue Job must be running on Lernen for this add-on to work. See documentation here
  • Configure this queue worker to have long timeout settings. This add-on copies all storage data from local storage to AWS S3 Bucket in the background, and this process may take a few minutes to complete. You can set timeout in your /etc/supervisor/conf.d/ file as:
                
                               
                                  ...
                                  php artisan queue:work --timeoute=3600     //Adjust the timeout as needed
                                  ...
                               
                               
  • Lernen version: 2.1.2

Download & Installation

Follow these steps to install the S3Konnect add-on in your Lernen project:

  • Step 1: Download the Package

    When downloading the zip package file from CodeCanyon, you'll have all the files you need inside. The zip package contains the following files:

    • S3konnect.zip contains the S3Konnect Add-on
    • documentation.zip contains documentation for the add-on
  • Step 2: Extract the Package
    • Extract the downloaded zip file i.e. S3konnect.zip
  • Step 3: Install S3Konnect
    • Go to Admin > Manage Addons and click on Add new. Lernen Addons
    • Choose the S3konnect.zip file and click on Install. Lernen Addons
    • Alternatively, Manual Installation

      If you prefer to manually install the S3Konnect add-on, follow these steps:

      • Extract the downloaded zip file i.e. S3konnect.zip in Modules/ directory
        • After uploading you need to execute the following commands in the website root directory through CLI
          • Execute this – php artisan module:enable S3konnect

Admin Settings

  • Maintenance Mode:
  • When working with Laravel and AWS S3, you need to set up an IAM user with the appropriate permissions to interact with your S3 bucket. These permissions will depend on the specific actions your application needs to perform with the S3 bucket, such as reading, writing, or deleting files.
  • Go to Admin > Site management > Global settings > Maintenance and enable maintenance mode. Lernen Addons
  • Global Settings Overview:
    • In the S3 Bucket Setting section, you can access S3 bucket settings:
    • Access Key ID: Set the Access Key ID for your S3 bucket.
    • Secret Access Key: Set the Secret Access Key for your S3 bucket.
    • Default Region: Select the Default Region for your S3 bucket.
    • Bucket Name: Set the Bucket Name for your S3 bucket.
  • Save Changes: After adding the settings, click the Save changes button to apply the updates.
  • Reset Options: You can reset specific sections or all settings using the Reset section or Reset all buttons.
Global Settings Panel
  • Disable maintenance mode after setting S3Konnect
  • Go to Admin > Site management > Global settings > Maintenance and disable maintenance mode. Lernen Addons
  • File Migration to S3:
    • Once settings are saved, S3Konnect will automatically migrate existing files from local storage to S3.
  • Usage:
    • After configuration, your application will handle files directly with AWS S3 Bucket. You do not need to make any additional adjustments to file upload code in your application.
  • Basic Permissions for Laravel to Access S3

    • When working with Laravel and AWS S3, you need to set up an IAM user with the appropriate permissions to interact with your S3 bucket. These permissions will depend on the specific actions your application needs to perform with the S3 bucket, such as reading, writing, or deleting files.
    • Uploading, downloading, deleting, listing files settings:
      • For basic interaction with an S3 bucket (uploading, downloading, deleting, listing files), the IAM user should have a policy like this:
      •                                  
                                            ...
                                            {
                                               "Version": "2012-10-17",
                                               "Statement": [
                                                  {
                                                     "Effect": "Allow",
                                                     "Action": "s3:*",
                                                     "Resource": [
                                                     "arn:aws:s3:::your-bucket-name",
                                                     "arn:aws:s3:::your-bucket-name/*"
                                                     ]
                                                  }
                                               ]
                                               }