This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
3496
Features / Re: New revs - Public comments
« on May 3rd, 2012, 08:12 PM »
If it's not used for anything other than receiving those results, get rid of it because we don't need it.
As far as multiplying small files goes, it's a tricky one. Certainly for such things it would be faster to have the small files for specific actions rather than big files containing everything (because that all still has to be loaded and parsed even if not run).
In hindsight it was one of the things I didn't like about SimpleDesk in the end was putting all the AJAX stuff into a single file, when all the AJAX code was all called for every action even if only part of it was ever used. There is a part of me that would prefer to break things down where there's no commonality to code (if they don't have any shared code, split 'em up) but I can see the argument about fewer files too.
One thing I would say at this juncture is that I would quite like to split Aeva-Gallery up a bit. Loading all that code for every single action=media item (including items, previews, albums, etc.) is heavy.Quote I've been working with ~50 tabs lately where I've been trying to piece together stuff on Node.js etc. but 700 tabs is insane!Quote Pretty much, yes.
As far as multiplying small files goes, it's a tricky one. Certainly for such things it would be faster to have the small files for specific actions rather than big files containing everything (because that all still has to be loaded and parsed even if not run).
In hindsight it was one of the things I didn't like about SimpleDesk in the end was putting all the AJAX stuff into a single file, when all the AJAX code was all called for every action even if only part of it was ever used. There is a part of me that would prefer to break things down where there's no commonality to code (if they don't have any shared code, split 'em up) but I can see the argument about fewer files too.
One thing I would say at this juncture is that I would quite like to split Aeva-Gallery up a bit. Loading all that code for every single action=media item (including items, previews, albums, etc.) is heavy.
Same here. I have the sidebar enabled in Opera, with my list of tabs, because with 736 tabs (as of now...), it's definitely impossible to use the horizontal tab bar for switching between tabs.
Before we forget -- when we add UI for choosing blog types, it should act as a 'template' like in the custom fields, i.e. it'll automatically set up other things in the page but users will be free to change them... I suppose that's how you envisioned it, too?
3497
Bug reports / Re: Minor bug with drafts and entities
« on May 3rd, 2012, 02:08 PM »
It's done onsubmit normally, so it's not like we couldn't pull the content into a variable, modify that in-place and then submit that content via the draft saving mechanism.
But there's also that debate over whether we actually want entities to be converted or not (as we mentioned elsewhere recently)
But there's also that debate over whether we actually want entities to be converted or not (as we mentioned elsewhere recently)
3498
Bug reports / Re: Minor bug with drafts and entities
« on May 3rd, 2012, 12:54 PM »
Does it do it if you save the draft manually? Maybe it doesn't call weSaveEntities at all, I can't remember.
3499
Off-topic / Re: Bitcointalk.org $11k bounty for new forum software
« on May 3rd, 2012, 12:53 PM »The main problem is insecure SMF 0day due to it's mess of an architecture.Bitcointalk is the first forum to see SMF 0day
And really you're just quoting that statement. Not explaining what the problem is. In any case, I think you've failed to grasp the meaning of the word 'fork' as in 'has the same base'. Wedge is rather different from SMF but it still has a lot of the same base in it.
3500
Archived fixes / Re: Logging password errors
« on May 2nd, 2012, 09:39 PM »
Choosing types to log is an interesting idea though I don't think I'd offer all types of error; I don't think I'd offer to hide plugin errors for example.
What I would be more inclined to do is figure out better ways to handle some of these; 404s need a proper option, sure, but password errors can be handled more gracefully, perhaps by logging the number of failures in the user's account and only notify the admin when a certain number of failures is hit (and then reset that on successful login and once the warning has been issued)
What I would be more inclined to do is figure out better ways to handle some of these; 404s need a proper option, sure, but password errors can be handled more gracefully, perhaps by logging the number of failures in the user's account and only notify the admin when a certain number of failures is hit (and then reset that on successful login and once the warning has been issued)
3501
Archived fixes / Re: Logging password errors
« on May 2nd, 2012, 07:51 PM »
I can't remember if likes was permission based or not, don't think it is though :/
Regarding errors, there's an interesting situation attached. After the third attempt, the session will notice and ask instead for username or email to remind you, so in theory bruteforcing is supposed to cap at 3 though it's possible to bypass that under certain circumstances... is a bit complicated.
I agree in principle that we can cut back on the 'password' errors (note that they have their own category now, heh) but not sure how best to do it.
Regarding errors, there's an interesting situation attached. After the third attempt, the session will notice and ask instead for username or email to remind you, so in theory bruteforcing is supposed to cap at 3 though it's possible to bypass that under certain circumstances... is a bit complicated.
I agree in principle that we can cut back on the 'password' errors (note that they have their own category now, heh) but not sure how best to do it.
3502
Off-topic / Re: Bitcointalk.org $11k bounty for new forum software
« on May 2nd, 2012, 05:07 PM »I am sure once you get down to the business side things will change. I suspect some sneakiness here, especially since it is a one post user. I think it is just someone who wants their hands on your source before you release it, intentions unknown though.
They didn't come to a developer network to post a job, they came to a place where a forum software is known to be in the making.
Worst case scenario they can release the pre-release you sell them as their own.
I'm not seeing any indication that they're enthusiastic about seeing/selling software but they want something tailored to them, and I don't think they're going to get it without paying for customisations, no platform offers all of that out of the box.
SMF only support OpenID 1. SMF in no way supports OpendID 2 standards and currently I see no hurry in fixing the problem at SMF.
Except we won't "pre-release" Wedge to anyone but our consultants and, later, our friends...
If they're willing to wait until Wedge alpha is out, then good for them. If they want to give us money to finish implementing what they need, good for them too
3503
Archived fixes / Re: Long cache keys make the cache fail.
« on May 2nd, 2012, 01:51 PM »
We salt the hash by using the username as part of the hash itself meaning that the rainbow table will have to be regenerated for every username. Though the multi-iteration hashing will also slow down generation of the rainbow tables too. Salting is a given regardless of how the hash was done ;)
Nao, what you've got there seems workable; all the embed URLs are embedded as [url=blah]blah[/url] IIRC, so you should be fine with that.
Nao, what you've got there seems workable; all the embed URLs are embedded as [url=blah]blah[/url] IIRC, so you should be fine with that.
3504
Off-topic / Re: So, busy out here in RL
« on May 2nd, 2012, 01:48 PM »
I'm not really using it for LESS particularly.
OK, the reason I'm using it instead of PHP is because what I'm trying to do cannot be done in Apache/PHP or nginx/PHP without capping the number of users to a fraction of what I can do with Node.js.
Here's the thing, the nature of what I'm building relies on holding connections open; no point polling the server every few seconds unless there's something to receive. So I have two choices, I can either poll the server every few seconds (which is a load generator in itself) or I can have long life connections (think Websockets or Comet long-polling)
The problem with long life connections done with PHP is that each connection opens a PHP interpreter instance. That means I can scale to maybe 100 connections (which doesn't even mean 100 users) before I run out of memory on a 1GB RAM VPS. I did experiment with using nginx with the HTTP Push module but the authentication method doesn't really work there because you end up holding connections without any real ability to authenticate (because in the nginx/PHP scenario, you're using PHP-FPM, there's no way I could find to receive the connection, authenticate, then disconnect from PHP-FPM until there's something to actually send along that authenticated channel)
WIth Node.js however I can open many many connections to idle cheaply and only do work on them when there is work to do, and that includes authentication when the connection comes in.
OK, the reason I'm using it instead of PHP is because what I'm trying to do cannot be done in Apache/PHP or nginx/PHP without capping the number of users to a fraction of what I can do with Node.js.
Here's the thing, the nature of what I'm building relies on holding connections open; no point polling the server every few seconds unless there's something to receive. So I have two choices, I can either poll the server every few seconds (which is a load generator in itself) or I can have long life connections (think Websockets or Comet long-polling)
The problem with long life connections done with PHP is that each connection opens a PHP interpreter instance. That means I can scale to maybe 100 connections (which doesn't even mean 100 users) before I run out of memory on a 1GB RAM VPS. I did experiment with using nginx with the HTTP Push module but the authentication method doesn't really work there because you end up holding connections without any real ability to authenticate (because in the nginx/PHP scenario, you're using PHP-FPM, there's no way I could find to receive the connection, authenticate, then disconnect from PHP-FPM until there's something to actually send along that authenticated channel)
WIth Node.js however I can open many many connections to idle cheaply and only do work on them when there is work to do, and that includes authentication when the connection comes in.
3505
Bug reports / Re: Pretty URL remarks
« on May 2nd, 2012, 01:41 PM »
Actually, the former (file access). The alternative to allowing file uploads is to push it all into the DB and call for it as necessary, pushing it out to the cache folder to make it faster. But if that includes executable code, you're still making executable code writable by the webserver owner which makes it vulnerable to abuse from outside. (Cache files are less of a risk because they're purged periodically)
3506
Off-topic / Re: Bitcointalk.org $11k bounty for new forum software
« on May 2nd, 2012, 01:39 PM »
Well, I think he's smoking something but in the meantime let's analyse the comments.Quote Not really possible. Every complex change will cause trouble in whatever you do.Quote I firmly agree on the no AGPL part. That licence is even worse than GPL.Quote That assumes, of course, that everything else is going to be reworked for PostgreSQL. SMF and Wedge's structure will still require massive overhauls.
It also depends on what you call an 'abstraction layer'. What SMF has is an abstraction layer. What Wedge has is less of an abstraction layer but still by definition an abstraction layer.Quote Well, SMF 2.0 and Wedge do this.Quote I'd argue that SMF and Wedge's general structure is generally secure. But I won't argue with the premise that the way input handling is done is somewhat insecure.Quote As I've said before I'm not entirely convinced that multi-iteration hashing is entirely necessary, especially as it weakens entropy. But the password upgrading is easy to do in SMF/Wedge.Quote That lets out running a portal mod, then, heh. But neither SMF nor Wedge allow this.Quote Marking things read will be interesting then as will a few other trivialities.Quote I guess that's why he hasn't updated to SMF 2.0.Quote I can agree with this, actually. I've never been much of a fan of certain admin interfaces.Quote A lot of that is straight permissions. The rest is mostly general housekeeping that is not a significant amount of work.Quote Easy enough group configuration.Quote That won't work well whatever you're doing.Quote SMF already has internal handling for this, however it will have to be improved for what they're after.Quote The email handling is a lot more complex than what SMF normally asks for though it is certainly possible to do. To me, though, it implies that there is a risk attached to that software, in keeping with why I steer well clear of Bitcoins generally. (I mean, what good is a currency you can generate by burning CPU cycles and little more and that it's easier to steal than a conventional bank account is to break.)Quote Well, SMF 2.0 has that.
...bah, too bored to read any more. Lots of talk about forum specific tweaks that are probably not as effective as he thinks they will be. I won't disagree that the way SMF and Wedge handle GET/POST data is not ideal but I'm not yet sure what I want to do that's better.
The software must be written in PHP or C++, as these are the only two languages I am very familiar with. The code must be extremely easy to modify. I want to be able to make even complex changes in behavior without much trouble.
The software can be under any license as long as I have complete access to the code forever, I can modify the code, and I will not be required to publish private modifications I make to the code (no AGPL). It can be based on paid software if the cost of the license is reflected in your price.
It would be fine for you to sell your software after you make it for this forum.
PostgreSQL is greatly preferred. Queries should be well-optimized. Do not use a database abstraction layer.
It also depends on what you call an 'abstraction layer'. What SMF has is an abstraction layer. What Wedge has is less of an abstraction layer but still by definition an abstraction layer.
Database queries should wherever possible be done using prepared statements, something like pg_query_params, or some other method that doesn't require the programmer to manually escape things inline.
Security is very important. Your code should have a "generally secure architecture": it should be very difficult for a programmer to mistakenly introduce security flaws.
Use salted multi-iteration hashing for passwords using one of the SHA-2 algorithms. Passwords in the existing SHA-1 format need to be automatically upgraded once the user logs in again.
No user group should be able to run arbitrary PHP code.
All actions must be done by POSTing the server. GET requests must not have side-effects.
The default theme should be minimalistic like the current theme. Nothing that looks "web 2.0": no speech bubbles, no significant space between posts, no significant hover effects, and few rounded corners.
Admin settings that are not changed very often can be made changeable from files instead of from a web interface, though changing the settings from the files should be easy. The web interface must not allow admins to add/edit UIs, execute arbitrary code/SQL, or tamper with logging.
- Admins, with all powers. Only group capable of seeing IP addresses. It must be possible for admins to make certain groups, certain posts, and certain topics immune to certain types of moderation.
- Global mods, capable of doing everything with posts and posters.
- Local mods, capable of doing everything with posts and posters in their sections. Posters banned by a local mod are only banned in the sections that the local mod has jurisdiction over.
- Jr. mods, who can only moderate posters that are not established.
- Established posters: all posters who have met some easily-configurable criteria. To start with, the criteria will be 8 weighted hours online (see below for info on weighted stats).
- Categorizers: Can move all topics
- Whitelisted: immune from proxy bans, and maybe other restrictions later
- VIP donator: capable of accessing the donator section, able to change his name, and able to assign himself a custom title
- Donator+: capable of accessing the donator section and able to change his name
- Donator: capable of accessing the donator section
- Scammer: Unable to delete or modify his own profile or messages. Has his posts and PMs marked specially.
These user groups will be hidden and not listed in a user's profile or next to his posts:
- Local mods (when outside of their sections)
- Jr. Mods
- Established posters
- Categorizers
- Whitelisted
- Donator
In addition to the pips ("stars") that most forums have, small image and text "badges" associated with some membergroups should be possible.
Certain groups (including some poster ranks) imply "whitelisted".
There needs to be "weighted time online" and "weighted post count" in addition to the raw values. It should not be possible for a user to increase one of the weighted values by too much without increasing the other value. If you post 200 posts in 1 hour, your weighted post count should be 1. If you post 1 post in 200 hours, your weighted time online should 6 hours. These numbers should be configurable and should apply retroactively when changed (where possible).
Time online should not increase if you're simply refreshing a page, and it should increase more slowly if you seem to be a bot.
All actions that write to the database should have at least one associated configurable limit. Like "can post x topics per y seconds". There should also be a limit that prevents users from posting too soon after being stopped by another limit. It should also be easily possible for admins to ban certain regex expressions in posts, titles, and usernames (separate ban lists) from the web interface.
The limits may be modified based on membergroup. The actual limits may be relaxed, and the result of exceeding the limit may also change. Exceeding limits can do nothing, reject the action ("you may not post this topic because you just posted one 5 minutes ago!"), or automatically ban the user.
When a guest tries to post a reply, he will be asked for the necessary account creation info (username and password) on the same page where he can enter his reply.
Email addresses will not be required on registration. However, the board will not send email to the user until an email address is provided and verified.
A user's very first post must not be a new topic.
It should be possible to use OpenID authentication instead of a password. The main login method should not be OpenID, though. Maybe entering an OpenID URL into the username or password field will trigger OpenID authentication.
OpenID URLs should not be used as real usernames.
...bah, too bored to read any more. Lots of talk about forum specific tweaks that are probably not as effective as he thinks they will be. I won't disagree that the way SMF and Wedge handle GET/POST data is not ideal but I'm not yet sure what I want to do that's better.
3507
Archived fixes / Re: Long cache keys make the cache fail.
« on May 2nd, 2012, 12:53 AM »This cache thing isn't as simple as it looks, long keys pass the file name character limit.
The problem with using a cache table is that it's not efficient (especially as in an ideal world even something like $modSettings as was would be properly cached, which it isn't right now)
Also note that in the proper end of caching where you're using memcached or similar, there are longer (if any) limits applied to the key names, so this is really a matter just for the file cache to contend with.
3508
Off-topic / So, busy out here in RL
« on May 2nd, 2012, 12:50 AM »
I thought I'd share some of my frustrations with you all.
I won't get into the detail of it but the last few days I've been snowed under - as I mentioned briefly - in building an app using Node.js, Express, Socket.io and MongoDB. I'm not going to explain what the app is, hopefully you'll see soon enough, but it's certainly been an interesting experience for me so far, and I feel like sharing what I've found.
First up, for those of who aren't familiar with Node.js, let me explain. We here are far more used to deploying apps where we have a web server like Apache, which receives requests, passes some of them onto PHP to process the contents of the page, and handles the page until it's ready and sends it back to the user.
It's convenient, practical and we're all used to it, but the app I've been working on lately requires longlife connections, what we would normally consider to be Comet style. I could have done it in AJAX but Comet is far less vicious on the server, especially given the real-time nature of the app in question, but in Apache/PHP this just is not practical.
Enter, then, Node.js. At first glance it sounds fantastic - you're working in JavaScript on the server side (so it's easy to learn, in theory) but there's no webserver. In other words, you write some JS that also functions *AS* the webserver.
From the Node.js docs, this would be pretty much the simplest possible webserver in Node:
Code: [Select]
Yup, you see that right. You're handling raw HTTP requests and headers. For someone like me who's been behind the cosy framework of PHP for years, this is... something of a change of pace. It's not a bad one at all, it's just a lot to take on board.
Especially with the heavy-going view it has towards I/O. In PHP, the script runs from top to bottom, and it waits for I/O to complete - so execution of a given page waits while a DB query completes, for example. This doesn't happen in Node, or at least it shouldn't.
The idea, really, is that you push the request off to another function and handle its response in a callback, so that mainline execution can get back to whatever it was doing. This, for me, is a *major* change of pace because it's just not a mentality I'm used to working in.
But, so far so good, actually. I was able to fashion something workable with that, but it wasn't really what I wanted, I wanted something that did some of the work for me. Yes, that's right, I started looking at frameworks and ended up with Express.
Express makes a lot of the work easier, but it has two problems. The first is that its documentation is absolutely crap. No, really, it's ABSOLUTELY SHIT. http://expressjs.com/guide.html is the entire official guide.
There's several sub-problems. Firstly, it makes no mention of Express 3.0 at all and only barely mentions 2.x in passing for migration. It would be OK reading the source, if Express were all the source, except it isn't. It's a framework on top of another framework, called Connect, and it's very hard to figure out WTF is going on when Express doesn't seem to point to another about Connect, like any other documentation.
The second problem is probably a bigger one in the scheme of things. A lot of people did figure out how to use Express and muddle through. And some people have written blogs on it, others have asked and answered things on StackOverflow. The result was that I've had dozens and dozens of tabs open in my browser for the last couple of days as I start to piece things together.
I mean, I have a functioning webserver, it receives requests, if they're dynamic pages, they're routed properly. If they're static resources, again routed properly. 404 and 500 have their own proper pages with correct headers and everything. But it took me over a day to figure all this out to make it work how I wanted because the documentation is so poor. And I mentioned that I had dozens and dozens of tabs open... I still have about 18 tabs open for the next stage of the project, and that's the problem in itself: there's so many bits and pieces on it but they're all haphazard and many of them are legacy items.
For example, I found one tutorial from late 2010 which refers to using Express methods for handling static content, and it refers to staticGzip and staticProvider; the former indicating that content should be gzipped and the latter to indicate that a given path is where static content should be served from.
But the manual doesn't mention these, it only talks about a method simply called static, which has a slightly different calling argument structure to staticProvider but does mostly the same job. After 20 minutes of digging around I found that staticProvider was deprecated in favour of simply static[1] and that staticGzip is no longer directly available because most people deploying such apps would serve static content like that from a CDN and not from your own server. A reasonable if slightly misguided idea, I think. As it happens in this case I'm looking at deploying with sufficiently long-life expiries that it doesn't really matter so much.
But anyway, I've spent so long trying to piece everything together that it's just left me feeling so frustrated.
I haven't actually told you the worst part yet, actually. Node has a nifty-in-principle tool called npm for installing packages. There's a central repository that lists packages and most of the time you can do npm install <package> and boom, it'll download. Unless it's Express, in which case you have to have make installed to be able to install it. This took me a while to figure out due to no-one describing it anywhere and npm giving me less than helpful messages.
It gets a bit better, actually. You can declare a package.json file which indicates a package's dependencies. This can be the Node versions supported, or it can be the version(s) of packages you need. My project needs Express, Socket.io and MongoDB's connector, seems straightforward enough. Until you hit the joys of figuring out which versions you need, of course.
Oh, and there's more fun. Each of those has other dependencies which also needs to be met. And it's not clear whether some of those come installed or as optional extras, Express for example states a 'devDependency' of Jade, though it doesn't actually install Jade unless you ask it to. Again, not documented anywhere. Then more version juggling.
Jade is actually pretty neat, though. Had we not had the template skeleton I might have suggested a move to it, because it allows for replacing blocks of a document, for prepending/appending content to blocks and so on. Plus the fact that Jade's syntax is incredibly tight and descriptive and not the usual verbosity of HTML itself. http://jade-lang.com/ if you're curious.
Anyway, that's enough rambling and venting from me. For my next challenge, figure out how sessions work (and figure out how to make them compliant with the EU laws, ahahahahah) and then bolt on Websockets type connections to it and maybe see if we can't do something truly wonderful from there on in!
The bottom line is that Node and its tools make for a very interesting and flexible platform for deploying unconventional applications but the lack of good documentation for major components (Node itself is well documented, just not its good bolt-ons so much) really makes it a struggle to implement anything.
I won't get into the detail of it but the last few days I've been snowed under - as I mentioned briefly - in building an app using Node.js, Express, Socket.io and MongoDB. I'm not going to explain what the app is, hopefully you'll see soon enough, but it's certainly been an interesting experience for me so far, and I feel like sharing what I've found.
First up, for those of who aren't familiar with Node.js, let me explain. We here are far more used to deploying apps where we have a web server like Apache, which receives requests, passes some of them onto PHP to process the contents of the page, and handles the page until it's ready and sends it back to the user.
It's convenient, practical and we're all used to it, but the app I've been working on lately requires longlife connections, what we would normally consider to be Comet style. I could have done it in AJAX but Comet is far less vicious on the server, especially given the real-time nature of the app in question, but in Apache/PHP this just is not practical.
Enter, then, Node.js. At first glance it sounds fantastic - you're working in JavaScript on the server side (so it's easy to learn, in theory) but there's no webserver. In other words, you write some JS that also functions *AS* the webserver.
From the Node.js docs, this would be pretty much the simplest possible webserver in Node:
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');Yup, you see that right. You're handling raw HTTP requests and headers. For someone like me who's been behind the cosy framework of PHP for years, this is... something of a change of pace. It's not a bad one at all, it's just a lot to take on board.
Especially with the heavy-going view it has towards I/O. In PHP, the script runs from top to bottom, and it waits for I/O to complete - so execution of a given page waits while a DB query completes, for example. This doesn't happen in Node, or at least it shouldn't.
The idea, really, is that you push the request off to another function and handle its response in a callback, so that mainline execution can get back to whatever it was doing. This, for me, is a *major* change of pace because it's just not a mentality I'm used to working in.
But, so far so good, actually. I was able to fashion something workable with that, but it wasn't really what I wanted, I wanted something that did some of the work for me. Yes, that's right, I started looking at frameworks and ended up with Express.
Express makes a lot of the work easier, but it has two problems. The first is that its documentation is absolutely crap. No, really, it's ABSOLUTELY SHIT. http://expressjs.com/guide.html is the entire official guide.
There's several sub-problems. Firstly, it makes no mention of Express 3.0 at all and only barely mentions 2.x in passing for migration. It would be OK reading the source, if Express were all the source, except it isn't. It's a framework on top of another framework, called Connect, and it's very hard to figure out WTF is going on when Express doesn't seem to point to another about Connect, like any other documentation.
The second problem is probably a bigger one in the scheme of things. A lot of people did figure out how to use Express and muddle through. And some people have written blogs on it, others have asked and answered things on StackOverflow. The result was that I've had dozens and dozens of tabs open in my browser for the last couple of days as I start to piece things together.
I mean, I have a functioning webserver, it receives requests, if they're dynamic pages, they're routed properly. If they're static resources, again routed properly. 404 and 500 have their own proper pages with correct headers and everything. But it took me over a day to figure all this out to make it work how I wanted because the documentation is so poor. And I mentioned that I had dozens and dozens of tabs open... I still have about 18 tabs open for the next stage of the project, and that's the problem in itself: there's so many bits and pieces on it but they're all haphazard and many of them are legacy items.
For example, I found one tutorial from late 2010 which refers to using Express methods for handling static content, and it refers to staticGzip and staticProvider; the former indicating that content should be gzipped and the latter to indicate that a given path is where static content should be served from.
But the manual doesn't mention these, it only talks about a method simply called static, which has a slightly different calling argument structure to staticProvider but does mostly the same job. After 20 minutes of digging around I found that staticProvider was deprecated in favour of simply static[1] and that staticGzip is no longer directly available because most people deploying such apps would serve static content like that from a CDN and not from your own server. A reasonable if slightly misguided idea, I think. As it happens in this case I'm looking at deploying with sufficiently long-life expiries that it doesn't really matter so much.
But anyway, I've spent so long trying to piece everything together that it's just left me feeling so frustrated.
I haven't actually told you the worst part yet, actually. Node has a nifty-in-principle tool called npm for installing packages. There's a central repository that lists packages and most of the time you can do npm install <package> and boom, it'll download. Unless it's Express, in which case you have to have make installed to be able to install it. This took me a while to figure out due to no-one describing it anywhere and npm giving me less than helpful messages.
It gets a bit better, actually. You can declare a package.json file which indicates a package's dependencies. This can be the Node versions supported, or it can be the version(s) of packages you need. My project needs Express, Socket.io and MongoDB's connector, seems straightforward enough. Until you hit the joys of figuring out which versions you need, of course.
Oh, and there's more fun. Each of those has other dependencies which also needs to be met. And it's not clear whether some of those come installed or as optional extras, Express for example states a 'devDependency' of Jade, though it doesn't actually install Jade unless you ask it to. Again, not documented anywhere. Then more version juggling.
Jade is actually pretty neat, though. Had we not had the template skeleton I might have suggested a move to it, because it allows for replacing blocks of a document, for prepending/appending content to blocks and so on. Plus the fact that Jade's syntax is incredibly tight and descriptive and not the usual verbosity of HTML itself. http://jade-lang.com/ if you're curious.
Anyway, that's enough rambling and venting from me. For my next challenge, figure out how sessions work (and figure out how to make them compliant with the EU laws, ahahahahah) and then bolt on Websockets type connections to it and maybe see if we can't do something truly wonderful from there on in!
The bottom line is that Node and its tools make for a very interesting and flexible platform for deploying unconventional applications but the lack of good documentation for major components (Node itself is well documented, just not its good bolt-ons so much) really makes it a struggle to implement anything.
| 1. | Including a snide mention from Express's author that JSLint is 'lame' because it can't differentiate between 'static' being used as a method name as being used to indicate something being static. |
3509
Off-topic / Re: HTML5 Upload Progress.
« on May 1st, 2012, 07:59 PM »
I know Dragooon actually implemented this into a plugin for Wedge, but I can't remember offhand how he actually did it.
3510
Off-topic / Re: Different Keys (touch screen keyboards) for different form elements?
« on May 1st, 2012, 07:58 PM »
I never looked to be honest, but it would be neat if they do.
Certainly if they don't now, they will going forward and hopefully in a cross-browser fashion.
Certainly if they don't now, they will going forward and hopefully in a cross-browser fashion.