{"version":3,"sources":["logo.svg","FileBrowser.js","S3Browser.js","SharesBrowser.js","Doc.js","App.js","reportWebVitals.js","index.js"],"names":["prettyBytes","require","axios","publicUrl","process","REACT_APP_GOZ_PUBLIC_URL","backend","REACT_APP_GOZ_BACKEND_URL","useStyles","makeStyles","table","minWidth","editor","minHeight","form","margin","dropzone","backgroundColor","FileShareDialog","props","classes","onClose","open","useState","errMsg","setErrMsg","msg","setMsg","link","setLink","name","setName","access","setAccess","duration","setDuration","Fragment","file","Dialog","maxWidth","fullWidth","DialogTitle","id","Alert","severity","FormControl","className","InputLabel","htmlFor","Input","onChange","e","target","value","Select","Grid","container","item","xs","Button","variant","color","onClick","f","token","get","params","parseInt","headers","then","resp","host","window","location","protocol","data","catch","err","message","getlink","navigator","clipboard","writeText","TextField","multiline","disabled","label","class","NewDirDialog","onCancel","onCreate","dir","setDir","handleCancel","Card","CardContent","CardActions","FileDeleteDialog","infoMsg","setInfoMsg","counter","setCounter","handleClose","useEffect","recursiveDeletion","nbfiles","deleteFile","path","fake","auth_token","a","delete","getFiles","Content","fileToDelete","nbFilesToDelete","Dir","Name","files","length","i","console","debug","FileInfoDialog","fileInfo","TableContainer","component","Paper","Table","TableHead","TableRow","TableCell","TableBody","Size","Date","Perm","OooEditor","setFileInfo","oooEnabled","codimdEnabled","dest","edit","href","rel","Tooltip","title","FileBrowser","setFiles","readOnly","setReadOnly","fileDelete","setFileDelete","fileShare","setFileShare","loading","setLoading","search","setSearch","setToken","user","password","setUser","createDir","setCreateDir","fileToMove","setFileToMove","history","useHistory","query","URLSearchParams","useLocation","gotoroute","useParams","goto_path","log","t","localStorage","getItem","qt","onLogin","logout","onLogout","removeItem","replace","downloadFileLink","goto","newdir","fileinfo","push","dirs","split","slice","join","fileSort","b","undefined","sort","ReadOnly","response","status","refresh","fileType","isDir","ext","pop","endsWith","indexOf","onDrop","useCallback","acceptedFiles","upload","files2upload","forEach","useDropzone","getRootProps","getInputProps","moveFileTo","patch","moveFrom","rename","Box","spacing","autoComplete","type","post","Token","setItem","size","placeholder","map","Sharing","getFileInfo","shareAccess","moveFile","error","flexform","display","flexDirection","project","bucket","Link","S3Browser","swift","setSwift","s3Token","setS3Token","setProject","buckets","setBuckets","setBucket","bucketMeta","setBucketMeta","s3User","setS3User","newBucket","setNewBucket","getBucketFiles","getBucketMeta","p","getBuckets","Bucket","logout2s3","updateBucketMetaPublic","is_public","public","updateBucketMetaWeb","web","isBucketPublic","isBucketWeb","Buckets","tmp_files","tmp_dir","substring","Files","s3","s3file","bytes","subdir","last_modified","Project","URL","count","put","Typography","m","url","method","responseType","createObjectURL","Blob","document","createElement","setAttribute","body","appendChild","click","downloadFile","SharesBrowser","shares","setShares","tokens","setTokens","group","mode","shareWith","setShareWith","updateShares","revokeToken","anontoken","removeShare","share","filter","ToUser","ToGroup","Path","addShare","index","WriteAllowed","Expires","toLocaleDateString","Rw","Revoked","Doc","App","uploads","setUploads","sidebarOpen","setSideBarOpen","handleViewSidebar","setRefresh","to","nbuploads","from","progress","ts","uploadFile","now","upload2s3","uploadFile2s3","Promise","resolve","reject","config","onUploadProgress","progressEvent","percentCompleted","Math","round","loaded","total","u","FormData","append","res","Container","md","style","gutterBottom","toLocaleTimeString","exact","render","reportWebVitals","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","ReactDOM","StrictMode","getElementById"],"mappings":"oPAAe,I,ocCuCTA,GAAcC,EAAQ,IAEtBC,GAAQD,EAAQ,IAEhBE,GAAYC,gLAAYC,0BAA4B,GACpDC,GAAUF,gLAAYG,2BAA6BJ,GAEnDK,GAAYC,YAAW,CACzBC,MAAO,CACLC,SAAU,KAEZC,OAAQ,CACJC,UAAW,KAEfC,KAAM,CACFC,OAAQ,QAEZC,SAAU,CACNC,gBAAiB,eAQnBC,GAAkB,SAACC,GACrB,IAAMC,EAAUZ,KACRa,EAAkBF,EAAlBE,QAASC,EAASH,EAATG,KAMjB,EAA4BC,mBAAS,IAArC,mBAAOC,EAAP,KAAeC,EAAf,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AD,CAAWjJ,OAAQ+H,SAEjD,eAAC,IAAD,CAAOtO,KAAK,oBAAoB6P,OAAQ,kBACtC,eAACjT,EAAA,EAAD,CAAME,MAAI,EAACC,GAAI,GAAIyS,GAAI,GAAvB,SAA4B,eAAC,GAAD,CAAahL,QAASA,EAASE,SAAUA,EAAUmB,QAASA,EAASU,OAAQA,SAE3G,eAAC,IAAD,CAAOvG,KAAK,kBAAkB6P,OAAQ,kBACpC,eAACjT,EAAA,EAAD,CAAME,MAAI,EAACC,GAAI,GAAIyS,GAAI,GAAvB,SAA4B,eAAC,GAAD,CAAWjJ,OAAQ+H,SAEjD,eAAC,IAAD,CAAOtO,KAAK,UAAU6P,OAAQ,kBAC5B,eAACjT,EAAA,EAAD,CAAME,MAAI,EAACC,GAAI,GAAIyS,GAAI,GAAvB,SAA4B,eAAC,GAAD,CAAenS,MAAOA,SAEpD,eAAC,IAAD,CAAO2C,KAAK,OAAO6P,OAAQ,kBACzB,eAACjT,EAAA,EAAD,CAAME,MAAI,EAACC,GAAI,GAAIyS,GAAI,GAAvB,SAA4B,eAAC,GAAD,wBC/NrBM,GAZS,SAAAC,GAClBA,GAAeA,aAAuBC,UACxC,8BAAqBtS,MAAK,YAAkD,IAA/CuS,EAA8C,EAA9CA,OAAQC,EAAsC,EAAtCA,OAAQC,EAA8B,EAA9BA,OAAQC,EAAsB,EAAtBA,OAAQC,EAAc,EAAdA,QAC3DJ,EAAOF,GACPG,EAAOH,GACPI,EAAOJ,GACPK,EAAOL,GACPM,EAAQN,OCDdO,IAAST,OACP,eAAC,IAAMU,WAAP,UACE,eAAC,GAAD,MAEFhF,SAASiF,eAAe,SAM1BV,O","file":"static/js/main.81bfb6fb.chunk.js","sourcesContent":["export default __webpack_public_path__ + \"static/media/logo.6ce24c58.svg\";","import React, { useCallback, useEffect, useState } from 'react'\nimport {Alert} from '@material-ui/lab';\nimport Card from '@material-ui/core/Card';\nimport CardContent from '@material-ui/core/CardContent';\nimport Table from '@material-ui/core/Table';\nimport TableBody from '@material-ui/core/TableBody';\nimport TableCell from '@material-ui/core/TableCell';\nimport TableContainer from '@material-ui/core/TableContainer';\nimport TableHead from '@material-ui/core/TableHead';\nimport TableRow from '@material-ui/core/TableRow';\nimport Paper from '@material-ui/core/Paper';\nimport { makeStyles } from '@material-ui/core/styles';\nimport FolderIcon from '@material-ui/icons/Folder';\nimport DeleteIcon from '@material-ui/icons/Delete';\n\nimport DescriptionIcon from '@material-ui/icons/Description';\nimport PictureAsPdfIcon from '@material-ui/icons/PictureAsPdf';\nimport InfoIcon from '@material-ui/icons/Info';\nimport EditIcon from '@material-ui/icons/Edit';\nimport VisibilityIcon from '@material-ui/icons/Visibility';\nimport ShareIcon from '@material-ui/icons/Share';\nimport GetAppIcon from '@material-ui/icons/GetApp';\nimport ControlCameraIcon from '@material-ui/icons/ControlCamera';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport Dialog from '@material-ui/core/Dialog';\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport Grid from '@material-ui/core/Grid';\nimport FormControl from '@material-ui/core/FormControl';\nimport InputLabel from '@material-ui/core/InputLabel';\nimport Input from '@material-ui/core/Input';\nimport Select from '@material-ui/core/Select';\nimport TextField from '@material-ui/core/TextField';\nimport Tooltip from '@material-ui/core/Tooltip';\n\nimport {useDropzone} from 'react-dropzone'\nimport { useLocation, useParams, useHistory } from \"react-router-dom\";\nimport { CardActions } from '@material-ui/core';\n\nconst prettyBytes = require('pretty-bytes');\n\nconst axios = require('axios');\n\nconst publicUrl = process.env.REACT_APP_GOZ_PUBLIC_URL || '';\nconst backend = process.env.REACT_APP_GOZ_BACKEND_URL || publicUrl\n\nconst useStyles = makeStyles({\n table: {\n minWidth: 650,\n },\n editor: {\n minHeight: 800,\n },\n form: {\n margin: '10px'\n },\n dropzone: {\n backgroundColor: 'lightGrey',\n },\n });\n\n\nexport const Context = React.createContext();\n\n\nconst FileShareDialog = (props) => {\n const classes = useStyles();\n const { onClose, open } = props;\n \n const handleClose = () => {\n onClose();\n };\n\n const [errMsg, setErrMsg] = useState('')\n const [msg, setMsg] = useState('')\n const [link, setLink] = useState('')\n const [name, setName] = useState('')\n const [access, setAccess] = useState('ro')\n const [duration, setDuration] = useState(30)\n\n const copyLink = () => {\n navigator.clipboard.writeText(link);\n setMsg('Link copied to clipboard');\n }\n\n const getlink = () => {\n let f = props.file;\n let token = props.token;\n axios.get(`${backend}/api/shares${f}`, {\n params: {\n name: name,\n access: access,\n duration: parseInt(duration) * 24 * 3600,\n },\n headers: {\n 'Authorization': 'Bearer ' + token\n }\n }).then(resp => {\n // console.log('link', resp.data)\n let host = window.location.protocol + \"//\" + window.location.host;\n setLink(`${host}?token=${resp.data.token}`)\n setErrMsg('')\n }).catch(err => {\n setErrMsg(err.message)\n })\n }\n return (\n {props.file &&\n \n {props.file}\n {errMsg && {errMsg}}\n\n \n Share link label\n setName(e.target.value)} value={name}/>\n \n\n \n Access\n \n \n\n \n Duration (days)\n setDuration(e.target.value)} value={duration}/>\n \n \n \n \n \n {link && \n \n \n }\n \n {link && \n \n \n \n \n \n }\n {msg && \n
\n
{msg}
\n
\n }\n
\n }\n
)\n}\n\n// Dialog to create a directory\nconst NewDirDialog = (props) => {\n const classes = useStyles();\n const { onCancel, onCreate, open } = props;\n const [dir, setDir] = useState(\"\")\n \n const handleCancel = () => {\n onCancel();\n };\n const handleCreate = () => {\n if (dir === \"\") {\n onCancel();\n return;\n }\n onCreate(dir);\n };\n\n return (\n \n \n Create directory\n \n \n \n Directory\n setDir(e.target.value)} value={dir}/>\n \n \n \n \n \n \n \n \n \n )\n}\n\nconst FileDeleteDialog = (props) => {\n const classes = useStyles();\n const [errMsg, setErrMsg] = useState('')\n const [infoMsg, setInfoMsg] = useState('')\n const [counter, setCounter] = useState(0);\n\n\n const { onClose, file, open, dir, token } = props;\n \n const handleClose = () => {\n onClose();\n };\n\n useEffect(() => {\n if(!dir || !file) {\n return\n }\n setInfoMsg(\"Scanning...\")\n recursiveDeletion(dir, file, true, token).then((nbfiles) => {\n setCounter(nbfiles)\n setInfoMsg(\"Will delete\")\n }).catch(err => setErrMsg(err.message))\n }, [dir, file, token])\n\n const deleteFile = async (path, fake, auth_token) => {\n if(fake) {\n // console.debug('should delete', path)\n return\n }\n await axios.delete(`${backend}/api/files${path}`, {\n headers: {\n 'Authorization': 'Bearer ' + auth_token\n },\n }); \n }\n \n const getFiles = async (path, auth_token) => {\n let resp = await axios.get(`${backend}/api/files${path}`, {\n headers: {\n 'Authorization': 'Bearer ' + auth_token\n }\n })\n // console.log('files=', path, resp.data)\n return resp.data.Content\n }\n\n const recursiveDeletion = async (path, fileToDelete, fake, auth_token) => {\n let nbFilesToDelete = 0\n if (fileToDelete.Dir) {\n let files = await getFiles(`${path}/${fileToDelete.Name}`, auth_token)\n if(files.length > 0) {\n for(let i=0;i {\n //toDelete = 0\n setCounter(0)\n setInfoMsg(\"Deleting...\")\n recursiveDeletion(dir, file, false, token).then(() => {\n handleClose()\n }).catch(err => {\n setErrMsg(err.message)\n })\n }\n\n return (\n \n {errMsg && {errMsg}}\n {file && \n \n {file.Name}\n \n \n {file.Dir &&
{file.Name} is a directory, delete all content?
}\n {infoMsg && {infoMsg} {counter} files}\n
\n \n \n \n \n
\n\n
\n }\n\n\n\n
\n )\n}\n\nconst FileInfoDialog = (props) => {\n const classes = useStyles();\n const { onClose, fileInfo, open } = props;\n \n const handleClose = () => {\n onClose();\n };\n \n return (\n \n {fileInfo &&\n \n {fileInfo.Name}\n \n \n \n \n Name\n Size\n Date\n Permissions\n \n \n \n \n {fileInfo.Name}\n {prettyBytes(fileInfo.Size)}\n {fileInfo.Date}\n {fileInfo.Perm}\n \n \n
\n
\n
}\n
\n );\n \n\n\n}\n\nconst OooEditor = (props) => {\n const [fileInfo, setFileInfo] = useState(null)\n const oooEnabled = process.env.REACT_APP_GOZ_OOO || false\n const codimdEnabled = process.env.REACT_APP_GOZ_CODIMD || false\n\n const ooEdit = (filename, oooEnabled, codimdEnabled) => {\n let ooext = []\n if (oooEnabled) {\n ooext = ['doc', 'docx', 'dotx', 'odt', 'rtf', 'txt', 'pdf', 'html', 'epub', 'xps', 'xml', 'docxf', 'xls', 'xlsx', 'xltx', 'ods', 'ots', 'csv', 'ppt', 'pptx', 'potx', 'odp', 'otp'];\n }\n if (codimdEnabled) {\n ooext.push('md')\n }\n if(!oooEnabled && !codimdEnabled) {\n return false\n }\n for(let i=0;i {\n if(!oooEnabled && !codimdEnabled) {\n // preview only\n setFileInfo({dest: `/api/download${props.dir}/${props.file.Name}?token=${props.token}&preview=1`, edit: false})\n // console.debug('ooo not enabled')\n return\n }\n if(props.file) {\n let fileIsEditable = false\n let dest = `/api/download${props.dir}/${props.file.Name}?token=${props.token}&preview=1`\n if (ooEdit(props.file.Name, oooEnabled, codimdEnabled)) {\n fileIsEditable = true\n let tool = 'ooo'\n if (props.file.Name.endsWith('.md')) {\n tool = 'codimd'\n }\n let path = props.file.Name\n dest = `/${tool}${path}?token=${props.token}`\n if (path[0] !== \"/\") {\n dest = `/${tool}${props.dir}/${path}?token=${props.token}`\n }\n }\n setFileInfo({dest: dest, edit: fileIsEditable})\n }\n }, [props, oooEnabled, codimdEnabled])\n\n return (\n { fileInfo && fileInfo.edit && }\n { fileInfo && !fileInfo.edit && }\n )\n}\n\nconst FileBrowser = (props) => {\n const [files, setFiles] = useState([])\n const [dir, setDir] = useState('/')\n const [readOnly, setReadOnly] = useState(false);\n const [errMsg, setErrMsg] = useState('')\n const [fileInfo, setFileInfo] = useState(null)\n const [fileDelete, setFileDelete] = useState(null)\n const [fileShare, setFileShare] = useState(null)\n const [loading, setLoading] = useState(false)\n const [search, setSearch] = useState('');\n // should get user shares\n const [token, setToken] = useState(null)\n const [user, setUser] = useState({\n user: \"\",\n password: \"\",\n })\n const [createDir, setCreateDir] = useState(false)\n\n const [fileToMove, setFileToMove] = useState(null)\n\n const history = useHistory();\n\n\n\n function useQuery() {\n return new URLSearchParams(useLocation().search);\n }\n let query = useQuery();\n\n let { gotoroute } = useParams();\n\n useEffect(() => {\n if(!gotoroute && dir !== '/') {\n setDir('/')\n return\n }\n if(!gotoroute) {\n return\n }\n let goto_path = `/${gotoroute}`\n if (goto_path && goto_path !== dir) {\n console.log('gotoroute', gotoroute, dir)\n setDir(goto_path)\n }\n }, [gotoroute, dir])\n\n useEffect(() => {\n let t = localStorage.getItem(\"goz-token\");\n let qt = query.get('token');\n if (qt) {\n t = qt;\n }\n if(t && t !== token) {\n setToken(t)\n props.onLogin(t)\n }\n }, [query, token, props])\n\n const logout = (onLogout) => {\n setToken(null);\n localStorage.removeItem(\"goz-token\")\n if(onLogout) {\n onLogout()\n }\n window.location.replace('/')\n }\n const log2 = () => {\n axios.post(`${backend}/api/auth`, user).then((response) => {\n setToken(response.data.Token)\n props.onLogin(response.data.Token)\n localStorage.setItem(\"goz-token\", response.data.Token)\n setUser({...user, password: ''})\n }).catch(err => {\n setErrMsg(err.response.data ? err.response.data : err.message)\n });\n \n }\n\n const isSearch = (name) => {\n return (search.length===0 || (search.length>=3 && name.indexOf(search)>=0))\n }\n\n const rename = (f) => {\n let path = f.Name;\n let dest = `${path}`\n if (path[0] !== \"/\") {\n dest = `${dir}/${path}`\n }\n setLoading(true)\n axios.patch(`${backend}/api/files${f.moveFrom}`, null, {\n headers: {\n 'Authorization': 'Bearer ' + token\n },\n params: {\n name: dest,\n }\n \n }).then(() => {\n setFileToMove(null);\n return getFiles(dir, token);\n })\n .then((resp) => {\n resp.data.Content.sort(fileSort)\n setFiles(resp.data.Content)\n setLoading(false)\n setErrMsg('')\n })\n .catch((err) => {\n setFileToMove(null)\n setErrMsg(\"Failed to move file: \" + err.message)\n })\n }\n\n const getFiles = (path, auth_token) => {\n if(!auth_token) {return}\n return axios.get(`${backend}/api/files${path}`, {\n headers: {\n 'Authorization': 'Bearer ' + auth_token\n }\n })\n }\n\n const handleCreateDirectory = (value) => {\n setCreateDir(false)\n setLoading(true)\n setSearch('')\n axios.post(`${backend}/api/upload${dir}/${value}`, null, {\n headers: {\n 'Authorization': 'Bearer ' + token\n }\n })\n .then(() => {\n return getFiles(dir, token);\n })\n .then((resp) => {\n resp.data.Content.sort(fileSort)\n setFiles(resp.data.Content)\n setLoading(false)\n setErrMsg('')\n })\n .catch(err => {\n console.error(err.message)\n setErrMsg(err.message)\n })\n }\n const handleCancelCreateDirectory = () => {\n setCreateDir(false)\n }\n\n const handleFileInfoClose = () => {\n setFileInfo(null)\n };\n\n const handleFileDeleteClose = () => {\n setFileDelete(null)\n setLoading(true)\n getFiles(dir, token).then((resp) => {\n resp.data.Content.sort(fileSort)\n setFiles(resp.data.Content)\n setLoading(false)\n setErrMsg('')\n })\n }\n\n const handleFileShareClose = () => {\n setFileShare(null)\n }\n\n const downloadFileLink = (f, auth_token) => {\n if(!auth_token) {return}\n let path = f.Name;\n let dest = `${path}`\n if (path[0] !== \"/\") {\n dest = `${dir}/${path}`\n }\n return `${backend}/api/download${dest}?token=${auth_token}`\n }\n\n const getFileInfo = (f) => {\n if(!token) {return}\n let path = f.Name;\n\n let dest = `${path}`\n if (path[0] !== \"/\") {\n dest = `${dir}/${path}`\n }\n // console.debug('getfileinfo', dest)\n axios.get(`${backend}/api/info${dest}`, {\n headers: {\n 'Authorization': 'Bearer ' + token\n }\n }).then(resp => {\n // console.debug(resp.data)\n setFileInfo(resp.data.Content[0])\n }).catch(err => {\n setErrMsg(err.message)\n if(err.response.status === 401) {\n logout()\n }\n })\n }\n\n const classes = useStyles();\n\n const goto = (newdir, fileinfo) => {\n if (fileinfo == null) {\n //setDir(newdir)\n history.push('/file'+newdir)\n return\n }\n let path = fileinfo.Name;\n if (!fileinfo.Dir) {\n return\n }\n\n let dest = `${path}`\n if (path === '..') {\n let dirs = newdir.split('/')\n // Should check if subdir is a base share, else prevent\n //setDir(dirs.slice(0, dirs.length-1).join('/'))\n history.push('/file'+dirs.slice(0, dirs.length-1).join('/'))\n return\n }\n if (path[0] !== \"/\") {\n dest = `${newdir}/${path}`\n }\n setErrMsg('')\n //setDir(dest)\n\n history.push('/file'+dest)\n }\n\n\n const fileSort = (a, b) => {\n if(a.Dir && !b.Dir) {\n return -1\n } else if (b.Dir && !a.Dir) {\n return 1\n }\n return a.Name < b.Name ? -1 : 1\n }\n useEffect(() => {\n let dest = dir;\n if (dir === undefined || dir === null|| dir === '') {\n dest = \"/\";\n }\n if(!token) {return}\n\n // console.log('fetch', dest)\n setLoading(true)\n setSearch('')\n getFiles(dest, token).then((resp) => {\n if(dest !== '/') {\n resp.data.Content.sort(fileSort)\n }\n // console.debug('files', dest, resp.data.Content)\n setReadOnly(resp.data.ReadOnly ?? false)\n setFiles(resp.data.Content)\n setLoading(false)\n //setErrMsg('')\n\n }).catch(err => {\n setErrMsg(dir+': '+ err.message)\n // setDir('/')\n history.push('/file/')\n // goto('/', {Name: '/', Dir: true})\n setLoading(false)\n if(err.response.status === 401) {\n logout(props.onLogout)\n }\n })\n }, [dir, token, props.refresh, props.onLogout])\n\n\n const fileType = (isDir, name) => {\n if (isDir) {\n return ()\n }\n const ooext = ['doc', 'docx', 'dotx', 'odt', 'rtf', 'txt', 'pdf', 'html', 'epub', 'xps', 'xml', 'docxf', 'xls', 'xlsx', 'xltx', 'ods', 'ots', 'csv', 'ppt', 'pptx', 'potx', 'odp', 'otp'];\n let ext = name.split('.').pop();\n if(ext.endsWith('pdf')) {\n return ()\n } else if(ooext.indexOf(ext) > 0) {\n return ()\n }\n return ()\n }\n\n const onDrop = useCallback((acceptedFiles) => {\n if(!props.upload) {\n return;\n }\n let files2upload = [];\n acceptedFiles.forEach((file) => {\n // console.log('drop',file)\n files2upload.push(file)\n })\n props.upload(files2upload, dir, token);\n \n }, [dir, props, token])\n const {getRootProps, getInputProps} = useDropzone({onDrop})\n\n const shareAccess = (f) => {\n let dest = `${f.Name}`\n if (f.Name[0] !== \"/\") {\n dest = `${dir}/${f.Name}`\n }\n setFileShare(dest)\n }\n\n const deleteFile = (f) => {\n setFileDelete(f);\n\n }\n\n const moveFile = (f) => {\n f.moveFrom = `${dir}/${f.Name}` ;\n setFileToMove(f)\n }\n\n const moveFileTo = () => {\n rename(fileToMove)\n }\n\n return (\n \n {token === null && \n \n \n {errMsg && {errMsg}}\n \n \n \n \n \n User id\n setUser({...user, user: e.target.value})} value={user.user}/>\n \n \n \n \n Password\n setUser({...user, password: e.target.value})} value={user.password}/>\n \n \n \n \n \n \n \n \n \n \n \n }\n {token !== null &&\n \n {dir !== '/' && \n \n
\n \n

Drag 'n' drop some files here, or click to select files

\n
\n
\n
}\n\n \n {errMsg && {errMsg}}\n {loading && Loading...}\n \n \n \n \n {gotoroute} {readOnly ? \"* Read only mode *\" : \"\"}\n \n \n \n \n setSearch(e.target.value)} value={search}/>\n \n {!loading && \n \n \n \n Type\n Name\n Size\n Date\n \n {dir !== \"/\" && }\n \n \n \n \n {fileToMove && \n Moving...\n {dir}/ setFileToMove({...fileToMove, Name: e.target.value})} value={fileToMove.Name}/>\n\n \n From {fileToMove.moveFrom}\n \n \n \n \n }\n {dir !== \"/\" && \n goto(dir, {Name: '..', Dir: true})}>\n {fileType(true)}\n \n ..\n 0\n \n \n \n }\n {files.map((f) => isSearch(f.Name) && (\n \n goto(dir, f)}>\n {fileType(f.Dir, f.Name)}\n \n {f.Name} {f.Sharing && [{f.Sharing}]}\n {prettyBytes(f.Size)}\n {f.Date}\n \n getFileInfo(f)}/>\n {!f.Dir && }\n {dir !== \"/\" && shareAccess(f)}/>}\n {!f.Dir && }\n {!f.Dir && moveFile(f)}/>}\n {dir !== \"/\" && deleteFile(f)}/>}\n \n \n ))}\n \n
\n
}\n
\n
\n }\n \n \n \n \n
\n )\n}\n\nexport default FileBrowser;","import React, { useCallback, useEffect, useState } from 'react'\nimport {Alert} from '@material-ui/lab';\nimport Card from '@material-ui/core/Card';\nimport CardContent from '@material-ui/core/CardContent';\nimport Typography from '@material-ui/core/Typography';\n\nimport Table from '@material-ui/core/Table';\nimport TableBody from '@material-ui/core/TableBody';\nimport TableCell from '@material-ui/core/TableCell';\nimport TableContainer from '@material-ui/core/TableContainer';\nimport TableHead from '@material-ui/core/TableHead';\nimport TableRow from '@material-ui/core/TableRow';\nimport Paper from '@material-ui/core/Paper';\nimport { makeStyles } from '@material-ui/core/styles';\nimport FolderIcon from '@material-ui/icons/Folder';\nimport DescriptionIcon from '@material-ui/icons/Description';\nimport DeleteIcon from '@material-ui/icons/Delete';\nimport PublishIcon from '@material-ui/icons/Publish';\nimport ShareIcon from '@material-ui/icons/Share';\n\nimport GetAppIcon from '@material-ui/icons/GetApp';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport Dialog from '@material-ui/core/Dialog';\nimport FormControl from '@material-ui/core/FormControl';\nimport InputLabel from '@material-ui/core/InputLabel';\nimport Input from '@material-ui/core/Input';\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport Grid from '@material-ui/core/Grid';\nimport {useDropzone} from 'react-dropzone'\nimport TextField from '@material-ui/core/TextField';\nconst prettyBytes = require('pretty-bytes');\n\nconst axios = require('axios');\n\nconst publicUrl = process.env.REACT_APP_GOZ_PUBLIC_URL || '';\nconst backend = process.env.REACT_APP_GOZ_BACKEND_URL || publicUrl\n\nconst useStyles = makeStyles({\n table: {\n minWidth: 650,\n },\n\n dropzone: {\n backgroundColor: 'lightGrey',\n },\n\n flexform: {\n display: 'flex',\n flexDirection: 'row',\n }\n});\n\nconst FileShareDialog = (props) => {\n const classes = useStyles();\n const { onClose, open } = props;\n \n const handleClose = () => {\n setLink(\"\")\n onClose();\n };\n\n const [errMsg, setErrMsg] = useState('')\n const [link, setLink] = useState('')\n //const [access, setAccess] = useState('ro')\n const [duration, setDuration] = useState(30)\n\n\n const getlink = () => {\n let f = props.file;\n if (f[0] !== \"/\") {\n f = \"/\" + f;\n }\n let token = props.token;\n axios.get(`${backend}/api/s3share/${props.project}/${props.bucket}${f}`, {\n params: {\n duration: parseInt(duration) * 24 * 3600,\n },\n headers: {\n 'X-Auth-Token': token\n }\n }).then(resp => {\n // console.log('link', resp.data)\n setLink(resp.data.Link)\n setErrMsg('')\n }).catch(err => {\n setErrMsg(err.message)\n })\n }\n return (\n {props.file &&\n \n {props.file}\n {errMsg && {errMsg}}\n \n Duration (days)\n setDuration(e.target.value)} value={duration}/>\n \n \n\n \n \n }\n )\n}\n\n\n\nconst S3Browser = (props) => {\n\n const classes = useStyles()\n\n const [errMsg, setErrMsg] = useState('')\n const [loading, setLoading] = useState(false)\n const [swift, setSwift] = useState('')\n\n const [s3Token, setS3Token] = useState(null)\n const [project, setProject] = useState('')\n const [buckets, setBuckets] = useState([])\n const [bucket, setBucket] = useState('')\n const [bucketMeta, setBucketMeta] = useState({})\n const [files, setFiles] = useState([])\n const [dir, setDir] = useState('')\n const [fileShare, setFileShare] = useState(null)\n\n const [s3User, setS3User] = useState({\n user: \"\",\n password: \"\",\n project: \"\"\n })\n\n const [newBucket, setNewBucket] = useState('')\n\n\n const handleFileShareClose = (value) => {\n setFileShare(null)\n }\n\n const shareAccess = (f) => {\n let dest = `${dir}${f.Name}`\n // console.log('should share', dest)\n setFileShare(dest)\n }\n\n useEffect(() => {\n if(s3Token === null || !bucket) {\n return\n }\n getBucketFiles(project, bucket, dir, s3Token)\n }, [dir, bucket, s3Token, project])\n\n useEffect(() => {\n if (s3Token === null) {\n setBucket('')\n setBuckets([])\n setDir('')\n }\n },[s3Token])\n\n useEffect(() => {\n if (bucket === '' || project === '' || s3Token === null) {\n return\n }\n // console.debug('bucket changed', bucket)\n getBucketFiles(project, bucket, '', s3Token)\n getBucketMeta(project, bucket)\n }, [bucket, project, s3Token])\n\n\n\n useEffect(() => {\n let t = localStorage.getItem(\"goz-s3token\");\n let p = localStorage.getItem(\"goz-s3project\")\n if(t && p) {\n setS3Token(t)\n setProject(p)\n setSwift(localStorage.getItem(\"goz-s3url\"))\n getBuckets(p, t)\n }\n }, [])\n\n const getBucketMeta = (project, bucket) => {\n axios.get(`${backend}/api/s3meta/${project}/${bucket}`, {\n 'headers': {\n 'X-Auth-Token': s3Token\n }\n }).then((response) => {\n // console.log('bucket meta', response.data)\n setBucketMeta(response.data.Bucket)\n }).catch(err => {\n setErrMsg(err.message)\n if(err.response.status === 401) {\n logout2s3()\n }\n });\n }\n\n const updateBucketMetaPublic = (project, bucket, is_public) => {\n axios.post(`${backend}/api/s3meta/${project}/${bucket}`, null, {\n 'headers': {\n 'X-Auth-Token': s3Token\n },\n params: {\n public: is_public\n }\n \n }).then((response) => {\n setBucketMeta({...bucketMeta, \"X-Container-Read\": is_public})\n }).catch(err => {\n setErrMsg(err.message)\n if(err.response.status === 401) {\n logout2s3()\n }\n });\n }\n\n const updateBucketMetaWeb = (project, bucket, web) => {\n axios.post(`${backend}/api/s3meta/${project}/${bucket}`, null, {\n 'headers': {\n 'X-Auth-Token': s3Token\n },\n params: {\n web: web\n }\n \n }).then((response) => {\n setBucketMeta({...bucketMeta, \"X-Container-Meta-Web-Listings\": web})\n }).catch(err => {\n setErrMsg(err.message)\n if(err.response.status === 401) {\n logout2s3()\n }\n });\n }\n\n\n // TODO temp url with prefix https://docs.openstack.org/swift/latest/api/temporary_url_middleware.html\n\n const isBucketPublic= () => {\n if (bucketMeta[\"X-Container-Read\"]) {\n return true\n }\n return false\n }\n\n const isBucketWeb = () => {\n if (bucketMeta[\"X-Container-Meta-Web-Listings\"]) {\n return true\n }\n return false\n }\n\n const logout2s3 = () => {\n setS3Token(null);\n localStorage.removeItem(\"goz-s3token\")\n localStorage.removeItem(\"goz-s3project\")\n\n }\n const log2s3 = () => {\n // console.log('should get token from s3')\n axios.post(`${backend}/api/s3auth`, s3User).then((response) => {\n setS3Token(response.data.Token)\n localStorage.setItem(\"goz-s3token\", response.data.Token)\n localStorage.setItem(\"goz-s3project\", response.data.Project)\n localStorage.setItem(\"goz-s3url\", response.data.URL)\n setProject(response.data.Project)\n setS3User({...s3User, password: ''})\n getBuckets(response.data.Project, response.data.Token)\n setSwift(response.data.URL)\n }).catch(err => {\n setErrMsg(err.message)\n });\n \n }\n\n const getBuckets = (project, token) => {\n axios.get(`${backend}/api/s3/${project}`, {\n 'headers': {\n 'X-Auth-Token': token\n }\n }).then((response) => {\n setBuckets(response.data.Buckets)\n if(!bucket && response.data.Buckets.length>0) {\n setBucket(response.data.Buckets[0].name)\n }\n }).catch(err => {\n setErrMsg(err.message)\n if(err.response.status === 401) {\n logout2s3()\n }\n }); \n }\n\n const getBucketFiles = (project, bucket, path, token) => {\n setLoading(true)\n\n axios.get(`${backend}/api/s3/${project}/${bucket}${path}`, {\n 'headers': {\n 'X-Auth-Token': token\n }\n }).then((response) => {\n let tmp_files = [];\n let tmp_dir = dir.substring(1);\n for(let i=0;i {\n setErrMsg(err.message)\n setLoading(false)\n if(err.response.status === 401) {\n logout2s3()\n }\n }); \n }\n\n\n const onDrop = useCallback((acceptedFiles) => {\n acceptedFiles.forEach((file) => {\n if(props.upload) {\n let backend = `${swift}/v1/AUTH_${project}/${bucket}`\n props.upload(backend, file, dir, s3Token);\n }\n })\n \n }, [dir, project, props, bucket, swift, s3Token])\n const {getRootProps, getInputProps} = useDropzone({onDrop})\n\n\n const goto = (dir, fileinfo) => {\n if (fileinfo === null) {\n setDir(dir)\n return\n }\n let path = fileinfo.Name;\n if (!fileinfo.Dir) {\n return\n }\n //setDir(`${dir}/${f.Name}`)\n // console.log('goto request', dir, path)\n let dest = `${path}`\n if (path === '..') {\n let dirs = dir.split('/')\n // console.log('goto', dirs.slice(0, dirs.length-2).join('/') + '/')\n // Should check if subdir is a base share, else prevent\n setDir(dirs.slice(0, dirs.length-2).join('/') + '/')\n return\n }\n if (dir[dir.length-1] !== \"/\") {\n dest = `${dir}/${path}`\n } else {\n dest = `${dir}${path}`\n }\n setDir(dest)\n // console.log('goto', dir, path, dest)\n }\n\n const fileType = (isDir) => {\n if (isDir) {\n return ()\n }\n return ()\n }\n\n\n const deleteFile = (fileInfo) => {\n let path = fileInfo.Name;\n if(fileInfo.Dir) {\n setErrMsg('not a file')\n return\n }\n\n let dest = `${path}`\n if (dir[dir.length-1] !== \"/\") {\n dest = `${dir}/${path}`\n } else {\n dest = `${dir}${path}`\n }\n \n axios.delete(`${swift}/v1/AUTH_${project}/${bucket}${dest}`,\n {\n headers: {\n 'X-Auth-Token': s3Token,\n }\n }\n ).then((response) => {\n getBucketFiles(project, bucket, dir, s3Token)\n }).catch(err => {\n console.error(err)\n if(err.response.status === 401) {\n logout2s3()\n }\n }); \n }\n\n \n\n const downloadFile = (fileInfo) => {\n let path = fileInfo.Name;\n if(fileInfo.Dir) {\n setErrMsg('not a file')\n return\n }\n\n let dest = `${path}`\n if (dir[dir.length-1] !== \"/\") {\n dest = `${dir}/${path}`\n } else {\n dest = `${dir}${path}`\n }\n\n axios({\n url: `${swift}/v1/AUTH_${project}/${bucket}${dest}`,\n method: 'GET',\n responseType: 'blob', // important\n headers: {\n 'X-Auth-Token': s3Token,\n }\n }).then((response) => {\n const url = window.URL.createObjectURL(new Blob([response.data]));\n const link = document.createElement('a');\n link.href = url;\n link.setAttribute('download', fileInfo.Name); //or any other extension\n document.body.appendChild(link);\n link.click();\n }).catch(err => {\n console.error(err);\n /*\n if(err.response.status === 401) {\n logout2s3()\n }*/\n }); \n }\n\n const createBucket = () => {\n axios.put(`${swift}/v1/AUTH_${project}/${newBucket}`, null,\n {\n headers: {\n 'X-Auth-Token': s3Token,\n }\n }\n ).then((response) => {\n getBuckets(project, s3Token)\n }).catch(err => {\n console.error(err)\n setErrMsg(err.message)\n if(err.response.status === 401) {\n logout2s3()\n }\n }); \n setNewBucket('')\n }\n\n return (\n \n {errMsg && {errMsg}}\n {loading && Loading...}\n\n {dir && {dir}}\n {s3Token === null && \n \n \n \n User id\n setS3User({...s3User, user: e.target.value})} value={s3User.user}/>\n \n \n \n \n Password\n setS3User({...s3User, password: e.target.value})} value={s3User.password}/>\n \n \n \n \n Project\n setS3User({...s3User, project: e.target.value})} value={s3User.project}/>\n \n \n \n \n \n \n \n \n }\n {s3Token !== null && \n \n \n \n \n \n {buckets.map(b => (\n \n ))}\n \n Bucket name\n setNewBucket(e.target.value)} value={newBucket}/>\n \n \n \n \n {bucket && \n \n \n {bucket}\n \n \n Visibility\n { isBucketPublic() &&
}\n { !isBucketPublic() &&
}\n
\n \n Web access\n { isBucketWeb() &&
\n \n \n
}\n { !isBucketWeb() && }\n
\n \n \n {swift}/v1/AUTH_{project}/{bucket}/\n \n \n
\n
\n
\n
}\n
\n\n
\n \n \n
\n \n

Drag 'n' drop some files here, or click to select files

\n \n \n
\n
\n
\n \n \n \n \n \n Type\n Name\n Size\n Date\n \n \n \n \n {dir !== \"/\" && \n goto(dir, {Name: '..', Dir: true})}>\n {fileType(true)}\n \n ..\n 0\n \n \n \n }\n {files.map((f) => (\n \n goto(dir, f)}>\n {fileType(f.Dir)}\n \n {f.Name}\n {prettyBytes(f.Size)}\n {f.Date}\n \n {!f.Dir && downloadFile(f)}/>}\n {!f.Dir && deleteFile(f)}/>}\n { shareAccess(f)}/>}\n\n \n \n ))}\n \n
\n
\n\n\n\n
\n
\n
}\n \n\n
\n )\n}\n\nexport default S3Browser;","import React, { useEffect, useState } from 'react'\nimport {Alert} from '@material-ui/lab';\nimport Table from '@material-ui/core/Table';\nimport TableBody from '@material-ui/core/TableBody';\nimport TableCell from '@material-ui/core/TableCell';\nimport TableContainer from '@material-ui/core/TableContainer';\nimport TableHead from '@material-ui/core/TableHead';\nimport TableRow from '@material-ui/core/TableRow';\nimport Paper from '@material-ui/core/Paper';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Button from '@material-ui/core/Button';\nimport Grid from '@material-ui/core/Grid';\nimport FormControl from '@material-ui/core/FormControl';\nimport InputLabel from '@material-ui/core/InputLabel';\nimport Select from '@material-ui/core/Select';\nimport TextField from '@material-ui/core/TextField';\n\n\n// const prettyBytes = require('pretty-bytes');\n\nconst axios = require('axios');\n\nconst publicUrl = process.env.REACT_APP_GOZ_PUBLIC_URL || '';\nconst backend = process.env.REACT_APP_GOZ_BACKEND_URL || publicUrl\n\nconst useStyles = makeStyles({\n table: {\n minWidth: 650,\n },\n editor: {\n minHeight: 800,\n },\n form: {\n margin: '10px'\n },\n dropzone: {\n backgroundColor: 'lightGrey',\n },\n });\n\n\nexport const Context = React.createContext();\n\n\nconst SharesBrowser = (props) => {\n\n const [shares, setShares] = useState([])\n const [tokens, setTokens] = useState([])\n const [errMsg, setErrMsg] = useState('')\n const [loading, setLoading] = useState(false)\n const [token, setToken] = useState(null)\n const [shareWith, setShareWith] = useState({\n path: '',\n user: '',\n group: '',\n mode: 'ro'\n })\n\n\n const classes = useStyles();\n\n\n const updateShares = () => {\n setLoading(true)\n axios.get(`${backend}/api/shares/`, {\n headers: {\n 'Authorization': 'Bearer ' + props.token\n }\n }).then(resp => {\n setShares(resp.data.shares)\n setLoading(false)\n }).catch(err => {\n console.error('failed to get shares')\n })\n axios.get(`${backend}/api/tokens`, {\n headers: {\n 'Authorization': 'Bearer ' + props.token\n }\n }).then(resp => {\n // console.debug('tokens', resp.data)\n setTokens(resp.data.tokens)\n }).catch(err => {\n console.error('failed to get tokens')\n })\n }\n\n const addShare = () => {\n if (shareWith.path === '') {\n setErrMsg('empty path')\n return\n }\n if (shareWith.user === '' && shareWith.group === '') {\n setErrMsg('both user and group are empty')\n return\n }\n let filter = {\n access: shareWith.mode,\n }\n if (shareWith.user !== '') {\n filter['user'] = shareWith.user\n }\n if (shareWith.group !== '') {\n filter['group'] = shareWith.group\n }\n axios.post(`${backend}/api/shares${shareWith.path}`,null, {\n headers: {\n 'Authorization': 'Bearer ' + props.token\n },\n params: filter\n }).then(resp => {\n updateShares()\n setShareWith({\n path: '',\n user: '',\n group: '',\n mode: 'ro'\n })\n setErrMsg('')\n }).catch(err => {\n console.error('failed to delete share')\n })\n\n \n }\n\n const revokeToken = async (anontoken) => {\n axios.delete(`${backend}/api/auth/token`, {\n headers: {\n 'Authorization': 'Bearer ' + props.token,\n 'X-Token': anontoken.Token\n }\n }).then(() => updateShares())\n .catch(err => console.error('failed to revoke token', err))\n }\n\n const removeShare = async (share) => {\n let filter = {}\n if (share.ToUser !== '') {\n filter['user'] = share.ToUser\n }\n if (share.ToGroup !== '') {\n filter['group'] = share.ToGroup\n }\n axios.delete(`${backend}/api/shares${share.Path}`, {\n headers: {\n 'Authorization': 'Bearer ' + props.token\n },\n params: filter\n }).then(resp => {\n updateShares()\n setErrMsg('')\n }).catch(err => {\n console.error('failed to delete share')\n })\n }\n\n useEffect(() => {\n if(!props.token) {return}\n updateShares()\n }, [props.token])\n\n return (\n \n {errMsg && {errMsg}}\n {loading && Loading...}\n\n {props.token === null &&
Please login first
}\n

User shares

\n\n {props.token !== null &&\n \n \n \n \n \n \n Path\n Shared with user\n Shared with group\n Write allowed?\n \n \n \n \n \n \n \n \n setShareWith({...shareWith, path: e.target.value})} value={shareWith.path}/>\n \n \n \n \n setShareWith({...shareWith, user: e.target.value})} value={shareWith.user}/>\n \n \n \n \n setShareWith({...shareWith, group: e.target.value})} value={shareWith.group}/>\n \n \n \n \n Access\n \n \n \n \n \n \n \n {shares.map((f, index) => (\n \n {f.Path}\n {f.ToUser}\n {f.ToGroup}\n {f.WriteAllowed ? \"yes\": \"no\"}\n \n \n \n \n ))}\n \n
\n
\n
\n
\n }\n\n

Anonymous link tokens

\n {props.token !== null &&\n \n \n \n \n \n \n Name\n Path\n Expires\n Access\n \n \n \n \n {tokens.map((f, index) => (\n \n {f.Name}\n {f.Path}\n {new Date(f.Expires*1000).toLocaleDateString()}\n {f.Rw ? \"rw\": \"ro\"}\n {f.Revoked ? \"revoked\": }\n \n ))}\n \n
\n
\n
\n
\n }\n
\n )\n}\n\nexport default SharesBrowser;","import React from 'react'\n\nexport const Context = React.createContext();\n\n\nconst Doc = (props) => {\n\n return (\n
\n

Documentation

\n\n

HomeAndCo provides remote access to a filesystem, allowing to navigate in\ndirectories and download, upload or share files

\n

After login, you access the filesystem with your usual permissions.

\n\n

Files

\n\n

This page gives access to the remote file system and can be used to\nlist, download or upload files.

\n\n

All configured directories are accessible (can be your home directory but also other group or public directories).\nSome directories may be in read-only mode.

\n\n

To navigate in directories, you can click on directory icon to go in this directory.\nQuestion mark icon can give further information on the directory (permissions etc..).

\n\n

When listing a directory (depending on size can take a few seconds), you have the list of\nsubdirectories and files.

\n
    \n
  • Question mark icon will give file/dir information
  • \n
  • Trash icon will delete file or recursively delete directory content
  • \n
  • Download icon will ... download the file
  • \n
  • Move icon (files only) will move a file to an other directory. Once clicked, go to expected destination, path and move confirmation are found at the top of the table
  • \n
  • Edit icon opens a file in LibreOffice for supported file types (can be used with other users for collaborative edition)
  • \n
  • Share icon opens a dialog where you name the link you want to create, the permissions and the expiration time. An url with a token will be shown after creation and can be sent to people you want to share the file/dir with
  • \n
\n\n

Shares

\n\n

Once you get a share link, the url can be used by anyone to access a file or a directory (and all its sub content).\nRead-write shares should be used with care!!!

\n\n

Users with this link do not need to have an account and will see only the shared file/directory. From here they can browse and download files.

\n

After expiration time, user will not have access anymore

\n\n

Tokens can also be used with tools like curl to download files, simply setting in URL headers Authorization: Bearer YOURTOKEN and url https://.../api/files/xxxx (xxxx = path to the file)

\n\n

Webdav access

\n\n

It is also possible to access filesystem via webdav (to mount disk on linux or windows as a remote disk), using url: davs://homeandco.genouest.org/api/webdav. You will be prompted for login/password.

\n

For webdav access with shared links, use *anonymous* for login, and the token as password (https://...?token=**token**)

\n\n

Objects

\n\n

This page gives access to an object store (Openstack switf) and can be used to\nlist, download or upload files.

\n\n\n

Shares

\n\n

This page lists the files already shared with a public link and their expiration.\nIt is possible to revoke a link to prevent further usage.

\n\n

You can also share in this page in filesystem path with an other known user or group.\nShares can be read-only (the default) or with write access.

\n\n

Shares can be removed at any time.

\n\n

Managing access

\n

It is possible to deny remote access via homeandco. To do so, create a file named .homeandco.deny in a dir, this dir and subdirs won't have remote web access

\n

You can also create static web sites (html pages) with public access (anyone with url can view it).

\n

Accessing https://.../web/file_path will give public (anonymous) access to a file or directory if base directory or parent directory contains a file named homeandco.public.

\n

If path is a directory and contains an index.html it will be served, making possible to host a static web site

\n\n

Command line

\n

Using curl:

\n\n

# with TOKEN an environment variable with token to access file /home/homeandco/myfile

\n
curl -H \"Authorization: Bearer $TOKEN\"  'https://homeandco.genouest.org/api/download/home/homeandco/myfile'
\n

OR

\n
curl 'https://homeandco.genouest.org/api/download/home/homeandco/myfile?token=$TOKEN'
\n\n

Using get:

\n

# download directory content recursively, with TOKEN an environment variable with token to access directory /home/homeandco/test/

\n

# Caution to ending slash for directories

\n
wget --header=\"Authorization: Bearer $TOKEN\"  -r --no-parent -R \"index.html*\"  https://homeandco.genouest.org/api/download/home/homeandco/test/
\n\n

A command line tool can be used to list/download/upload files or directories.

\n

Binary can be downloaded at https://gitlab.inria.fr/genouest/r-d/homeandco/-/releases with Hac command line client for your platform (linux, mac, windows).

\n\n
export HAC_URL=https://homeandco.genouest.org
\n
# Using credentials
\n
export HAC_USER=my_user_login
\n
export HAC_PASSWORD=my_password
\n
# OR
\n
export HAC_TOKEN=xxxx if using a share token
\n
./hac ls path_to_my_home
\n
./hac cp --from hac://path_to_remote_file_or_directory_to_download --to path_to_local_directory
\n
./hac cp --from path_to_local_file_or_directory_to_upload --to hac://path_to_remote_directory
\n\n

On windows, to set environment variables:

\n\n $env:HAC_URL='https://homeandco.genouest.org'\n\n
\n
)\n}\n\nexport default Doc;","import logo from './logo.svg';\nimport './App.css';\n\nimport { useEffect, useState } from 'react'\n\nimport {Container} from '@material-ui/core'\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\n\nimport Grid from '@material-ui/core/Grid';\n\nimport { BrowserRouter as Router, Switch, Route, Link } from \"react-router-dom\";\nimport Card from '@material-ui/core/Card';\nimport CardContent from '@material-ui/core/CardContent';\n//import CardHeader from '@material-ui/core/CardHeader';\nimport Typography from '@material-ui/core/Typography';\n\nimport FileBrowser from './FileBrowser'\nimport S3Browser from './S3Browser'\nimport SharesBrowser from './SharesBrowser'\n//import AuthComponent from './Auth'\nimport Doc from './Doc'\n\nconst axios = require('axios');\nconst publicUrl = process.env.REACT_APP_GOZ_PUBLIC_URL || '';\nconst backend = process.env.REACT_APP_GOZ_BACKEND_URL || publicUrl\n\n\n\nfunction App() {\n\n // 0: shares, 1: swift\n const [fileAccess, setFileAccess] = useState(0)\n const [uploads, setUploads] = useState([])\n const [token, setToken] = useState(null)\n const [sidebarOpen, setSideBarOpen] = useState(true);\n const handleViewSidebar = () => {\n setSideBarOpen(!sidebarOpen);\n };\n \n const [refresh, setRefresh] = useState(0)\n\n const upload = async (files, to, token)=> {\n let nbuploads = 0;\n let nbfiles = files.length\n for(let i=0; i {\n let f = {s3 :url, name: from.name, from: from, to: to, status: 'pending', progress: 0, token: token}\n // console.debug('add to download', f)\n setUploads([f])\n uploadFile2s3(f).then(() => {\n setRefresh(Date.now())\n })\n }\n\n const onLogin = (token) => {\n setToken(token)\n }\n\n const onLogout = () => {\n setToken(null)\n }\n\n const uploadFile2s3 = (f) => {\n return new Promise((resolve, reject) => {\n const config = {\n onUploadProgress: function(progressEvent) {\n if (!uploads.length===0) {return}\n var percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total)\n let u = [...uploads];\n u[0].progress = percentCompleted\n setUploads(u) \n },\n headers: {\n 'X-Auth-Token': f.token\n }\n }\n let data = new FormData()\n data.append('file', f.from)\n let u = [...uploads];\n u[0].status = 'uploading'\n let dest = `${f.to}${f.name}`\n \n axios.put(`${f.s3}/${dest}`, data, config)\n .then(res => {\n let u = [...uploads];\n u[0].status = 'completed'\n u[0].progress = 100\n setUploads(u)\n resolve()\n })\n .catch(err => {\n let u = [...uploads];\n u[0].progress = 0\n u[0].status = 'error'\n if (err.response) {\n u[0].status = err.response.data\n }\n setUploads(u)\n reject()\n })\n })\n }\n\n\n const uploadFile = (f) => {\n return new Promise((resolve, reject) => {\n const config = {\n onUploadProgress: function(progressEvent) {\n if (uploads.length === 0) {return}\n var percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total)\n let u = [...uploads];\n u[0].progress = percentCompleted\n setUploads(u) \n },\n headers: {\n 'Authorization': 'Bearer ' + f.token\n }\n }\n let data = new FormData()\n data.append('file', f.from)\n // console.debug('upload to ', f.to)\n\n axios.post(`${backend}/api/upload${f.to}/${f.name}`, data, config)\n .then(() => {\n f.progress = 100\n f.status = 'completed'\n setUploads([f])\n // console.debug('uploaded', f)\n resolve();\n })\n .catch(err => {\n f.progress = 0\n f.status = 'error'\n if (err.response) {\n f.status = err.response.data\n }\n setUploads([f])\n // console.debug('upload error', f)\n reject();\n })\n\n })\n }\n\n return (\n
\n
\n HomeAndCo\n
\n \n \n {!sidebarOpen && \n \n \n \n \n \n \n }\n \n {sidebarOpen && \n \n \n \n \n \n \n \n \n\n\n \n {uploads.length > 0 && \n
Uploads
\n {uploads.map((u,i) => (\n
\n \n \n \n {u.ts.toLocaleTimeString()}\n \n {u.name} [{u.progress}%] {u.status}\n \n \n
\n ))}\n
}\n
\n
\n }\n\n\n (\n \n )}/>\n (\n \n )}/>\n (\n \n )}/>\n (\n \n )}/>\n (\n \n )}/>\n (\n \n )}/>\n \n\n
\n\n
\n
\n
\n );\n}\n\nexport default App;\n","const reportWebVitals = onPerfEntry => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry);\n getFID(onPerfEntry);\n getFCP(onPerfEntry);\n getLCP(onPerfEntry);\n getTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport reportWebVitals from './reportWebVitals';\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root')\n);\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n"],"sourceRoot":""}