Anahita Project

The #Anahita #project management group. Visit https://github.com/anahitasocial for more information about Anahita code and how to get started.

Stories

Rastin Mehr

Rastin Mehr commented on the topic

Revising Anahita's S3 Storage Plugin

Starting a topic on the S3 storage plugin to document the upgrades that appear to be required.  I'll use the topic itself to post relevant background and then post questions I have at the moment as...

Read More

Starting a topic on the S3 storage plugin to document the upgrades that appear to be required.  I'll use the topic itself to post relevant background and then post questions I have at the moment as comments on the topic.

Here is an AWS source document I've found describing recent changes:

https://docs.aws.amazon.com/general/latest/gr/sigv4_changes.html

Key points:

Previous method was referred to as Signature Version 2, the new method is referred to as Signature Version 4.

The original s3lib.php file includes a link in the header comments that is no longer functional.  In researching an updated version of the file, I've found two sources on GitHub:

https://github.com/racklin/amazon-s3-php-class

and

https://github.com/tpyo/amazon-s3-php-class

According to an article I found on Medium, the fork maintained by Rack Lin is preferable:

https://medium.com/@martindrapeau/simple-php-code-to-push-files-to-aws-s3-3396f9b3d02a

So I'm using the Rack Lin fork as the starting point for the updates.  Copying down the library file ('S3.php') I found a few extra spaces which once deleted helps focus strictly on what's changed by running a diff against Anahita's 's3lib.php' file.

What's new - variables:

  • $region
  • $progressFunction
  • $signVer

What's new - functions:

  • setRegion()
  • getRegion()
  • setSignatureVersion()
  • setProgressFunction()
  • __getSignatureV4()

What changed - functions:

  • __construct() now includes $region
  • putBucket() now calls getRegion()
  • inputFile() now includes sha256sum encoding
  • putObject() now includes sha256sum encoding
  • __getCloudFrontDistributionConfigXML() now checks that $trustedSigners is not empty
  • getResponse() now checks $signVer for 'v2' versus 'v4'
  • getResponse() now includes the $progressFunction

Anahita's PlgStorageS3 class:

A little intro on Anahita's PlgStorageS3 class, then the questions to follow...

So Anahita's PlgStorageS3 class appears to need revisions in order to account for the signature version and region.  It seems these should be parameters that can be assigned in the Plugin's settings through additions to the s3.json file, with the signature version as a drop-down selector, and the region a text field with the default value of 'us-east-1'.

The "core" functions in PlgStorageS3 (_read, _write, _exists, and _delete) appear they should be compatible with the Rack Lin replacement for the s3lib.php file.

Protected variables would need to be added for $_region and $_signature, and it appears the __construct function would need to be amended to account for both.

Read Less
Create the S3 object in the plugin's __construct method because at that point; all the parameters are initialized previously in the _initialize method. When you are passing parameters to the s3lib object, they need to... Read More
Create the S3 object in the plugin's __construct method because at that point; all the parameters are initialized previously in the _initialize method. When you are passing parameters to the s3lib object, they need to be in the correct order as the s3lib's __construct method.

Yes, the other methods in this plugin pass the required values to the S3 object or return a value received from the s3 object. This plugin is an adaptor to make the S3 library work with Anahita.

Did I answer your questions? Read Less
yes the order of the passed parameters is important. If you are passing all of them, just pass 's3.amazonaws.com' for the endpoint. That should happen in the _initialize method where you are adding default values.
Unknown Person liked this
Rastin Mehr

Rastin Mehr commented on the topic

Revising Anahita's S3 Storage Plugin

Starting a topic on the S3 storage plugin to document the upgrades that appear to be required.  I'll use the topic itself to post relevant background and then post questions I have at the moment as...

Read More

Starting a topic on the S3 storage plugin to document the upgrades that appear to be required.  I'll use the topic itself to post relevant background and then post questions I have at the moment as comments on the topic.

Here is an AWS source document I've found describing recent changes:

https://docs.aws.amazon.com/general/latest/gr/sigv4_changes.html

Key points:

Previous method was referred to as Signature Version 2, the new method is referred to as Signature Version 4.

The original s3lib.php file includes a link in the header comments that is no longer functional.  In researching an updated version of the file, I've found two sources on GitHub:

https://github.com/racklin/amazon-s3-php-class

and

https://github.com/tpyo/amazon-s3-php-class

According to an article I found on Medium, the fork maintained by Rack Lin is preferable:

https://medium.com/@martindrapeau/simple-php-code-to-push-files-to-aws-s3-3396f9b3d02a

So I'm using the Rack Lin fork as the starting point for the updates.  Copying down the library file ('S3.php') I found a few extra spaces which once deleted helps focus strictly on what's changed by running a diff against Anahita's 's3lib.php' file.

What's new - variables:

  • $region
  • $progressFunction
  • $signVer

What's new - functions:

  • setRegion()
  • getRegion()
  • setSignatureVersion()
  • setProgressFunction()
  • __getSignatureV4()

What changed - functions:

  • __construct() now includes $region
  • putBucket() now calls getRegion()
  • inputFile() now includes sha256sum encoding
  • putObject() now includes sha256sum encoding
  • __getCloudFrontDistributionConfigXML() now checks that $trustedSigners is not empty
  • getResponse() now checks $signVer for 'v2' versus 'v4'
  • getResponse() now includes the $progressFunction

Anahita's PlgStorageS3 class:

A little intro on Anahita's PlgStorageS3 class, then the questions to follow...

So Anahita's PlgStorageS3 class appears to need revisions in order to account for the signature version and region.  It seems these should be parameters that can be assigned in the Plugin's settings through additions to the s3.json file, with the signature version as a drop-down selector, and the region a text field with the default value of 'us-east-1'.

The "core" functions in PlgStorageS3 (_read, _write, _exists, and _delete) appear they should be compatible with the Rack Lin replacement for the s3lib.php file.

Protected variables would need to be added for $_region and $_signature, and it appears the __construct function would need to be amended to account for both.

Read Less
I think the code you have written in __construct need to move to _initialize method. __construct only receives the custom configurations, if there are any. In the _initialize you'll check to see if there are any custo... Read More
I think the code you have written in __construct need to move to _initialize method. __construct only receives the custom configurations, if there are any. In the _initialize you'll check to see if there are any custom values passed in the $config object, otherwise use the ones provided by the plugin parameters or default hardcoded values. Read Less
Ok, I was wrong. I checked the order of execution. The _initialize gets called first, so you need to set the $config default values in the _initialize method. Then the constructor is called, in __construct if a $confi... Read More
Ok, I was wrong. I checked the order of execution. The _initialize gets called first, so you need to set the $config default values in the _initialize method. Then the constructor is called, in __construct if a $config object is passed to the function, then use it. Perhaps it is even more comfortable if you merge it, so the fields that contain a value overwrite the default values. Otherwise, use the default values that you set in the _initialize function. Read Less
Rastin Mehr

Rastin Mehr commented on the topic

Revising Anahita's S3 Storage Plugin

Starting a topic on the S3 storage plugin to document the upgrades that appear to be required.  I'll use the topic itself to post relevant background and then post questions I have at the moment as...

Read More

Starting a topic on the S3 storage plugin to document the upgrades that appear to be required.  I'll use the topic itself to post relevant background and then post questions I have at the moment as comments on the topic.

Here is an AWS source document I've found describing recent changes:

https://docs.aws.amazon.com/general/latest/gr/sigv4_changes.html

Key points:

Previous method was referred to as Signature Version 2, the new method is referred to as Signature Version 4.

The original s3lib.php file includes a link in the header comments that is no longer functional.  In researching an updated version of the file, I've found two sources on GitHub:

