Coder Social home page Coder Social logo

jveverka / file-server Goto Github PK

View Code? Open in Web Editor NEW
63.0 6.0 20.0 192 KB

Simple file server providing REST APIs to access remote file system.

License: Apache License 2.0

Java 99.23% Shell 0.55% Dockerfile 0.22%
file-sharing file-manager file-upload springboot jdk11 microservice file-system java11

file-server's People

Contributors

jveverka avatar keejef avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

file-server's Issues

Running with Docker with default configurations.

Just a little suggestion for noobs.. when running the appliction on docker with the default configuration , it may be important to to mention that the application should be run with the -v flag and that the path must match the home property under fileserver in the default configuration file .

i.e -v '/home/john/fs':/home/john/fs

application.yml
fileserver:
   home :  /home/john/fs

Anonymous access returns 403 HTTP code

Running file-server:1.3.0-amd64 via Docker on Windows. Logged in access to different directories with different roles works correctly. However, when trying to download a file or listing files to a directory with the "anonymous" role without logging in doesn't work, not even sending the cookie returned after the first try.

Using the default application.yml configuration:

     - path: 'anonymous-read/*'
       access: READ
       roles:
         - anonymous

Docker log, when logging in as "joe" and calling http://localhost:8888/services/files/list/anonymous-read:

2022-12-01 13:18:12.890  INFO 7 --- [nio-8888-exec-1] itx.fileserver.controler.AuthController  : login: joe AE3F9075EB87F2E8450F8B65AB65FB94
2022-12-01 13:18:12.890  INFO 7 --- [nio-8888-exec-1] i.f.s.d.inmemory.AuditServiceInmemory    : storeAudit: 1669900692 joe LOGIN
2022-12-01 13:18:16.947  INFO 7 --- [nio-8888-exec-3] i.f.controler.FileServerController       : getFiles: anonymous-read
2022-12-01 13:18:16.947  INFO 7 --- [nio-8888-exec-3] itx.fileserver.services.FileServiceImpl  : getFilesInfo: anonymous-read
2022-12-01 13:18:16.947  INFO 7 --- [nio-8888-exec-3] i.f.services.FileAccessServiceImpl       : checkAccess: public anonymous-read/* public/* READ/READ_WRITE
2022-12-01 13:18:16.949  INFO 7 --- [nio-8888-exec-3] i.f.services.FileAccessServiceImpl       : checkAccess: public anonymous-read/* joe/for-everybody/* READ/READ
2022-12-01 13:18:16.949  INFO 7 --- [nio-8888-exec-3] i.f.services.FileAccessServiceImpl       : checkAccess: anonymous anonymous-read/* * READ/READ_WRITE
2022-12-01 13:18:16.950  INFO 7 --- [nio-8888-exec-3] i.f.services.FileAccessServiceImpl       : checkAccess: anonymous anonymous-read/* anonymous-read/* READ/READ
2022-12-01 13:18:16.950  INFO 7 --- [nio-8888-exec-3] i.f.services.FileAccessServiceImpl       : checkAccess: anonymous anonymous-read/* anonymous-readwrite/* READ/READ_WRITE
2022-12-01 13:18:16.955  INFO 7 --- [nio-8888-exec-3] i.f.services.FileAccessServiceImpl       : checkAccess: public anonymous-read/anonymous-read public/* READ/READ_WRITE
2022-12-01 13:18:16.955  INFO 7 --- [nio-8888-exec-3] i.f.services.FileAccessServiceImpl       : checkAccess: public anonymous-read/anonymous-read joe/for-everybody/* READ/READ
2022-12-01 13:18:16.955  INFO 7 --- [nio-8888-exec-3] i.f.services.FileAccessServiceImpl       : checkAccess: anonymous anonymous-read/anonymous-read * READ/READ_WRITE
2022-12-01 13:18:16.955  INFO 7 --- [nio-8888-exec-3] i.f.services.FileAccessServiceImpl       : checkAccess: anonymous anonymous-read/anonymous-read anonymous-read/* READ/READ
2022-12-01 13:18:16.955  INFO 7 --- [nio-8888-exec-3] i.f.services.FileAccessServiceImpl       : checkAccess: anonymous anonymous-read/anonymous-read anonymous-readwrite/* READ/READ_WRITE
2022-12-01 13:18:16.958  INFO 7 --- [nio-8888-exec-3] i.f.services.FileAccessServiceImpl       : checkAccess: public anonymous-read/test.txt public/* READ/READ_WRITE
2022-12-01 13:18:16.958  INFO 7 --- [nio-8888-exec-3] i.f.services.FileAccessServiceImpl       : checkAccess: public anonymous-read/test.txt joe/for-everybody/* READ/READ
2022-12-01 13:18:16.958  INFO 7 --- [nio-8888-exec-3] i.f.services.FileAccessServiceImpl       : checkAccess: anonymous anonymous-read/test.txt * READ/READ_WRITE
2022-12-01 13:18:16.959  INFO 7 --- [nio-8888-exec-3] i.f.services.FileAccessServiceImpl       : checkAccess: anonymous anonymous-read/test.txt anonymous-read/* READ/READ
2022-12-01 13:18:16.959  INFO 7 --- [nio-8888-exec-3] i.f.services.FileAccessServiceImpl       : checkAccess: anonymous anonymous-read/test.txt anonymous-readwrite/* READ/READ_WRITE

...
[more files]
...

2022-12-01 13:18:16.988  INFO 7 --- [nio-8888-exec-3] i.f.s.d.inmemory.AuditServiceInmemory    : storeAudit: 1669900696 joe LIST_DIR

and the response:

{
    "path": "anonymous-read",
    "fileInfo": [
        {
            "filePath": "text.txt",
            "size": 203,
            "lastModified": 1669630057251
        },
        {
            "more":"files"
        }
    ],
    "directoryInfo": []
}

But when logging out and then calling the endpoint it seems an "anonymous" session is created without further action:

2022-12-01 13:18:16.988  INFO 7 --- [nio-8888-exec-3] i.f.s.d.inmemory.AuditServiceInmemory    : storeAudit: 1669900696 joe LIST_DIR
2022-12-01 13:22:59.403  INFO 7 --- [nio-8888-exec-6] itx.fileserver.controler.AuthController  : logout: AE3F9075EB87F2E8450F8B65AB65FB94
2022-12-01 13:22:59.403  INFO 7 --- [nio-8888-exec-6] i.f.s.d.inmemory.AuditServiceInmemory    : storeAudit: 1669900979 joe LOGOUT
2022-12-01 13:22:59.403  INFO 7 --- [nio-8888-exec-6] itx.fileserver.config.SessionListener    : sessionDestroyed: AE3F9075EB87F2E8450F8B65AB65FB94
2022-12-01 13:23:02.020  INFO 7 --- [nio-8888-exec-7] itx.fileserver.config.SessionListener    : sessionCreated: 514697DDA3BAE65EDCF9A5A708FC97E6
2022-12-01 13:23:02.020  INFO 7 --- [nio-8888-exec-7] i.f.s.d.inmemory.AuditServiceInmemory    : storeAudit: 1669900982 ANONYMOUS LOGIN

There are no new logs when calling the endpoint again with the session cookie.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.