Skip to content
Snippets Groups Projects
Commit 70462029 authored by iaibrys's avatar iaibrys
Browse files

Initial (unauthed) version.

parent efaa36e3
Branches
No related tags found
No related merge requests found
**/node_modules
deps/**/*
module.exports = {
"extends": ["eslint:recommended", "airbnb"],
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"jquery": true
},
"globals": {
},
rules: {
'no-console': 'off',
"no-restricted-syntax": ["error", "ForInStatement", "LabeledStatement", "WithStatement"]
},
};
**/node_modules
\ No newline at end of file
[submodule "deps/RichFilemanager"]
path = deps/RichFilemanager
url = https://github.com/servocoder/RichFilemanager
{
"boss": true,
"curly": true,
"eqeqeq": true,
"eqnull": true,
"expr": true,
"immed": true,
"noarg": true,
"onevar": false,
"quotmark": "single",
"smarttabs": true,
"trailing": true,
"undef": true,
"unused": true,
"esversion": 6,
"node": true,
"globals": { "window": true, "document": true, "jQuery": true, "navigator": true }
}
FROM mhart/alpine-node:10
ENV APP_DIR=/app
RUN mkdir ${APP_DIR}
WORKDIR ${APP_DIR}
COPY . ${APP_DIR}
RUN npm install
ENTRYPOINT ["sh", "-c", "./scripts/run-server.sh"]
Subproject commit 957267f765d2c112b4562f4ec68a90debe565395
index.js 0 → 100644
'use strict';
const path = require('path');
const express = require('express');
const filemanager = require(path.resolve(
__dirname,
'node_modules',
'rich-filemanager-node'
)); // Should be `require("rich-filemanager-node")` in your project
const PUBLIC_ROOT = process.env.PUBLIC_ROOT || path.join(__dirname, 'public');
const config = path.join(PUBLIC_ROOT, 'config', 'filemanager.config.json');
let app = express();
// These middlewares are being used to serve static files.
// static files from rich-filemanager module.
// app.use(express.static('deps/RichFilemanager'));
app.use(express.static(PUBLIC_ROOT));
//Filemanager route
app.use('/filemanager', filemanager(process.env.DTU_FILEMANAGER_ROOT || './no-access', config));
// '/filemanager' is the connector url.
// Don't forget to set it in the api.connectorUrl of `filemanager.config.json` for the frontend
//Listen for requests
const port = process.env.PORT || 5000;
app.listen(port, function () {
console.log('App listening on port ' + port);
});
This diff is collapsed.
{
"name": "dtu-enote-filemanager",
"version": "1.0.0",
"description": "Filemanager for DTU eNote",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"serve": "NODE_ENV=production node ./index.js",
"lint": "eslint *.js",
"pretty": "prettier --single-quote --write index.js"
},
"repository": {
"type": "git",
"url": "git@lab.compute.dtu.dk:enote/filemanager.git"
},
"keywords": [
"file",
"filemanager",
"enote"
],
"author": "Iain J. Bryson",
"license": "ISC",
"dependencies": {
"eslint-config-airbnb": "^17.1.0",
"express": "^4.16.4",
"rich-filemanager-node": "^0.1.5"
},
"devDependencies": {
"eslint": "^5.15.3",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.12.4",
"prettier": "^1.16.4"
}
}
{
"_comment": "IMPORTANT : go to the wiki page to know about options configuration https://github.com/servocoder/RichFilemanager/wiki/Configuration-options",
"options": {
"theme": "flat-dark",
"showTitleAttr": false,
"showConfirmation": true,
"browseOnly": false,
"fileSorting": "NAME_ASC",
"folderPosition": "bottom",
"quickSelect": false,
"logger": false,
"allowFolderDownload": true,
"allowChangeExtensions": false,
"capabilities": [
"select",
"upload",
"download",
"rename",
"copy",
"move",
"delete",
"extract",
"createFolder"
]
},
"language": {
"default": "en",
"available": ["ar", "bs", "ca", "cs", "da", "de", "el", "en", "es", "fa", "fi", "fr", "he", "hu", "it", "ja", "nl", "pl", "pt", "ru", "sv", "th", "tr", "vi", "zh-CN", "zh-TW"]
},
"formatter": {
"datetime": {
"skeleton": "yMMMdHm"
}
},
"filetree": {
"enabled": true,
"foldersOnly": false,
"reloadOnClick": true,
"expandSpeed": 200,
"showLine": true,
"width": 200,
"minWidth": 200
},
"manager": {
"defaultViewMode": "grid",
"dblClickOpen": false,
"selection": {
"enabled": true,
"useCtrlKey": true
},
"renderer": {
"position": false,
"indexFile": "readme.md"
}
},
"api": {
"lang": "nodejs",
"connectorUrl": "/filemanager",
"requestParams": {
"GET": {},
"POST": {},
"MIXED": {}
}
},
"security": {
"readOnly": false,
"extensions": {
"policy": "DISALLOW_LIST",
"ignoreCase": true,
"restrictions": []
}
},
"upload": {
"multiple": true,
"maxNumberOfFiles": 5,
"chunkSize": false
},
"clipboard": {
"enabled": true,
"encodeCopyUrl": true
},
"filter": {
"image": ["jpg", "jpeg", "gif", "png", "svg"],
"media": ["ogv", "avi", "mkv", "mp4", "webm", "m4v", "ogg", "mp3", "wav"],
"office": ["txt", "pdf", "odp", "ods", "odt", "rtf", "doc", "docx", "xls", "xlsx", "ppt", "pptx", "csv", "md"],
"archive": ["zip", "tar", "rar"],
"audio": ["ogg", "mp3", "wav"],
"video": ["ogv", "avi", "mkv", "mp4", "webm", "m4v"]
},
"search": {
"enabled": true,
"recursive": false,
"caseSensitive": false,
"typingDelay": 500
},
"viewer": {
"absolutePath": true,
"previewUrl": false,
"image": {
"enabled": true,
"lazyLoad": true,
"showThumbs": true,
"thumbMaxWidth": 64,
"extensions": [
"jpg",
"jpe",
"jpeg",
"gif",
"png",
"svg"
]
},
"video": {
"enabled": true,
"extensions": [
"ogv",
"mp4",
"webm",
"m4v"
],
"playerWidth": 400,
"playerHeight": 222
},
"audio": {
"enabled": true,
"extensions": [
"ogg",
"mp3",
"wav"
]
},
"iframe": {
"enabled": true,
"extensions": [
"htm",
"html"
],
"readerWidth": "95%",
"readerHeight": "600"
},
"opendoc": {
"enabled": true,
"extensions": [
"pdf",
"odt",
"odp",
"ods"
],
"readerWidth": "640",
"readerHeight": "480"
},
"google": {
"enabled": true,
"extensions": [
"doc",
"docx",
"xls",
"xlsx",
"ppt",
"pptx"
],
"readerWidth": "640",
"readerHeight": "480"
},
"codeMirrorRenderer": {
"enabled": true,
"extensions": [
"txt",
"csv"
]
},
"markdownRenderer": {
"enabled": true,
"extensions": [
"md"
]
}
},
"editor": {
"enabled": true,
"theme": "default",
"lineNumbers": true,
"lineWrapping": true,
"codeHighlight": true,
"matchBrackets": true,
"extensions": [
"html",
"txt",
"csv",
"md"
]
},
"customScrollbar": {
"enabled": false,
"theme": "inset-2-dark",
"button": true
},
"extras": {
"extra_js": [],
"extra_js_async": true
},
"url": "https://github.com/servocoder/RichFilemanager",
"version": "2.7.6"
}
$('.fm-container').richFilemanager({
// options for the plugin initialization step and callback functions, see:
// https://github.com/servocoder/RichFilemanager/wiki/Configuration-options#plugin-parameters
});
\ No newline at end of file
#!/bin/sh
# sh because alpine!
# set -e
cp -R deps/RichFilemanager/* /public
cp -R public/* /public
export PUBLIC_ROOT=/public
npm run serve
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment