Disabled registration and now there is no login page...


  • Over the weekend we have had about 300 or so bots register on our forum. I deleted them all today and decided to disable to registration page until I can figure out how to stop them.

    I have also disabled local user login to see if that would give me the correct IP address on the users profile account.

    I logged out to test it and now I have no login form and I am unable to log back in.

    Any help?


  • I think I solved this with ./nodebb reset settings, but, you'll need to redo any settings you changed.

    Not sure if there's another way. Can't remember.


  • Thanks, I'll try it out soon.


  • Luckily I was still signed in on my phone. Managed to turn local login back on and i can sign in now.

    Can someone explain to me what exactly the local login is?


  • @Scuzz said:

    Can someone explain to me what exactly the local login is?

    Local login is the user/password authentication mechanism NodeBB uses by default. Disabling it removes the ability to login unless you have a plugin installed that provides an alternate method of authentication (i.e. logging in with your Google or GitHub account).


  • @Xiph Thanks, the local login name is kinda confusing. I'll remember to not disable that again.


  • I installed nodebb and it seems like there's no admin or even login page, registering for new accounts is only temporary because there are no threads/boards. I'm not sure if this is a bug or a bad repo. I was going for an openshift installation from the instructions in the docs, seemed fine up until I realized it never mentioned creating an admin user, which I guess is supposed to happen. Although it sounds like the local login is disabled by default because none of the logins I made can log back in? Odd.

    If someone knows the right way of doing an openshift install / how to add admin users from openshift that'd be great.


  • @UnknownGeek To settle anything you're not sure on, sounds like it could be an issue with master of NodeBB and openshift. Creating an admin is done at the setup part. Local login is not disabled by default. It seems like a database issue, but I've never used Openshift, so I can't be sure.

    Can you try port 8000, someone reported that's the only port websockets work on. Also try the auth in the config, found in this post


  • I just went with the docs using redis, I'll try using mongodb next. Not sure that websockets would be the issue normally the bindings go from port 80 to backend 8080 It seemed more like the scripts weren't set up to create an admin anyway. I went through the repo and walked myself through the javascript, didn't look like there was anything that had to do with creating an admin account if it was missing. Though I can't say I know nodebb at the core level.

    I do know that nodejs would have websockets and http enabled on that port though:
    https://github.com/openshift/origin-server/blob/master/cartridges/openshift-origin-cartridge-nodejs/metadata/manifest.yml

  • Gamers Admin

    Admin creation happens here.


  • Straight to the heart of the issue, though looking at it now I'm not sure why that wasn't part of the prompts I got, looks like it would've had to have double checked to make sure an admin exists. Maybe when using the redis database there's already an admin user? After I typed the redis password the script ended, and it definitely saved the config.json, I had to crack it open to copy over the password because I got it wrong. Seemed like after a restart nodebb was up and running.

  • Gamers Admin

    If you have access to the redis instance you can flush and start over.

    redis-cli
    select <db number>
    flushdb
    

    Then start over with the setup.

    Alternative you can check if there is an admin group and it has members by.

    redis-cli
    smembers group:administrators:members
    

  • If I don't get a mongodb instance running properly I'll try doing a redis install again. If it seems to be a repeat problem I'll see if emptying the database doesn't help, may be a good idea to add to the docs just in case though.


  • @UnknownGeek said:

    If I don't get a mongodb instance running properly I'll try doing a redis install again. If it seems to be a repeat problem I'll see if emptying the database doesn't help, may be a good idea to add to the docs just in case though.

    Docs could do with a lick of paint. Certain things aren't included, docs are quite developer focussed at the minute. 😆


  • Tried going about connecting to redis, yet to figure out how. It just seems odd that the logins I made were definitely kept (after clearing my cache they still show up). (Nodebb has access but I don't?) I also read in other parts of the forums that the first user logged in is supposed to be made an admin with access to the /admin route, but that didn't seem to the case when I did a fresh install. The only thing I can imagine is that there's an admin user already preconfigured in the database and it skips some parts of some important nodebb configuration.


  • Had issue with my install and redis flush definitely helped (warning: I did the flushall since I didn't have anything else using it). This allowed me to go back and do the setup again which then generated the admin user to login and configure the settings.


  • How'd you connect to redis? I found I kept getting warnings that I couldn't be connected.


  • @UnknownGeek said:

    How'd you connect to redis? I found I kept getting warnings that I couldn't be connected.

    What version of Redis are you running? Sorry, don't know the command on openshift. 😆


  • @a_5mith said:

    What version of Redis are you running? Sorry, don't know the command on openshift. 😆

    https://github.com/smarterclayton/openshift-redis-cart/tree/master/versions/2.6/bin

    Figured it out, combining the redis-cli command with the $REDIS_CLI environment variable, I'll see if doing a flush all doesn't help. Feeling a little silly I didn't notice...they did that on purpose.

    redis-cli $REDIS_CLI


  • Got it running, admin was created, as were discussion threads (looks good so far), but the login page is still missing, or I think it shouldn't be, it looks like it's trying to output the login form but instead it's spitting out:
    [object Object]

    Registration still works, which I find odd.

Suggested Topics

| |