Jump to content

Marquinhos

Clients
  • Posts

    62
  • Joined

  • Last visited

 Content Type 

Downloads

Release Notes

IPS4 Guides

IPS4 Developer Documentation

Invision Community Blog

Development Blog

Deprecation Tracker

Providers Directory

Forums

Events

Store

Gallery

Posts posted by Marquinhos

  1. Check out the Amazon.php file  I realized that if bucket name is "." (dot?) it should use the path style, but really doesnt make any sence to have a url https://s3.amazon.com/./path/ as base url, it should be https://s3.amazon.com/bucket/path   instead 

     

    <?php 
    //system/File/Amazon.php
    //...
    /**
         * Build up the base Amazon URL
         * @param   array   $configuration  Configuration data
         * @return string
         */
        public static function buildBaseUrl( $configuration )
        {
            if ( mb_strstr( $configuration['bucket'], '.' ) )
            {
                return (
                \IPS\Request::i()->isSecure() ? "https" : "http" ) . "://"
                . ( isset( $configuration['endpoint'] ) ? $configuration['endpoint'] : "s3.amazonaws.com" )
                . "/{$configuration['bucket']}"
                . static::bucketPath( $configuration )
                . '/';
            }
            else
            {
                return (
                \IPS\Request::i()->isSecure() ? "https" : "http" ) . "://{$configuration['bucket']}."
                . ( isset( $configuration['endpoint'] ) ? $configuration['endpoint'] : "s3.amazonaws.com" )
                . static::bucketPath( $configuration )
                . '/';
            }
        }

    As result to use dot as bucket name it will be return a 403 (probably due wrong signature)

     

    Could contain: Text, File, Menu, Webpage

  2. We recently decided to opt for an s3 compatible on-premise solution, namely https://min.io/.

    We would like to use a subdomain of our own domain to identify the storage, but the implementation made in IPS generates something like https://bucketname.file.example.com , which we were unable to do by using the free version of cloudflare.

    The alternative is to use the bucket as the path name, as supported by the official amazon SDK (see the javascript snippet below).

    const AWS = require('aws-sdk');
    const fs = require('fs');
    
    const s3 = new AWS.S3({
       endpoint: 'https://files.example.com',    //alternative compatible s3 software
        accessKeyId: 'foo',
        secretAccessKey: 'boo',
        s3ForcePathStyle: true,
    });
    
    const bucket = 'attachments';
    s3.createBucket({ Bucket: bucket }, err => {
        if (err) {
            return console.log('err createBucket', err);
        }
    });
    const time = new Date().getTime();
      fs.readFile('index.js', (err, data) => {
         if (err) throw err;
         const params = {
             Bucket: bucket, // pass your bucket name
             Key: 'tests/'+time+'.js', // file will be saved as attachment/bucket/time.js
             Body: JSON.stringify(data, null, 2)
         };
         s3.upload(params, function(s3Err, data) {
             if (s3Err) throw s3Err
             console.log(`File uploaded successfully at ${data.Location}`)
    		 
    
    		s3.getObject({Bucket: bucket, Key: 'tests/'+time+'.js'}, function(err, data)
    		{
    			console.error(err);
    			 console.log(data);
    		});
    
         });
      });

    We tested it with a custom url but it didn't work, apparently it only modifies the download url and not the bucket upload url.


    I appreciate if anyone can help with this issue.

  3. The issue started at November 29, no changes were made, I have no idea how it started.

    We turned off all customization and also used a default invision theme (create a new from easy mode)

     

    image.png.cdde7278bf688aaca6e5a517db45f747.png

     

    Error: Call to a member function snippet() on null in /srv/www/forum/public/cache/template_2_1bb0e8f6d56f81d6c7163246c7be5ae2_forums.php:3324 Stack trace: 
    #0 /srv/www/forum/public/system/Theme/SandboxedTemplate.php(61): IPS\Theme\Cache\class_forums_front_forums->questionRow() 
    #1 /srv/www/forum/public/cache/template_2_1bb0e8f6d56f81d6c7163246c7be5ae2_forums.php(1458): IPS\Theme\_SandboxedTemplate->__call() 
    #2 /srv/www/forum/public/system/Theme/SandboxedTemplate.php(61): IPS\Theme\Cache\class_forums_front_forums->forumTable() 
    #3 /srv/www/forum/public/system/Helpers/Table/Table.php(564): IPS\Theme\_SandboxedTemplate->__call() 
    #4 /srv/www/forum/public/applications/forums/modules/front/forums/forums.php(413): IPS\Helpers\Table\_Table->__toString() 
    #5 /srv/www/forum/public/applications/forums/modules/front/forums/forums.php(38): IPS\forums\modules\front\forums\_forums->_forum() 
    #6 /srv/www/forum/public/system/Dispatcher/Controller.php(101): IPS\forums\modules\front\forums\_forums->manage() 
    #7 /srv/www/forum/public/system/Dispatcher/Dispatcher.php(153): IPS\Dispatcher\_Controller->execute() 
    #8 /srv/www/forum/public/index.php(13): IPS\_Dispatcher->run() 
    #9 {main}
    1. [Template forums/front/forums/questionRow is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]]

     

     

  4. Hello,

     

    I made some changes on default invision theme, and it was not able to upgrade to 4.6 properly, I tried to restore but doesn't worked, them I deleted it 🙂 (yes, I know)

     

    But I don't find anywere the default (this blue and white one) to download.

     

     

    I appreciate if someone can share with me the default and clear theme of invision .

  5. On 5/16/2019 at 6:53 AM, Matt said:

    Sales figures mean nothing sadly. There's little point investing a lot of energy into a system that does not work on one of the top two phone platforms.

    I think we're on Web 5.0 by now.

    I would agree, other than push notifications which require an app for iOS.

    Take a look at https://firebase.google.com/ its provide a full solution for native/apps/web in one place, and the best Cloud Messaging (FCM) is no-cost and it can be handled by php with a simple http 1.1 API:

    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://fcm.googleapis.com/fcm/send');
    $request->setMethod(HTTP_METH_POST);
    
    $request->setHeaders(array(
        'content-type' => 'application/json',
      'authorization' => 'key=<CONFIG_SERVER_KEY>'
    ));
    
    $body = [
        "to" => "<user-firebase-token>",
        "time_to_live" => 259200,
        "data" => [ //Some custom stuff
        	"update"=> true, //you can tell the service worker to self update
        	"actions"=> [["action"=> "ok", "title"=> "OK"],["action"=>"link", "title"=>"Acces","link"=>"https://forum.com"]],  //Send somo actions to compose buttons
        	"actionsUrl"=> {"link"=>"https://google.com"}, //and ask to open another url
        ],
         "notification": [
               "body" => "Fancy Notification",
               "title" =>"Small Tittle",
               "image"=> "https://cdn.forum.com/monthly_2020_09/log.png.c10d6f024b155b08ab5f46d029749b42.png", //think on send topic first image
               "click_action"=> "https://invisioncommunity.com/forums/topic/451842-why-not-offer-push-notifications-solution/" //
           ],
          "fcm_options"=> [
           	 "analytics_label"=> "forum-push"
           ]
       ];
    $request->setBody(json_encode($body));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }

    At front-end with service worker (supported by all modern browsers) 

    // If you would like to customize notifications that are received in the
    // background (Web app is closed or not in browser focus) then you should
    // implement this optional method.
    messaging.onBackgroundMessage(function(payload) {
      console.log('[firebase-messaging-sw.js] Received background message ', payload);
         // Customize notification here
          const {notification} = payload;
          const {data} = payload;
          data.click_action = notification.click_action;	  
    	  const {title} = notification;
    	  const notificationOptions = {
    		  requireInteraction: true, //Some default options
    		  data: data,
    		  ...notification
    		  };
    	
    	  console.log(notificationOptions);
    	  //Show notification
    	  return self.registration.showNotification(title,
    		notificationOptions);
    });

     

    More details: https://github.com/firebase/quickstart-js/tree/master/messaging


    All you need to do is handle the token from firebase to user, and then in the service queue send notifications to user when needed.

    When the user has the focus on the web page you can handle the notifications in the UI.

     

    It will work on all top users and technologies.

     

     

     

  6. On 7/29/2019 at 11:35 AM, Marquinhos said:

     

    We disabled the background task, and the current tasks still "stucked", its around 6500 tasks there, there is a way to clean it?

    image.thumb.png.aa088e37f06ce927e874ab21cdccea67.png

    After update sommeting is conflicting with the latest version of font awesome, before update from version 1.x it was working.

    Before:

    image.png.d08cb3897feba4028f583acab275eaa9.png

    After:

    image.png.38ebf6daec22a2c661a8f1778d17eff4.png

     

    image.png.55a14415b38d1d8fdb931f782ea2cd1b.png

    Only image icons are working.

     

     

    Any help?

    If possible add the support to FA v5,  In the previusly version it was working, the last update mess with something 

     

  7. On 7/14/2019 at 3:48 AM, Fosters said:

    Yes, I would remove the background task!

     

    A members trophies will be then only awarded when somebody visits this members profile or when the member logs in, which saves a lot resources.

     

    We disabled the background task, and the current tasks still "stucked", its around 6500 tasks there, there is a way to clean it?

     

    After update sommeting is conflicting with the latest version of font awesome, before update from version 1.x it was working.

     

    image.png.38ebf6daec22a2c661a8f1778d17eff4.png

     

    image.png.55a14415b38d1d8fdb931f782ea2cd1b.png

    Only image icons are working.

     

     

×
×
  • Create New...