Limit public access to /<project>/~site only (OD-1147)
Armin Pfurtscheller opened 3 years ago

Hi Robin,

I've discovered the convenient feature "Publish Site" to deploy a static site and being accessible via /<project>/~site. Now I am wondering if it would make sense to have a possibility to only make the site accessible by the public?

Following the suggestion from the docs to allow anonymous access comes with the consequence that the whole project (or better: the whole onedev app) is accessible anonymously. This is not what I want. Just like Github or Gitlab pages are accessible from the public I want the same for my project site and keeping everything else hidden without authorization.

Do you think such a feature would make sense?

Thanks for your feedback!

  • Armin Pfurtscheller changed title 3 years ago
    Previous Value Current Value
    Limit public access to /<project/~site only
    Limit public access to /<project>/~site only
  • Robin Shen commented 3 years ago

    No problem. Will add this improvment in a patch release.

  • Armin Pfurtscheller commented 3 years ago

    Awesome - thanks for your quick response on that topic! This is super useful IMO if the project page can be directly used as hosting place for the site made public via a reverse proxy - no deployment via Docker container to (local) registry, container restart etc. required, but it's simply done when the project page is published :-)

  • Armin Pfurtscheller commented 3 years ago

    Hey @robin I would have one more request or question regarding the project site serving in the background - assuming I have a structure like:

    • index.html
    • subpage1/index.html
    • subpage2/index.html

    When trying to reach them via

    • https://localhost:6610/<project>/~site/subpage1 --> doesn't work
    • https://localhost:6610/<project>/~site/subpage1/ --> doesn't work
    • https://localhost:6610/<project>/~site/subpage1/index.html --> work

    Is it possible that the resolution to index.html is not active with the webserver serving the project site? Thanks!

  • Robin Shen commented 3 years ago

    It is served with a simple file server. Will improve it to handle this case.

  • Unknown commented 3 years ago

    Onedev supports static site deployment?

  • Robin Shen commented 3 years ago

    Yes, check the publish site step.

  • Unknown commented 3 years ago

    @robin There does not seem to be any documentation of this on https://docs.onedev.io/

    Am I missing something? I tried using the search function of the website to see if I was missing anything, but it does not seem like I am :/

  • Robin Shen commented 3 years ago

    Yes, this is not mentioned in docs. Contribution welcomed, 😁

  • Unknown commented 3 years ago

    hint hint (Polarian get to it)

  • Unknown commented 3 years ago

    I will play around with it... I wonder if it is powerful enough to build onedev/docs and deploy it to a static site 🤔

  • OneDev changed state to 'Closed' 3 years ago
    Previous Value Current Value
    Open
    Closed
  • OneDev commented 3 years ago

    State changed as code fixing the issue is committed

  • Marcos de Oliveira commented 3 years ago

    @robin would be cool if we could have a role for that, so we could limit it or allow everyone (as with current fix).

  • Robin Shen commented 3 years ago

    @markkrj please file a separate issue for role based site access.

  • Unknown commented 3 years ago

    @robin Sorry for interrupting but I wanted to discuss something.

    I took a look at the publish site section of the CI/CD and it is not self explanatory, definitely needs documentation, but first someone with experience with it must write the documentation.

    I have a question, do you plan on supporting custom domains similar to how github does, by adding your domain to your account settings and then selecting it when you build the site, provided you point the A record to the IP address of the onedev instance.

  • Robin Shen commented 3 years ago

    @polarian no custom domain will be supported. User will need to achieve this via reverse proxy.

  • Unknown commented 3 years ago

    Hm, giving me ideas here Robin on how to improve my public instance.

    A simple reverse proxy daemon running side by side with onedev sounds like a good idea. Does onedev support external authentication, aka, use of a onedev account to authenticate with another service?

  • Robin Shen commented 3 years ago

    Currently OneDev can be configured to authenticate via LDAP server, or OpenID SSO providers.

    To authenticate via other account system, additional plugin can be written.

  • Unknown commented 3 years ago

    I meant using onedev to auth other applications "Sign in with onedev" then you enter onedev instance base url and then it redirects you to that instance etc.

    would be useful for expanding onedev :)

  • Robin Shen commented 3 years ago

    OneDev will need to be a Idp in that case. Unless OneDev is popular enough, I guess no one will be using it for authentication...

  • Unknown commented 3 years ago

    Guess thats a "if you want it code it yourself" problem

  • OneDev changed state to 'Released' 3 years ago
    Previous Value Current Value
    Closed
    Released
  • OneDev commented 3 years ago

    State changed as build #3440 is successful

issue 1/1
Type
Improvement
Priority
Normal
Assignee
Issue Votes (0)
Watchers (5)
Reference
OD-1147
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover