Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

feat(sg): command to add default site-admin with predefined access token #63320

Merged
Strum355 merged 2 commits into
mainfrom
nsc/sg-siteadmin-preset-token
Jun 19, 2024
Merged

feat(sg): command to add default site-admin with predefined access token #63320
Strum355 merged 2 commits into
mainfrom
nsc/sg-siteadmin-preset-token

Conversation

@Strum355

@Strum355 Strum355 commented Jun 18, 2024

Copy link
Copy Markdown
Contributor

Adds a subcommand to sg db called default-site-admin that creates a site-admin user with user:pass sourcegraph:sourcegraph and a predefined hard-coded token sgp_local_f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0

Test plan

go run ./dev/sg -- db default-site-admin with clean database
" " after having run that (when everything should be set)
" " when user exists but token doesnt

Changelog

@cla-bot cla-bot Bot added the cla-signed label Jun 18, 2024
@Strum355 Strum355 force-pushed the nsc/sg-siteadmin-preset-token branch from 803c1c3 to 2184f42 Compare June 19, 2024 12:39
@Strum355 Strum355 changed the title feat(sg): command to add predefined access token for first site-admin account feat(sg): command to add default site-admin with predefined access token Jun 19, 2024
@Strum355 Strum355 force-pushed the nsc/sg-siteadmin-preset-token branch from 2184f42 to 45903e0 Compare June 19, 2024 12:44
@Strum355 Strum355 marked this pull request as ready for review June 19, 2024 12:44
@Strum355 Strum355 requested a review from jhchabran June 19, 2024 12:44
@Strum355 Strum355 force-pushed the nsc/sg-siteadmin-preset-token branch from 45903e0 to 6b216f2 Compare June 19, 2024 12:45
Comment thread dev/sg/sg_db.go Outdated
})
}

// equivalent to "8756ee46f2b54254fc52041455c2a7fda46af44a"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can't we use a more recognizable token?

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.

How about f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah good enough :)

@Strum355 Strum355 merged commit a5a6a0d into main Jun 19, 2024
@Strum355 Strum355 deleted the nsc/sg-siteadmin-preset-token branch June 19, 2024 14:02
jhchabran referenced this pull request Jun 19, 2024
Follow-up to https://github.com/sourcegraph/sourcegraph/pull/63320 as I
noticed that the `UsageText` didn't include `sg db default-site-admin`.
Additionally, it was quite verbose without providing much info, so I
just dropped it in favour of highlighting notable commands.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants