Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update mirroring code to our official mirror code #133

Open
Seldaek opened this issue Apr 23, 2020 · 10 comments
Open

Update mirroring code to our official mirror code #133

Seldaek opened this issue Apr 23, 2020 · 10 comments
Assignees

Comments

@Seldaek
Copy link

Seldaek commented Apr 23, 2020

I just published https://github.com/composer/mirror which supports Composer 1 and Composer 2 style metadata mirroring. I would appreciate very much if you could update this repo to use this instead of however you are doing it now. I am fairly sure our implementation is correct, and especially that it will be maintained.

I'm happy to discuss how to achieve this etc.

Also note that generally speaking I hope Composer 2 will reduce the need for third party mirrors as it does parallelize requests to the repository, and data transfer is overall smaller, so latency should be much less problematic.

@webysther
Copy link
Owner

Of course, I will change to use them.

An unexpected effect of creating this mirror is the fact that it has become an alternative in places where internet access is restricted, not just the ability to parallelize, as is the case in China with the great firewall of china.

I asked this a while ago, would you have the documented specification of the metadata structure?

@Seldaek
Copy link
Author

Seldaek commented Apr 26, 2020

The v2 metadata is much simpler, two files per package ($name~dev.json for dev versions and $name.json for the rest), and mostly documented in https://github.com/composer/composer/blob/master/UPGRADE-2.0.md#for-composer-repository-implementors - but it's also fully implemented by the mirroring script code and packagist.org, so unless you're serving your own packages, you don't really need to care just for process of mirroring.

@webysther
Copy link
Owner

webysther commented Apr 26, 2020

Do you think it is better to update the code to use this script or archive this project and suggest using the new repository?

@Seldaek
Copy link
Author

Seldaek commented Apr 26, 2020

I don't know how much effort it is for you to migrate.. And I don't know how much people need/care about the "homepage" aspect of this repo. My thing is really just a background worker to mirror files. So I wouldn't say it replaces all of this repo.. That's why I thought maybe it'd be good to continue having this as a sample homepage for mirrors that they can tweak as needed.

@webysther
Copy link
Owner

webysther commented Apr 26, 2020

I need a few days to offer support, I will follow closely the evolution of composer v2, congratulations! I am very happy with the evolution.

If you want to migrate this repository in the future, we can talk to make a plan for it, it is up to you.

@webysther webysther pinned this issue Apr 27, 2020
@peter279k
Copy link

I'm interested in migrating original packagist-mirror to composer/mirror script.

I want to know current works about that and binding above two mirrors together successfully :).

@webysther
Copy link
Owner

Hi @peter279k please start a PR, because covid the country I live was huge impacted and my time is focus on my current job, I appreciate help. :)

@Seldaek
Copy link
Author

Seldaek commented Oct 17, 2020

Any progress here? As per composer/composer#9297 it seems that currently this repo generates invalid repositories for Composer 2.

@peter279k
Copy link

For now, I don't figure out the current way to migrate composer/mirror to this packagist-mirror because the composer/mirror is simpler and more different than packagist-mirror.

Maybe we can use php bin/mirror create -v2 -vvv or php bin/mirror create -v1 -vvv to create different metadata version?

Please suggest some recommendations about this. Thanks.

@Seldaek
Copy link
Author

Seldaek commented Oct 17, 2020

Well IMO the entire mirroring script here should be replaced by the composer/mirror logic. As per the setup instructions, you should run all 3 commands to produce a mirror which supports composer 1 and 2. If you only want v2 you can skip the --v1 command and set has_v1_mirror to false in the config.

I am not familiar with the code in this repo, nor how bin/mirror works, but right now the mirror in south africa advertises v2 metadata by defining a metadata-url but it doesn't actually have the data files present, so it breaks. It should at least remove metadata-url if v2 is not fully supported, so that composer 2 can still rely on the v1 metadata files and keep working.

@webysther webysther self-assigned this Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants