Remove Docker stuff for now
This commit is contained in:
parent
8d64bb5270
commit
f7bd32ab21
8 changed files with 13 additions and 48 deletions
|
@ -1,2 +0,0 @@
|
||||||
.git
|
|
||||||
.env*
|
|
14
Dockerfile
14
Dockerfile
|
@ -1,14 +0,0 @@
|
||||||
FROM kudoz/iojs-gm
|
|
||||||
MAINTAINER Jonathan Cremin <jonathan@crem.in>
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
RUN npm install && npm rebuild node-sass
|
|
||||||
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
EXPOSE 4040
|
|
||||||
|
|
||||||
CMD npm start
|
|
|
@ -1,5 +1,10 @@
|
||||||
# Hostr [](https://circleci.com/gh/kudos/hostr)
|
# Hostr [](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
|
## Getting Started
|
||||||
|
|
||||||
### Runtimes
|
### Runtimes
|
||||||
|
|
2
app.js
2
app.js
|
@ -17,8 +17,6 @@ import co from 'co';
|
||||||
import api from './api/app';
|
import api from './api/app';
|
||||||
import { ws } from './api/app';
|
import { ws } from './api/app';
|
||||||
import web from './web/app';
|
import web from './web/app';
|
||||||
import { init as storageInit } from './lib/storage';
|
|
||||||
storageInit();
|
|
||||||
|
|
||||||
import debugname from 'debug';
|
import debugname from 'debug';
|
||||||
const debug = debugname('hostr');
|
const debug = debugname('hostr');
|
||||||
|
|
|
@ -2,7 +2,6 @@ machine:
|
||||||
services:
|
services:
|
||||||
- docker
|
- docker
|
||||||
pre:
|
pre:
|
||||||
- curl https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash
|
|
||||||
- npm install -g npm@3
|
- npm install -g npm@3
|
||||||
node:
|
node:
|
||||||
version: iojs-2.5.0
|
version: iojs-2.5.0
|
||||||
|
@ -12,13 +11,10 @@ test:
|
||||||
- mongo hostr test/fixtures/mongo-user.js test/fixtures/mongo-file.js
|
- mongo hostr test/fixtures/mongo-user.js test/fixtures/mongo-file.js
|
||||||
override:
|
override:
|
||||||
- npm run cover
|
- 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:
|
dependencies:
|
||||||
cache_directories:
|
cache_directories:
|
||||||
- node_modules
|
- node_modules
|
||||||
- web/public/jspm_packages
|
- web/public/jspm_packages
|
||||||
post:
|
post:
|
||||||
- ./node_modules/.bin/jspm config registries.github.auth $JSPM_GITHUB_AUTH_TOKEN
|
- npm run jspm
|
||||||
- ./node_modules/.bin/jspm install
|
|
||||||
|
|
|
@ -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
|
|
|
@ -1,19 +1,19 @@
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
function range(start,stop) {
|
function range(start, stop) {
|
||||||
var result=[];
|
var result = [];
|
||||||
for (var idx=start.charCodeAt(0),end=stop.charCodeAt(0); idx <=end; ++idx){
|
for (var idx = start.charCodeAt(0), end = stop.charCodeAt(0); idx <= end; ++idx){
|
||||||
result.push(String.fromCharCode(idx));
|
result.push(String.fromCharCode(idx));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
};
|
}
|
||||||
|
|
||||||
const storePath = process.env.FILE_PATH || path.join(process.env.HOME, '.hostr', 'uploads');
|
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'));
|
const directories = range('A', 'Z').concat(range('a', 'z'), range('0', '9'));
|
||||||
|
|
||||||
export function init() {
|
export default function init() {
|
||||||
directories.forEach((directory) => {
|
directories.forEach((directory) => {
|
||||||
if (!fs.existsSync(path.join(storePath, directory))) {
|
if (!fs.existsSync(path.join(storePath, directory))) {
|
||||||
fs.mkdirSync(path.join(storePath, directory));
|
fs.mkdirSync(path.join(storePath, directory));
|
||||||
|
|
|
@ -13,11 +13,11 @@
|
||||||
"build-js": "babel -D -m system -d web/public/build -i web/public web/public/src",
|
"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/",
|
"build-sass": "node-sass -r -o web/public/styles/ web/public/styles/",
|
||||||
"cover": "istanbul cover _mocha -- --require babel/register test/**/*.spec.js",
|
"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",
|
"jspm": "jspm install",
|
||||||
"start": "npm run build && babel-node app.js",
|
"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",
|
"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-js": "babel -Dw -m system -d web/public/build web/public/src",
|
||||||
"watch-server": "nodemon -x \"babel-node\" app.js",
|
"watch-server": "nodemon -x \"babel-node\" app.js",
|
||||||
"watch-sass": "node-sass -w -r -o web/public/styles/ web/public/styles/"
|
"watch-sass": "node-sass -w -r -o web/public/styles/ web/public/styles/"
|
||||||
|
@ -55,13 +55,11 @@
|
||||||
"koa-websocket": "~1.0.0",
|
"koa-websocket": "~1.0.0",
|
||||||
"mandrill-api": "~1.0.45",
|
"mandrill-api": "~1.0.45",
|
||||||
"mime-types": "~2.1.5",
|
"mime-types": "~2.1.5",
|
||||||
"mkdirp": "~0.5.1",
|
|
||||||
"moment": "~2.10.6",
|
"moment": "~2.10.6",
|
||||||
"mongodb-promisified": "~1.0.3",
|
"mongodb-promisified": "~1.0.3",
|
||||||
"node-sass": "~3.2.0",
|
"node-sass": "~3.2.0",
|
||||||
"node-uuid": "~1.4.3",
|
"node-uuid": "~1.4.3",
|
||||||
"passwords": "~1.3.0",
|
"passwords": "~1.3.0",
|
||||||
"pretty-error": "~1.2.0",
|
|
||||||
"raven": "~0.8.1",
|
"raven": "~0.8.1",
|
||||||
"redis": "~0.12.1",
|
"redis": "~0.12.1",
|
||||||
"redis-url": "~1.2.1",
|
"redis-url": "~1.2.1",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue