Commit Graph

44 Commits

Author SHA1 Message Date
Tianon Gravi 6fbb0282e9 Trim descriptions based on bytes, not characters
It turns out that the Hub description length limit is 25k *bytes*, not characters.  We've gotten lucky that our few unicode glyphs have landed so far such that we've never run into a problem with this before now, but we're currently hitting this while trying to push the `amd64/nextcloud` description in that the trimmed version ends up being exactly 25,003 bytes thanks to the unicode glyphs throwing off our trimming calculations (and getting really [un]lucky with the exact positioning of the markdown such that our trimming doesn't walk back far enough).

This fixes that by calculating and trimming based on bytes, accounting for cases of unicode glyphs directly spanning the 25k byte boundary.

After applying this fix, the same breaking `amd64/nextcloud` trimmed description is 24,725 bytes instead.
2024-07-05 16:35:22 -07:00
yosifkit 63c9218175
Add Docker Hub categories (#2446)
* Add repo metadata, start with categories!

scripts for checking repo categories, updating the canonical set
added categories to push.pl

* Add initial set of semi-acurate categories

* Adjustments following tianon's review

* Simplify metadata.sh use cases (CI or interactive); just diff and check all the time

Update README.md about metadata.sh usage

* Unify the categories checks into one jq expressions

* Update initial categories

* Link to Docker docs for categories; minor categories script adjustments
2024-05-17 11:44:00 -07:00
Tianon Gravi e1f232931d Remove CSRF handling
This was required at some point in the past, but it appears to no longer be necessary!
2024-03-08 12:55:11 -08:00
Tianon Gravi 5880c1f427 Remove "attempt-login" endpoint (apparently no longer necessary or even existent) 2023-11-29 13:55:44 -08:00
Joseph Ferguson b6ba610419 Only upload logos to library/
logos upload is not currently available on our arch-specifc namespaces
2023-09-29 09:45:18 -07:00
Tianon Gravi 231b5858d7 Ditch b64_encode, which does not appear to be required 2023-09-28 10:30:22 -07:00
Joseph Ferguson 0441838500 Update logo upload to simpler single API reguest flow 2023-09-28 10:09:45 -07:00
Tianon Gravi b239baff4c Update to use the new repo logos API 2023-07-20 13:09:40 -07:00
Tianon Gravi 0ad17f594a Adjust "Docker Hub" URL references to use a shared variable
(This makes testing against Hub's staging environment more straightforward.)
2023-05-12 10:30:20 -07:00
Tianon Gravi bac0d1d2c9 Let "push.pl" fail when updates fail 2023-05-11 09:29:54 -07:00
Tianon Gravi 5531f0fa3a Remove unused "userData" query 2023-04-14 15:34:55 -07:00
Tianon Gravi 6592764bf9 Update trimmed description "hub-feedback" link and add "roadmap" link 2023-04-13 16:23:37 -07:00
Tianon Gravi a922faeafe Remove "neo4j" short tags special case
> Now that we're only supporting 3 images, would it be possible to get the supported tags listed on https://hub.docker.com/_/neo4j?tab=description again?
2022-11-28 16:26:42 -08:00
Tianon Gravi a79dd8a53a Add "description cut off" warning at end too
This has to be slightly more clever than the warning at the beginning to try and avoid weird markdown rendering (so it looks reasonably clean) but it isn't *too* horrible.
2022-04-07 10:28:48 -07:00
Tianon Gravi 77bfb4d6a4 Move/rename sponsored links section 2021-09-24 13:50:30 -07:00
Joe Ferguson 6d56ef8eec A little ♥♥♥ and clarification for the main README 2021-09-09 11:03:23 -07:00
Tianon Gravi 5225ac8a72 Remove erroneous debugging output 2021-06-28 10:19:13 -07:00
Tianon Gravi da494d90a0 Preserve Docker-provided "Sponsored Links" while updating descriptions 2021-06-28 10:09:28 -07:00
Tianon Gravi 1bd03c064c Adjust "tag list too long" description to make the full link more obvious
Also, adjust `neo4j` to always defer the supported tag listing to GitHub.
2021-06-24 14:26:13 -07:00
Tianon Gravi 50326f312f Update to Mojolicious 8.35 2020-03-26 15:29:23 -07:00
Tianon Gravi da98c367a9 Add logo pushing ability for library/ images! 2020-01-09 15:56:47 -08:00
Tianon Gravi a428c3d925 Adjust long-description trimming to prefer trimming tag listing
Instead of cutting off the end of the image documentation, this change makes the code prefer to trim the entire "Supported tags" list, which for all our images which currently go over the limit brings them down enough to be within.  The note about where to get the full `README.md` file (with the "Supported tags" list intact) still stands, although could maybe do with some better styling and/or wording to make it more obvious (TBD).

I also verified that this change does the right thing in the fallback case by making the `postgres` image description intentionally extra long and verified that it simply trims the description content as before (since taking off the tags doesn't make the description short enough to be under the limit in that case).
2019-07-01 14:43:25 -07:00
Tianon Gravi c35e6aa062 Add "X-CSRFToken" header for new Docker Hub API changes 2018-12-24 11:41:10 -08:00
Tianon Gravi 161bc52791 Add "--namespace" to push.pl 2017-11-16 16:17:03 -08:00
Tianon Gravi c390af36ae Make it clear failures to get the initial API are simply warnings and will be skipped 2017-11-16 11:35:27 -08:00
Tianon Gravi 7057ad9690 Add (and later strip) a nice warning at the top of README.md about it being auto-generated 2017-03-10 14:05:36 -08:00
Tianon Gravi 3bca1909de Handle completely uninitialized repo descriptions better by explicitly converting undef to "" (avoids warnings about "Use of uninitialized value $currentText") 2015-12-29 13:58:56 -08:00
Tianon Gravi 79613d80ad Update length limit to 25k
See https://github.com/docker/hub-beta-feedback/issues/238#issuecomment-137202994
2015-09-02 11:56:22 -07:00
Tianon Gravi f33d5af2fd Add some temporary description trimming 2015-08-12 10:45:25 -07:00
Tianon Gravi 39b21e67ba Handle failure in push.pl slightly better 2015-08-07 16:38:18 -07:00
Tianon Gravi c75ad54975 Update push.pl for the new v2 hub! 🎉
So much cleaner now! 🤘
2015-08-07 14:58:26 -07:00
Joe Ferguson 74056bfc7e Fix for deprecated mojo function 2015-07-29 13:03:21 -07:00
Tianon Gravi 67d25c0ce4 Add "--batchmode" flag for automated docs updates (still displays all diffs) 2015-06-01 12:08:59 -07:00
Tianon Gravi 3b5860d665 Relax repo 404 "die" to just "warn and next" (darn cassandra, still in-progress) 2015-05-01 13:59:30 -06:00
Tianon Gravi 0d21a376fe Add "quit" choice to push.pl 2015-04-21 10:44:56 -06:00
Tianon Gravi 2633e18b55 Reorganize "push.pl" to put the "vimdiff" logic in one place for cool dispatch-conf-alike behavior 2015-04-20 11:04:27 -06:00
Tianon Gravi fb58df1b30 Fix "Use of uninitialized value $val in concatenation (.) or string at ./push.pl line 82." 2015-02-23 14:48:05 -07:00
Joe Ferguson f01231d766 Update push script for Mojo changes
- http://mojolicio.us/perldoc/Mojo/UserAgent/CookieJar.txt
2015-02-18 14:23:50 -08:00
Tianon Gravi b7ae9303dd Mojo::DOM::val is deprecated :( 2014-11-14 10:42:21 -07:00
Tianon Gravi f486c61ca6 Fix spurious vimdiff showing up with identical files 2014-10-23 14:09:24 -06:00
Tianon Gravi 1a7ef62ffb Add a basic Dockerfile and fix some minor issues in push.pl 2014-10-21 22:29:49 -06:00
Tianon Gravi d7ee163fee Add explicit error handling after we update a description (in case our short description is too long or something similar) 2014-10-10 17:23:12 -06:00
Tianon Gravi 3e21ed765c Fix a few minor issues with the push script (especially UTF-8 compatibility) 2014-09-24 14:31:59 -06:00
Tianon Gravi a837b609ef Add a script for pushing descriptions trivially via vimdiff
This is inspired by Gentoo's `dispatch-conf`, which I've got configured to use `vimdiff` on all my Gentoo boxen, and it's just about the greatest thing ever.

This has a nasty little `monkey_patch` to Mojo's `CookieJar` that needs more digging to figure out what's going on there, but otherwise it's pretty solid.
2014-09-23 14:02:34 -06:00