Jump to content

The Old Man

Clients
  • Posts

    3,958
  • Joined

  • Last visited

  • Days Won

    11

 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 The Old Man

  1. After double-checking this regex found I needed to change this:

    <DirectoryMatch "^/home/(.*)/public_html$">
    AllowOverride AuthConfig
    </DirectoryMatch> 

    to:

    <DirectoryMatch "^\/home\/(.*)\/public_html$">
    AllowOverride AuthConfig
    </DirectoryMatch>

    in order to get a valid regex match on my hosts public_htmls, but after restarting Apache the AdminCP warning still shows the server doesn't support Authentication headers.

  2. Hi @Marc Stridgen

    Sure, I just did a quick test with and without the plug-in and it made no difference. I think its just that there are no images for those forums anymore, at least according to the source code in the dev tools.

    TEST 1 Firefox DuckDuckGo Extension Disabled:

    Could contain: Electronics, Mobile Phone, Phone, Text

    Some images not showing

    Could contain: File, Webpage, Electronics, Mobile Phone, Phone, Person

     

    TEST 2 Firefox DuckDuckGo Extension Enabled:

    Could contain: Page, Text, Advertisement, Poster

    Still some images not loading

    Could contain: File, Webpage, Person, Computer Hardware, Electronics, Hardware

     

    Advanced Development forum image is in the source code and is a jpg, but Marketplace for example seems to have no image set, I think that's the reason:

    Could contain: Page, Text

     

    Pretty similar in Chrome with the DuckDuckGo extension enabled too:

    Could contain: File, Page, Text

     

  3. Thanks for the suggestion. I’ve modified it to:

    Quote

    <DirectoryMatch "^/home/(.*)/public_html$">
    AllowOverride AuthConfig
    </DirectoryMatch>

    to match all users public_html directories but the warning message about authentication headers in IPS AdminCP API Key settings hasn’t gone away.

    Also modified:


       SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$0

    to 

    SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

    Using an API key via URL query works okay on the core hello endpoint, but no luck using a header instead, I still get:

    REQUEST DATA

    []

    RESPONSE

    { "errorCode": "3S290\/9", "errorMessage": "INVALID_ACCESS_TOKEN" }

  4. Thanks I’ll have another go. (Sorry the code button isn’t showing in this forum on tablet, only quote).

    re errors, I get:

    Quote

    RESPONSE

    { "errorCode": "3S290\/9", "errorMessage": "INVALID_ACCESS_TOKEN" }

    and

    {
      "error": "invalid_client"
    }

    I’m just trying connecting with API Tester app on my iPad which seems really good with lots of examples to get you going. It also supports both REST and GraphQL, so I figured I would try to create an oAuth for it rather than simple API URL key as I’ve done in past for connecting via Wordpress. I tried to use the oAuth page options that don't prompt a login screen because I want to eventually run the code as a script both within IPS and externally.

    If I go to the IPS API key page, I see the message:

    Quote

    Your server does not support authentication headers. As you will need to pass the API key in the URL, we recommend you set up IP address restriction.

    However I know my server does as far as Wordpress’ health check tool is concerned.

    I’ve tried everything to get authentication headers works for IPS. I’ve tried the various suggestions found online about adding CGIAuthPass to htaccess, allowing Authconfig to be used via AllowOveride in htaccess via adding this to post_virtualhost_global.conf 

    Quote

     

    <Directory "\/public_html\/">
    AllowOverride AuthConfig
    </Directory>

    <IfModule mod_headers.c>
    Header merge Access-Control-Allow-Headers *,Authorization
    Header merge Access-Control-Expose-Headers *,Authorization
    Header set Access-Control-Allow-Credentials true
    Header set Access-Control-Allow-Methods "GET,POST,PUT,HEAD,OPTIONS"
    </IfModule>

    <IfModule mod_headers.c>
      <IfModule mod_setenvif>
       SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$0   
      </IfModule>
    </IfModule>

     

    but so far IPS always reports that message so I thought oAuth would be better. 

    I realise that selfhosted server config is beyond support’s realm, but I just want to make sure I’m at least trying with the correct oAuth settings, given there are so many and the help docs don’t say which options to configure for use with the API and GraphQL.

  5. When creating an oAuth there is a bewildering array of options which change depending on which previous options you have checked. Once I have tried a few times to connect and tweak the settings on the client side, IPS blocks me but there is no reset option in the AdminCP.

    Please can you confirm which settings and options I need to generate an oAuth to be able to connect externally to access the GraphQL and REST API features?

     

  6. After upgrading to 4.7.8 earlier, I’ve found that the moderator drop down list doesn’t work properly when in the new grid layout mode. The list of actions displays, but selecting any of the does nothing. Works fine in the traditional table layout though.

    Could contain: File, Page, Text, Webpage
     

    (Tested using default IPS and custom themes but only using iPad with iPadOS 16.3.1 Safari).

     

    Also, the grid layout doesn’t show in /files/categories/ view, but this may be by design.

     

  7. 3 hours ago, Jim M said:

    Unfortunately, there is not a way for this to happen in the core software. Please feel free to submit a Feature Suggestion for further evaluation in a future release.

    Thank you, apparently it’s been a long awaited request. 
     

    2 hours ago, Adriano Faria said:

    There’s a plugin to accomplish this: 

    Not perfect but better than the current layout. 

    Thanks for the option.

  8. I missed this topic, but completely agree after being advised it’s not possible to achieve this in the Downloads app.

    It’s pretty silly to be honest if clients have waited such a long time for this basic functionality that is present in other areas of IPS and configured this way for the Marketplace here.

    Honestly what’s the point of having a totally empty parent category that misleads users into missing the content inside the subcategories.

  9. 17 hours ago, virap1 said:
    $api_url = 'https://your-forum-url.com/api/rest/';

    The endpoint might not be correct, I used /api/core/hello for example but we were on 4.3 back then.

    // Test Connection to IPS REST API and display response
    		function invTest_ipsHelloTest_shortcode (){
    
    	// Authorize the requests by sending the API key as the key parameter in the request. Locked down to server by IP in IPS.
    		
    		$communityUrl = 'https://example.com/mycommunity';
    		
    		$apiKey = 'hfquhgfhwuhguwhruggqwrhghwrhg blah';
    
          $endpoint = '/api/core/hello';
          
    	// NB To avoid "PHP Warning:  parse_url() expects parameter 1 to be string, array given", the request needs to be a concatenated string not an array! GS
    
          $request = $communityUrl . $endpoint . "?key=". $apiKey;
    
    	// GET the remote request headers and body
    		$response = wp_remote_get( $request );
    
    	// GET just the remote response body
    		$response_body = wp_remote_retrieve_body( $response );
    
    	// GET the remote response code and message
    		$http_code = wp_remote_retrieve_response_code( $response );
    		$http_message = wp_remote_retrieve_response_message( $response );
    
    
    	// Check for error
    		if ( is_wp_error( $response ) ) {
    		return sprintf( 'Oops. The URL %1s could not be retrieved.', $request );
    	}
    	
    	// return something if not an error
    		if ( ! is_wp_error( $response )  ) {
    
    
    	// Uncomment to debug and show headers and body
    
    	return $results = '<pre>' . print_r($response, true) . '</pre>';
    
    	// Uncomment to debug and show just the body!
    
    	// return $results = '<pre>' . print_r($response_body, true) . '</pre>';
    
    	// Uncomment to debug and show the status code e.g. int(200)
    	// return $http_code.'&nbsp;'.$http_message;
    
    	}
    
    }

     

  10. 17 hours ago, virap1 said:

    So tried to see if I can use the Rest api to get the blog records and move them to the database, but I am getting "401 Unauthorized" error saying

    "errorCode": "3S290\/9",

    "errorMessage": "INVALID_ACCESS_TOKEN"

    If you get your key working, you may not need this but I had a similar difficulty and found that it was easier to Authorize the requests by sending the API key as the key parameter in the request, a key locked down to the server by IP in IPS.

    Also to avoid "PHP Warning:  parse_url() expects parameter 1 to be string, array given", the request needs to be a concatenated string, not an array.

    $request = $communityUrl . $endpoint . "?key=". $apiKey;

     

  11. I've been trying for some while now to do this and was hoping Adriano had a plugin to do it!

    My members have not used Blogs for several years, but of the 30 or so blogs with 400 comments, I really wanted to preserve a few from members who have passed away or where they were behind-the-scenes-style community project blogs.

    I've had mixed results with RSS, as some RSS feeds don't include the formatting and of course, you lose the associated comments, tags and reactions. I didn't try REST API for this but I did use that to convert from IPS Gallery to WordPress Gallery which worked fine for my needs.

    I've just started getting familiar with GraphQL which seems useful.

    I know it's a one-time conversion to move Blogs to Pages, but Adriano if you have an existing solution that would be a big time saver.

×
×
  • Create New...