• HOME
    • PRODUCT
    • PRICING
    • ABOUT
    • COMMUNITY
    Menu
    • HOME
    • PRODUCT
    • PRICING
    • ABOUT
    • COMMUNITY
    Get in touch
    Get in touch
    Menu
    • HOME
    • PRODUCT
    • PRICING
    • ABOUT
    • COMMUNITY
    • Sign in
    • Start free trial
    • Get in touch
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags
    • Users
    • Groups
    • Documentation
      • Home
      • Read API
      • Write API
      • Plugin Development
    1. Home
    2. LukeLaupheimer
    • Profile
    • Following 0
    • Followers 0
    • Topics 4
    • Posts 14
    • Best 3
    • Controversial 0
    • Groups 0

    LukeLaupheimer

    @LukeLaupheimer

    3
    Reputation
    408
    Profile views
    14
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    LukeLaupheimer Unfollow Follow

    Best posts made by LukeLaupheimer

    • RE: NodeBB periodically hangs

      This is pretty hacky but it's worked beautifully so far: I wrote a Ruby script that tries to load my page. If it fails, it restarts the server. This is run in a cron job every minute. Here's my code:

      require 'net/http'
      
      begin
      	print "Downloading the page..."
      	res = Net::HTTP.start("yourdomainhere.com", :read_timeout => 5)
      	res.get('/')
      	puts " success!"
      rescue Net::ReadTimeout => e
      	print " failed.\n\nRestarting the server..."
      	`./nodebb restart`
      
      	puts " success!"
      end
      

      Until the cause of this is figured out, this or something like it might be a good enough workaround. It sure beats me manually restarting it after my users throw a fit.

      posted in Technical Support
      LukeLaupheimer
      LukeLaupheimer
    • RE: Translator ignoring entries that don't pass a parameter to it

      @julian I'll certainly give it a shot in my spare time--probably tomorrow night, during one of the usergroup meetings I attent. I'm a Rails guy for a living and I'm just kind of hacking my way through NodeJS land, and more specifically NodeBB.

      I think most of the work involved will revolve around reproducing the error, since calls to translator without a param sent along the way so plainly work all over the rest of the software. Will be doing some research!

      posted in Plugin Development
      LukeLaupheimer
      LukeLaupheimer
    • RE: NodeBB periodically hangs

      @L33t I set up a cron job so that it wouldn't be subject to the server resetting. I wanted it to be somewhat resilient in spite of its hackiness.

      That said, this is just treating a symptom. I absolutely do not advocate for this approach on a permanent basis, only until the true cause has been revealed and addressed. It's the software engineers' equivalent of filling a hole in a dam with a big wad of gum. It buys you time. It doesn't solve the real issue.

      posted in Technical Support
      LukeLaupheimer
      LukeLaupheimer

    Latest posts made by LukeLaupheimer

    • RE: Translator ignoring entries that don't pass a parameter to it

      @julian I've made a pull request that creates a test and actually addresses the underlying problem on top of it! https://github.com/NodeBB/NodeBB/pull/4796

      If there's something messed up about it feel free to tell me. Like I said, I'm new to the NodeJS world so I wouldn't be surprised if I did something incorrectly. 🙂

      TheStranjer created this issue in NodeBB/NodeBB

      closed Sanitize posts before plugin filters, not afterward #4796

      posted in Plugin Development
      LukeLaupheimer
      LukeLaupheimer
    • RE: Translator ignoring entries that don't pass a parameter to it

      @julian I'll certainly give it a shot in my spare time--probably tomorrow night, during one of the usergroup meetings I attent. I'm a Rails guy for a living and I'm just kind of hacking my way through NodeJS land, and more specifically NodeBB.

      I think most of the work involved will revolve around reproducing the error, since calls to translator without a param sent along the way so plainly work all over the rest of the software. Will be doing some research!

      posted in Plugin Development
      LukeLaupheimer
      LukeLaupheimer
    • RE: Translator ignoring entries that don't pass a parameter to it

      @julian I hacked it to work with this commit: https://github.com/LukeLaupheimer/nodebb-plugin-nwod-roller/commit/c54dbbe4182f2bc6ac6c1007e4f717827a4c7414

      But something tells me that this is not the ideal approach, like, at all. File this under things that work, but shouldn't need to be done.

      0 TheStranjer committed to LukeLaupheimer/nodebb-plugin-nwod-roller
      Hacky solution to the rendering problem
      posted in Plugin Development
      LukeLaupheimer
      LukeLaupheimer
    • RE: Translator ignoring entries that don't pass a parameter to it

      @julian Unfortunately, I do not. There are no errors showing. What I get is just the raw text of the partial: [[nwodroll:no-rerolls]].In the code, I figured surrounding the No Rerolls method in parentheses might impact it, but it didn't.

      I also tried using the translator object server-side and that worked beautifully! So there's clearly something wrong with my partials that I can't quite identify.

      posted in Plugin Development
      LukeLaupheimer
      LukeLaupheimer
    • RE: NodeBB periodically hangs

      @L33t I set up a cron job so that it wouldn't be subject to the server resetting. I wanted it to be somewhat resilient in spite of its hackiness.

      That said, this is just treating a symptom. I absolutely do not advocate for this approach on a permanent basis, only until the true cause has been revealed and addressed. It's the software engineers' equivalent of filling a hole in a dam with a big wad of gum. It buys you time. It doesn't solve the real issue.

      posted in Technical Support
      LukeLaupheimer
      LukeLaupheimer
    • Translator ignoring entries that don't pass a parameter to it

      In the template file I'm writing, I can use the internationalization function for entries that take a parameter (like %1 or %2). Example: [[nwodroll:again, {again}]] works just fine, but [[nwodroll:no_rerolls]] does not. I see examples of the latter all over the core NodeBB code, and the core NodeBB code actually works. So from that, I know I'm doing something wrong that causes this, but for the life of me I can't figure it out.

      Here's the repository: https://github.com/LukeLaupheimer/nodebb-plugin-nwod-roller

      Any ideas?

      posted in Plugin Development
      LukeLaupheimer
      LukeLaupheimer
    • RE: NodeBB periodically hangs

      This is pretty hacky but it's worked beautifully so far: I wrote a Ruby script that tries to load my page. If it fails, it restarts the server. This is run in a cron job every minute. Here's my code:

      require 'net/http'
      
      begin
      	print "Downloading the page..."
      	res = Net::HTTP.start("yourdomainhere.com", :read_timeout => 5)
      	res.get('/')
      	puts " success!"
      rescue Net::ReadTimeout => e
      	print " failed.\n\nRestarting the server..."
      	`./nodebb restart`
      
      	puts " success!"
      end
      

      Until the cause of this is figured out, this or something like it might be a good enough workaround. It sure beats me manually restarting it after my users throw a fit.

      posted in Technical Support
      LukeLaupheimer
      LukeLaupheimer
    • NodeBB periodically hangs

      NodeBB periodically hangs every few hours, requiring me to restart the server. No error messages are listed in the NodeBB log or the MongoDB log. I can't reproduce the error.

      What causes this? Is there a tool one can use to detect this and automatically restart the server?

      posted in Technical Support
      LukeLaupheimer
      LukeLaupheimer
    • Keeps crashing periodically

      Hi guys, the NodeBB installation I have keeps crashing periodically. When it does it throws this error:

      5/6 18:47 [310] - error: /sitemap/pages.xml
       undefined
      
      posted in Technical Support
      LukeLaupheimer
      LukeLaupheimer
    • RE: Hook for when chat message is sent

      @pichalite I just tried it. Unfortunately, it didn't activate when I sent a message to my test account. (I had console.log dump out whatever the first param was)

      This would've been great if it solved the problem, too.

      posted in Plugin Development
      LukeLaupheimer
      LukeLaupheimer

    Get Started

    • Product
    • Pricing

    Resources

    • Demo Site
    • Answers
    • Docs
    • Bug Bounty

    Company

    • About
    • Blog
    • Contact
    Start Free Trial
    Github Facebook Instagram Twitter
    © 2014 – 2022 NodeBB, Inc. — Made in Canada.
    • Terms
    • Privacy
    • GDPR
    • DMCA
    • Contact
    Menu
    • Terms
    • Privacy
    • GDPR
    • DMCA
    • Contact