Permalink
Browse files

Zeta, paga la coca!

0 parents commit 64e4610188e4d39b445f57b824931511fc9e4ffd @HispachanFiles committed Apr 13, 2016
Showing with 152,669 additions and 0 deletions.
  1. +3 −0 .babelrc
  2. +83 −0 .gitignore
  3. +37 −0 .vscode/launch.json
  4. +8 −0 .vscode/settings.json
  5. +49 −0 README.md
  6. +75 −0 app.js
  7. +110 −0 bin/www
  8. +157 −0 client/components/archiver.js
  9. +37 −0 client/components/renderer.js
  10. +78 −0 client/main.js
  11. +185 −0 components/archiver/index.js
  12. +28 −0 components/deleteThread.js
  13. +27 −0 components/parsers/parseBoard.js
  14. +79 −0 components/parsers/parsePost.js
  15. +40 −0 components/parsers/parseThread.js
  16. +15 −0 components/testThread.js
  17. +83 −0 gulpfile.js
  18. +6 −0 jsconfig.json
  19. +46 −0 models/thread.js
  20. +1 −0 news.md
  21. +3 −0 nodemon.json
  22. +48 −0 package.json
  23. +32,257 −0 public/dist/app.js
  24. BIN public/favicon.ico
  25. BIN public/images/404.png
  26. BIN public/images/apiLogo.png
  27. BIN public/images/dado.png
  28. BIN public/images/default_banner.png
  29. BIN public/images/md_banner.png
  30. BIN public/images/top_icn.png
  31. +255 −0 public/semantic/components/accordion.css
  32. +592 −0 public/semantic/components/accordion.js
  33. +10 −0 public/semantic/components/accordion.min.css
  34. +11 −0 public/semantic/components/accordion.min.js
  35. +276 −0 public/semantic/components/ad.css
  36. +10 −0 public/semantic/components/ad.min.css
  37. +1,077 −0 public/semantic/components/api.js
  38. +11 −0 public/semantic/components/api.min.js
  39. +125 −0 public/semantic/components/breadcrumb.css
  40. +10 −0 public/semantic/components/breadcrumb.min.css
  41. +3,237 −0 public/semantic/components/button.css
  42. +10 −0 public/semantic/components/button.min.css
  43. +949 −0 public/semantic/components/card.css
  44. +10 −0 public/semantic/components/card.min.css
  45. +588 −0 public/semantic/components/checkbox.css
  46. +706 −0 public/semantic/components/checkbox.js
  47. +10 −0 public/semantic/components/checkbox.min.css
  48. +11 −0 public/semantic/components/checkbox.min.js
  49. +274 −0 public/semantic/components/colorize.js
  50. +11 −0 public/semantic/components/colorize.min.js
  51. +259 −0 public/semantic/components/comment.css
  52. +10 −0 public/semantic/components/comment.min.css
  53. +125 −0 public/semantic/components/container.css
  54. +10 −0 public/semantic/components/container.min.css
  55. +200 −0 public/semantic/components/dimmer.css
  56. +667 −0 public/semantic/components/dimmer.js
  57. +10 −0 public/semantic/components/dimmer.min.css
  58. +11 −0 public/semantic/components/dimmer.min.js
  59. +260 −0 public/semantic/components/divider.css
  60. +10 −0 public/semantic/components/divider.min.css
  61. +1,389 −0 public/semantic/components/dropdown.css
  62. +3,223 −0 public/semantic/components/dropdown.js
  63. +10 −0 public/semantic/components/dropdown.min.css
  64. +13 −0 public/semantic/components/dropdown.min.js
  65. +162 −0 public/semantic/components/embed.css
  66. +662 −0 public/semantic/components/embed.js
  67. +10 −0 public/semantic/components/embed.min.css
  68. +11 −0 public/semantic/components/embed.min.js
  69. +301 −0 public/semantic/components/feed.css
  70. +10 −0 public/semantic/components/feed.min.css
  71. +1,024 −0 public/semantic/components/flag.css
  72. +10 −0 public/semantic/components/flag.min.css
  73. +993 −0 public/semantic/components/form.css
  74. +1,256 −0 public/semantic/components/form.js
  75. +10 −0 public/semantic/components/form.min.css
  76. +11 −0 public/semantic/components/form.min.js
  77. +1,880 −0 public/semantic/components/grid.css
  78. +10 −0 public/semantic/components/grid.min.css
  79. +722 −0 public/semantic/components/header.css
  80. +10 −0 public/semantic/components/header.min.css
  81. +2,583 −0 public/semantic/components/icon.css
  82. +10 −0 public/semantic/components/icon.min.css
  83. +302 −0 public/semantic/components/image.css
  84. +10 −0 public/semantic/components/image.min.css
  85. +487 −0 public/semantic/components/input.css
  86. +10 −0 public/semantic/components/input.min.css
  87. +482 −0 public/semantic/components/item.css
  88. +10 −0 public/semantic/components/item.min.css
  89. +1,114 −0 public/semantic/components/label.css
  90. +10 −0 public/semantic/components/label.min.css
  91. +922 −0 public/semantic/components/list.css
  92. +10 −0 public/semantic/components/list.min.css
  93. +286 −0 public/semantic/components/loader.css
  94. +10 −0 public/semantic/components/loader.min.css
  95. +1,864 −0 public/semantic/components/menu.css
  96. +1 −0 public/semantic/components/menu.min.css
  97. +464 −0 public/semantic/components/message.css
  98. +10 −0 public/semantic/components/message.min.css
  99. +510 −0 public/semantic/components/modal.css
  100. +887 −0 public/semantic/components/modal.js
  101. +10 −0 public/semantic/components/modal.min.css
  102. +11 −0 public/semantic/components/modal.min.js
  103. +148 −0 public/semantic/components/nag.css
  104. +476 −0 public/semantic/components/nag.js
  105. +10 −0 public/semantic/components/nag.min.css
  106. +11 −0 public/semantic/components/nag.min.js
  107. +349 −0 public/semantic/components/popup.css
  108. +1,353 −0 public/semantic/components/popup.js
  109. +10 −0 public/semantic/components/popup.min.css
  110. +11 −0 public/semantic/components/popup.min.js
  111. +517 −0 public/semantic/components/progress.css
  112. +793 −0 public/semantic/components/progress.js
  113. +10 −0 public/semantic/components/progress.min.css
  114. +11 −0 public/semantic/components/progress.min.js
  115. +132 −0 public/semantic/components/rail.css
  116. +10 −0 public/semantic/components/rail.min.css
  117. +266 −0 public/semantic/components/rating.css
  118. +475 −0 public/semantic/components/rating.js
  119. +10 −0 public/semantic/components/rating.min.css
  120. +11 −0 public/semantic/components/rating.min.js
  121. +429 −0 public/semantic/components/reset.css
  122. +10 −0 public/semantic/components/reset.min.css
  123. +312 −0 public/semantic/components/reveal.css
  124. +10 −0 public/semantic/components/reveal.min.css
  125. +376 −0 public/semantic/components/search.css
  126. +1,278 −0 public/semantic/components/search.js
  127. +10 −0 public/semantic/components/search.min.css
  128. +11 −0 public/semantic/components/search.min.js
  129. +745 −0 public/semantic/components/segment.css
  130. +10 −0 public/semantic/components/segment.min.css
  131. +154 −0 public/semantic/components/shape.css
  132. +876 −0 public/semantic/components/shape.js
  133. +10 −0 public/semantic/components/shape.min.css
  134. +11 −0 public/semantic/components/shape.min.js
  135. +629 −0 public/semantic/components/sidebar.css
  136. +1,023 −0 public/semantic/components/sidebar.js
  137. +10 −0 public/semantic/components/sidebar.min.css
  138. +11 −0 public/semantic/components/sidebar.min.js
  139. +161 −0 public/semantic/components/site.css
  140. +487 −0 public/semantic/components/site.js
  141. +10 −0 public/semantic/components/site.min.css
  142. +11 −0 public/semantic/components/site.min.js
  143. +695 −0 public/semantic/components/state.js
  144. +11 −0 public/semantic/components/state.min.js
  145. +584 −0 public/semantic/components/statistic.css
  146. +10 −0 public/semantic/components/statistic.min.css
  147. +606 −0 public/semantic/components/step.css
  148. +10 −0 public/semantic/components/step.min.css
  149. +79 −0 public/semantic/components/sticky.css
  150. +882 −0 public/semantic/components/sticky.js
  151. +10 −0 public/semantic/components/sticky.min.css
  152. +11 −0 public/semantic/components/sticky.min.js
  153. +92 −0 public/semantic/components/tab.css
  154. +897 −0 public/semantic/components/tab.js
  155. +10 −0 public/semantic/components/tab.min.css
  156. +11 −0 public/semantic/components/tab.min.js
  157. +1,049 −0 public/semantic/components/table.css
  158. +10 −0 public/semantic/components/table.min.css
  159. +1,982 −0 public/semantic/components/transition.css
  160. +1,069 −0 public/semantic/components/transition.js
  161. +10 −0 public/semantic/components/transition.min.css
  162. +11 −0 public/semantic/components/transition.min.js
  163. +125 −0 public/semantic/components/video.css
  164. +532 −0 public/semantic/components/video.js
  165. +10 −0 public/semantic/components/video.min.css
  166. +11 −0 public/semantic/components/video.min.js
  167. +1,213 −0 public/semantic/components/visibility.js
  168. +11 −0 public/semantic/components/visibility.min.js
  169. +517 −0 public/semantic/components/visit.js
  170. +11 −0 public/semantic/components/visit.min.js
  171. +35,350 −0 public/semantic/semantic.css
  172. +20,611 −0 public/semantic/semantic.js
  173. +11 −0 public/semantic/semantic.min.css
  174. +19 −0 public/semantic/semantic.min.js
  175. BIN public/semantic/themes/basic/assets/fonts/icons.eot
  176. +450 −0 public/semantic/themes/basic/assets/fonts/icons.svg
  177. BIN public/semantic/themes/basic/assets/fonts/icons.ttf
  178. BIN public/semantic/themes/basic/assets/fonts/icons.woff
  179. BIN public/semantic/themes/default/assets/fonts/icons.eot
  180. BIN public/semantic/themes/default/assets/fonts/icons.otf
  181. +565 −0 public/semantic/themes/default/assets/fonts/icons.svg
  182. BIN public/semantic/themes/default/assets/fonts/icons.ttf
  183. BIN public/semantic/themes/default/assets/fonts/icons.woff
  184. BIN public/semantic/themes/default/assets/fonts/icons.woff2
  185. BIN public/semantic/themes/default/assets/images/flags.png
  186. +284 −0 public/stylesheets/Hispachan.scss
  187. +43 −0 public/stylesheets/HispachanFiles.scss
  188. +74 −0 public/stylesheets/css/nprogress.css
  189. +126 −0 public/stylesheets/ku/hispamovil.scss
  190. +136 −0 public/stylesheets/ku/imageboard.scss
  191. +114 −0 routes/api.js
  192. +18 −0 routes/index.js
  193. +56 −0 routes/socket.js
  194. +100 −0 routes/thread.js
  195. +32 −0 server-settings.js
  196. +56 −0 settings.js
  197. +165 −0 typings/async/async.d.ts
  198. +266 −0 typings/cheerio/cheerio.d.ts
  199. +1,076 −0 typings/express/express.d.ts
  200. +16 −0 typings/form-data/form-data.d.ts
  201. +3,190 −0 typings/jquery/jquery.d.ts
  202. +15 −0 typings/mkdirp/mkdirp.d.ts
  203. +503 −0 typings/mongoose/mongoose.d.ts
  204. +2,079 −0 typings/node/node.d.ts
  205. +262 −0 typings/request/request.d.ts
  206. +255 −0 typings/vue/vue.d.ts
  207. +42 −0 views/api.jade
  208. +10 −0 views/error.jade
  209. +39 −0 views/hispachan/post.jade
  210. +25 −0 views/hispachan/postMeta.jade
  211. +22 −0 views/hispachan/thread.jade
  212. +40 −0 views/index.jade
  213. +43 −0 views/layout.jade
@@ -0,0 +1,3 @@
+{
+ "presets": ["es2015"]
+}
@@ -0,0 +1,83 @@
+# Logs
+logs
+*.log
+
+# Data
+data/*
+
+# Compiled Stylesheets
+public/stylesheets/*.css
+public/stylesheets/*.css.map
+!public/stylesheets/css/*.css
+
+# Runtime data
+pids
+*.pid
+*.seed
+
+# Directory for instrumented libs generated by jscoverage/JSCover
+lib-cov
+
+# Coverage directory used by tools like istanbul
+coverage
+
+# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
+.grunt
+
+# Compiled binary addons (http://nodejs.org/api/addons.html)
+build/Release
+
+# Dependency directory
+# Commenting this out is preferred by some people, see
+# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
+node_modules
+
+# Users Environment Variables
+.lock-wscript
+
+# =========================
+# Operating System Files
+# =========================
+
+# OSX
+# =========================
+
+.DS_Store
+.AppleDouble
+.LSOverride
+
+# Thumbnails
+._*
+
+# Files that might appear on external disk
+.Spotlight-V100
+.Trashes
+
+# Directories potentially created on remote AFP share
+.AppleDB
+.AppleDesktop
+Network Trash Folder
+Temporary Items
+.apdisk
+
+# Windows
+# =========================
+
+# Windows image file caches
+Thumbs.db
+ehthumbs.db
+
+# Folder config file
+Desktop.ini
+
+# Recycle Bin used on file shares
+$RECYCLE.BIN/
+
+# Windows Installer files
+*.cab
+*.msi
+*.msm
+*.msp
+
+# Windows shortcuts
+*.lnk
@@ -0,0 +1,37 @@
+{
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": "Launch",
+ "type": "node",
+ "request": "launch",
+ "program": "${workspaceRoot}\\bin\\www",
+ "stopOnEntry": false,
+ "args": [],
+ "cwd": "${workspaceRoot}",
+ "preLaunchTask": null,
+ "runtimeExecutable": null,
+ "runtimeArgs": [
+ "--nolazy"
+ ],
+ "env": {
+ "NODE_ENV": "development"
+ },
+ "externalConsole": false,
+ "sourceMaps": false,
+ "outDir": null
+ },
+ {
+ "name": "Attach",
+ "type": "node",
+ "request": "attach",
+ "port": 5858,
+ "address": "localhost",
+ "restart": false,
+ "sourceMaps": false,
+ "outDir": null,
+ "localRoot": "${workspaceRoot}",
+ "remoteRoot": null
+ }
+ ]
+}
@@ -0,0 +1,8 @@
+// Place your settings in this file to overwrite default and user settings.
+{
+ "files.exclude": {
+ "**/.git": true,
+ "**/.DS_Store": true,
+ "**/dist": true
+ }
+}
@@ -0,0 +1,49 @@
+<center>
+![Hispachan Files](public/images/md_banner.png)
+</center>
+
+
+Hispachan Files es una herramienta para guardar hilos de [hispachan.org](https://www.hispachan.org). También ofrece una API no-oficial para el mismo.
+
+Utiliza [Node.js](https://nodejs.org/) en el servidor, [Mongo](https://www.mongodb.org/) como base de datos y [Vue.js](http://www.vuejs.org/) + [Semantic UI](http://semantic-ui.com/) para el front end.
+
+Este es el primer proyecto de gran escala que hago en Node, así que si hay algo en mi código que te arda el culito, no seas marica y abre un pull request.
+
+## Instalación Local
+
+- Instala Node.js y Mongo
+- Descarga / Clona el repositorio
+- Edita los archivos de configuración (`settings.js` y `server-settings.js`).
+- Abre una terminal en la carpeta del repositorio
+- Instala las dependencias:
+```
+npm install
+```
+- Inicia el servidor:
+```
+npm start
+```
+- Abre http://localhost:8000 desde tu navegador
+
+Listo, ahora tienes tu propio HispaFiles para uso persona <s>para guardar tus cepillos</s>.
+
+## Cosas por hacer
+
+Esta nueva versión de HispaFiles está hecha completamente desde cero, así que aún hay un par de cosas que hacen falta. Esto es lo que se me ocurre de momento:
+
+ - [ ] Expandir imágenes/webm en la misma página
+ - [ ] Eliminar hilos si no cumplen 2 horas de antigüedad en Hispa
+ - [ ] Añadir "backlinks" a las respuestas
+ - [ ] Añadir preview de refs
+ - [ ] Añadir los demás estilos (a parte de Hispachan)
+ - [ ] Añadir la opción de descarga en zip
+ - [ ] Añadir una página dedicada a los resultados de búsqueda
+ - [ ] Añadir estadísticas publicas en la página principal (número de hilos guardados, espacio usado, etc)
+
+Si se te ocurre algo mas, o encuentras un bug, puedes [contactarme](mailto:hispachanfiles@gmail.com) o abrir una issue. O incluso mejor, podrías hacer una pull request.
+
+## ¿Qué pasará con el anterior HispaFiles?
+
+Los datos siguen ahí. Si quieres recuperar un hilo guardado en el antiguo HispaFiles, solo pon su URL en el nuevo [HispaFiles](https://www.hispachanfiles.org/).
+
+Ten en cuenta que esto no servirá en la versión presente en este repo, deberás hacerlo en la página principal.
@@ -0,0 +1,75 @@
+var express = require('express');
+var socket_io = require( "socket.io" );
+var path = require('path');
+var favicon = require('serve-favicon');
+var logger = require('morgan');
+var cookieParser = require('cookie-parser');
+var bodyParser = require('body-parser');
+var sass = require('node-sass-middleware');
+var mongoose = require('mongoose');
+
+var routes = require('./routes/index');
+var apiRoutes = require('./routes/api');
+var socketRoutes = require('./routes/socket');
+var threadRoutes = require('./routes/thread');
+
+var settings = require('./settings');
+var serverSettings = require('./server-settings');
+
+var app = express();
+
+// Socket.io
+var io = socket_io();
+app.io = io;
+
+// Mongoose
+mongoose.connect(serverSettings.db.url);
+
+// view engine setup
+app.set('views', path.join(__dirname, 'views'));
+app.set('view engine', 'jade');
+app.use(sass({
+ src: path.join(__dirname, 'public'),
+ dest: path.join(__dirname, 'public'),
+ sourceMap: true
+}));
+app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
+app.use(logger('dev'));
+app.use(bodyParser.json());
+app.use(bodyParser.urlencoded({ extended: false }));
+app.use(cookieParser());
+app.use(express.static(path.join(__dirname, 'public')));
+app.use('/data', express.static(path.join(__dirname, 'data')));
+
+app.use('/', routes);
+app.use('/', threadRoutes);
+if(settings.features.apiEnabled)
+{
+ app.use('/api', apiRoutes);
+}
+
+io.on('connection', socketRoutes);
+
+// catch 404 and forward to error handler
+app.use(function(req, res, next) {
+ var err = new Error('Not Found');
+ err.status = 404;
+ next(err);
+});
+
+// error handlers
+
+app.use(function(err, req, res, next) {
+ res.status(err.status || 500);
+ if(app.get('env') === 'development')
+ {
+ res.jsonp(err);
+ }
+ else
+ {
+ res.render('error', err);
+ }
+});
+
+
+module.exports = app;
@@ -0,0 +1,110 @@
+#!/usr/bin/env node
+
+/**
+ * Module dependencies.
+ */
+
+var app = require('../app');
+var debug = require('debug')('HispachanAPI:server');
+var http = require('http');
+var https = require('http');
+var serverSettings = require('../server-settings');
+
+/**
+ * Get port from environment and store in Express.
+ */
+
+var port = normalizePort(process.env.PORT || '8000');
+app.set('port', port);
+
+/**
+ * Create HTTP server.
+ */
+var server;
+if(serverSettings.ssl.enabled)
+{
+ server = https.createServer({
+ cert: serverSettings.ssl.cert,
+ key: serverSettings.ssl.key,
+ pfx: serverSettings.ssl.pfx
+ }, app);
+}
+else
+{
+ server = http.createServer(app);
+}
+
+/**
+ * Socket.io
+ */
+
+var io = app.io
+io.attach( server );
+
+/**
+ * Listen on provided port, on all network interfaces.
+ */
+
+server.listen(port);
+server.on('error', onError);
+server.on('listening', onListening);
+
+/**
+ * Normalize a port into a number, string, or false.
+ */
+
+function normalizePort(val) {
+ var port = parseInt(val, 10);
+
+ if (isNaN(port)) {
+ // named pipe
+ return val;
+ }
+
+ if (port >= 0) {
+ // port number
+ return port;
+ }
+
+ return false;
+}
+
+/**
+ * Event listener for HTTP server "error" event.
+ */
+
+function onError(error) {
+ if (error.syscall !== 'listen') {
+ throw error;
+ }
+
+ var bind = typeof port === 'string'
+ ? 'Pipe ' + port
+ : 'Port ' + port;
+
+ // handle specific listen errors with friendly messages
+ switch (error.code) {
+ case 'EACCES':
+ console.error(bind + ' requires elevated privileges');
+ process.exit(1);
+ break;
+ case 'EADDRINUSE':
+ console.error(bind + ' is already in use');
+ process.exit(1);
+ break;
+ default:
+ throw error;
+ }
+}
+
+/**
+ * Event listener for HTTP server "listening" event.
+ */
+
+function onListening() {
+ var addr = server.address();
+ var bind = typeof addr === 'string'
+ ? 'pipe ' + addr
+ : 'port ' + addr.port;
+ debug('Listening on ' + bind);
+}
Oops, something went wrong.

0 comments on commit 64e4610

Please sign in to comment.