gitoria
All repositories: gitoria
3.2 KB
// components/addcode.hl — "ADD CODE TO THIS REPOSITORY" (gitoria#7, gitoria#20): the clone address and the exact git commands, for a// new folder and for an existing one; plain text on the Code tab (code, branch, commit pages) while nothing is pushed yet. The// password is an access token (main page). Shown only for an EXISTING, EMPTY repo; never on Readme / Pull requests / Releases /// Tickets / Settings (those pages don't use it). It is the page's own (inside the repo level's slot), so it is read fresh on// every navigation.import { NL, publicUrl, hostOnly, cloneOrigin } from '../lib/util.hl'import { slugOfRequest } from '../lib/orgs.hl'import { repoAt } from '../lib/repos.hl'import { isEmptyNow } from '../lib/git.hl'import { sshEnabled, sshUrl } from '../lib/sshkeys.hl'host = nullorepo = ''session = nullslug = slugOfRequest(host, orepo)repo = repoAt(slug, session)cloneUrl = repo != null ? cloneOrigin(slug) : ''tokensHref = publicUrl + '/#tokens'sshKeysHref = publicUrl + '/#sshkeys'showAddCode = repo != null && isEmptyNow(slug)newCommands = 'echo "# ' + slug + '" >> README.md' + NL + 'git init -b main' + NL + 'git add README.md' + NL + 'git commit -m "first commit"' + NL + 'git remote add origin ' + cloneUrl + NL + 'git push -u origin main'existingCommands = 'git remote add origin ' + cloneUrl + NL + 'git branch -M main' + NL + 'git push -u origin main'cloneCommand = 'git clone ' + cloneUrl// SSH (only when the sshd container is set up, sshkeys.hl): the same commands with the ssh address; the key comes from the main pageshowSsh = sshEnabled && repo != nullsshAddress = repo != null ? sshUrl(hostOnly, repo.slug) : ''sshCloneCommand = 'git clone ' + sshAddresssshCommands = 'git remote add origin ' + sshAddress + NL + 'git push -u origin main'View {if (showAddCode) {addCode { id = "addcode"h2 { "Add code to this repository" }h2 { "Clone it" }pre { id = "clonecommand" cloneCommand }h2 { "Push a new project" }pre { id = "newcommands" newCommands }h2 { "Push an existing project" }pre { id = "existingcommands" existingCommands }if (showSsh) {h2 { "Or over SSH" }pre { id = "sshclonecommand" sshCloneCommand }pre { id = "sshcommands" sshCommands }p { class = "muted" "Add your public key under " a { id = "tosshkeys" href = sshKeysHref "SSH keys" } " on the main page after you log in; only the owner can push." }}p { class = "muted" "Reading needs no login. To push you must be the owner of this repository: git asks for a user name (anything) and a password — that is an access token, made under " a { id = "totokens" href = tokensHref "Access tokens" } " on the main page after you log in." }}}}Style {addCode {display = 'grid'gap = '.5rem'minWidth = '0''> *' {margin = '0'}}#addcode {padding = '1rem'background = 'var(--color-surface)'borderRadius = 'var(--radius-large)'pre {margin = '0'padding = '.6rem .8rem'overflowX = 'auto'font = '.875rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace'color = 'var(--color-text-strong)'background = 'var(--color-background-sunken)'borderRadius = 'var(--radius-large)'whiteSpace = 'pre-wrap'overflowWrap = 'anywhere'}}}
Branches
- f1-broken-json
- f2-api-bugs
- gp-gate-ports
- heap-revert
- hl25-records
- ident-chooser-selector
- mainmain branch
- p51-public-pr-reads
- records-1112
- s25-no-session-on-login-error
- v59
- w52-person-approval
- w52b-approval-followup
- w52c-header-phone
- w53-pulls-speed-pr
- w54-repo-rename-pr
- w55-rename-org
- w56-owner-members
- w62-pr-close
- w63-force-push
- w64-org-slash
Latest commits
- 9364fb16gitoria#40: ssh pushes call /__git/pushed before and after (ensurePulls, notifyPush, syncPulls); gate over the sshd imagemre
- 2ef23df0gitoria#40: the browser gate reads the title without the #Nmre
- b9137ff0gitoria#40: pull requests are stored with a number, refs/pull/N/head, syncPulls and pullObject; /pulls shows #Nmre
- 06d622daown image tag gitoria-runtime:debian12 for gitoria and standby (shared tag lost git)mre
- 20caa33agitoria#37: media queries in the language's @media block (minWidth = '60rem') in list, codebrowser and repomre
- c4175e6dgitoria: a startup error prints its message before exit 1 (hybriel#247)mre
- c50d17efKeep function-route not-found style in shared stylesheetmre
- e42d78d3Preserve ticket state CSS and document function-route style gapmre
- c6b7154eWIP gitoria#26: move styles into nested component blocksmre
- 77a2c31cgitoria#31: plain declarations instead of needless let in lib/ and tools/ (103 let removed, 137 kept because reassigned); no other changemre
- 4b98ab62gitoria: an ident access key (idt_) works as the git password; read key clones only, bad key 401, ident down 503 (ident#27); gate tests/ident-access-gitoria.mjs in deploy.shmre
- 1185f686gitoria#36: a failed return from tickets shows a note on the settings page and leaves one log line per outcome; no code is exchangedmre
- 5d2c385agitoria: the sign-in callback keeps the session it finds and signs it in (same cookie, nothing signed out; ident#28); security gate 71+5 failing → 76 passed; deploy.sh runs tests/private.mjs toomre
- 241ef3f9deploy.sh: rebuild the sshd image before up -d (GO34c)mre
- 821cdbb1gitoria#34b: styles, create-repo tool, docs, push/ssh gates sign in through the selector, shots scriptmre
- a81abdc9gitoria#34: org page via function route, member-reachable orgs, selects, reportmre
- 17f031f0gitoria#34: private repos, organizations, members, move tool, gatemre
- 71b69343gitoria#23: the sidebar's Repositories link was a 404 after any in-page navigation (static menu re-evaluated publicUrl in the browser); the menu is an instance property now; gate taps it after a tab, folder, filemre
- 90b4f728gitoria#25: restore the homepage cache and the parsed-blocks cache (they store data under immutable keys, no HTML); the page key, the framework readme key and the textHash key stay removedmre
- a487248cgitoria#25: remove every cache that hid the page build (page key, Markdown render key, homepage cache, parsed-blocks cache) and the gate that only tested themmre