Jump to content

Steve Grant_189967

Clients
  • Posts

    19
  • Joined

  • Last visited

Reputation Activity

  1. Thanks
    Steve Grant_189967 got a reaction from konon in Limit JS script loading to specific usergroups   
    One feature of my site is that there is limited free access to anybody who wishes to have it, but for unlimited access there is an annual subscription payable. For the "free" users (including guests), the tradeoff is that they are served adverts. I would like to ensure that the JavaScript file(s) that are loaded for the adverts are not even in the output HTML code for paid subscribers.
    For example:
    {{some template code to say "if user is not in Administrators, Moderators or Paid Subscribers groups, output this line"}} <script type="text/javascript" src="/some/path/to.js"></script> {{endif}} How would I achieve this?
  2. Like
    Steve Grant_189967 got a reaction from SeNioR- in Limit JS script loading to specific usergroups   
    Gotcha, thanks 🤦‍♂️
    {{if !\IPS\Member::loggedIn()->inGroup(array(4,6,7))}} <script type="text/javascript" src="script.js"></script> {{endif}} Now working 😎
  3. Agree
    Steve Grant_189967 reacted to AlexWebsites in Word Filter - Rebuild Posts/Content   
    It would be great if there was a feature to rebuild posts after a word filter(s) was added. I know there are some plugins/apps to achieve this but something built in sounds like a no brainer for a complete word filter solution.

    Also, is there a template to use a word filter xml file? Or is this created when you have these on one site and then download?

  4. Like
    Steve Grant_189967 got a reaction from PurplePixel in Allow Conversion process to take place via CLI   
    Given the length of time taken for a relatively mature forum on a different provider (e.g. vBulletin) to convert to Invision - a forum I run with around 2.5 million posts has taken two and a half days, for example - would it not be prudent to offer the conversion process as a CLI command? This would allow the server the site is to be hosted on to be utilised to its maximum in terms of memory usage, and would also prevent the need for the site admin to have a browser tab open on the conversion process for the entirety of the operation.
    It's not practical for popular sites to need to go down for days in order to convert and hopefully improve the experience for its users - anything that can be done to speed up the conversion process should be embraced.
  5. Like
    Steve Grant_189967 got a reaction from sobrenome in Multiple servers behind load balancer   
    It's written in Node.js 12.x
    exports.handler = __f0; function __f1(__0, __1, __2, __3) { return (function() { with({ }) { return function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; } }).apply(undefined, undefined).apply(this, arguments); } function __getTaskUrl(__0) { return (function() { with({ __awaiter: __f1, axios_1: require("axios/index.js"), getTaskUrl: __getTaskUrl }) { return function /*getTaskUrl*/(url) { return __awaiter(this, void 0, void 0, function* () { try { const response = yield axios_1.default.get(url); console.log(response); } catch (error) { console.error(error); throw (error); } }); }; } }).apply(undefined, undefined).apply(this, arguments); } function __f0(__0) { return (function() { with({ __awaiter: __f1, getTaskUrl: __getTaskUrl, url: "https://###SITE_URL###/applications/core/interface/task/web.php?key=680cb24a3d18c05c1d5d35e169cb9a4a" }) { return (event) => __awaiter(void 0, void 0, void 0, function* () { console.log('getting url'); yield getTaskUrl(url); console.log('exiting...'); }); } }).apply(undefined, undefined).apply(this, arguments); } I should also add that I've since reverted back to using cron. While if you're running multiple instances there is a risk of encountering a race condition with the cron running on multiple servers simultaneously, I've found that my site currently hasn't needed to use the autoscaling capability - generally getting average CPU usage of about 20%. My bottleneck is the database, the schema is baffling, to be honest - using InnoDB as it's best for relational tables and yet using denormalised tables 🤔
  6. Thanks
    Steve Grant_189967 got a reaction from sobrenome in Multiple servers behind load balancer   
    Good question - just checked, and it looks like it's always free, up to 1m requests and 3.2m seconds of compute time per month, which is obviously more than enough. 👍
  7. Like
    Steve Grant_189967 got a reaction from sobrenome in Multiple servers behind load balancer   
    Nothing - it's Free Tier eligible. As an example for when that year has elapsed, last month I was billed for 16,000 GB-Seconds (the free tier limit is 400,000), and made 7,718 requests, as I set it to only run every 5 minutes rather than every minute, which seems wholly unnecessary.
  8. Like
    Steve Grant_189967 got a reaction from sobrenome in Multiple servers behind load balancer   
    The workaround I found for that - as it is possible that you'll end up with race conditions if the cron did execute simultaneously on multiple instances - was to use the Web Service option and wrote a Lambda function to make the request every minute.
  9. Like
    Steve Grant_189967 got a reaction from sobrenome in Multiple servers behind load balancer   
    Hi everyone,
    Just wondering if anybody has any experience or potential "DO NOT DO THIS UNDER ANY CIRCUMSTANCES" warnings with using an auto-scaling network of identical web servers to host Invision, so a load balancer directing traffic to one or more servers behind it, with the number of servers changing depending on the traffic volume? I'll be using AWS but I guess the same would be feasible on other cloud platforms. I think I'd put the codebase on a volume that would be shared and mounted on all of the servers, with assets served from S3/CloudFront.
    Any suggestions or ideas welcome!
  10. Like
    Steve Grant_189967 got a reaction from CoffeeCake in Allow Conversion process to take place via CLI   
    Given the length of time taken for a relatively mature forum on a different provider (e.g. vBulletin) to convert to Invision - a forum I run with around 2.5 million posts has taken two and a half days, for example - would it not be prudent to offer the conversion process as a CLI command? This would allow the server the site is to be hosted on to be utilised to its maximum in terms of memory usage, and would also prevent the need for the site admin to have a browser tab open on the conversion process for the entirety of the operation.
    It's not practical for popular sites to need to go down for days in order to convert and hopefully improve the experience for its users - anything that can be done to speed up the conversion process should be embraced.
×
×
  • Create New...