• Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
v3.5.2 Latest
Buy Hosting

Couldn't set default admin username and password in config.json

Scheduled Pinned Locked Moved Technical Support
12 Posts 5 Posters 1.8k Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    Yangjun Wang
    wrote on last edited by Yangjun Wang
    #1

    In code src/install.js, it seems configure variables like admin:username , defaultTheme are loaded from config.json. But it seems there configure variables don't affect the setup results at all. How could I setup with a configured admin account and theme?

    {
         "url": "http://0.0.0.0:4567",
        "secret": "123456-eb70-4605-kkerg-720752bc4aca",
        "defaultTheme": "nodebb-theme-timuu",
        "setup": {
            "admin:username": "admin",
            "admin:password": "abcdefg",
            "admin:password:confirm": "abcdefg",
            "admin:email": "[email protected]"
        }
    }
    
    1 Reply Last reply
    0
  • PitaJP Offline
    PitaJP Offline
    PitaJ Global Moderator Plugin & Theme Dev
    wrote on last edited by
    #2
    $ ./nodebb setup --help
    
     Usage: setup [options] [config]
    
     Run the NodeBB setup script, or setup with an initial config
    
    
     Options:
    
      -h, --help output usage information
    

    You want to pass JSON text as the config. You can read a config file into an environmental variable and pass that as the config parameter:

    BASE_CONFIG=$(cat config.base.json)
    ./nodebb setup $BASE_CONFIG
    

    I think that's right anyways

    vinuV 1 Reply Last reply
    1
  • vinuV Offline
    vinuV Offline
    vinu
    replied to PitaJ on last edited by
    #3

    @pitaj

    I have tried using the above command, but not succeeded..

    ./nodebb setup '{"url":"http://localhost:4567","secret":" 92b094a0-f72b-45d9-9640-243de540012d","database":"mongo","port":"4567","mongo":{"host":"127.0.0.1","port":27017,"username":"","password":"","database":"nodebb","uri":"mongodb://11.2.3.75:27017"},"setup":{"admin:username":"admin_vsv","admin:password":"Password@1","admin:password:confirm":"Test@123","admin:email":"[email protected]"}}'
    2021-01-06T10:44:19.246Z [6623] - info: NodeBB Setup Triggered via Command Line
    
    Welcome to NodeBB v1.13.3!
    
    This looks like a new installation, so you'll have to answer a few questions about your environment before we can proceed.
    Press enter to accept the default setting (shown in brackets).
    2021-01-06T10:44:19.253Z [6623] - error: Invalid json in nconf.get('setup'), ignoring setup values
    2021-01-06T10:44:19.254Z [6623] - error: Required values are missing for automated setup:
    2021-01-06T10:44:19.254Z [6623] - error:   admin:username
    2021-01-06T10:44:19.254Z [6623] - error:   admin:password
    2021-01-06T10:44:19.255Z [6623] - error:   admin:password:confirm
    2021-01-06T10:44:19.255Z [6623] - error:   admin:email
    
    
    1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by
    #4

    You might have to escape the json values, see here. I remember we had to escape the json like that for travis.

    vinuV 1 Reply Last reply
    0
  • vinuV Offline
    vinuV Offline
    vinu
    replied to <baris> on last edited by
    #5

    @baris
    Thanks for your quick response.

    I tried the below command

    ./nodebb app --setup="{\\\"url\\\":\\\"http:\\/\\/localhost:4567\\\",\\\"secret\\\":\\\" 92b094a0-f72b-45d9-9640-243de540012d\\\",\\\"database\\\":\\\"mongo\\\",\\\"port\\\":\\\"4567\\\",\\\"mongo\\\":{\\\"host\\\":\\\"127.0.0.1\\\",\\\"port\\\":27017,\\\"username\\\":\\\"\\\",\\\"password\\\":\\\"\\\",\\\"database\\\":\\\"nodebb\\\",\\\"uri\\\":\\\"mongodb:\\/\\/11.2.3.75:27017\\\"},\\\"setup\\\":{\\\"admin:username\\\":\\\"admin_vsv\\\",\\\"admin:password\\\":\\\"Password@1\\\",\\\"admin:password:confirm\\\":\\\"Test@123\\\",\\\"admin:email\\\":\\\"[email protected]\\\"}}"
    2021-01-06T15:38:22.528Z [24887] - info: Launching web installer on port 4567
    2021-01-06T15:38:24.048Z [24887] - info: Web installer listening on http://0.0.0.0:4567
    

    I got stuck at web installer. We have to manually feed the information again in web page http://0.0.0.0:4567

    But our requirement is we should able to setup through jenkins command shell.

    @PitaJ @julian

    PitaJP 1 Reply Last reply
    0
  • PitaJP Offline
    PitaJP Offline
    PitaJ Global Moderator Plugin & Theme Dev
    replied to vinu on last edited by
    #6

    @vinu you want node app --setup, not ./nodebb app --setup

    vinuV 1 Reply Last reply
    0
  • vinuV Offline
    vinuV Offline
    vinu
    replied to PitaJ on last edited by vinu
    #7

    @pitaj I am getting

    vinu@tilap330-vinu:~/Projects/nodebb$ node app --setup="{\\\"url\\\":\\\"http:\\/\\/localhost:4567\\\",\\\"secret\\\":\\\" 92b094a0-f72b-45d9-9640-243de540012d\\\",\\\"database\\\":\\\"mongo\\\",\\\"port\\\":\\\"4567\\\",\\\"mongo\\\":{\\\"host\\\":\\\"127.0.0.1\\\",\\\"port\\\":27017,\\\"username\\\":\\\"\\\",\\\"password\\\":\\\"\\\",\\\"database\\\":\\\"nodebb\\\",\\\"uri\\\":\\\"mongodb:\\/\\/11.2.3.75:27017\\\"},\\\"setup\\\":{\\\"admin:username\\\":\\\"admin_vsv\\\",\\\"admin:password\\\":\\\"Password@1\\\",\\\"admin:password:confirm\\\":\\\"Test@123\\\",\\\"admin:email\\\":\\\"[email protected]\\\"}}"
    2021-01-06T16:45:09.311Z [undefined/31941] - info: NodeBB v1.13.3 Copyright (C) 2013-2021 NodeBB Inc.
    2021-01-06T16:45:09.312Z [undefined/31941] - info: This program comes with ABSOLUTELY NO WARRANTY.
    2021-01-06T16:45:09.313Z [undefined/31941] - info: This is free software, and you are welcome to redistribute it under certain conditions.
    2021-01-06T16:45:09.313Z [undefined/31941] - info: 
    2021-01-06T16:45:09.646Z [31941] - info: NodeBB Setup Triggered via Command Line
    
    Welcome to NodeBB v1.13.3!
    
    This looks like a new installation, so you'll have to answer a few questions about your environment before we can proceed.
    Press enter to accept the default setting (shown in brackets).
    2021-01-06T16:45:09.650Z [31941] - error: Invalid json in nconf.get('setup'), ignoring setup values
    URL used to access this NodeBB (http://localhost:4567) (node:31941) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
    (Use `node --trace-warnings ...` to show where the warning was created)
    
    
    1 Reply Last reply
    0
  • PitaJP Offline
    PitaJP Offline
    PitaJ Global Moderator Plugin & Theme Dev
    wrote on last edited by
    #8

    It says pretty clearly that the json you provided is invalid. I don't know what to tell you.

    vinuV 1 Reply Last reply
    0
  • vinuV Offline
    vinuV Offline
    vinu
    replied to PitaJ on last edited by
    #9

    @pitaj Not sure what is the valid JSON to be added here.

    As per @baris comment as commented above, I started using json by escaping.

    I am using below JSON. Please correct me how can we use the below JSON in setup command

    {
        "url": "http://0.0.0.0:4567",
        "secret": "123456-eb70-4605-kkerg-720752bc4aca",
        "setup": {
            "admin:username": "adminvsv",
            "admin:password": "Password@123",
            "admin:password:confirm": "Password@123",
            "admin:email": "[email protected]"
        },
        "database": "mongo",
        "mongo": {
            "host": "127.0.0.1",
            "port": "27017",
            "username": "",
            "password": "",
            "database": "nodebb"
        }
    }
    
    1 Reply Last reply
    0
  • PitaJP Offline
    PitaJP Offline
    PitaJ Global Moderator Plugin & Theme Dev
    wrote on last edited by PitaJ
    #10

    I think it's because you're escaping the forward-slashes. To make it easier, you can do this in your browser console to output what should go in the shell command:

    JSON.stringify(<obj>).replace(/"/g, '\\"')
    

    Let me know if that works for you

    1 Reply Last reply
    0
  • venkATV Offline
    venkATV Offline
    venkAT
    wrote on last edited by
    #11

    @PitaJ @vinu
    I am using the above command what you mention in the post for nodebb setup

    node app --setup="{\"url\":\"http://0.0.0.0:4567\",\"secret\":\"123456-eb70-4605-kkerg-720752bc4aca\",\"admin:username\":\"venkat\",\"admin:password\":\"Test@123\",\"admin:password:confirm\":\"Test@123\",\"admin:email\":\"[email protected]\",\"database\":\"mongo\",\"mongo\":{\"host\":\"127.0.0.1\",\"port\":\"27017\",\"username\":\"\",\"password\":\"\",\"database\":\"nodebb\"}}"
    

    but I am unable perform login what ever the login details adding in the json string. It is always giving invalid credentials.
    can you help me on that

    PitaJP 1 Reply Last reply
    0
  • PitaJP Offline
    PitaJP Offline
    PitaJ Global Moderator Plugin & Theme Dev
    replied to venkAT on last edited by
    #12

    @venkat what was the output of that command? NodeBB starts up fine?

    1 Reply Last reply
    0

Copyright © 2023 NodeBB | Contributors
  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development