Skip to content

Add account info page and change up colors#902

Merged
BNH440 merged 17 commits into
ocf:masterfrom
vqbc:master
Jun 9, 2026
Merged

Add account info page and change up colors#902
BNH440 merged 17 commits into
ocf:masterfrom
vqbc:master

Conversation

@vqbc

@vqbc vqbc commented May 24, 2026

Copy link
Copy Markdown
Contributor

It will work once quota gets fixed trust me

@vqbc

vqbc commented May 30, 2026

Copy link
Copy Markdown
Contributor Author

Okie it does work

@jaysa68 jaysa68 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

account page looks great, and i am down 4 the color and font change.... fresh coat of paint

@jaysa68

jaysa68 commented May 30, 2026

Copy link
Copy Markdown
Member

id like approval from a current SM though, since its a fairly forward-facing change

@sophiebsw sophiebsw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems good, i only have some very minor changes

i do want to run it myself to see the color/font change before approving

Comment thread ocfweb/account/info.py Outdated
Comment thread ocfweb/account/templates/account/info/index.html Outdated
Comment thread ocfweb/main/templates/main/home.html Outdated
vqbc and others added 2 commits May 30, 2026 03:24
Co-authored-by: sophie <sophiebsw@gmail.com>
Co-authored-by: sophie <sophiebsw@gmail.com>
@vqbc

vqbc commented May 30, 2026

Copy link
Copy Markdown
Contributor Author

Will go ahead and make those changes

There is also a corresponding PR at ocf/mkdocs#66

Here's an example of the color/font difference:

image

I basically just wanted it to match our promotional materials, keyboards, etc. better by using blue as the accent color

Comment thread ocfweb/account/info.py
@BNH440

BNH440 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

I think this seems ready to merge but I think @24apricots had some comments

@vqbc

vqbc commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

where

@24apricots 24apricots left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool stuff!

Comment thread ocfweb/account/commands.py Outdated
Comment thread ocfweb/account/info.py
Comment thread ocfweb/account/info.py
ssh = SSHClient()
host_keys = ssh.get_host_keys()
entry_ed25519 = HostKeyEntry.from_line(
'ssh.ocf.berkeley.edu ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPm+RlDujsxQyxFTEOCTeImSBDvr63cL8Kg+rNrH6NK8', # noqa

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this in two different files

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wdym

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its in here and commands

Comment thread ocfweb/account/commands.py Outdated

if not error:
if command_to_run == 'paper':
command_to_run = f"/run/current-system/sw/bin/paper view {username} | sed 's/\x1B\\[[0-9;]*[a-zA-Z]//g'" # noqa

@24apricots 24apricots Jun 5, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arbitrary code execution. its minor because you authenticated as the username, but nonetheless

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also i think sed, which im assuming is here to remove ansi color stuff, is unnecessary if you set get_pty to False

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, this page is deprecated though so might as well just remove it?

Comment thread ocfweb/account/info.py Outdated
Comment thread ocfweb/account/commands.py Outdated
Comment thread ocfweb/account/commands.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these intentionally left unchanged?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ngl i was just testing the paper command and idk if the page as a whole is worth updating

Comment thread ocfweb/account/commands.py Outdated
COMMAND_CHOICES = (
(
'/opt/share/utils/bin/paper',
'paper',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was the path to the paper binary removed here and hard coded (with the correct path for nixos) in line 56?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's kind of a jank solution to add in the username

Comment thread ocfweb/account/commands.py Outdated
@@ -45,6 +52,8 @@ def commands(request: HttpRequest) -> HttpResponse:
error = 'Authentication failed. Did you type the wrong username or password?'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(this line was not changed by you) this error may be confusing when the error is not related to an incorrect username or password

Comment thread ocfweb/account/commands.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(this line was not changed by you) why do we have them enter the username when they are already logged in and the username can be pulled from there? is this to support running commands as another user given their password?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im not sure if we should allow that since they can just log in as that other user

@vqbc

vqbc commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

considering the vast majority of the issues are from the basically deprecated commands page, do we want to just remove it tbh

@vqbc

vqbc commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

like it's probably a minor security risk just to keep around unmaintained and there's not rly any practical purpose for it

@24apricots

Copy link
Copy Markdown
Member

sure

@24apricots

Copy link
Copy Markdown
Member

running commands can already be done in a browser or any ssh client at ssh.ocf.berkeley.edu so that part is not needed. maybe we can link to it from the account status page?

@vqbc

vqbc commented Jun 7, 2026

Copy link
Copy Markdown
Contributor Author

Ok bye bye commands

@BNH440 BNH440 requested a review from 24apricots June 9, 2026 23:41
@BNH440 BNH440 merged commit 8c224a1 into ocf:master Jun 9, 2026
1 of 2 checks passed
@vqbc

vqbc commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

merge the mkdocs pr too pls ^_^

ocf/mkdocs#66

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

Successfully merging this pull request may close these issues.

5 participants