Skip to content

Force share password via server config#1820

Open
aetasoul wants to merge 6 commits into
eikek:masterfrom
aetasoul:feat/force-pass-1777
Open

Force share password via server config#1820
aetasoul wants to merge 6 commits into
eikek:masterfrom
aetasoul:feat/force-pass-1777

Conversation

@aetasoul

Copy link
Copy Markdown
Contributor

This PR implements #1777

When sharry.restserver.backend.share.require-share-password = true, authenticated users must set a password on every share they create.

  • Share creation is blocked server side if no password is provided enforced on both upload paths, cannot be bypassed via API
  • DELETE /sec/share/:id/password returns an error instead of removing the password
  • UI marks the password field as required, shows a error message on submit without a password, and disables the remove-password action
  • Alias uploads are unaffected

Changes

  • ShareConfig: new requireSharePassword: Boolean flag (default false)
  • UploadResult: new checkPasswordRequired check, chained after checkValidity
  • OShare.create: applies the check before inserting the share
  • ShareRoutes: DELETE /:id/password guarded by the flag
  • InfoRoutes / AppConfig: sharePasswordRequired exposed via GET /api/v2/open/info/appconfig so the frontend can adapt
  • Elm frontend: passwordValidationError state added to Share and Detail pages; passwordRequiredToCreate and passwordCannotBeRemoved messages added in all 8 supported languages
  • reference.conf, configure.md, webapp.md, sharry-openapi.yml: documentation

@mergify

mergify Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

aetasoul added 4 commits June 30, 2026 12:02
Server side enforcement in OShare.create() via new checkPasswordRequired check on UploadResult.
Config flag `require-share-password` (default false) exposed through AppConfig to the frontend.

Frontend guards: Share page blocks submit without password
Detail page blocks clearing password when flag is on
DELETE /sec/share/:id/password returns 400 when flag is on
@aetasoul aetasoul force-pushed the feat/force-pass-1777 branch from 7d5993f to 4bd9c2f Compare June 30, 2026 10:12
aetasoul added 2 commits July 1, 2026 14:54
Master's PT-BR translation predates require-share-password, leaving
`br` Texts records incomplete for passwordCannotBeRemoved (DetailPage)
and passwordRequiredToCreate (SharePage). No textual git conflict on
merge, but Elm compile failed CI.
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.

1 participant