https://github.com/racklin/amazon-s3-php-class

and

https://github.com/tpyo/amazon-s3-php-class

According to an article I found on Medium, the fork maintained by Rack Lin is preferable:

https://medium.com/@martindrapeau/simple-php-code-to-push-files-to-aws-s3-3396f9b3d02a

So I'm using the Rack Lin fork as the starting point for the updates.  Copying down the library file ('S3.php') I found a few extra spaces which once deleted helps focus strictly on what's changed by running a diff against Anahita's 's3lib.php' file.

What's new - variables:

  • $region
  • $progressFunction
  • $signVer

What's new - functions:

  • setRegion()
  • getRegion()
  • setSignatureVersion()
  • setProgressFunction()
  • __getSignatureV4()

What changed - functions:

  • __construct() now includes $region
  • putBucket() now calls getRegion()
  • inputFile() now includes sha256sum encoding
  • putObject() now includes sha256sum encoding
  • __getCloudFrontDistributionConfigXML() now checks that $trustedSigners is not empty
  • getResponse() now checks $signVer for 'v2' versus 'v4'
  • getResponse() now includes the $progressFunction

Anahita's PlgStorageS3 class:

A little intro on Anahita's PlgStorageS3 class, then the questions to follow...

So Anahita's PlgStorageS3 class appears to need revisions in order to account for the signature version and region.  It seems these should be parameters that can be assigned in the Plugin's settings through additions to the s3.json file, with the signature version as a drop-down selector, and the region a text field with the default value of 'us-east-1'.

The "core" functions in PlgStorageS3 (_read, _write, _exists, and _delete) appear they should be compatible with the Rack Lin replacement for the s3lib.php file.

Protected variables would need to be added for $_region and $_signature, and it appears the __construct function would need to be amended to account for both.

Read Less
Rastin Mehr liked this
I wanted to let you know how much I appreciate this!
Unknown Person liked this
Rastin Mehr

Rastin Mehr shared a photo

Added react-player which supports platforms such as youtube, vimeo, soundcloud, twitch, and dailymotion. #Anahita #Hackathon #Players #ReactJS #MaterialUI #ReactPlayer
Rastin Mehr

Rastin Mehr shared a note

Going to try the react player library this weekend for Anahita. I think it would be a more suitable option than plyr.io https://www.npmjs.com/package/react-player #Anahita #Hackathon #ReactJS #Pla... Read More
Going to try the react player library this weekend for Anahita. I think it would be a more suitable option than plyr.io https://www.npmjs.com/package/react-player #Anahita #Hackathon #ReactJS #Players Read Less
Rastin Mehr

Rastin Mehr shared a photo

Content Filters for Hashtags, Mentions, and URLs

Today we added content filters for hashtags, mentions, and URLs. Quite likely we won't be using plyr.io for the anahita-react app, because it is processing heavy and throwing way too many errors. We are going to try the react-player library instead which has support for youtube, vimeo, soundcloud, and facebook videos. It seems to be less processing intensive too. We'll see about that. #Anahita #Hackathon #ContentFilters
Rastin Mehr

Rastin Mehr shared a photo

Anahita Locations - Browse View, now with addresses #ReactJS #MaterialUI
Rastin Mehr

Rastin Mehr shared a photo

Anahita Locations Read View

Locations Read View. This was quite simple and there was already a React component for rendering the map. #ReactJS #MaterialUI
Rastin Mehr

Rastin Mehr shared a photo

Anahita Locations Browse

Locations Browse view. This was surprisingly easy using the new HOC approach
Rastin Mehr

Rastin Mehr shared new photos

Rastin Mehr

Rastin Mehr shared a photo

An example of Hashtag view in Anahita React app

This is the first iteration of Hashtag Read view with the list of taggables. We also made improvements to the API and how the taggables JSON being constructed. The new changes will be in the next release of Anahita. #Anahita #Hackathon #Tags #Taggables
Rastin Mehr

Rastin Mehr shared a note

While implementing the tags in the React app I noticed that Anahita doesn't yet have an API to obtain the taggables, so I got down to implementing the taggables API which will be available in the n... Read More
While implementing the tags in the React app I noticed that Anahita doesn't yet have an API to obtain the taggables, so I got down to implementing the taggables API which will be available in the next release of Anahita. Taggables are nodes that are related to a tag such as a hashtag or a location. #Anahita #Hackathon Read Less
Rastin Mehr

Rastin Mehr commented on the photo

Comments in a stream

I think the UI elements are a bit bulky. That can be refined later, but the data state management and workflows are working nicely.
Rastin Mehr

Rastin Mehr shared a photo

Comments in a stream

Implementing comments was a bit challenging and yet quite fun. This is the first iteration of comments with inline editing and actions. #Anahita #ReactJS #ReduxJS #MaterialUI #Comments
Rastin Mehr

Rastin Mehr shared a photo

Allowing comments on a stream came as a design pattern challenge at first, but the 5th idea worked well which was constructing a two level comment state tree where comments are grouped by parent ids. Now this approach is working too well which means whenever a comment is added all the stories on the stream with the same set of comments get updated. That means we need to make changes to the query that fetches and reorders the list of stories. #Anahita #Comments #DesignPatterns #ReactJS #ReduxJS #MaterialUI
Rajkumar Mundel

Rajkumar Mundel and Rastin Mehr commented on the topic

Any Specific date for the release of 1st version of Anahita-ReactJS

Any specific date for the release of 1st version of Anahita-ReactJS ?

Thank you :)

Sure :)
You are doing brilliant work :). Cheers :)
Rastin Mehr liked this
Rastin Mehr
Rastin Mehr
April 12 2019 Permalink
Thank you!
Rajkumar Mundel

Rajkumar Mundel and Rastin Mehr commented on the topic

Any Specific date for the release of 1st version of Anahita-ReactJS

Any specific date for the release of 1st version of Anahita-ReactJS ?

Thank you :)

:) Thank you for quick reply :). Yes I am eagerly waiting for Anahita React to use on Anahita on my phone as a web app :)

This part is still not started - "back-end code to APIs only" ??

Thank you :)
Rastin Mehr liked this
Rastin Mehr
Rastin Mehr
April 11 2019 Permalink
Likewise here. We aren’t reducing the back-end to APIs until the React App is stable and in good shape to replace the current UI.
Rajkumar Mundel liked this
Rastin Mehr

Rastin Mehr commented on the topic

Any Specific date for the release of 1st version of Anahita-ReactJS

Any specific date for the release of 1st version of Anahita-ReactJS ?

Thank you :)

Rastin Mehr liked this
Rastin Mehr
Rastin Mehr
April 08 2019 Permalink
I wish I could tell, but we are solving a lot of design patterns for the first time and it's hard to come up with an estimate. Social networks are as complex as they get when it gets to applications, they can be quite... Read More
I wish I could tell, but we are solving a lot of design patterns for the first time and it's hard to come up with an estimate. Social networks are as complex as they get when it gets to applications, they can be quite elegant too. We are already using the Anahita React as a reference for a lot of our internal projects. We're going to keep building until it is ready. Quite likely as a new template for Anahita until it is stable enough, then we'll proceed with reducing the back-end code to APIs only. That's going to be fun! Read Less
Rajkumar Mundel

Rajkumar Mundel started a topic

Any Specific date for the release of 1st version of Anahita-ReactJS

Any specific date for the release of 1st version of Anahita-ReactJS ?

Thank you :)

Rastin Mehr liked this
Rastin Mehr

Rastin Mehr shared a photo

Spruced up media cards and added actions #Anahita #Hackathon #ReactJS #MaterialUI
Rajkumar Mundel liked this

Photos View All

Articles View All

Topics View All

To-dos View All

Powered by Anahita