granicus_archiver.web.config

class granicus_archiver.web.config.AppConfig(hostname: str = 'localhost', port: int = 8080, sockfile: ~pathlib._local.Path | None = None, serve_static: bool = True, read_only: bool = True, static_url: ~yarl.URL = URL('/'), use_s3: bool = False, s3_data_dir: ~pathlib._local.Path | None = None, nav_links: ~typing.Sequence[~granicus_archiver.web.types.NavLink] = (('home', 'Home', 'home', None), ('legistar', 'Legistar', 'rguid_legistar_items', None), ('clips', 'Clips', 'clip_list', None)), index_nav_link_name: str = 'home', site_name: str = 'Granicus Archive', hidden_clip_categories: ~typing.Sequence[~granicus_archiver.clips.model.Location] = <factory>, hidden_clip_list_filters: ~typing.Sequence[ListFilterField] = <factory>)[source]

Bases: BaseConfig

Web app configuration

Parameters:
hostname: str = 'localhost'

Hostname to bind to

port: int = 8080

Port to bind to

sockfile: Path | None = None

UNIX socket file to bind to

If None, the hostname and port will be used instead.

serve_static: bool = True

Whether to serve static files directly from aiohttp

read_only: bool = True

If True, the app will not allow modification of any data files

static_url: URL = URL('/')

Root URL to serve static files from

If serve_static is True, this should be "/". Otherwise, it should be the URL path to the static files.

use_s3: bool = False

If True, the app will use S3 to for data files and assets

s3_data_dir: Path | None = None

Root directory to store local data files from s3

Navigation links for the app

Name of the nav link in nav_links to use for the index page (home page)

site_name: str = 'Granicus Archive'

Name of the site

hidden_clip_categories: Sequence[Location]

List of clip categories to hide in the UI

hidden_clip_list_filters: Sequence[ListFilterField]

List of clip list filters to hide in the UI

group_key: ClassVar[str] = 'web'

Unique key for BaseConfig subclasses

classmethod load(filename: PathLike) Self[source]

Load the configuration from a file

Parameters:

filename (PathLike)

Return type:

Self

save(filename: PathLike) None[source]

Save the configuration to a file

Parameters:

filename (PathLike)

Return type:

None

update(**kwargs) bool[source]

Update the config from keyword arguments

Return type:

bool

classmethod build_defaults(**kwargs) Self[source]

Create the config using defaults

Any provided keyword arguments will override the default

Return type:

Self

classmethod load_from_env() Self[source]

Load the config from environment variables

Return type:

Self

granicus_archiver.web.config.APP_CONF_KEY = <AppKey(granicus_archiver.web.config.AppConfig, type=granicus_archiver.web.config.AppConfig)>

App key for the AppConfig instance