Add --share-log flag to upload install.log to paste.rs#4511
Add --share-log flag to upload install.log to paste.rs#4511Softer wants to merge 2 commits intoarchlinux:masterfrom
Conversation
|
Just note that I started a conversation about an arch official channel for posting these logs. I created a ticket to track the progress on gitlab@archlinux #833 |
|
We can change --share-log behavior transparently for users any time we need without changing user's expectation. :) |
| default=False, | ||
| help='Enabled verbose options', | ||
| ) | ||
| parser.add_argument( |
There was a problem hiding this comment.
this sholdn't be an argument as an argument implies that you're running archinstall with that flag, but what you're doing here is running a command associated with archinstall. So it would make more sense to have it as
archinstall share-log
instead
| @@ -0,0 +1,71 @@ | |||
| import sys | |||
There was a problem hiding this comment.
I think we can move this into the output.py file as all log logic is consolidated there
| f'Log file is too large to share: {size} bytes (limit: {_PASTE_MAX_SIZE} bytes). Trim it or upload manually.', | ||
| file=sys.stderr, | ||
| ) | ||
| return 1 |
There was a problem hiding this comment.
Instead of returning we should truncate it from bottom up so we get the latest installation attempts. I don't envision many users running into this but it's better to get some logs than none at all
| ) | ||
|
|
||
| try: | ||
| answer = input('Continue? [y/N]: ').strip().lower() |
There was a problem hiding this comment.
We should be using the TUI here not the raw input stuff, have a look at the WifiHandler as that is also a standalone menu triggered from main.py
| log_path = logger.path | ||
|
|
||
| if not log_path.exists(): | ||
| print(f'Log file not found: {log_path}', file=sys.stderr) |
There was a problem hiding this comment.
Use info instead as that will also appear in the logs and is testable (I promise one day we'll have tests)
Replaces the broken
curl ... https://0x0.sthint with an integratedarchinstall --share-logcommand that uploads/var/log/archinstall/install.logto paste.rs and prints a shareable URL. Also updates the same hint in the README, the bug report docs, and the GitHub bug issue template, so all four user-facing references now point to the working command.Refs #4396 (0x0.st has disabled uploads). Supersedes #4507, which removes the hint without offering a replacement.
Why paste.rs
install.logrenders as a readable page rather than a raw downloadinstall.logsizes)The endpoint is referenced exactly once - a constant in
archinstall/lib/share_log.py. If a self-hosted paste service is set up later, or 0x0.st returns, swapping it is a one-line change.Behavior
stderrstdout, so it can be piped (archinstall --share-log | xclip -sel clip)_log_sys_info()and uses bareprint()instead ofinfo()/warn(), so the file uploaded matches the file on disk byte-for-byte (no "About to upload..." line gets injected into the log)Test plan
archinstall --share-logon a live ISO - URL is printed and the paste matchesinstall.logbyte-for-bytearchinstall --share-logansweringn- exits cleanly without uploadingarchinstall --share-logwithinstall.logmissing - reports the error and exits non-zeroarchinstall --share-logwith no network - reports the error and exits non-zero