From f7bd32ab21a8aa40f07ece6f98a39046008e9636 Mon Sep 17 00:00:00 2001 From: Jonathan Cremin Date: Sun, 23 Aug 2015 19:12:59 +0100 Subject: [PATCH] Remove Docker stuff for now --- .dockerignore | 2 -- Dockerfile | 14 -------------- README.md | 5 +++++ app.js | 2 -- circle.yml | 6 +----- docker-compose.yml | 16 ---------------- lib/storage.js | 10 +++++----- package.json | 6 ++---- 8 files changed, 13 insertions(+), 48 deletions(-) delete mode 100644 .dockerignore delete mode 100644 Dockerfile delete mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index f4a6fa4..0000000 --- a/.dockerignore +++ /dev/null @@ -1,2 +0,0 @@ -.git -.env* diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index c78d494..0000000 --- a/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM kudoz/iojs-gm -MAINTAINER Jonathan Cremin - -WORKDIR /app - -COPY . . - -RUN npm install && npm rebuild node-sass - -RUN npm run build - -EXPOSE 4040 - -CMD npm start diff --git a/README.md b/README.md index 13e5b6c..2a67387 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ # Hostr [![Circle CI](https://circleci.com/gh/kudos/hostr.svg?style=svg&circle-token=1b4dec62afcb7960446edf241a5cf9238b8c20ed)](https://circleci.com/gh/kudos/hostr) +## About +Hostr is a project I started almost ten years ago when I set out to learn web development. Since then it's seen over 100,000 signups and served up over 2 billion file downloads. + +It has been through many iterations, but in its current incarnation Hostr is built using [Babel](https://babeljs.io/) and [Koa](http://koajs.com/). The frontend is built with Angular, for now. + ## Getting Started ### Runtimes diff --git a/app.js b/app.js index 4b8f786..5eadde7 100644 --- a/app.js +++ b/app.js @@ -17,8 +17,6 @@ import co from 'co'; import api from './api/app'; import { ws } from './api/app'; import web from './web/app'; -import { init as storageInit } from './lib/storage'; -storageInit(); import debugname from 'debug'; const debug = debugname('hostr'); diff --git a/circle.yml b/circle.yml index 2954b8f..c384c31 100644 --- a/circle.yml +++ b/circle.yml @@ -2,7 +2,6 @@ machine: services: - docker pre: - - curl https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash - npm install -g npm@3 node: version: iojs-2.5.0 @@ -12,13 +11,10 @@ test: - mongo hostr test/fixtures/mongo-user.js test/fixtures/mongo-file.js override: - npm run cover - post: - - docker build -t $CIRCLE_PROJECT_REPONAME:$CIRCLE_BUILD_NUM . && docker save $CIRCLE_PROJECT_REPONAME:$CIRCLE_BUILD_NUM | gzip > $CIRCLE_ARTIFACTS/$CIRCLE_PROJECT_REPONAME-ci-build-$CIRCLE_BUILD_NUM.tar.gz dependencies: cache_directories: - node_modules - web/public/jspm_packages post: - - ./node_modules/.bin/jspm config registries.github.auth $JSPM_GITHUB_AUTH_TOKEN - - ./node_modules/.bin/jspm install + - npm run jspm diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 78f9a16..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,16 +0,0 @@ -web: - image: kudoz/hostr - env_file: .env-docker - links: - - redis - - mongo - ports: - - 443:4040 -redis: - image: redis - ports: - - 6379:6379 -mongo: - image: mongo - ports: - - 27017:27017 diff --git a/lib/storage.js b/lib/storage.js index 932f07c..9441963 100644 --- a/lib/storage.js +++ b/lib/storage.js @@ -1,19 +1,19 @@ import fs from 'fs'; import path from 'path'; -function range(start,stop) { - var result=[]; - for (var idx=start.charCodeAt(0),end=stop.charCodeAt(0); idx <=end; ++idx){ +function range(start, stop) { + var result = []; + for (var idx = start.charCodeAt(0), end = stop.charCodeAt(0); idx <= end; ++idx){ result.push(String.fromCharCode(idx)); } return result; -}; +} const storePath = process.env.FILE_PATH || path.join(process.env.HOME, '.hostr', 'uploads'); const directories = range('A', 'Z').concat(range('a', 'z'), range('0', '9')); -export function init() { +export default function init() { directories.forEach((directory) => { if (!fs.existsSync(path.join(storePath, directory))) { fs.mkdirSync(path.join(storePath, directory)); diff --git a/package.json b/package.json index 3d58acf..1e2ea70 100644 --- a/package.json +++ b/package.json @@ -13,11 +13,11 @@ "build-js": "babel -D -m system -d web/public/build -i web/public web/public/src", "build-sass": "node-sass -r -o web/public/styles/ web/public/styles/", "cover": "istanbul cover _mocha -- --require babel/register test/**/*.spec.js", - "init": "babel-node init.js", + "init": "babel-node -e \"require('./lib/storage')();\"", "jspm": "jspm install", "start": "npm run build && babel-node app.js", "test": "mongo hostr test/fixtures/mongo-user.js test/fixtures/mongo-file.js && mocha -r babel/register test/api test/web", - "watch": "parallelshell \"npm run watch-js\" \"npm run watch-server\" \"npm run watch-sass\"", + "watch": "parallelshell \"npm run watch-js\" \"npm run watch-sass\" \"npm run watch-server\"", "watch-js": "babel -Dw -m system -d web/public/build web/public/src", "watch-server": "nodemon -x \"babel-node\" app.js", "watch-sass": "node-sass -w -r -o web/public/styles/ web/public/styles/" @@ -55,13 +55,11 @@ "koa-websocket": "~1.0.0", "mandrill-api": "~1.0.45", "mime-types": "~2.1.5", - "mkdirp": "~0.5.1", "moment": "~2.10.6", "mongodb-promisified": "~1.0.3", "node-sass": "~3.2.0", "node-uuid": "~1.4.3", "passwords": "~1.3.0", - "pretty-error": "~1.2.0", "raven": "~0.8.1", "redis": "~0.12.1", "redis-url": "~1.2.1",