
Make Private Forum
-
function loggedIn(req, res, next) { if(req.user && parseInt(req.user.uid, 10)) { return next(); } var allowed = ['config', 'get_templates_listing', '403', 'login', 'register']; if(req.params && allowed.indexOf(req.params.route) !== -1) { return next(); } res.status('403'); res.redirect('/403'); } app.all('/api/:route/*?', loggedIn); app.all('/api/:route', loggedIn);
Looks like you don't need the last route. With the above code and the
return ajaxify('register');
in templates.js it redirects to register for me. Let me know if it doesn't work. -
It doesn't work for me. I put that block of code indented after the line:
app.namespace(nconf.get('relative_path'), function () {
I think this might be another caching issue, but it keeps forgetting who I am and I keep having to call
flushall
on the database and doingnode app --setup
again to be able to log in and test it. -
This post is deleted! -
I'm not sure why you are getting that permission error. @julian might have a better idea.
-
Okay, I figured out the Redis thing. The permissions for dump.rdb were fine. But I had to expand the permissions for the directory they were in (/redis).
Still having the same problem with the app though. The redirect to /register isn't working and I'm getting the white screen minus the nav bar instead of getting routed to /403 or /register.
-
There's no reason why the dumpfile should be owned by
root:wheel
. Try shutting down redis, deletingdump.rdb
, and starting redis again withsudo service redis-server start
.You should not need root to use
redis-cli
. -
What does the chrome inspector say when you are redirected to
/register
? -
I never get redirected to /register.
Okay, thanks for the suggestion. I'll give it a try. -
In response to:
sudo service redis-server start
I get:
sudo: service: command not found
Plus, that doesn't give me a way to specify my redis.conf file, right?
-
@aaron It depends on how you installed redis. You'd use
service
if it was installed viaapt-get
, usually. -
I'm on a mac so I think I used Brew to install Redis. What was starting it that way going to accomplish? Do you know another way? Thanks!
-
Ah, when it comes to Macs, I probably know less than you do...!
-
Thanks @baris. Do you know what this warning signifies?
warn: [init] Cache buster not set
-
Sorry to necro a thread, but was this ever realized?
-
@Tanner Yupp.
Go into category permissions and tick Find Category for guests, but leave everything else unticked, then tick everything for registered and admins and any custom groups you created, they'll see the category on the home screen, but need to log in before they can read, see here: http://35hz.co.uk
Click A-Z of production.
-
@a_5mith said:
@Tanner Yupp.
Go into category permissions and tick Find Category for guests, but leave everything else unticked, then tick everything for registered and admins and any custom groups you created, they'll see the category on the home screen, but need to log in before they can read, see here: http://35hz.co.uk
Click A-Z of production.
I was hoping for more of a one-click "Make Forum Private" solution but that answers my question, thanks