Comments (11)
Same problem here on fresh install.
Fixed it by editing the lib/servers.js (/usr/local/lib/node_modules/log.io/lib/servers.js) and adding the following line after line 360:
app.use(express.basicAuth(config.auth.user,config.auth.pass));
It now reads with the line before and after:
staticPath = (_ref = config.staticPath) != null ? _ref : __dirname + '/../';
app.use(express.basicAuth(config.auth.user,config.auth.pass));
return app.use(express"static")
You probably want to add an if/else conditioning to whether the auth already exists.
from log.io.
Same here.
from log.io.
@d4fseeker, should the change in /usr/local/lib/node_modules/log.io/lib/server.js be wrapped in a:
if (config.auth) {
app.use(express.basicAuth(config.auth.user,config.auth.pass));
}
from log.io.
I cannot access a log.io install atm, so you'll have to check but if I remember correctly the wrapper class always exists and thus would return bool/true no matter what.
You'd have to check config.auth.user and config.auth.pass to bypass that, e.g:
if(config.auth.user != null && config.auth.pass != null)
app.use(express.basicAuth(config.auth.user,config.auth.pass));
I have to admit I'm not sure if comparing against null is sufficient since CoffeeScript has made me lazy with it's "?" operator.
from log.io.
To be perfectly equivalent with Coffeescript's "?" Operator, you'd need to check for both null and undefined.
from log.io.
This is the correct syntax:
if (config.auth && config.auth.user && config.auth.pass) {
app.use(express.basicAuth(config.auth.user,config.auth.pass));
}
from log.io.
and here is the coffee script :
staticPath = config.staticPath ? __dirname + '/../'
app.use express.basicAuth(config.auth.user, config.auth.pass) if config.auth and config.auth.user and config.auth.pass
app.use express.static staticPath
from log.io.
HI,
For me I fixed it like this (near line 360) file /usr/local/lib/node_modules/log.io/lib/server.js :
staticPath = (_ref = config.staticPath) != null ? _ref : __dirname + '/../';
// add fix start
app.use(express.basicAuth(config.auth.user, config.auth.pass))
if (config.auth && config.auth.user && config.auth.pass)
// fix end
return app.use(express"static");
And It works.
Regards,
from log.io.
Hi, I've downloaded & installed log.io today and still have no auth, my config file looks like:
exports.config = {
host: '0.0.0.0',
port: 28778,
// Enable HTTP Basic Authentication
auth: {
user: "test",
pass: "test123"
},
/*
// Enable HTTPS/SSL
ssl: {
key: '/path/to/privatekey.pem',
cert: '/path/to/certificate.pem'
},
*/
/*
// Restrict access to websocket (socket.io)
// Uses socket.io 'origins' syntax
restrictSocket: ':',
*/
/*
// Restrict access to http server (express)
restrictHTTP: [
"192.168.29.39",
"10.0.*"
]
*/
}
Any hint on why this is happening?
Thanks for your help.
from log.io.
@albertojm, i install by npm today and i have same problom.
if you check /usr/lib/node_modules/log.io/src/server.coffee
, you'll find something missing around line 180 and 181:
if @auth?
app.use express.basicAuth @auth.user, @auth.pass
it looks like code in npm is not the same in current repo...?
try add these to /usr/lib/node_modules/log.io/lib/server.js
app = express();
...
//just add these three line below
if (this.auth != null) {
app.use(express.basicAuth(this.auth.user, this.auth.pass));
}
...
if (config.restrictHTTP) {
then edit config file and run
it works for me!
from log.io.
Thanks @vansteki ! that worked for me too.
from log.io.
Related Issues (20)
- Can I use to view any system logs, but not in real time? HOT 1
- feeding daily rotated log file
- log.io on Ubuntu20 HOT 3
- Install problem on Ubuntu 18 HOT 1
- One "Source" entry per file when wildcard is used in path
- Having issues on Centos 7 HOT 1
- `~/.log.io` folder and subfolders not being created on install HOT 1
- High CPU usage with node
- Starting service shows nothing in existing log
- How to add user login to the current log.io?
- Whats happening to development? HOT 8
- When installing Log.io, it looks not to be installed
- docker logs input
- Hello
- Hello
- Is there any way to decrease cpu usage. It is taking too much load on server.
- Loggin
- Not able to install log.io HOT 1
- logs are not update with the latest version HOT 1
- File inputs don't work after server restart
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from log.io.