Cloud9使用用户名密码认证

2015-11-25

http://stackoverflow.com/questions/28822695/change-the-username-and-add-a-password-for-cloud9-in-the-beaglebone-black

运行时添加: -a user:pass

node /cloud9/server.js –listen 0.0.0.0 –port 80 -w /workspace -a user:pass

To set a default username and password:

Open the file /opt/cloud9/build/standalonebuild/configs/standalone.js.

Locate the following code block. (Should be at the top of the file)

    if (!optimist.local) {
        optimist
            .boolean("t")
            .describe("t", "Start in test mode")
            .describe("k", "Kill tmux server in test mode")
            .default("b", false)
            .describe("b", "Start the bridge server - to receive commands from the cli")
            .default("w", config.workspaceDir)
            .describe("w", "Workspace directory")
            .alias("p", "port")
            .default("port", process.env.PORT || config.port)
            .describe("port", "Port")
            .alias("d", "debug")
            .default("debug", false)
            .describe("debug", "Turn debugging on")
            .alias("l", "listen")
            .default("listen", process.env.IP || config.host)
            .describe("listen", "IP address of the server")
            .boolean("help")
            .describe("workspacetype")
            .alias("ws", "workspacetype")
            .describe("readonly", "Run in read only mode")
            .alias("ro", "readonly")
            .describe("packed", "Whether to use the packed version.")
            .boolean("packed")
            .default("packed", config.packed)
            .alias("a", "auth")
            .describe("auth", "Basic Auth username:password")
            .default("auth", ":")
            .describe("collab", "Whether to enable collab.")
            .default("collab", config.collab)
            // @lennartcl this should be moved
            .describe("lb.fileserver", "LogicBlox file server Url")
            .default("lb.fileserver", config.logicblox && config.logicblox.fileServerURL);
    }

At the line .default(“auth”, “:”), type in the username and password you’d like to use in the format of username:password, e.g. .default(“auth”, “user:pass”)

You should be all set! Try accessing 11.22.33.44:3000, and there should be a pop-up prompting for username and password.