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

Feature request: SuSE SLES 12 repos #6

Open
nephilim1973 opened this issue Apr 14, 2016 · 6 comments
Open

Feature request: SuSE SLES 12 repos #6

nephilim1973 opened this issue Apr 14, 2016 · 6 comments

Comments

@nephilim1973
Copy link

Hi,
I have a feature request for your script.

For mirroring SLES repos, you have to give a token with each download URL/file.

https://updates.suse.com/SUSE/Products/SLE-SERVER/12/x86_64/product/?<token>

You could generate your own token, if you paste a valid "Registration Code" from SuSE Customer Center
https://scc.suse.com/subscriptions
in this command line:

curl -H "Authorization: Token token=YourRegistrationCode" https://scc.suse.com/connect/subscriptions/products | tr "," "\n" | grep -i "url" | grep -i "SLE-SERVER"

Output example:

https://updates.suse.com/SUSE/Products/SLE-SERVER/12/x86_64/product/?lWDDA38y7a1zHcZrMj2aTSNun-Su4vB7Q6E1fe2JG4BYyonwRpTRjiqTXFtYuXMuZpsLBDfDbVbHki5waK1vBF0bfZAhGkd_3SiR_0s3XuOYqIqhwedet5ZiUx9NiULiF6X6RzF6dLB9
https://updates.suse.com/SUSE/Products/SLE-SERVER/12-SP1/x86_64/product/?a1U84xkEgkn2sy08EZm8lJdZ6N6bTWpyWT_ASOHCSdAfHg34saaSeICJV_CJbOLHVEfpZ07iRiIJpRIzYSv-T-1qMIUX8qMQ4bTjB5_ggFtI209CYrWGQOpSsCkT_vFXVqpNeIDmEgGA9b1ikQ

Just to avoid misunderstandings:
For EACH file to download, you have to add the ?<token> to the URL.

So, it would be very nice, if you could add a config option "auth_token", where the token could be stored for each repo (every repo has its own token).
If this option is set, and if repo is a SuSE SLES repo, each file/download URL should expanded with
?$auth_token string

Thanks and regards.

@pyther
Copy link
Owner

pyther commented Apr 14, 2016

Under the hood, repo_sync (part of yum utils) is being used to mirror repositories. Can you sync the repo successfully if set url = https://updates.suse.com/SUSE/Products/SLE-SERVER/12/x86_64/product/?YOUR_API_KEY?

@nephilim1973
Copy link
Author

Unfortunatelly not.

yum.Errors.NoMoreMirrorsRepoError: failure: repodata/repomd.xml from sles12: [Errno 256] No more mirrors to try.
https://updates.suse.com/SUSE/Products/SLE-SERVER/12/x86_64/product/?AAAAAAAAAAAAAAAA-LEMuj9nkfRSSbGhKjhMWQLnBEAcUmETDG20VIWbt1VJWZvF0EFoVPhMtOM4f6YE0USY_jeRzGnHXDGuZLL1YI7H3dVKSHZumIaCAHtahtvhomMFZYOZE7P4UD6K/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for sles12: Damaged repomd.xml file

The reason for that is, that the repomd.xml should be downloaded without the trailing ?AAAAAAAAAAAAAAAA-LEMuj9nkfRSSbGhKjhMWQLnBEAcUmETDG20VIWbt1VJWZvF0EFoVPhMtOM4f6YE0USY_jeRzGnHXDGuZLL1YI7H3dVKSHZumIaCAHtahtvhomMFZYOZE7P4UD6K

The above URL
https://updates.suse.com/SUSE/Products/SLE-SERVER/12/x86_64/product/?AAAAAAAAAAAAAAAA-LEMuj9nkfRSSbGhKjhMWQLnBEAcUmETDG20VIWbt1VJWZvF0EFoVPhMtOM4f6YE0USY_jeRzGnHXDGuZLL1YI7H3dVKSHZumIaCAHtahtvhomMFZYOZE7P4UD6K/repodata/repomd.xml
is unuseable.

Correct URL should be:

https://updates.suse.com/SUSE/Products/SLE-SERVER/12/x86_64/product/repodata/repomd.xml?AAAAAAAAAAAAAAAA-LEMuj9nkfRSSbGhKjhMWQLnBEAcUmETDG20VIWbt1VJWZvF0EFoVPhMtOM4f6YE0USY_jeRzGnHXDGuZLL1YI7H3dVKSHZumIaCAHtahtvhomMFZYOZE7P4UD6K

@pyther
Copy link
Owner

pyther commented Apr 14, 2016

With upstream_sync, upstream_sync generates the proper yum.conf for use by reposync.

You can see the commands upstream_sync is running with the -c option

@nephilim1973
Copy link
Author

Ok, i will try this....

@nephilim1973
Copy link
Author

$ upstream_sync.py -c
sles12:
  reposync -c /var/tmp/upstream_sync-linuxteam/sles12.repo -r sles12 -p /mirror/sles12 --arch x86_64 --tempcache --norepopath --downloadcomps --newest-only --delete -q
  createrepo --pretty --database --update --cachedir /mirror/sles12/.cache /mirror/sles12 -q
$ reposync -c /var/tmp/upstream_sync-linuxteam/sles12.repo -r sles12 -p /mirror/sles12 --arch x86_64 --tempcache --norepopath --downloadcomps --newest-only --delete -q

yum.Errors.NoMoreMirrorsRepoError: failure: repodata/repomd.xml from sles12: [Errno 256] No more mirrors to try.
https://updates.suse.com/SUSE/Products/SLE-SERVER/12/x86_64/product/?AAAAAAAAAAAAAAAA-LEMuj9nkfRSEHzHvPhMWQLnBEAcUmETDG20VIWbt1VJWZvF0EFoVPhMtOM4f6YE0USY_jeRzGnHXDGuZLL1YI7H3dVKSHZuAdHgFdtahtvhomMFZYOZE7P4UD6K/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for sles12: Damaged repomd.xml file

--> Same issue here... Wrong URL

@pyther
Copy link
Owner

pyther commented Apr 14, 2016

That makes sense. Reading the yum page, it does not appear there is an option add a suffix to all urls. Yum support HTTP Basic Auth and HTTPS Client Authentication.

Unfortunately I don't have a good solution.

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

2 participants