public

package
v0.0.0-...-5dda92a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2026 License: AGPL-3.0 Imports: 12 Imported by: 1

Documentation

Overview

Package public adds some public routes that can be used to give information to anonymous users, or to the not yet authentified cozy owner on its login page.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Avatar

func Avatar(c echo.Context) error

Avatar returns the default avatar currently.

  1. If an avatar has been uploaded through `PUT /settings/avatar`, this image will be returned.

  2. Otherwise it depends on the `fallback` query param:

    2.1. `fallback=404`: just respond a 404 if no avatar file was set

    2.2. `fallback=default` (or empty): get the `default-avatar.png` asset (for retro-compatibility)

    2.3. `fallback=anonymous`: get a generic user avatar without initials visible (respects `format`)

    2.4. `fallback=initials`, initials are calculated:

    2.4.1. Attempt with [../../model/settings/service.go] PublicName(), which gets the instance's `public_name`, or the `DomainName`

  3. Additional query params when `fallback` isn't set or is `anonymous`:

    4.1. `fx=translucent`: if SVG, make the output partially transparent 4.2. `as=unconfirmed`: if SVG, make the output grayscale 4.3. `format=png`: request a PNG response, otherwise defaults to SVG 4.4. `q=high`: request a larger but higher quality file (for SVG means embedding the font)

func Prelogin

func Prelogin(c echo.Context) error

Prelogin returns information that could be useful to show a login page (like in the flagship app).

func Routes

func Routes(router *echo.Group)

Routes sets the routing for the public service

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL