79 points
*

Misleading title.

If my thing was public in the past, and I took it private, the old public code is still public.

That’s… How the Internet works anyway.

Edit: See Eager Eagle’s better explanation below.

TL;DR - be careful who you allow to fork your private repos. And if you need to take a public repo, which has forks, private, consider archiving the repo and doing all the new work in a new repo. Which is arguably the reasonable thing to do anyway.

Still a misleading title. This isn’t a way to break into all or even most of your private repositories.

permalink
report
reply
29 points

That is not exactly what they are saying. You could create a private fork of a public repo and the code in your private fork is publicly accessible.

permalink
report
parent
reply
29 points

I don’t think you can create private forks from public repos (the fork is public upon creation). This is more like the opposite:

If there’s a private repo that is forked and the fork is made public, further changes to that original private repo become public too, despite the repo remaining private and the fork not being synced.

permalink
report
parent
reply
12 points

Misleading title.

The title literally spells out the concern, which is that code that is in a private or deleted repository is, in some circumstances, visible publicly.

What title would you propose?

If my thing was public in the past, and I took it private, the old public code is still public.

The “Accessing Private Repo Data” section covers a situation where code that has always been private becomes publicly visible.

permalink
report
parent
reply
1 point

the title is dyslexic at best

permalink
report
parent
reply
51 points
*

While this is still a massive problem, it does require a public fork at some point. So if you have a private repo that has never had a public fork, you should be safe.

permalink
report
reply
11 points

(unforked repos that are forks are also affected.)

permalink
report
parent
reply
7 points

Yes, but only in very limited circumstances. If you:

  1. fork a private repo with commit A into another private repo
  2. add commit B in your fork
  3. someone makes the original repo public
  4. You add commit C to the still private fork

then commits A and B are publicly visible, but commit C is not.

Per the linked Github docs:

If a public repository is made private, its public forks are split off into a new network.

Modifying the above situation to start with a public repo:

  1. fork a public repository that has commit A
  2. make commit B in your fork
  3. You delete your fork

Commit B remains visible.

A version of this where step 3 is to take the fork private isn’t feasible because you can’t take a fork private - you have to duplicate the repo. And duplicated repos aren’t part of the same repository network in the way that forks are, so the same situation wouldn’t apply.

permalink
report
parent
reply
4 points

The second situation you listed is incredibly common, as the blog post explains.

permalink
report
parent
reply
15 points

Im thinking of self hosting Forgejo one day.

permalink
report
reply
13 points

I do and it is pretty easy with docker compose.

permalink
report
parent
reply
5 points

Does it treat forks differently?

permalink
report
parent
reply
-1 points
*

sourcehut is much better if you can pay

Edit: Only repo hosters need to pay. Everything else is free.

permalink
report
parent
reply
15 points
*

I want forgejo for its upcoming federation feature tbh.

permalink
report
parent
reply
-1 points

Considering that git doesn’t need federation, and email is the grandfather of federation, sourcehut has a working version of it this very moment.

permalink
report
parent
reply
6 points

What makes sourcehut better?

From a self-hosting perspective, it looks like much more of a pain to get it set up and to keep it updated. There aren’t even official Docker images or builds. (There’s this and the forks of it, but it’s unofficial and explicitly says it’s not recommended for prod use.)

permalink
report
parent
reply
3 points

It also supports browsing without JavaScript, if that’s your thing.

permalink
report
parent
reply
2 points
*

Sourcehut has straightforward much better UI, UX, and features (more than gitea/forgejo but less than GitLab ig). I really dig the subdomain design.

Issues and PRs are conducted through email, essentially making that part federated and signup-less.

I’ve seen many pieces of software that claim to be beta/not used for prod but are actually bedrock solid.

permalink
report
parent
reply
12 points

Damn that’s a huge problem

permalink
report
reply
11 points

The takeaway is to not use forks if there are changes you want to keep private.

permalink
report
reply
10 points
permalink
report
parent
reply

Open Source

!opensource@lemmy.ml

Create post

All about open source! Feel free to ask questions, and share news, and interesting stuff!

Useful Links

Rules

  • Posts must be relevant to the open source ideology
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

Community icon from opensource.org, but we are not affiliated with them.

Community stats

  • 3.7K

    Monthly active users

  • 1.8K

    Posts

  • 30K

    Comments