Code Monkey home page Code Monkey logo

Comments (8)

mholt avatar mholt commented on July 27, 2024 1

You could probably use something like:

@forbidWrite {
    vars http.auth.user.id test
    not method GET HEAD OPTIONS PROPFIND
}
handle @forbidWrite {
    respond "Not allowed" 403
}
handle {
    # everything else
}

from caddy-webdav.

arichiardi avatar arichiardi commented on July 27, 2024 1

Came here to say thank you @mholt - this is the only solution that works here - I can see files but not modify them.

EDIT: ah well, adding a second user actually has got the same behavior as guest. I cannot read/write. It is a pity cause this seems the only way to do this, I'll have to ask on the forum.

with this conf:

:8080 {
    rewrite /dav /dav/

        # Thank you mholt for this solution:
        #   https://github.com/mholt/caddy-webdav/issues/27
    @noGuestsWrite {
        vars http.auth.user.id guest
        not method GET HEAD OPTIONS PROPFIND
    }
    handle @noGuestsWrite {
        respond 403
    }
    handle {
        basicauth /dav/media {
            guest <XYZ>
        }

        webdav /dav/* {
            root /srv/http/dav/All
            prefix /dav/media
        }
        file_server
    }
}

from caddy-webdav.

mholt avatar mholt commented on July 27, 2024

Depends on how you're authenticating users and such. What is your config / what have you tried so far?

from caddy-webdav.

underlaw avatar underlaw commented on July 27, 2024

thx

:2333
{
encode gzip
basicauth {
underlaw JDJhJDE0JDI1OUJCR3VndzBWUWtSU3ZsdVJXUGVrLzlsV0M2N3AuN2taRmkvY2ZnMlVIR1VtZnE4bjN5
test JDJhJDE0JDI1OUJCR3VndzBWUWtSU3ZsdVJXUGVrLzlsV0M2N3AuN2taRmkvY2ZnMlVIR1VtZnE4bjN5
}
root * /mnt/sda1/movie

route {
rewrite /webdav /webdav/
webdav /webdav/* {
prefix /webdav
}
file_server browse
}
}

underlaw has read, write, edit and delete permission; test has only read permission.

how to do? thx

from caddy-webdav.

underlaw avatar underlaw commented on July 27, 2024

Are you talking about setting different shared folders for different users? This is different from what I want. I want the same shared folder, but different users have different permissions. Thank you

from caddy-webdav.

underlaw avatar underlaw commented on July 27, 2024

I mean: the shared folder is /mnt/sda1/movie, undelaw has read-write permission, and test only has read permission.

from caddy-webdav.

mholt avatar mholt commented on July 27, 2024

No, that's disallowing writes for the user named test.

With further questions, please try asking on our forums! https://caddy.community

from caddy-webdav.

SoSolife avatar SoSolife commented on July 27, 2024

No, that's disallowing writes for the user named test.

With further questions, please try asking on our forums! https://caddy.community

But it also disallow read files from server on applications that support webdav when test remove method PROPFIND.
And it retains method PROPFIND, test can delete files from server.
Just want to share friends with accounts and not to modify files on server.

from caddy-webdav.

Related Issues (20)

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.