├── codeveloper-frontend ├── src │ ├── locale │ │ ├── en.js │ │ ├── index.js │ │ └── ko.js │ ├── assets │ │ └── header_bg.png │ ├── App.vue │ ├── style │ │ ├── component │ │ │ ├── Dimmer.css │ │ │ ├── Loading.css │ │ │ ├── Nav.css │ │ │ ├── MessageBox.css │ │ │ ├── ProfileBox.css │ │ │ └── RegistBox.css │ │ └── spa │ │ │ ├── Login.css │ │ │ ├── Home.css │ │ │ └── IDE.css │ ├── socket │ │ ├── index.js │ │ ├── socket-types.js │ │ ├── event-listener.js │ │ └── action.js │ ├── store │ │ ├── index.js │ │ ├── action-types.js │ │ ├── modules │ │ │ └── err-message.js │ │ ├── state.js │ │ ├── mutation-types.js │ │ ├── mutations.js │ │ └── actions.js │ ├── components │ │ ├── Loading.vue │ │ ├── Dimmer.vue │ │ ├── Nav.vue │ │ ├── MessageBox.vue │ │ ├── ProfileBox.vue │ │ └── RegistBox.vue │ ├── main.js │ ├── config │ │ └── router.js │ └── spa │ │ ├── IDE │ │ ├── computed.js │ │ ├── methods.js │ │ └── IDE.vue │ │ ├── Login.vue │ │ └── Home.vue ├── README.md ├── .babelrc ├── .gitignore ├── .editorconfig ├── index.html ├── package.json └── webpack.config.js ├── codeveloper-backend ├── .gitignore ├── src │ ├── passport │ │ ├── index.js │ │ └── passport.js │ ├── docker │ │ ├── index.js │ │ ├── dockerfile │ │ │ └── DockerFile │ │ └── container.js │ ├── index.js │ ├── cookie-session │ │ └── index.js │ ├── socket │ │ ├── socket-types.js │ │ └── index.js │ ├── mysql │ │ └── index.js │ ├── routes │ │ ├── auth.js │ │ ├── file │ │ │ ├── index.js │ │ │ └── file.ctrl.js │ │ ├── index.js │ │ └── user.js │ └── auth │ │ └── index.js ├── .env_sample ├── package.json ├── codeveloper.sql ├── index.js └── package-lock.json ├── README.md └── LICENSE /codeveloper-frontend/src/locale/en.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /codeveloper-frontend/README.md: -------------------------------------------------------------------------------- 1 | # codeveloper-frontend 2 | -------------------------------------------------------------------------------- /codeveloper-backend/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | uploads 3 | .env -------------------------------------------------------------------------------- /codeveloper-backend/src/passport/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./passport'); 2 | -------------------------------------------------------------------------------- /codeveloper-backend/src/docker/index.js: -------------------------------------------------------------------------------- 1 | exports.container = require('./container') 2 | 3 | -------------------------------------------------------------------------------- /codeveloper-frontend/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { "modules": false }], 4 | "stage-3" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /codeveloper-frontend/src/assets/header_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/J911/codeveloper/HEAD/codeveloper-frontend/src/assets/header_bg.png -------------------------------------------------------------------------------- /codeveloper-frontend/src/locale/index.js: -------------------------------------------------------------------------------- 1 | import * as ko from './ko' 2 | import * as en from './en' 3 | 4 | export { 5 | ko, 6 | en 7 | } -------------------------------------------------------------------------------- /codeveloper-backend/.env_sample: -------------------------------------------------------------------------------- 1 | PORT=3000 2 | GITHUB_CLIENT_SECRET=1234 3 | DB_HOST=localhost 4 | DB_NAME=codeveloper 5 | DB_ID=codeveloper 6 | DB_PW=1234 -------------------------------------------------------------------------------- /codeveloper-backend/src/docker/dockerfile/DockerFile: -------------------------------------------------------------------------------- 1 | # terminal:node 2 | FROM node:6 3 | RUN mkdir /workdir 4 | WORKDIR /workdir 5 | CMD /bin/bash 6 | -------------------------------------------------------------------------------- /codeveloper-backend/src/index.js: -------------------------------------------------------------------------------- 1 | const routes = require('./routes'); 2 | const passport = require('./passport'); 3 | 4 | module.exports = { 5 | routes, 6 | passport 7 | } -------------------------------------------------------------------------------- /codeveloper-frontend/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log 5 | yarn-error.log 6 | 7 | # Editor directories and files 8 | .idea 9 | *.suo 10 | *.ntvs* 11 | *.njsproj 12 | *.sln 13 | -------------------------------------------------------------------------------- /codeveloper-frontend/src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /codeveloper-frontend/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /codeveloper-backend/src/cookie-session/index.js: -------------------------------------------------------------------------------- 1 | const cookieSession = require('cookie-session'); 2 | 3 | module.exports = cookieSession({ 4 | keys: ['session_key$$'], 5 | cookie: { 6 | maxAge: 1000 * 60 * 60 7 | } 8 | }) -------------------------------------------------------------------------------- /codeveloper-frontend/src/style/component/Dimmer.css: -------------------------------------------------------------------------------- 1 | #dimmer { 2 | position: fixed; 3 | top:0; 4 | left:0; 5 | right: 0; 6 | bottom: 0; 7 | z-index: 9999; 8 | background-color: rgba(0, 0, 0, 0.63); 9 | cursor: pointer; 10 | } -------------------------------------------------------------------------------- /codeveloper-frontend/src/socket/index.js: -------------------------------------------------------------------------------- 1 | import io from 'socket.io-client' 2 | import eventListener from './event-listener' 3 | import * as action from './action' 4 | 5 | let socket = io() 6 | eventListener(socket) 7 | 8 | socket.action = action 9 | 10 | export default socket -------------------------------------------------------------------------------- /codeveloper-frontend/src/socket/socket-types.js: -------------------------------------------------------------------------------- 1 | export const JOIN_IDE = "JOIN:IDE" 2 | export const UPDATE_CODE = "UPDATE:CODE" 3 | export const CHAT_MESSAGE = "CHAT:MESSAGE" 4 | 5 | export const CONTAINER_INIT = "CONTAINER:INIT" 6 | export const CONTAINER_CP = "CONTAINER:CP" 7 | export const CONTAINER_COMMAND = "CONTAINER:COMMAND" 8 | -------------------------------------------------------------------------------- /codeveloper-frontend/src/store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | 4 | import state from './state' 5 | import actions from './actions' 6 | import mutations from './mutations' 7 | 8 | Vue.use(Vuex) 9 | 10 | export const store = new Vuex.Store({ 11 | state, 12 | mutations, 13 | actions 14 | }); -------------------------------------------------------------------------------- /codeveloper-backend/src/socket/socket-types.js: -------------------------------------------------------------------------------- 1 | exports.JOIN_IDE = "JOIN:IDE" 2 | exports.UPDATE_CODE = "UPDATE:CODE" 3 | exports.CHAT_MESSAGE = "CHAT:MESSAGE" 4 | 5 | exports.CONTAINER_INIT = "CONTAINER:INIT" 6 | exports.CONTAINER_CP = "CONTAINER:CP" 7 | exports.CONTAINER_COMMAND = "CONTAINER:COMMAND" 8 | 9 | exports.DISCONNECT = "disconnect" -------------------------------------------------------------------------------- /codeveloper-backend/src/mysql/index.js: -------------------------------------------------------------------------------- 1 | const mysql = require('mysql'); 2 | require('dotenv').config(); 3 | 4 | const connection = mysql.createConnection({ 5 | host: process.env.DB_HOST, 6 | user: process.env.DB_ID, 7 | password: process.env.DB_PW, 8 | database: process.env.DB_NAME 9 | }); 10 | 11 | connection.connect(); 12 | 13 | module.exports = connection; -------------------------------------------------------------------------------- /codeveloper-frontend/src/components/Loading.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /codeveloper-frontend/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueRouter from 'vue-router' 3 | import router from './config/router' 4 | import { store } from './store'; 5 | 6 | import VueCodemirror from 'vue-codemirror' 7 | import 'codemirror/lib/codemirror.css' 8 | 9 | import App from './App.vue' 10 | 11 | Vue.use(VueRouter) 12 | Vue.use(VueCodemirror) 13 | new Vue({ 14 | el: '#app', 15 | router, 16 | store, 17 | render: h => h(App) 18 | }) 19 | -------------------------------------------------------------------------------- /codeveloper-frontend/src/store/action-types.js: -------------------------------------------------------------------------------- 1 | 2 | export const GET_USER = 'GET_USER' 3 | export const GET_FILE = 'GET_FILE' 4 | export const GET_MASTER_FILE = 'GET_MASTER_FILE' 5 | export const NEW_FILE = 'NEW_FILE' 6 | export const GET_FILE_LIST = 'GET_FILE_LIST' 7 | export const GET_MASTER_FILE_LIST = 'GET_MASTER_FILE_LIST' 8 | export const UPDATE_FILE = 'UPDATE_FILE' 9 | export const GET_HOSTS = 'GET_HOSTS' 10 | export const GET_CONTRIBUTORS = 'GET_CONTRIBUTORS' 11 | export const ADD_CONTRIBUTOR = 'ADD_CONTRIBUTOR' -------------------------------------------------------------------------------- /codeveloper-frontend/src/components/Dimmer.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /codeveloper-backend/src/routes/auth.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | 4 | const passport = require('../passport'); 5 | 6 | router.get('/github', passport.authenticate('github')); 7 | router.get('/github/callback', passport.authenticate('github', { failureRedirect: '/login' }), (req, res) => { 8 | // Successful authentication, redirect home. 9 | res.redirect('/'); 10 | }); 11 | router.get('/logout', (req, res) => { 12 | req.session = null; 13 | res.clearCookie('sid'); 14 | res.redirect('/'); 15 | }); 16 | module.exports = router; -------------------------------------------------------------------------------- /codeveloper-frontend/src/style/component/Loading.css: -------------------------------------------------------------------------------- 1 | #loading { 2 | position: fixed; 3 | top:0; 4 | left:0; 5 | right: 0; 6 | bottom: 0; 7 | z-index: 99999; 8 | background-color: rgb(41, 39, 39); 9 | color: white; 10 | text-align: center; 11 | line-height: 100vh; 12 | animation: resize; 13 | animation-duration: 1s; 14 | animation-iteration-count: infinite; 15 | animation-direction: alternate-reverse; 16 | } 17 | @keyframes resize { 18 | 0% { 19 | font-size: 20px; 20 | } 21 | 100% { 22 | font-size: 50px; 23 | } 24 | } -------------------------------------------------------------------------------- /codeveloper-frontend/src/style/component/Nav.css: -------------------------------------------------------------------------------- 1 | nav { 2 | height: 30px; 3 | line-height: 30px; 4 | padding: 10px 20px; 5 | } 6 | nav a.brand { 7 | color: #000; 8 | text-decoration: none; 9 | font-family: 'Oswald', sans-serif; 10 | float: left; 11 | } 12 | nav ul.menu { 13 | float: right; 14 | margin: 0; 15 | } 16 | nav ul.menu li.item { 17 | display: inline-block; 18 | padding: 0 15px; 19 | cursor: pointer; 20 | font-weight: 400; 21 | color:rgb(52, 52, 52); 22 | } 23 | nav ul.menu li.item:hover { 24 | color: rgb(232, 119, 119); 25 | transition: .2s all; 26 | } -------------------------------------------------------------------------------- /codeveloper-frontend/src/socket/event-listener.js: -------------------------------------------------------------------------------- 1 | import * as types from './socket-types' 2 | import { store } from '../store' 3 | export default (socket) => { 4 | socket.on(types.UPDATE_CODE, data => { 5 | if(store.state.ide.file.currentIdx == data.idx) { 6 | store.commit('UPDATE_CODE_STATE', 'recv') 7 | store.commit('UPDATE_CODE', data.code) 8 | } 9 | }) 10 | socket.on(types.CHAT_MESSAGE, msg => { 11 | store.commit("UPDATE_CHAT", msg) 12 | }) 13 | socket.on(types.CONTAINER_COMMAND, msg => { 14 | store.commit("UPDATE_CONSOLE_LOG", msg) 15 | }) 16 | } -------------------------------------------------------------------------------- /codeveloper-frontend/src/store/modules/err-message.js: -------------------------------------------------------------------------------- 1 | // import * as messages from './messages' 2 | import { ko } from '../../locale' 3 | 4 | export default (action,code) => { 5 | switch(code){ 6 | case 4: 7 | return ko.CANNOT_ADD_CONTRIBUTOR_ME 8 | case 1: 9 | return ko.NO_PERMITION 10 | case 2: 11 | return ko.NO_CONTRIBUTOR 12 | case 3: 13 | return ko.EXIST_CONTRIBUTOR 14 | case 9: 15 | return ko.DATABASE_ERROR 16 | case 10: 17 | return ko.NOT_FOUND_FILE 18 | default: 19 | return ko.DEFAULT_ERROR 20 | } 21 | } 22 | 23 | -------------------------------------------------------------------------------- /codeveloper-backend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "codeveloper-backend", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "Jay (https://github.com/J911)", 10 | "license": "GPL-3.0", 11 | "dependencies": { 12 | "connect-flash": "^0.1.1", 13 | "cookie-parser": "^1.4.3", 14 | "cookie-session": "^2.0.0-beta.3", 15 | "dotenv": "^5.0.1", 16 | "express": "^4.16.3", 17 | "mysql": "^2.15.0", 18 | "passport": "^0.4.0", 19 | "passport-github": "^1.1.0", 20 | "socket.io": "^2.1.0" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /codeveloper-frontend/src/socket/action.js: -------------------------------------------------------------------------------- 1 | import * as types from './socket-types' 2 | 3 | export const join = (socket, joinId) => socket.emit(types.JOIN_IDE, {joinId}) 4 | export const updateCode = (socket, update) => socket.emit(types.UPDATE_CODE, {idx: update.idx, master:update.master, code: update.code }) 5 | 6 | export const initContainer = (socket, uid) => socket.emit(types.CONTAINER_INIT, {uid}) 7 | export const cpContainer = (socket, uid, filenames) => socket.emit(types.CONTAINER_CP, {uid, filenames}) 8 | export const cmdContainer = (socket, uid, cmd) => socket.emit(types.CONTAINER_COMMAND, {uid, cmd}) 9 | export const sendMessage = (socketm, msg) => socket.emit(types.CHAT_MESSAGE, { msg }) -------------------------------------------------------------------------------- /codeveloper-backend/src/routes/file/index.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | const file = require('./file.ctrl'); 4 | 5 | router.use('/', (req, res, next) => { 6 | if(req.session.passport && req.session.passport.user) next(); 7 | else return res.status(403).json({ 8 | errorCode: 1 9 | }) 10 | }); 11 | 12 | router.get('/', file.getFile); 13 | router.post('/', file.writeFile); 14 | 15 | router.get('/master', file.getMasterFile); 16 | router.get('/master/:idx', file.getMasterCode); 17 | router.post('/master/:idx', file.updateMasterCode); 18 | 19 | router.get('/:idx', file.getCode); 20 | router.post('/:idx', file.updateCode); 21 | 22 | 23 | module.exports = router; -------------------------------------------------------------------------------- /codeveloper-backend/src/routes/index.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | const auth = require('./auth'); 4 | const user = require('./user'); 5 | const file = require('./file'); 6 | 7 | router.get('/', (req, res, next)=> { 8 | req.session.passport && req.session.passport.user ? res.redirect('/ide') : next(); 9 | }); 10 | router.use('/ide', (req, res, next)=> { 11 | req.session.passport && req.session.passport.user ? next() : res.redirect('/'); 12 | }); 13 | router.use('/auth', auth); 14 | router.use('/user', user); 15 | router.use('/file', file); 16 | router.get('/test', (req, res)=> { 17 | return res.status(404).json({ 18 | errorCode: 1 19 | }) 20 | }) 21 | 22 | module.exports = router; -------------------------------------------------------------------------------- /codeveloper-backend/codeveloper.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE members ( 2 | `idx` int(11) NOT NULL, 3 | `user_id` text NOT NULL, 4 | `user_name` text NOT NULL, 5 | `user_avatar` text NOT NULL 6 | ); 7 | 8 | ALTER TABLE `members` 9 | ADD PRIMARY KEY (`idx`); 10 | 11 | ALTER TABLE `members` 12 | MODIFY `idx` int(11) NOT NULL AUTO_INCREMENT; 13 | COMMIT; 14 | 15 | 16 | CREATE TABLE `files` ( 17 | `idx` int(11) NOT NULL, 18 | `uid` text NOT NULL, 19 | `name` text NOT NULL, 20 | `icon` text NOT NULL 21 | ); 22 | 23 | ALTER TABLE `files` 24 | ADD PRIMARY KEY (`idx`); 25 | 26 | ALTER TABLE `files` 27 | MODIFY `idx` int(11) NOT NULL AUTO_INCREMENT; 28 | COMMIT; 29 | 30 | 31 | CREATE TABLE `contributors` ( 32 | `master` text NOT NULL, 33 | `contributor` text NOT NULL 34 | ); -------------------------------------------------------------------------------- /codeveloper-frontend/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | codeveloper-frontend 9 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /codeveloper-backend/src/docker/container.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const child_process = require('child_process'); 3 | 4 | exports.init = data => { 5 | const uid = data.uid; 6 | child_process.exec(`docker run -itd --name ${uid} terminal:node`); 7 | } 8 | 9 | exports.cp = data => { 10 | const uid = data.uid; 11 | const filenames = data.filenames; 12 | 13 | for(let i=0;i { 20 | const uid = data.uid; 21 | const cmd = data.cmd.split(' '); 22 | const run = child_process.spawn(`docker`,['exec',uid].concat(cmd)); 23 | return run; 24 | } -------------------------------------------------------------------------------- /codeveloper-backend/src/auth/index.js: -------------------------------------------------------------------------------- 1 | const connection = require('../mysql'); 2 | const findOrCreate = (userInfo, callback) => { 3 | const sql = `SELECT * FROM members WHERE user_id = '${userInfo.user_id}'`; 4 | connection.query(sql, (err,users) => { 5 | if(users[0]) return callback(null, userInfo); 6 | else { 7 | const sql = `INSERT INTO members(user_id, user_name, user_avatar) VALUES('${userInfo.user_id}', '${userInfo.user_name}','${userInfo.user_avatar}')`; 8 | connection.query(sql, (err) => { 9 | if(err) { 10 | console.log(err); 11 | return callback(false, null); 12 | } 13 | return callback(null, userInfo); 14 | }) 15 | } 16 | }); 17 | 18 | } 19 | 20 | module.exports = { 21 | findOrCreate 22 | } -------------------------------------------------------------------------------- /codeveloper-backend/src/passport/passport.js: -------------------------------------------------------------------------------- 1 | const passport = require('passport'); 2 | const GitHubStrategy = require('passport-github').Strategy; 3 | const Auth = require('../auth'); 4 | require('dotenv').config(); 5 | 6 | passport.use(new GitHubStrategy({ 7 | clientID: 'feabea44a7abf82a9dd7', 8 | clientSecret: process.env.GITHUB_CLIENT_SECRET, 9 | callbackURL: "http://127.0.0.1:3000/auth/github/callback" 10 | }, 11 | function(accessToken, refreshToken, profile, cb) { 12 | Auth.findOrCreate({ user_id: profile.id, user_name: profile.username, user_avatar: profile.photos[0].value }, function (err, user) { 13 | return cb(err, user); 14 | }); 15 | } 16 | )); 17 | 18 | passport.serializeUser(function (user, done) { 19 | done(null, user) 20 | }); 21 | 22 | passport.deserializeUser(function (user, done) { 23 | done(null, user); 24 | }); 25 | module.exports = passport; -------------------------------------------------------------------------------- /codeveloper-frontend/src/store/state.js: -------------------------------------------------------------------------------- 1 | export default { 2 | chat: [], 3 | contributors: [], 4 | registBox: { 5 | show: false 6 | }, 7 | user: { 8 | user_id: null, 9 | user_avatar: null 10 | }, 11 | profileBox: { 12 | show: false, 13 | contributorIdx: null 14 | }, 15 | messageBox: { 16 | show: false, 17 | title: 'Message', 18 | contents: '', 19 | }, 20 | env: { 21 | loading: true, 22 | dimmer: false, 23 | consoleMenu: 'terminal', 24 | }, 25 | ide: { 26 | terminalLogs: [], 27 | code: '', 28 | codeState: 'basic', 29 | options: { 30 | tabSize: 4, 31 | mode: 'text/javascript', 32 | theme: 'base16-dark', 33 | lineNumbers: true, 34 | line: true 35 | }, 36 | file: { 37 | files: [], 38 | contributorFiles: [], 39 | currentIdx: null, 40 | currentMaster: null 41 | }, 42 | }, 43 | } -------------------------------------------------------------------------------- /codeveloper-frontend/src/config/router.js: -------------------------------------------------------------------------------- 1 | import VueRouter from 'vue-router' 2 | import Home from '../spa/Home.vue' 3 | import Login from '../spa/Login.vue' 4 | import IDE from '../spa/IDE/IDE.vue' 5 | 6 | const routes = [ 7 | { 8 | path: '/', 9 | component: Home, 10 | meta: { 11 | title: 'Codeveloper - 당신의 팀과 co-develop하세요!' 12 | } 13 | }, 14 | { 15 | path: '/login', 16 | component: Login, 17 | meta: { 18 | title: '로그인 - Codeveloper - 당신의 팀과 co-develop하세요!' 19 | } 20 | }, 21 | { 22 | path: '/ide', 23 | component: IDE, 24 | meta: { 25 | title: 'IDE - Codeveloper - 당신의 팀과 co-develop하세요!' 26 | } 27 | }, 28 | ] 29 | 30 | const router = new VueRouter({ 31 | mode: 'history', 32 | routes 33 | }) 34 | 35 | router.beforeEach(function (to, from, next) { 36 | if(to.meta && to.meta.title){ 37 | document.title = to.meta.title; 38 | } 39 | return next(); 40 | }); 41 | 42 | export default router -------------------------------------------------------------------------------- /codeveloper-frontend/src/components/Nav.vue: -------------------------------------------------------------------------------- 1 | 24 | 35 | 36 | -------------------------------------------------------------------------------- /codeveloper-frontend/src/components/MessageBox.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /codeveloper-frontend/src/style/component/MessageBox.css: -------------------------------------------------------------------------------- 1 | .messageBox { 2 | position: fixed; 3 | z-index: 99999; 4 | min-height: 100px; 5 | min-width: 400px; 6 | top: 50%; 7 | left: 50%; 8 | margin-top: -200px; 9 | margin-left: -200px; 10 | background-color: #fff; 11 | 12 | border-radius: 3px; 13 | padding: 20px; 14 | } 15 | .messageBox h1 { 16 | font-size: 1.4rem; 17 | margin: 0; 18 | color: rgb(31, 30, 30); 19 | } 20 | .messageBox p { 21 | text-align: center; 22 | font-size: 1.2rem; 23 | } 24 | .messageBox hr { 25 | border: 0; 26 | border-bottom: 1px solid rgb(122, 122, 122); 27 | } 28 | .messageBox button { 29 | display: block; 30 | width: 100px; 31 | height: 30px; 32 | margin: 0 auto; 33 | border: none; 34 | background-color: rgb(48, 168, 48); 35 | border-radius: 3px; 36 | font-weight: 600; 37 | color: white; 38 | cursor: pointer; 39 | } 40 | .messageBox button:focus { 41 | outline: none; 42 | } 43 | .messageBox button:active { 44 | background-color: rgb(39, 133, 39); 45 | } -------------------------------------------------------------------------------- /codeveloper-backend/src/socket/index.js: -------------------------------------------------------------------------------- 1 | const types = require('./socket-types') 2 | const ct = require('../docker').container 3 | 4 | module.exports = function (io, socket) { 5 | socket.on(types.JOIN_IDE, function(data) { 6 | socket.join('IDE' + data.joinId); 7 | }); 8 | 9 | socket.on(types.UPDATE_CODE, function(data) { 10 | io.sockets.in('IDE' + data.master).emit(types.UPDATE_CODE, {idx: data.idx, code: data.code}); 11 | }); 12 | 13 | socket.on(types.CHAT_MESSAGE, function(data) { 14 | io.sockets.in('IDE' + data.roomId).emit('send:message', data.message); 15 | }); 16 | 17 | socket.on(types.DISCONNECT, function(){ 18 | }); 19 | 20 | socket.on(types.CONTAINER_INIT, ct.init); 21 | 22 | socket.on(types.CONTAINER_CP, ct.cp); 23 | 24 | socket.on(types.CONTAINER_COMMAND, (data)=>{ 25 | const run = ct.command(data); 26 | run.stdout.on('data', data=>socket.emit(types.CONTAINER_COMMAND, data.toString())); 27 | run.stderr.on('data', data=>socket.emit(types.CONTAINER_COMMAND, data.toString())); 28 | }); 29 | } -------------------------------------------------------------------------------- /codeveloper-frontend/src/spa/IDE/computed.js: -------------------------------------------------------------------------------- 1 | import * as lang from '../../locale' 2 | 3 | export default { 4 | user() { 5 | return this.$store.state.user 6 | }, 7 | currentIdx() { 8 | return this.$store.state.ide.file.currentIdx 9 | }, 10 | currentMaster() { 11 | return this.$store.state.ide.file.currentMaster 12 | }, 13 | codeState() { 14 | return this.$store.state.ide.codeState 15 | }, 16 | code() { 17 | return this.$store.state.ide.code 18 | }, 19 | contributors() { 20 | return this.$store.state.contributors 21 | }, 22 | consoleMenu() { 23 | return this.$store.state.env.consoleMenu 24 | }, 25 | ideOption () { 26 | return this.$store.state.ide.options 27 | }, 28 | files () { 29 | return this.$store.state.ide.file.files 30 | }, 31 | contributorFiles () { 32 | return this.$store.state.ide.file.contributorFiles 33 | }, 34 | terminalLogs () { 35 | return this.$store.state.ide.terminalLogs 36 | }, 37 | locale () { 38 | return lang.ko 39 | } 40 | } -------------------------------------------------------------------------------- /codeveloper-frontend/src/components/ProfileBox.vue: -------------------------------------------------------------------------------- 1 | 12 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /codeveloper-frontend/src/style/component/ProfileBox.css: -------------------------------------------------------------------------------- 1 | .profileBox { 2 | position: fixed; 3 | z-index: 99999; 4 | min-height: 100px; 5 | min-width: 200px; 6 | top: 50%; 7 | left: 50%; 8 | margin-top: -200px; 9 | margin-left: -100px; 10 | background-color: #fff; 11 | 12 | border-radius: 3px; 13 | padding: 20px; 14 | text-align: center; 15 | } 16 | .profileBox h1 { 17 | font-size: 1.4rem; 18 | margin: 0; 19 | color: rgb(31, 30, 30); 20 | } 21 | .profileBox p { 22 | text-align: center; 23 | font-size: 1.2rem; 24 | } 25 | .profileBox hr { 26 | border: 0; 27 | border-bottom: 1px solid rgb(122, 122, 122); 28 | } 29 | .profileBox button { 30 | display: block; 31 | width: 100px; 32 | height: 30px; 33 | margin: 0 auto; 34 | border: none; 35 | background-color: rgb(214, 64, 64); 36 | border-radius: 3px; 37 | font-weight: 600; 38 | color: white; 39 | cursor: pointer; 40 | } 41 | .profileBox button:focus { 42 | outline: none; 43 | } 44 | .profileBox button:active { 45 | background-color: rgb(136, 36, 36); 46 | } 47 | .profileBox .profileImage { 48 | width: 200px; 49 | } -------------------------------------------------------------------------------- /codeveloper-frontend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "codeveloper-frontend", 3 | "description": "A Vue.js project", 4 | "version": "1.0.0", 5 | "author": "J911 ", 6 | "license": "GNU", 7 | "private": true, 8 | "scripts": { 9 | "dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot", 10 | "build": "cross-env NODE_ENV=production webpack --progress --hide-modules" 11 | }, 12 | "dependencies": { 13 | "axios": "^0.18.0", 14 | "socket.io-client": "^2.1.0", 15 | "vue": "^2.5.11", 16 | "vue-codemirror": "^4.0.4", 17 | "vue-router": "^3.0.1", 18 | "vuex": "^3.0.1" 19 | }, 20 | "browserslist": [ 21 | "> 1%", 22 | "last 2 versions", 23 | "not ie <= 8" 24 | ], 25 | "devDependencies": { 26 | "babel-core": "^6.26.0", 27 | "babel-loader": "^7.1.2", 28 | "babel-preset-env": "^1.6.0", 29 | "babel-preset-stage-3": "^6.24.1", 30 | "cross-env": "^5.0.5", 31 | "css-loader": "^0.28.7", 32 | "file-loader": "^1.1.4", 33 | "vue-loader": "^13.0.5", 34 | "vue-template-compiler": "^2.4.4", 35 | "webpack": "^3.6.0", 36 | "webpack-dev-server": "^2.9.1" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /codeveloper-frontend/src/spa/Login.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /codeveloper-frontend/src/store/mutation-types.js: -------------------------------------------------------------------------------- 1 | export const UPDATE_USER = 'UPDATE_USER' 2 | export const UPDATE_FILE = 'UPDATE_FILE' 3 | export const UPDATE_CURRENT_IDX = 'UPDATE_CURRENT_IDX' 4 | export const UPDATE_FILE_LIST = 'UPDATE_FILE_LIST' 5 | export const UPDATE_MASTER_FILE_LIST = 'UPDATE_MASTER_FILE_LIST' 6 | export const UPDATE_CODE = 'UPDATE_CODE' 7 | export const UPDATE_CODE_STATE = 'UPDATE_CODE_STATE' 8 | 9 | export const SHOW_DIMMER = 'SHOW_DIMMER' 10 | export const HIDE_DIMMER = 'HIDE_DIMMER' 11 | export const SHOW_MESSAGE_BOX = 'SHOW_MESSAGE_BOX' 12 | export const HIDE_MESSAGE_BOX = 'HIDE_MESSAGE_BOX' 13 | export const SHOW_REGIST_BOX = 'SHOW_REGIST_BOX' 14 | export const HIDE_REGIST_BOX = 'HIDE_REGIST_BOX' 15 | export const SHOW_PROFILE_BOX = 'SHOW_PROFILE_BOX' 16 | export const HIDE_PROFILE_BOX = 'HIDE_PROFILE_BOX' 17 | export const SHOW_LOADING = "SHOW_LOADING" 18 | export const HIDE_LOADING = "HIDE_LOADING" 19 | 20 | export const UPDATE_CONTRIBUTORS = 'UPDATE_CONTRIBUTORS' 21 | export const ADD_CONTRIBUTOR = 'ADD_CONTRIBUTOR' 22 | 23 | export const SWITCH_CONSOLE_MENU = 'SWITCH_CONSOLE_MENU' 24 | export const UPDATE_CONSOLE_LOG = 'UPDATE_CONSOLE_LOG' 25 | 26 | export const UPDATE_CHAT = 'UPDATE_CHAT' 27 | -------------------------------------------------------------------------------- /codeveloper-backend/index.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const cookieParser = require('cookie-parser'); 3 | const bodyParser = require('body-parser'); 4 | const cookieSession = require('./src/cookie-session'); 5 | const flash = require('connect-flash'); 6 | const path = require('path'); 7 | require('dotenv').config(); 8 | 9 | const socketEventHanddler = require('./src/socket'); 10 | const routes = require('./src/index').routes; 11 | const passport = require('./src/index').passport; 12 | 13 | const PORT = process.env.PORT || 3000; 14 | 15 | const app = express(); 16 | const http = require('http').Server(app); 17 | const io = require('socket.io')(http); 18 | 19 | io.use(function(socket, next) { 20 | cookieSession(socket.request, socket.request.res, next); 21 | }); 22 | 23 | app.use(cookieSession); 24 | app.use(flash()); 25 | app.use(passport.initialize()); 26 | app.use(passport.session()); 27 | 28 | app.use(bodyParser.json()); 29 | app.use(bodyParser.urlencoded({ extended: false })); 30 | app.use(cookieParser()); 31 | 32 | app.use('/', routes); 33 | app.use('/dist', express.static(path.join(__dirname, '../codeveloper-frontend/dist'))); 34 | app.use('*', (req, res)=>res.sendFile(path.join(__dirname, '../codeveloper-frontend/index.html'))); 35 | 36 | io.on('connection', (socket)=>socketEventHanddler(io, socket)); 37 | http.listen(PORT); 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /codeveloper-frontend/src/style/component/RegistBox.css: -------------------------------------------------------------------------------- 1 | .registBox { 2 | position: fixed; 3 | z-index: 99999; 4 | min-height: 100px; 5 | min-width: 400px; 6 | top: 50%; 7 | left: 50%; 8 | margin-top: -200px; 9 | margin-left: -200px; 10 | background-color: #fff; 11 | 12 | border-radius: 3px; 13 | padding: 20px; 14 | } 15 | .registBox h1 { 16 | font-size: 1.4rem; 17 | margin: 0; 18 | color: rgb(31, 30, 30); 19 | } 20 | .registBox p { 21 | text-align: center; 22 | font-size: 1.2rem; 23 | } 24 | .registBox input { 25 | display: block; 26 | width: 200px; 27 | height: 30px; 28 | font-weight: 800; 29 | font-size: 1.2rem; 30 | border: 1px solid rgb(221, 221, 221); 31 | background-color: rgb(245, 245, 245); 32 | border-radius: 3px; 33 | margin: 20px auto; 34 | text-align: center; 35 | } 36 | .registBox input:focus { 37 | outline: none; 38 | } 39 | .registBox hr { 40 | border: 0; 41 | border-bottom: 1px solid rgb(122, 122, 122); 42 | } 43 | .registBox button { 44 | display: block; 45 | width: 100px; 46 | height: 30px; 47 | margin: 0 auto; 48 | border: none; 49 | background-color: rgb(48, 168, 48); 50 | border-radius: 3px; 51 | font-weight: 600; 52 | color: white; 53 | cursor: pointer; 54 | } 55 | .registBox button:focus { 56 | outline: none; 57 | } 58 | .registBox button:active { 59 | background-color: rgb(39, 133, 39); 60 | } -------------------------------------------------------------------------------- /codeveloper-frontend/src/style/spa/Login.css: -------------------------------------------------------------------------------- 1 | article { 2 | position: absolute; 3 | padding: 20px; 4 | display: inline-block; 5 | width: 100%; 6 | box-sizing: border-box; 7 | text-align: center; 8 | height: 152px; 9 | top: 20%; 10 | } 11 | .login-wrapper { 12 | width: 40%; 13 | margin: 0 20px; 14 | text-align: center; 15 | display: inline-block; 16 | max-width: 400px; 17 | min-width: 300px; 18 | vertical-align: top; 19 | } 20 | .login-wrapper span.brand { 21 | color: #000; 22 | font-family: 'Oswald', sans-serif; 23 | } 24 | .login-wrapper .fa-heart { 25 | color: rgb(255, 96, 123); 26 | } 27 | .login-wrapper a { 28 | margin: 0 auto; 29 | text-decoration: none; 30 | display: block; 31 | line-height: 40px; 32 | width: 300px; 33 | height: 40px; 34 | font-size: 1rem; 35 | border: none; 36 | border-radius: 3px; 37 | box-shadow: 0 0 10px gray; 38 | font-weight: 600; 39 | background-color: rgb(251, 251, 251); 40 | color: rgb(72, 72, 72); 41 | } 42 | .login-wrapper a:focus { 43 | outline: none; 44 | } 45 | .login-wrapper a:active { 46 | background-color: rgb(230, 230, 230); 47 | } 48 | footer { 49 | position: absolute; 50 | bottom: 0; 51 | left: 0; 52 | right: 0; 53 | text-align: center; 54 | font-weight: 800; 55 | padding: 20px 0; 56 | } 57 | footer a.github { 58 | color: black; 59 | text-decoration: none; 60 | } -------------------------------------------------------------------------------- /codeveloper-frontend/src/components/RegistBox.vue: -------------------------------------------------------------------------------- 1 | 16 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /codeveloper-frontend/webpack.config.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var webpack = require('webpack') 3 | 4 | module.exports = { 5 | entry: './src/main.js', 6 | output: { 7 | path: path.resolve(__dirname, './dist'), 8 | publicPath: '/dist/', 9 | filename: 'build.js' 10 | }, 11 | module: { 12 | rules: [ 13 | { 14 | test: /\.css$/, 15 | use: [ 16 | 'vue-style-loader', 17 | 'css-loader' 18 | ], 19 | }, { 20 | test: /\.vue$/, 21 | loader: 'vue-loader', 22 | options: { 23 | loaders: { 24 | } 25 | // other vue-loader options go here 26 | } 27 | }, 28 | { 29 | test: /\.js$/, 30 | loader: 'babel-loader', 31 | exclude: /node_modules/ 32 | }, 33 | { 34 | test: /\.(png|jpg|gif|svg)$/, 35 | loader: 'file-loader', 36 | options: { 37 | name: '[name].[ext]?[hash]' 38 | } 39 | } 40 | ] 41 | }, 42 | resolve: { 43 | alias: { 44 | 'vue$': 'vue/dist/vue.esm.js' 45 | }, 46 | extensions: ['*', '.js', '.vue', '.json'] 47 | }, 48 | devServer: { 49 | historyApiFallback: true, 50 | noInfo: true, 51 | overlay: true 52 | }, 53 | performance: { 54 | hints: false 55 | }, 56 | devtool: '#eval-source-map' 57 | } 58 | 59 | if (process.env.NODE_ENV === 'production') { 60 | module.exports.devtool = '#source-map' 61 | // http://vue-loader.vuejs.org/en/workflow/production.html 62 | module.exports.plugins = (module.exports.plugins || []).concat([ 63 | new webpack.DefinePlugin({ 64 | 'process.env': { 65 | NODE_ENV: '"production"' 66 | } 67 | }), 68 | new webpack.optimize.UglifyJsPlugin({ 69 | sourceMap: true, 70 | compress: { 71 | warnings: false 72 | } 73 | }), 74 | new webpack.LoaderOptionsPlugin({ 75 | minimize: true 76 | }) 77 | ]) 78 | } 79 | -------------------------------------------------------------------------------- /codeveloper-frontend/src/spa/IDE/methods.js: -------------------------------------------------------------------------------- 1 | import socket from '../../socket' 2 | 3 | export default { 4 | openFile(idx) { 5 | this.$store.dispatch('GET_FILE', idx) 6 | }, 7 | openMasterFile(master, idx) { 8 | this.$store.dispatch('GET_MASTER_FILE', {master, idx}) 9 | }, 10 | codeChange(code) { 11 | if(this.currentIdx && this.codeState == 'basic'){ 12 | this.$store.dispatch('UPDATE_FILE', { 13 | idx : this.currentIdx, 14 | code, 15 | }) 16 | socket.action.updateCode(socket, { 17 | idx: this.currentIdx, master : this.currentMaster || this.user.user_id, 18 | code 19 | }) 20 | }else this.$store.commit('UPDATE_CODE_STATE', 'basic') 21 | }, 22 | newFile() { 23 | this.$store.dispatch('NEW_FILE', this.newFileName) 24 | .then(()=>this.$store.dispatch('GET_FILE_LIST')) 25 | this.newFileName = '' 26 | this.newFileActive = false 27 | }, 28 | openMessageBox(contents) { 29 | this.$store.commit('SHOW_MESSAGE_BOX', {contents}) 30 | }, 31 | openRegistBox() { 32 | this.$store.commit('SHOW_REGIST_BOX') 33 | }, 34 | showContributor (idx){ 35 | this.$store.commit('SHOW_PROFILE_BOX', idx) 36 | }, 37 | switchConsoleMenu (menu) { 38 | this.$store.commit('SWITCH_CONSOLE_MENU', menu) 39 | }, 40 | runCmd() { 41 | socket.action.cpContainer(socket, this.user.user_id, this.files) 42 | this.$store.commit('UPDATE_CONSOLE_LOG', this.user.user_name + '@codeveloper $ ' + this.command) 43 | socket.action.cmdContainer(socket, this.user.user_id, this.command) 44 | this.command = '' 45 | }, 46 | sendMessage() { 47 | socket.action.sendMessage(socket, this.chatMsg) 48 | }, 49 | scrollToEnd() { 50 | const container = document.querySelector('.terminal') 51 | const scrollHeight = container.scrollHeight 52 | container.scrollTop = scrollHeight 53 | } 54 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # codeveloper 2 | ![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg) 3 | 4 | Codeveloper - 당신의 팀과 co-develop하세요! 5 | 6 | ## 읽는법 7 | 코드벨로퍼, 코디벨로퍼와 같이 어떻게 이름을 읽어야할지 햇갈리는 경우가 있는데 **코드벨로퍼**라고 읽으면 됩니다. 8 | 9 | ## 코드벨로퍼 10 | ![CODEVELOPER](https://i.imgur.com/ff3JwFs.png) 11 | 코드벨로퍼는 웹 기반 IDE에디터로, 소켓 통신을 통해 여러사람이 동시에 작업할 수 있습니다. 12 | 13 | ## 오픈소스 프로젝트 14 | 모든 코드를 레파지토리에 공유합니다. 라이센스에 기반하여 마음껏 가져다 쓰셔도 됩니다. 15 | ~~*(이 코드들도 다 오픈소스로 만들어서)*~~ 16 | ## 빌드 가이드 17 | 18 | ## Feature 19 | - Ubuntu 기반의 터미널 제공 20 | - Node Js 런타임(V8) 제공 21 | - 파일 생성 및 코드 편집 가능 22 | - 공동개발자 등록 및 동시 코드 편집 23 | 24 | ### npm install 25 | ``` 26 | $ cd codeveloper-frontend 27 | $ npm install 28 | 29 | $ cd codeveloper-backend 30 | $ npm install 31 | ``` 32 | 33 | ### setting database 34 | ``` 35 | $ mysql -u root -p 36 | mariaDB [(none)] > create database codeveloper; 37 | mariaDB [(none)] > use codeveloper 38 | mariaDB [codeveloper] > source "codeveloper.sql"; 39 | ``` 40 | 41 | ### setting backend 42 | ``` 43 | $ cd codeveloper-backend 44 | $ cp .env_sample .env 45 | $ vi .env // env 수정 46 | $ mkdir uploads // init folder 47 | ``` 48 | 49 | ### build frontend 50 | ``` 51 | $ cd codeveloper-frontend 52 | $ npm run build 53 | ``` 54 | 55 | ### make docker image 56 | ``` 57 | $ cd codeveloper-backend/src/docker/dockerfile 58 | $ docker build --tag terminal:node . 59 | ``` 60 | 61 | ### run codeveloper 62 | ``` 63 | $ cd codeveloper-backend 64 | $ node index.js 65 | enjoy codeveloper 🙌 66 | ``` 67 | 68 | ## Stack 69 | 70 | ### backend 71 | - Node Js 72 | - Express Js 73 | - Mysql 74 | - Socket.io 75 | - Docker 76 | 77 | ### frontend 78 | - Vue Js 79 | - Webpack3 80 | - CodeMirror 81 | - FontAswome 82 | - Axios 83 | - Vuex 84 | 85 | ## 소개 Slide 86 | - [개발 계획](https://www.slideshare.net/ssuser827c0b/codeveloper) 87 | - [개발기](https://www.slideshare.net/ssuser827c0b/codeveloper-98231390) 88 | 89 | ## 데모 영상 90 | - [Youtube](https://youtu.be/lpQRb---oGI) 91 | 92 | ## 라이센스 93 | GNU General Public License v3.0 94 | -------------------------------------------------------------------------------- /codeveloper-frontend/src/locale/ko.js: -------------------------------------------------------------------------------- 1 | // Home Messages 2 | export const CODEVELOPER_SLOGAN = "당신의 팀과 co-develop하세요!" 3 | export const CODEVELOPER_SHORT_INTRODUCE = "codeveloper.io는 실시간 협업코딩 솔루션입니다." 4 | export const CODEVELOPER_INTRODUCE = "codeveloper는 여러 그룹이 동시에 소스코드를 개발 및 수정 할 수 있도록 개발된 웹 IDE입니다." 5 | export const CODEVELOPER_CONTENTS = "실시간 코드 동기화와 컴파일을 codeveloper에서 시작해보세요!" 6 | export const CODEVELOPER_LANGUAGES = "현재 지원언어" 7 | export const CODEVELOPER_NO_LANGUAGE = "원하는 언어가 없나요?" 8 | 9 | //LOGIN 10 | export const LOGIN_INTRODUCE = "Github 계정만 있으면 바로 시작할 수 있습니다!" 11 | export const LOGIN_TEXT = "로그인" 12 | 13 | // error Messages 14 | export const CANNOT_ADD_CONTRIBUTOR = "컨트리뷰터를 추가할 수 없습니다." 15 | export const CANNOT_ADD_CONTRIBUTOR_ME = "본인은 추가할 수 없습니다." 16 | export const NO_PERMITION = "권한이 존재하지 않습니다." 17 | export const NO_CONTRIBUTOR = "유저가 존재하지 않습니다." 18 | export const EXIST_CONTRIBUTOR = "이미 추가된 멤버입니다." 19 | export const DATABASE_ERROR = "데이터베이스 에러가 발생했습니다." 20 | export const DEFAULT_ERROR = "알수없는 에러가 발생했습니다." 21 | export const NOT_FOUND_FILE = "파일을 찾을 수 없습니다." 22 | 23 | // common Message 24 | 25 | export const CODEVELOPER_TEXT = "코드벨로퍼" 26 | export const PREPARATIONS_TEXT = "준비중입니다." 27 | export const DONE_TEXT = "완료" 28 | export const OKAY_TEXT = "확인" 29 | export const CLOSE_TEXT = "닫기" 30 | export const START_TEXT = "시작하기" 31 | export const ADD_TEXT = "추가" 32 | export const INTRODUCE_DEVELOPER = "개발자 소개" 33 | 34 | // IDE 35 | 36 | export const INPUT_GITHUB_NAME = "Github이름을 입력해주세요" 37 | export const IDE_INTRO_MESSAGE = `# INTRO MESSAGE 38 | 39 | # 코드 벨러퍼에 오신 것을 환영합니다! 40 | 41 | # 코드벨로퍼는 여러 개발자가 동시에 개발을 할 수 있는 웹 기반 IDE 입니다 42 | _ _ 43 | __ __ _____| |__ ___ _ __ ___ | |_ ___ 44 | \\ V V / -_) / _/ _ \\ ' \\/ -_) | _/ _ \\ 45 | \\_/\\_/\\___|_\\__\\___/_|_|_\\___| \\__\\___/ 46 | 47 | 48 | ___ ___ ___ _____ _____ _ ___ ___ ___ ___ 49 | / __/ _ \\| \\| __\\ \\ / / __| | / _ \\| _ \\ __| _ \\ 50 | | (_| (_) | |) | _| \\ V /| _|| |_| (_) | _/ _|| / 51 | \\___\\___/|___/|___| \\_/ |___|____\\___/|_| |___|_|_\\ 52 | 53 | 54 | 55 | # 개발자 GitHub 56 | - https://github.com/ 57 | # Codeveloper 레파지토리 58 | - https://github.com/J911/codeveloper` -------------------------------------------------------------------------------- /codeveloper-frontend/src/style/spa/Home.css: -------------------------------------------------------------------------------- 1 | hr { 2 | width: 30px; 3 | margin: 20px auto; 4 | border: 2px solid rgb(248, 107, 107); 5 | } 6 | a { 7 | text-decoration: none; 8 | color: black; 9 | } 10 | header { 11 | background-image: url('../../assets/header_bg.png'); 12 | background-position: center; 13 | text-align: center; 14 | padding: 100px 20px; 15 | color: #fff; 16 | height: 400px; 17 | box-sizing: border-box; 18 | } 19 | header h1 { 20 | line-height: 80px; 21 | font-size: 3rem; 22 | opacity: 0.9; 23 | } 24 | header p { 25 | opacity: 0.8; 26 | } 27 | header .btn-group { 28 | margin: 50px 0; 29 | } 30 | header button { 31 | width: 200px; 32 | height: 40px; 33 | font-size: 1rem; 34 | border: none; 35 | margin: 0 20px; 36 | font-weight: 600; 37 | background-color: rgb(220, 101, 101); 38 | border-radius: 3px; 39 | color: #fff; 40 | box-shadow: 0 0 10px rgb(106, 106, 106); 41 | cursor: pointer; 42 | } 43 | header button:active { 44 | background-color: rgb(218, 84, 84); 45 | } 46 | header button:focus { 47 | outline: none; 48 | } 49 | .gray { 50 | background-color: gray; 51 | } 52 | .gray:active { 53 | background-color: rgb(129, 118, 118); 54 | } 55 | article { 56 | padding: 20px; 57 | } 58 | article section { 59 | padding: 10px; 60 | } 61 | article section#introduce { 62 | text-align: center; 63 | } 64 | article section#language { 65 | text-align: center; 66 | } 67 | article section#introduce > i { 68 | font-size: 3rem; 69 | } 70 | article section#introduce h1 { 71 | line-height: 50px; 72 | } 73 | article section#language h1 { 74 | line-height: 50px; 75 | } 76 | article section#language ul.languages { 77 | padding: 20px 0; 78 | list-style: none; 79 | } 80 | article section#language ul.languages li.item { 81 | display: inline-block; 82 | padding: 0 20px; 83 | } 84 | span.icon { 85 | font-weight: 800; 86 | font-size: 2rem; 87 | } 88 | article section#language .sub-contents { 89 | font-size: 0.8rem; 90 | color: gray; 91 | cursor: pointer; 92 | } 93 | footer { 94 | position: relative; 95 | bottom: 0; 96 | left: 0; 97 | right: 0; 98 | text-align: center; 99 | font-weight: 800; 100 | padding: 20px 0; 101 | } 102 | footer a.github { 103 | color: black; 104 | text-decoration: none; 105 | } -------------------------------------------------------------------------------- /codeveloper-frontend/src/spa/Home.vue: -------------------------------------------------------------------------------- 1 | 41 | 42 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /codeveloper-backend/src/routes/user.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | const connection = require('../mysql'); 4 | 5 | router.use('/', (req, res, next) => { 6 | if(req.session.passport && req.session.passport.user) next(); 7 | else return res.status(403).json({ 8 | errorCode: 1 9 | }) 10 | }); 11 | 12 | router.get('/', (req, res, next) => { 13 | const session = req.session.passport.user; 14 | return res.json({user: session}); 15 | }); 16 | 17 | router.get('/host', (req, res, next)=> { 18 | const session = req.session.passport.user; 19 | const sql = `SELECT members.* FROM members INNER JOIN contributors ON contributors.master = members.user_id WHERE contributors.contributor = '${session.user_id}'`; 20 | connection.query(sql, (err, hosts) => { 21 | if(err) return res.status(500).json({ 22 | errorCode: 9 23 | }); 24 | return res.json({hosts: hosts}); 25 | }) 26 | }); 27 | 28 | router.get('/contributor', (req, res, next)=> { 29 | const session = req.session.passport.user; 30 | const sql = `SELECT members.* FROM members INNER JOIN contributors ON contributors.contributor = members.user_id WHERE contributors.master = '${session.user_id}'`; 31 | connection.query(sql, (err, contributors) => { 32 | if(err) return res.status(500).json({ 33 | errorCode: 9 34 | }); 35 | return res.json({contributors: contributors}); 36 | }) 37 | }); 38 | 39 | router.post('/contributor', (req, res, next)=> { 40 | const session = req.session.passport.user; 41 | const contributor = req.body.contributor; 42 | 43 | if(contributor == session.user_name) return res.status(400).json({ 44 | errorCode: 4 45 | }); // 본인을 추가한 경우 46 | 47 | const sql = `SELECT * FROM members WHERE user_name = '${contributor}'`; 48 | connection.query(sql, (err, user) => { 49 | if(err) return res.status(500).json({ 50 | errorCode: 1 51 | }); // DB 에러 52 | if(!user[0]) return res.status(404).json({ 53 | errorCode: 2 54 | }); // 유저가 존재하지 않음 55 | const sql = `SELECT * FROM contributors WHERE master = '${session.user_id}' and contributor = '${user[0].user_id}'`; 56 | connection.query(sql, (err, result) => { 57 | if(err) return res.status(500).json({ 58 | errorCode: 9 59 | }); // DB 에러 60 | if(result[0]) return res.status(409).json({ 61 | errorCode: 3 62 | }); // 중복 63 | const sql = `INSERT INTO contributors(master, contributor) VALUES('${session.user_id}', '${user[0].user_id}')`; 64 | 65 | connection.query(sql, (err) => { 66 | if(err) return res.status(500).json({ 67 | errorCode: 9 68 | }); // DB 에러 69 | return res.json({contributor: user[0]}); 70 | }); 71 | }) 72 | }); 73 | }); 74 | 75 | module.exports = router; -------------------------------------------------------------------------------- /codeveloper-frontend/src/store/mutations.js: -------------------------------------------------------------------------------- 1 | import * as types from './mutation-types' 2 | 3 | const mutations = { 4 | [types.UPDATE_USER]: function (state, payload) { 5 | state.user = payload 6 | }, 7 | [types.UPDATE_CODE_STATE]: function (state, payload) { 8 | state.ide.codeState = payload 9 | }, 10 | [types.UPDATE_CURRENT_IDX]: function (state, payload) { 11 | if(payload.master) state.ide.file.currentMaster = payload.master 12 | else state.ide.file.currentMaster = null 13 | state.ide.file.currentIdx = payload.idx 14 | }, 15 | [types.UPDATE_FILE]: function (state, payload) { 16 | state.ide.code = payload 17 | }, 18 | [types.UPDATE_FILE_LIST]: function (state, payload){ 19 | state.ide.file.files = payload 20 | }, 21 | [types.UPDATE_MASTER_FILE_LIST]: function (state, payload){ 22 | state.ide.file.contributorFiles.push(payload) 23 | }, 24 | [types.UPDATE_CODE]: function (state, payload){ 25 | state.ide.code = payload 26 | }, 27 | [types.SHOW_DIMMER]: function (state){ 28 | state.env.dimmer = true 29 | }, 30 | [types.HIDE_DIMMER]: function (state){ 31 | state.registBox.show = false 32 | state.env.messagebox = false 33 | state.profileBox.show = false 34 | state.env.dimmer = false 35 | }, 36 | [types.SHOW_LOADING]: function (state){ 37 | state.env.loading = true 38 | }, 39 | [types.HIDE_LOADING]: function (state){ 40 | state.env.loading = false 41 | }, 42 | [types.SHOW_MESSAGE_BOX]: function (state, payload){ 43 | state.env.dimmer = true 44 | state.profileBox.show = false 45 | state.registBox.show = false 46 | 47 | state.messageBox.title = payload.title || 'Message' 48 | state.messageBox.contents = payload.contents 49 | state.messageBox.show = true 50 | 51 | }, 52 | [types.HIDE_MESSAGE_BOX]: function (state){ 53 | state.env.dimmer = false 54 | state.messageBox.show = false 55 | }, 56 | [types.SHOW_REGIST_BOX]: function (state){ 57 | state.env.dimmer = true 58 | state.env.messagebox = false 59 | state.profileBox.active = false 60 | state.registBox.show = true 61 | 62 | }, 63 | [types.HIDE_REGIST_BOX]: function (state){ 64 | state.env.dimmer = false 65 | state.registBox.show = false 66 | }, 67 | [types.SHOW_PROFILE_BOX]: function (state, payload){ 68 | state.env.dimmer = true 69 | state.messageBox.show = false 70 | state.registBox.show = false 71 | 72 | state.profileBox.contributorIdx = payload 73 | state.profileBox.show = true 74 | }, 75 | [types.HIDE_PROFILE_BOX]: function (state){ 76 | state.env.dimmer = false 77 | state.profileBox.show = false 78 | }, 79 | [types.UPDATE_CONTRIBUTORS]: function (state, payload){ 80 | state.contributors = payload 81 | }, 82 | [types.ADD_CONTRIBUTOR]: function (state, payload){ 83 | state.contributors.push(payload) 84 | }, 85 | [types.SWITCH_CONSOLE_MENU]: function (state, payload){ 86 | state.env.consoleMenu = payload 87 | }, 88 | [types.UPDATE_CONSOLE_LOG]: function (state, payload){ 89 | state.ide.terminalLogs.push(payload) 90 | }, 91 | [types.UPDATE_CHAT]: function (state, payload){ 92 | state.chat.push(payload) 93 | }, 94 | } 95 | 96 | export default mutations -------------------------------------------------------------------------------- /codeveloper-frontend/src/store/actions.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | import * as types from './action-types' 3 | import * as mutationTypes from './mutation-types' 4 | 5 | import errMessage from './modules/err-message' 6 | 7 | const actions = { 8 | [types.GET_USER]: function (context) { 9 | return axios.get(`/user`) 10 | .then((result) => { 11 | setTimeout(()=>context.commit(mutationTypes.HIDE_LOADING), 1000) 12 | context.commit(mutationTypes.UPDATE_USER,result.data.user) 13 | }) 14 | .catch((e) => context.commit(mutationTypes.SHOW_MESSAGE_BOX, {contents: errMessage(types.GET_USER,e.response.data.errorCode)})) 15 | }, 16 | [types.GET_FILE_LIST]: function (context, payload) { 17 | axios.get(`/file`) 18 | .then((result) => { 19 | // this.code = result.data.code 20 | context.commit(mutationTypes.UPDATE_FILE_LIST, result.data.files) 21 | }) 22 | .catch((e) => context.commit(mutationTypes.SHOW_MESSAGE_BOX, {contents: errMessage(types.GET_FILE_LIST,e.response.data.errorCode)})) 23 | 24 | }, 25 | [types.GET_MASTER_FILE_LIST]: function (context, payload) { 26 | axios.get(`/file/master`, { params: { master: payload }}) 27 | .then((result) => { 28 | // this.code = result.data.code 29 | context.commit(mutationTypes.UPDATE_MASTER_FILE_LIST, result.data) 30 | }) 31 | .catch((e) => context.commit(mutationTypes.SHOW_MESSAGE_BOX, {contents: errMessage(types.GET_FILE_LIST,e.response.data.errorCode)})) 32 | 33 | }, 34 | [types.GET_FILE]: function (context, payload) { 35 | axios.get(`/file/${payload}`) 36 | .then((result) => { 37 | context.commit(mutationTypes.UPDATE_CURRENT_IDX, {idx: payload}) 38 | context.commit(mutationTypes.UPDATE_FILE, result.data.code) 39 | }) 40 | .catch((e) => context.commit(mutationTypes.SHOW_MESSAGE_BOX, {contents: errMessage(types.GET_FILE,e.response.data.errorCode)})) 41 | }, 42 | [types.GET_MASTER_FILE]: function (context, payload) { 43 | axios.get(`/file/master/${payload.idx}`, {params: {master:payload.master}}) 44 | .then((result) => { 45 | context.commit(mutationTypes.UPDATE_CURRENT_IDX, {idx: payload.idx, master:payload.master}) 46 | context.commit(mutationTypes.UPDATE_FILE, result.data.code) 47 | }) 48 | .catch((e) => context.commit(mutationTypes.SHOW_MESSAGE_BOX, {contents: errMessage(types.GET_FILE,e.response.data.errorCode)})) 49 | }, 50 | [types.NEW_FILE]: function (context, payload) { 51 | return axios.post(`/file`, {filename: payload}) 52 | .catch((e) => context.commit(mutationTypes.SHOW_MESSAGE_BOX, {contents: errMessage(types.GET_FILE,e.response.data.errorCode)})) 53 | }, 54 | 55 | [types.UPDATE_FILE]: function (context, payload) { 56 | if(context.state.ide.file.currentMaster) 57 | axios.post(`/file/master/${payload.idx}`, {master:context.state.ide.file.currentMaster, code: payload.code}) 58 | else 59 | axios.post(`/file/${payload.idx}`, {code: payload.code}) 60 | context.commit(mutationTypes.UPDATE_FILE, payload.code) 61 | }, 62 | 63 | [types.GET_HOSTS](context) { 64 | return axios.get(`/user/host`) 65 | .then((result) => result.data.hosts) 66 | .catch((e) => context.commit(mutationTypes.SHOW_MESSAGE_BOX, {contents: errMessage(types.GET_HOSTS,e.response.data.errorCode)})) 67 | }, 68 | 69 | [types.GET_CONTRIBUTORS](context) { 70 | axios.get(`/user/contributor`) 71 | .then((result) => context.commit(mutationTypes.UPDATE_CONTRIBUTORS, result.data.contributors)) 72 | .catch((e) => context.commit(mutationTypes.SHOW_MESSAGE_BOX, {contents: errMessage(types.GET_CONTRIBUTORS,e.response.data.errorCode)})) 73 | }, 74 | 75 | [types.ADD_CONTRIBUTOR]: function (context, payload) { 76 | axios.post(`/user/contributor`, {contributor: payload}) 77 | .then((result) => { 78 | context.commit(mutationTypes.SHOW_MESSAGE_BOX, {contents: "Success!"}) 79 | context.commit(mutationTypes.ADD_CONTRIBUTOR, result.data.contributor) 80 | }) 81 | .catch((e) => context.commit(mutationTypes.SHOW_MESSAGE_BOX, {contents: errMessage(types.ADD_CONTRIBUTOR,e.response.data.errorCode)})) 82 | } 83 | 84 | } 85 | 86 | export default actions -------------------------------------------------------------------------------- /codeveloper-frontend/src/style/spa/IDE.css: -------------------------------------------------------------------------------- 1 | a { 2 | text-decoration: none; 3 | color: rgb(235, 235, 235); 4 | } 5 | nav { 6 | position: fixed; 7 | top:0; 8 | left: 0; 9 | right: 0; 10 | height: 40px; 11 | background-color: #3c3c3c; 12 | box-shadow: 0 0 10px #060505; 13 | z-index: 999; 14 | padding: 0 20px; 15 | } 16 | nav a.brand { 17 | font-family: 'Oswald', sans-serif; 18 | float: left; 19 | line-height: 40px; 20 | } 21 | nav ul.menu{ 22 | float: right; 23 | list-style: none; 24 | margin: 0; 25 | } 26 | nav ul.menu li.item { 27 | display: inline-block; 28 | color: rgb(235, 235, 235); 29 | margin: 0 10px; 30 | cursor: pointer; 31 | } 32 | nav .profile img { 33 | height: 30px; 34 | border-radius: 6px; 35 | margin: 5px 5px 5px 20px; 36 | } 37 | nav span { 38 | vertical-align: 70%; 39 | } 40 | .explorer { 41 | position: absolute; 42 | top: 40px; 43 | left: 0; 44 | bottom: 0; 45 | display: inline-block; 46 | width: 20%; 47 | background-color: #252526; 48 | z-index: 999; 49 | color: rgb(199, 199, 199); 50 | } 51 | .explorer > .header { 52 | padding: 20px; 53 | 54 | } 55 | .explorer ul.files, 56 | .explorer ul.sub-files{ 57 | margin: 0; 58 | padding: 0; 59 | list-style: none; 60 | } 61 | .explorer ul.files li { 62 | line-height: 30px; 63 | } 64 | .explorer ul.files li.header { 65 | background-color: #3c3c3c; 66 | padding: 0 20px; 67 | font-weight: 800; 68 | 69 | } 70 | .explorer ul.files li.item { 71 | padding: 0 20px; 72 | cursor: pointer; 73 | } 74 | .explorer ul.files li.item:hover { 75 | background-color: rgb(46, 45, 45); 76 | } 77 | .explorer ul.files li.item.active { 78 | background-color: rgb(70, 70, 70); 79 | } 80 | .explorer ul.files li.item .new-file { 81 | background-color: #5c5c5cbb; 82 | color: white; 83 | border: 1px solid rgba(15, 15, 136, 0.473); 84 | font-weight: 600; 85 | padding: 5px; 86 | width: 70%; 87 | } 88 | .explorer ul.files li.item .new-file:focus { 89 | outline: none; 90 | } 91 | .explorer .new-items { 92 | float: right; 93 | } 94 | .explorer .new-items i { 95 | margin: 0 3px; 96 | cursor: pointer; 97 | } 98 | .explorer .footer { 99 | position: absolute; 100 | bottom: 0; 101 | width: 100%; 102 | padding: 10px; 103 | box-sizing: border-box; 104 | font-weight: 400; 105 | font-size: 0.8rem; 106 | } 107 | .explorer .footer .contributors { 108 | width: 100%; 109 | height: 40px; 110 | background-color: rgb(75, 74, 74); 111 | border-radius: 3px; 112 | padding: 5px; 113 | box-sizing: border-box; 114 | } 115 | .explorer .footer .contributors img { 116 | width: 20px; 117 | border-radius: 3px; 118 | cursor: pointer; 119 | } 120 | .explorer .footer .contributors i { 121 | font-size: 1.3rem; 122 | cursor: pointer; 123 | } 124 | .editor { 125 | position: absolute; 126 | top: 40px; 127 | right: 0; 128 | bottom: 30%; 129 | display: inline-block; 130 | width: 80%; 131 | background-color: #151515; 132 | } 133 | .console { 134 | position: absolute; 135 | top: 70%; 136 | right: 0; 137 | bottom: 0; 138 | display: inline-block; 139 | width: 80%; 140 | background-color: #151515; 141 | border-top: 1px solid rgb(57, 57, 57); 142 | } 143 | .console .header ul.menu{ 144 | list-style: none; 145 | color: rgb(171, 171, 171); 146 | margin: 0; 147 | padding: 20px 20px 0 20px; 148 | } 149 | .console .body { 150 | color: rgb(171, 171, 171); 151 | padding: 20px; 152 | } 153 | .console .body .chat, 154 | .console .body .terminal { 155 | list-style: none; 156 | padding: 5px 0; 157 | margin: 0; 158 | font-size: 15px; 159 | overflow: scroll; 160 | height: 14vh; 161 | } 162 | 163 | .console .body .terminal input{ 164 | background-color: #151515; 165 | width: 70%; 166 | border: none; 167 | padding: 0 5px; 168 | color: rgb(171, 171, 171); 169 | font-size: 15px; 170 | } 171 | .console .body .terminal pre { 172 | margin-top: 0; 173 | margin-bottom: 5px; 174 | } 175 | .console .body .terminal input:focus { 176 | outline: none; 177 | } 178 | .console .header ul.menu li.item{ 179 | display: inline-block; 180 | padding-bottom: 10px; 181 | margin: 0 10px; 182 | cursor: pointer; 183 | } 184 | .CodeMirror { 185 | height: auto; 186 | } 187 | .CodeMirror-scroll { 188 | height: 62vh; 189 | } 190 | .console .header ul.menu li.item.active { 191 | color: rgb(206, 206, 206); 192 | border-bottom: 2px solid rgb(181, 181, 181); 193 | } 194 | -------------------------------------------------------------------------------- /codeveloper-backend/src/routes/file/file.ctrl.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | const connection = require('../../mysql'); 4 | 5 | const baseDir = '../../../'; 6 | 7 | exports.getFile = (req, res) => { 8 | const session = req.session.passport.user; 9 | const sql = `SELECT * FROM files WHERE uid = ${session.user_id}`; 10 | connection.query(sql, (err, files) => { 11 | if(err) return res.status(500).json({ 12 | errorCode: 9 13 | }); 14 | return res.json({files: files}); 15 | }); 16 | } 17 | 18 | exports.getMasterFile = (req, res) => { 19 | const session = req.session.passport.user; 20 | const master = req.query.master; 21 | const sql = `SELECT files.* FROM files INNER JOIN contributors ON contributors.master = files.uid WHERE files.uid = '${master}' and contributors.contributor = '${session.user_id}'`; 22 | connection.query(sql, (err, files) => { 23 | if(err) return res.status(500).json({ 24 | errorCode: 9 25 | }); 26 | return res.json({master, files}); 27 | }); 28 | } 29 | 30 | exports.getCode = (req, res) => { 31 | const session = req.session.passport.user; 32 | const idx = req.params.idx; 33 | const sql = `SELECT * FROM files WHERE uid = ${session.user_id} and idx = ${idx}`; 34 | connection.query(sql, (err, files) => { 35 | if(err) return res.status(500).json({ 36 | errorCode: 9 37 | }); 38 | if(files[0]) fs.readFile(path.resolve(__dirname, `${baseDir}uploads/${session.user_id}_${idx}`), 'utf8', function(err, data){ 39 | if(err && err.errno == -2) 40 | fs.writeFileSync(path.resolve(__dirname, `${baseDir}uploads/${session.user_id}_${idx}`), ''); 41 | return res.json({code: data || ''}); 42 | }); 43 | else return res.status(404).json({ 44 | errorCode: 10 //파일을 찾을 수 없음. 45 | }); 46 | }); 47 | } 48 | 49 | exports.writeFile = (req, res) => { 50 | const session = req.session.passport.user; 51 | const filename = req.body.filename; 52 | const icon = 'fab fa-js'; 53 | 54 | const sql = `INSERT INTO files(uid, name, icon) VALUES('${session.user_id}', '${filename}', '${icon}')`; 55 | connection.query(sql, (err) => { 56 | if(err) return res.status(500).json({ 57 | errorCode: 9 58 | }); 59 | return res.json({result: "success"}); 60 | }); 61 | } 62 | 63 | exports.updateCode = (req, res) => { 64 | const session = req.session.passport.user; 65 | const idx = req.params.idx; 66 | const code = req.body.code; 67 | const sql = `SELECT * FROM files WHERE uid = ${session.user_id} and idx = ${idx}`; 68 | connection.query(sql, (err, files) => { 69 | if(err) return res.status(500).json({ 70 | errorCode: 9 71 | }); 72 | if(files[0]) fs.writeFile(path.resolve(__dirname, `${baseDir}uploads/${session.user_id}_${idx}`), code, function(err) { 73 | return res.json({result: "success"}); 74 | }); 75 | else return res.status(404).json({ 76 | errorCode: 10 //파일을 찾을 수 없음. 77 | }); 78 | }); 79 | } 80 | 81 | exports.updateMasterCode = (req, res) => { 82 | const session = req.session.passport.user; 83 | const idx = req.params.idx; 84 | const master = req.body.master; 85 | const code = req.body.code; 86 | const sql = `SELECT files.* FROM files INNER JOIN contributors ON contributors.master = files.uid WHERE files.uid = ${master} and files.idx = ${idx} and contributors.contributor = '${session.user_id}'`; 87 | connection.query(sql, (err, files) => { 88 | if(err) return res.status(500).json({ 89 | errorCode: 9 90 | }); 91 | if(files[0]) fs.writeFile(path.resolve(__dirname, `${baseDir}uploads/${master}_${idx}`), code, function(err) { 92 | return res.json({result: "success"}); 93 | }); 94 | else return res.status(404).json({ 95 | errorCode: 10 //파일을 찾을 수 없음. 96 | }); 97 | }); 98 | } 99 | 100 | exports.getMasterCode = (req, res) => { 101 | const session = req.session.passport.user; 102 | const idx = req.params.idx; 103 | const master = req.query.master; 104 | const sql = `SELECT files.* FROM files INNER JOIN contributors ON contributors.master = files.uid WHERE files.uid = ${master} and files.idx = ${idx} and contributors.contributor = '${session.user_id}'`; 105 | connection.query(sql, (err, files) => { 106 | if(err) return res.status(500).json({ 107 | errorCode: 9 108 | }); 109 | if(files[0]) fs.readFile(path.resolve(__dirname, `${baseDir}uploads/${master}_${idx}`), 'utf8', function(err, data){ 110 | if(err && err.errno == -2) 111 | fs.writeFileSync(path.resolve(__dirname, `${baseDir}uploads/${master}_${idx}`), ''); 112 | return res.json({code: data || ''}); 113 | }); 114 | else return res.status(404).json({ 115 | errorCode: 10 //파일을 찾을 수 없음. 116 | }); 117 | }); 118 | } -------------------------------------------------------------------------------- /codeveloper-frontend/src/spa/IDE/IDE.vue: -------------------------------------------------------------------------------- 1 | 108 | 109 | 162 | 163 | 164 | -------------------------------------------------------------------------------- /codeveloper-backend/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "codeveloper-backend", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "accepts": { 8 | "version": "1.3.5", 9 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", 10 | "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", 11 | "requires": { 12 | "mime-types": "2.1.18", 13 | "negotiator": "0.6.1" 14 | } 15 | }, 16 | "after": { 17 | "version": "0.8.2", 18 | "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", 19 | "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=" 20 | }, 21 | "array-flatten": { 22 | "version": "1.1.1", 23 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", 24 | "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" 25 | }, 26 | "arraybuffer.slice": { 27 | "version": "0.0.7", 28 | "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz", 29 | "integrity": "sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog==" 30 | }, 31 | "async-limiter": { 32 | "version": "1.0.0", 33 | "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", 34 | "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==" 35 | }, 36 | "backo2": { 37 | "version": "1.0.2", 38 | "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", 39 | "integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc=" 40 | }, 41 | "base64-arraybuffer": { 42 | "version": "0.1.5", 43 | "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz", 44 | "integrity": "sha1-c5JncZI7Whl0etZmqlzUv5xunOg=" 45 | }, 46 | "base64id": { 47 | "version": "1.0.0", 48 | "resolved": "https://registry.npmjs.org/base64id/-/base64id-1.0.0.tgz", 49 | "integrity": "sha1-R2iMuZu2gE8OBtPnY7HDLlfY5rY=" 50 | }, 51 | "better-assert": { 52 | "version": "1.0.2", 53 | "resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz", 54 | "integrity": "sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI=", 55 | "requires": { 56 | "callsite": "1.0.0" 57 | } 58 | }, 59 | "bignumber.js": { 60 | "version": "4.0.4", 61 | "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-4.0.4.tgz", 62 | "integrity": "sha512-LDXpJKVzEx2/OqNbG9mXBNvHuiRL4PzHCGfnANHMJ+fv68Ads3exDVJeGDJws+AoNEuca93bU3q+S0woeUaCdg==" 63 | }, 64 | "blob": { 65 | "version": "0.0.4", 66 | "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.4.tgz", 67 | "integrity": "sha1-vPEwUspURj8w+fx+lbmkdjCpSSE=" 68 | }, 69 | "body-parser": { 70 | "version": "1.18.2", 71 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz", 72 | "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", 73 | "requires": { 74 | "bytes": "3.0.0", 75 | "content-type": "1.0.4", 76 | "debug": "2.6.9", 77 | "depd": "1.1.2", 78 | "http-errors": "1.6.3", 79 | "iconv-lite": "0.4.19", 80 | "on-finished": "2.3.0", 81 | "qs": "6.5.1", 82 | "raw-body": "2.3.2", 83 | "type-is": "1.6.16" 84 | } 85 | }, 86 | "bytes": { 87 | "version": "3.0.0", 88 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", 89 | "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" 90 | }, 91 | "callsite": { 92 | "version": "1.0.0", 93 | "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", 94 | "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=" 95 | }, 96 | "component-bind": { 97 | "version": "1.0.0", 98 | "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", 99 | "integrity": "sha1-AMYIq33Nk4l8AAllGx06jh5zu9E=" 100 | }, 101 | "component-emitter": { 102 | "version": "1.2.1", 103 | "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", 104 | "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" 105 | }, 106 | "component-inherit": { 107 | "version": "0.0.3", 108 | "resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz", 109 | "integrity": "sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM=" 110 | }, 111 | "connect-flash": { 112 | "version": "0.1.1", 113 | "resolved": "https://registry.npmjs.org/connect-flash/-/connect-flash-0.1.1.tgz", 114 | "integrity": "sha1-2GMPJtlaf4UfmVax6MxnMvO2qjA=" 115 | }, 116 | "content-disposition": { 117 | "version": "0.5.2", 118 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", 119 | "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" 120 | }, 121 | "content-type": { 122 | "version": "1.0.4", 123 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", 124 | "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" 125 | }, 126 | "cookie": { 127 | "version": "0.3.1", 128 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", 129 | "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" 130 | }, 131 | "cookie-parser": { 132 | "version": "1.4.3", 133 | "resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.4.3.tgz", 134 | "integrity": "sha1-D+MfoZ0AC5X0qt8fU/3CuKIDuqU=", 135 | "requires": { 136 | "cookie": "0.3.1", 137 | "cookie-signature": "1.0.6" 138 | } 139 | }, 140 | "cookie-session": { 141 | "version": "2.0.0-beta.3", 142 | "resolved": "https://registry.npmjs.org/cookie-session/-/cookie-session-2.0.0-beta.3.tgz", 143 | "integrity": "sha512-zyqm5tA0z9yMEB/xyP7lnRnqp8eLR2e0dap+9+rBwVigla9yPKn8XTL1jJymog8xjfrowqW2o5LUjixQChkqrw==", 144 | "requires": { 145 | "cookies": "0.7.1", 146 | "debug": "3.1.0", 147 | "on-headers": "1.0.1", 148 | "safe-buffer": "5.1.1" 149 | }, 150 | "dependencies": { 151 | "debug": { 152 | "version": "3.1.0", 153 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", 154 | "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", 155 | "requires": { 156 | "ms": "2.0.0" 157 | } 158 | } 159 | } 160 | }, 161 | "cookie-signature": { 162 | "version": "1.0.6", 163 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", 164 | "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" 165 | }, 166 | "cookies": { 167 | "version": "0.7.1", 168 | "resolved": "https://registry.npmjs.org/cookies/-/cookies-0.7.1.tgz", 169 | "integrity": "sha1-fIphX1SBxhq58WyDNzG8uPZjuZs=", 170 | "requires": { 171 | "depd": "1.1.2", 172 | "keygrip": "1.0.2" 173 | } 174 | }, 175 | "core-util-is": { 176 | "version": "1.0.2", 177 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", 178 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" 179 | }, 180 | "debug": { 181 | "version": "2.6.9", 182 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 183 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 184 | "requires": { 185 | "ms": "2.0.0" 186 | } 187 | }, 188 | "depd": { 189 | "version": "1.1.2", 190 | "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", 191 | "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" 192 | }, 193 | "destroy": { 194 | "version": "1.0.4", 195 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", 196 | "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" 197 | }, 198 | "dotenv": { 199 | "version": "5.0.1", 200 | "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-5.0.1.tgz", 201 | "integrity": "sha512-4As8uPrjfwb7VXC+WnLCbXK7y+Ueb2B3zgNCePYfhxS1PYeaO1YTeplffTEcbfLhvFNGLAz90VvJs9yomG7bow==" 202 | }, 203 | "ee-first": { 204 | "version": "1.1.1", 205 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 206 | "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" 207 | }, 208 | "encodeurl": { 209 | "version": "1.0.2", 210 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", 211 | "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" 212 | }, 213 | "engine.io": { 214 | "version": "3.2.0", 215 | "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.2.0.tgz", 216 | "integrity": "sha512-mRbgmAtQ4GAlKwuPnnAvXXwdPhEx+jkc0OBCLrXuD/CRvwNK3AxRSnqK4FSqmAMRRHryVJP8TopOvmEaA64fKw==", 217 | "requires": { 218 | "accepts": "1.3.5", 219 | "base64id": "1.0.0", 220 | "cookie": "0.3.1", 221 | "debug": "3.1.0", 222 | "engine.io-parser": "2.1.2", 223 | "ws": "3.3.3" 224 | }, 225 | "dependencies": { 226 | "debug": { 227 | "version": "3.1.0", 228 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", 229 | "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", 230 | "requires": { 231 | "ms": "2.0.0" 232 | } 233 | } 234 | } 235 | }, 236 | "engine.io-client": { 237 | "version": "3.2.1", 238 | "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.2.1.tgz", 239 | "integrity": "sha512-y5AbkytWeM4jQr7m/koQLc5AxpRKC1hEVUb/s1FUAWEJq5AzJJ4NLvzuKPuxtDi5Mq755WuDvZ6Iv2rXj4PTzw==", 240 | "requires": { 241 | "component-emitter": "1.2.1", 242 | "component-inherit": "0.0.3", 243 | "debug": "3.1.0", 244 | "engine.io-parser": "2.1.2", 245 | "has-cors": "1.1.0", 246 | "indexof": "0.0.1", 247 | "parseqs": "0.0.5", 248 | "parseuri": "0.0.5", 249 | "ws": "3.3.3", 250 | "xmlhttprequest-ssl": "1.5.5", 251 | "yeast": "0.1.2" 252 | }, 253 | "dependencies": { 254 | "debug": { 255 | "version": "3.1.0", 256 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", 257 | "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", 258 | "requires": { 259 | "ms": "2.0.0" 260 | } 261 | } 262 | } 263 | }, 264 | "engine.io-parser": { 265 | "version": "2.1.2", 266 | "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.1.2.tgz", 267 | "integrity": "sha512-dInLFzr80RijZ1rGpx1+56/uFoH7/7InhH3kZt+Ms6hT8tNx3NGW/WNSA/f8As1WkOfkuyb3tnRyuXGxusclMw==", 268 | "requires": { 269 | "after": "0.8.2", 270 | "arraybuffer.slice": "0.0.7", 271 | "base64-arraybuffer": "0.1.5", 272 | "blob": "0.0.4", 273 | "has-binary2": "1.0.2" 274 | } 275 | }, 276 | "escape-html": { 277 | "version": "1.0.3", 278 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 279 | "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" 280 | }, 281 | "etag": { 282 | "version": "1.8.1", 283 | "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", 284 | "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" 285 | }, 286 | "express": { 287 | "version": "4.16.3", 288 | "resolved": "https://registry.npmjs.org/express/-/express-4.16.3.tgz", 289 | "integrity": "sha1-avilAjUNsyRuzEvs9rWjTSL37VM=", 290 | "requires": { 291 | "accepts": "1.3.5", 292 | "array-flatten": "1.1.1", 293 | "body-parser": "1.18.2", 294 | "content-disposition": "0.5.2", 295 | "content-type": "1.0.4", 296 | "cookie": "0.3.1", 297 | "cookie-signature": "1.0.6", 298 | "debug": "2.6.9", 299 | "depd": "1.1.2", 300 | "encodeurl": "1.0.2", 301 | "escape-html": "1.0.3", 302 | "etag": "1.8.1", 303 | "finalhandler": "1.1.1", 304 | "fresh": "0.5.2", 305 | "merge-descriptors": "1.0.1", 306 | "methods": "1.1.2", 307 | "on-finished": "2.3.0", 308 | "parseurl": "1.3.2", 309 | "path-to-regexp": "0.1.7", 310 | "proxy-addr": "2.0.3", 311 | "qs": "6.5.1", 312 | "range-parser": "1.2.0", 313 | "safe-buffer": "5.1.1", 314 | "send": "0.16.2", 315 | "serve-static": "1.13.2", 316 | "setprototypeof": "1.1.0", 317 | "statuses": "1.4.0", 318 | "type-is": "1.6.16", 319 | "utils-merge": "1.0.1", 320 | "vary": "1.1.2" 321 | } 322 | }, 323 | "finalhandler": { 324 | "version": "1.1.1", 325 | "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", 326 | "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", 327 | "requires": { 328 | "debug": "2.6.9", 329 | "encodeurl": "1.0.2", 330 | "escape-html": "1.0.3", 331 | "on-finished": "2.3.0", 332 | "parseurl": "1.3.2", 333 | "statuses": "1.4.0", 334 | "unpipe": "1.0.0" 335 | } 336 | }, 337 | "forwarded": { 338 | "version": "0.1.2", 339 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", 340 | "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" 341 | }, 342 | "fresh": { 343 | "version": "0.5.2", 344 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", 345 | "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" 346 | }, 347 | "has-binary2": { 348 | "version": "1.0.2", 349 | "resolved": "https://registry.npmjs.org/has-binary2/-/has-binary2-1.0.2.tgz", 350 | "integrity": "sha1-6D26SfC5vk0CbSc2U1DZ8D9Uvpg=", 351 | "requires": { 352 | "isarray": "2.0.1" 353 | }, 354 | "dependencies": { 355 | "isarray": { 356 | "version": "2.0.1", 357 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", 358 | "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=" 359 | } 360 | } 361 | }, 362 | "has-cors": { 363 | "version": "1.1.0", 364 | "resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz", 365 | "integrity": "sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk=" 366 | }, 367 | "http-errors": { 368 | "version": "1.6.3", 369 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", 370 | "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", 371 | "requires": { 372 | "depd": "1.1.2", 373 | "inherits": "2.0.3", 374 | "setprototypeof": "1.1.0", 375 | "statuses": "1.4.0" 376 | } 377 | }, 378 | "iconv-lite": { 379 | "version": "0.4.19", 380 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", 381 | "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" 382 | }, 383 | "indexof": { 384 | "version": "0.0.1", 385 | "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", 386 | "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=" 387 | }, 388 | "inherits": { 389 | "version": "2.0.3", 390 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 391 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" 392 | }, 393 | "ipaddr.js": { 394 | "version": "1.6.0", 395 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.6.0.tgz", 396 | "integrity": "sha1-4/o1e3c9phnybpXwSdBVxyeW+Gs=" 397 | }, 398 | "isarray": { 399 | "version": "1.0.0", 400 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 401 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 402 | }, 403 | "keygrip": { 404 | "version": "1.0.2", 405 | "resolved": "https://registry.npmjs.org/keygrip/-/keygrip-1.0.2.tgz", 406 | "integrity": "sha1-rTKXxVcGneqLz+ek+kkbdcXd65E=" 407 | }, 408 | "media-typer": { 409 | "version": "0.3.0", 410 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", 411 | "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" 412 | }, 413 | "merge-descriptors": { 414 | "version": "1.0.1", 415 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", 416 | "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" 417 | }, 418 | "methods": { 419 | "version": "1.1.2", 420 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 421 | "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" 422 | }, 423 | "mime": { 424 | "version": "1.4.1", 425 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", 426 | "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" 427 | }, 428 | "mime-db": { 429 | "version": "1.33.0", 430 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", 431 | "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==" 432 | }, 433 | "mime-types": { 434 | "version": "2.1.18", 435 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", 436 | "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", 437 | "requires": { 438 | "mime-db": "1.33.0" 439 | } 440 | }, 441 | "ms": { 442 | "version": "2.0.0", 443 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 444 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 445 | }, 446 | "mysql": { 447 | "version": "2.15.0", 448 | "resolved": "https://registry.npmjs.org/mysql/-/mysql-2.15.0.tgz", 449 | "integrity": "sha512-C7tjzWtbN5nzkLIV+E8Crnl9bFyc7d3XJcBAvHKEVkjrYjogz3llo22q6s/hw+UcsE4/844pDob9ac+3dVjQSA==", 450 | "requires": { 451 | "bignumber.js": "4.0.4", 452 | "readable-stream": "2.3.3", 453 | "safe-buffer": "5.1.1", 454 | "sqlstring": "2.3.0" 455 | } 456 | }, 457 | "negotiator": { 458 | "version": "0.6.1", 459 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", 460 | "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" 461 | }, 462 | "oauth": { 463 | "version": "0.9.15", 464 | "resolved": "https://registry.npmjs.org/oauth/-/oauth-0.9.15.tgz", 465 | "integrity": "sha1-vR/vr2hslrdUda7VGWQS/2DPucE=" 466 | }, 467 | "object-component": { 468 | "version": "0.0.3", 469 | "resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz", 470 | "integrity": "sha1-8MaapQ78lbhmwYb0AKM3acsvEpE=" 471 | }, 472 | "on-finished": { 473 | "version": "2.3.0", 474 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", 475 | "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", 476 | "requires": { 477 | "ee-first": "1.1.1" 478 | } 479 | }, 480 | "on-headers": { 481 | "version": "1.0.1", 482 | "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.1.tgz", 483 | "integrity": "sha1-ko9dD0cNSTQmUepnlLCFfBAGk/c=" 484 | }, 485 | "parseqs": { 486 | "version": "0.0.5", 487 | "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz", 488 | "integrity": "sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0=", 489 | "requires": { 490 | "better-assert": "1.0.2" 491 | } 492 | }, 493 | "parseuri": { 494 | "version": "0.0.5", 495 | "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz", 496 | "integrity": "sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo=", 497 | "requires": { 498 | "better-assert": "1.0.2" 499 | } 500 | }, 501 | "parseurl": { 502 | "version": "1.3.2", 503 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", 504 | "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=" 505 | }, 506 | "passport": { 507 | "version": "0.4.0", 508 | "resolved": "https://registry.npmjs.org/passport/-/passport-0.4.0.tgz", 509 | "integrity": "sha1-xQlWkTR71a07XhgCOMORTRbwWBE=", 510 | "requires": { 511 | "passport-strategy": "1.0.0", 512 | "pause": "0.0.1" 513 | } 514 | }, 515 | "passport-github": { 516 | "version": "1.1.0", 517 | "resolved": "https://registry.npmjs.org/passport-github/-/passport-github-1.1.0.tgz", 518 | "integrity": "sha1-jOHj/NYa11eOsd9ZWDnkrqEjVdQ=", 519 | "requires": { 520 | "passport-oauth2": "1.4.0" 521 | } 522 | }, 523 | "passport-oauth2": { 524 | "version": "1.4.0", 525 | "resolved": "https://registry.npmjs.org/passport-oauth2/-/passport-oauth2-1.4.0.tgz", 526 | "integrity": "sha1-9i+BWDy+EmCb585vFguTlaJ7hq0=", 527 | "requires": { 528 | "oauth": "0.9.15", 529 | "passport-strategy": "1.0.0", 530 | "uid2": "0.0.3", 531 | "utils-merge": "1.0.1" 532 | } 533 | }, 534 | "passport-strategy": { 535 | "version": "1.0.0", 536 | "resolved": "https://registry.npmjs.org/passport-strategy/-/passport-strategy-1.0.0.tgz", 537 | "integrity": "sha1-tVOaqPwiWj0a0XlHbd8ja0QPUuQ=" 538 | }, 539 | "path-to-regexp": { 540 | "version": "0.1.7", 541 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", 542 | "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" 543 | }, 544 | "pause": { 545 | "version": "0.0.1", 546 | "resolved": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz", 547 | "integrity": "sha1-HUCLP9t2kjuVQ9lvtMnf1TXZy10=" 548 | }, 549 | "process-nextick-args": { 550 | "version": "1.0.7", 551 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", 552 | "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" 553 | }, 554 | "proxy-addr": { 555 | "version": "2.0.3", 556 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.3.tgz", 557 | "integrity": "sha512-jQTChiCJteusULxjBp8+jftSQE5Obdl3k4cnmLA6WXtK6XFuWRnvVL7aCiBqaLPM8c4ph0S4tKna8XvmIwEnXQ==", 558 | "requires": { 559 | "forwarded": "0.1.2", 560 | "ipaddr.js": "1.6.0" 561 | } 562 | }, 563 | "qs": { 564 | "version": "6.5.1", 565 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", 566 | "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" 567 | }, 568 | "range-parser": { 569 | "version": "1.2.0", 570 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", 571 | "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" 572 | }, 573 | "raw-body": { 574 | "version": "2.3.2", 575 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz", 576 | "integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=", 577 | "requires": { 578 | "bytes": "3.0.0", 579 | "http-errors": "1.6.2", 580 | "iconv-lite": "0.4.19", 581 | "unpipe": "1.0.0" 582 | }, 583 | "dependencies": { 584 | "depd": { 585 | "version": "1.1.1", 586 | "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", 587 | "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=" 588 | }, 589 | "http-errors": { 590 | "version": "1.6.2", 591 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", 592 | "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", 593 | "requires": { 594 | "depd": "1.1.1", 595 | "inherits": "2.0.3", 596 | "setprototypeof": "1.0.3", 597 | "statuses": "1.4.0" 598 | } 599 | }, 600 | "setprototypeof": { 601 | "version": "1.0.3", 602 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", 603 | "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" 604 | } 605 | } 606 | }, 607 | "readable-stream": { 608 | "version": "2.3.3", 609 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", 610 | "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", 611 | "requires": { 612 | "core-util-is": "1.0.2", 613 | "inherits": "2.0.3", 614 | "isarray": "1.0.0", 615 | "process-nextick-args": "1.0.7", 616 | "safe-buffer": "5.1.1", 617 | "string_decoder": "1.0.3", 618 | "util-deprecate": "1.0.2" 619 | } 620 | }, 621 | "safe-buffer": { 622 | "version": "5.1.1", 623 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", 624 | "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" 625 | }, 626 | "send": { 627 | "version": "0.16.2", 628 | "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", 629 | "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", 630 | "requires": { 631 | "debug": "2.6.9", 632 | "depd": "1.1.2", 633 | "destroy": "1.0.4", 634 | "encodeurl": "1.0.2", 635 | "escape-html": "1.0.3", 636 | "etag": "1.8.1", 637 | "fresh": "0.5.2", 638 | "http-errors": "1.6.3", 639 | "mime": "1.4.1", 640 | "ms": "2.0.0", 641 | "on-finished": "2.3.0", 642 | "range-parser": "1.2.0", 643 | "statuses": "1.4.0" 644 | } 645 | }, 646 | "serve-static": { 647 | "version": "1.13.2", 648 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", 649 | "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", 650 | "requires": { 651 | "encodeurl": "1.0.2", 652 | "escape-html": "1.0.3", 653 | "parseurl": "1.3.2", 654 | "send": "0.16.2" 655 | } 656 | }, 657 | "setprototypeof": { 658 | "version": "1.1.0", 659 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", 660 | "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" 661 | }, 662 | "socket.io": { 663 | "version": "2.1.0", 664 | "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.1.0.tgz", 665 | "integrity": "sha512-KS+3CNWWNtLbVN5j0/B+1hjxRzey+oTK6ejpAOoxMZis6aXeB8cUtfuvjHl97tuZx+t/qD/VyqFMjuzu2Js6uQ==", 666 | "requires": { 667 | "debug": "3.1.0", 668 | "engine.io": "3.2.0", 669 | "has-binary2": "1.0.2", 670 | "socket.io-adapter": "1.1.1", 671 | "socket.io-client": "2.1.0", 672 | "socket.io-parser": "3.2.0" 673 | }, 674 | "dependencies": { 675 | "debug": { 676 | "version": "3.1.0", 677 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", 678 | "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", 679 | "requires": { 680 | "ms": "2.0.0" 681 | } 682 | } 683 | } 684 | }, 685 | "socket.io-adapter": { 686 | "version": "1.1.1", 687 | "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz", 688 | "integrity": "sha1-KoBeihTWNyEk3ZFZrUUC+MsH8Gs=" 689 | }, 690 | "socket.io-client": { 691 | "version": "2.1.0", 692 | "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.1.0.tgz", 693 | "integrity": "sha512-TvKPpL0cBON5LduQfR8Rxrr+ktj70bLXGvqHCL3er5avBXruB3gpnbaud5ikFYVfANH1gCABAvo0qN8Axpg2ew==", 694 | "requires": { 695 | "backo2": "1.0.2", 696 | "base64-arraybuffer": "0.1.5", 697 | "component-bind": "1.0.0", 698 | "component-emitter": "1.2.1", 699 | "debug": "3.1.0", 700 | "engine.io-client": "3.2.1", 701 | "has-binary2": "1.0.2", 702 | "has-cors": "1.1.0", 703 | "indexof": "0.0.1", 704 | "object-component": "0.0.3", 705 | "parseqs": "0.0.5", 706 | "parseuri": "0.0.5", 707 | "socket.io-parser": "3.2.0", 708 | "to-array": "0.1.4" 709 | }, 710 | "dependencies": { 711 | "debug": { 712 | "version": "3.1.0", 713 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", 714 | "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", 715 | "requires": { 716 | "ms": "2.0.0" 717 | } 718 | } 719 | } 720 | }, 721 | "socket.io-parser": { 722 | "version": "3.2.0", 723 | "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.2.0.tgz", 724 | "integrity": "sha512-FYiBx7rc/KORMJlgsXysflWx/RIvtqZbyGLlHZvjfmPTPeuD/I8MaW7cfFrj5tRltICJdgwflhfZ3NVVbVLFQA==", 725 | "requires": { 726 | "component-emitter": "1.2.1", 727 | "debug": "3.1.0", 728 | "isarray": "2.0.1" 729 | }, 730 | "dependencies": { 731 | "debug": { 732 | "version": "3.1.0", 733 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", 734 | "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", 735 | "requires": { 736 | "ms": "2.0.0" 737 | } 738 | }, 739 | "isarray": { 740 | "version": "2.0.1", 741 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", 742 | "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=" 743 | } 744 | } 745 | }, 746 | "sqlstring": { 747 | "version": "2.3.0", 748 | "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.0.tgz", 749 | "integrity": "sha1-UluKT9Jtb3GqYegipsr5dtMa0qg=" 750 | }, 751 | "statuses": { 752 | "version": "1.4.0", 753 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", 754 | "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" 755 | }, 756 | "string_decoder": { 757 | "version": "1.0.3", 758 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", 759 | "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", 760 | "requires": { 761 | "safe-buffer": "5.1.1" 762 | } 763 | }, 764 | "to-array": { 765 | "version": "0.1.4", 766 | "resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz", 767 | "integrity": "sha1-F+bBH3PdTz10zaek/zI46a2b+JA=" 768 | }, 769 | "type-is": { 770 | "version": "1.6.16", 771 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", 772 | "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", 773 | "requires": { 774 | "media-typer": "0.3.0", 775 | "mime-types": "2.1.18" 776 | } 777 | }, 778 | "uid2": { 779 | "version": "0.0.3", 780 | "resolved": "https://registry.npmjs.org/uid2/-/uid2-0.0.3.tgz", 781 | "integrity": "sha1-SDEm4Rd03y9xuLY53NeZw3YWK4I=" 782 | }, 783 | "ultron": { 784 | "version": "1.1.1", 785 | "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", 786 | "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==" 787 | }, 788 | "unpipe": { 789 | "version": "1.0.0", 790 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 791 | "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" 792 | }, 793 | "util-deprecate": { 794 | "version": "1.0.2", 795 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 796 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" 797 | }, 798 | "utils-merge": { 799 | "version": "1.0.1", 800 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", 801 | "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" 802 | }, 803 | "vary": { 804 | "version": "1.1.2", 805 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 806 | "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" 807 | }, 808 | "ws": { 809 | "version": "3.3.3", 810 | "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", 811 | "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", 812 | "requires": { 813 | "async-limiter": "1.0.0", 814 | "safe-buffer": "5.1.1", 815 | "ultron": "1.1.1" 816 | } 817 | }, 818 | "xmlhttprequest-ssl": { 819 | "version": "1.5.5", 820 | "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz", 821 | "integrity": "sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4=" 822 | }, 823 | "yeast": { 824 | "version": "0.1.2", 825 | "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", 826 | "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=" 827 | } 828 | } 829 | } 830 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------