Libellus Potionis

遵循以下最佳实践的项目将能够自愿的自我认证,并显示他们已经实现了核心基础设施计划(OpenSSF)徽章。

没有一套可以保证软件永远不会有缺陷或漏洞的做法;如果规范或假设是错误的,即使合适的方法也可能失败。也没有哪些做法可以保证一个项目能够维持健康和运作良好的开发者社区。但是,遵循最佳做法可以帮助改善项目的成果。例如,一些做法可以在发布之前进行多人评估,这可以帮助您找到其他难以找到的技术漏洞,并帮助建立信任,并希望不同公司的开发人员之间进行重复的交互。要获得徽章,必须满足所有“必须”和“禁止”的条款,满足所有“应该”条款或有合适的理由,所有“建议”条款必须满足或未满足(至少希望考虑)。欢迎通过 GitHub网站创建问题或提出请求进行反馈。另外还有一个一般讨论邮件列表

如果这是您的项目,请在项目页面上显示您的基准徽章状态!基准徽章状态如下所示: 项目13480的基准徽章等级为baseline-2 以下是如何嵌入基准徽章:
您可以通过将其嵌入到Markdown文件中来显示您的基准徽章状态:
[![OpenSSF Baseline](https://www.bestpractices.dev/projects/13480/baseline)](https://www.bestpractices.dev/projects/13480)
或者将其嵌入到HTML中:
<a href="https://www.bestpractices.dev/projects/13480"><img src="https://www.bestpractices.dev/projects/13480/baseline"></a>


这些是基准等级1的标准。 这些是标准版本 v2026.02.19。

Baseline Series: 基准等级1 基准等级2 基准等级3

        

 基本

  • 常规

    请注意,其他项目可能使用相同的名称。

    Libellus Potionis is a privacy-first, free, open-source, ad-free alcohol-consumption tracker that helps users monitor, pace, and manage their drinking habits entirely offline. It needs no invasive device permissions — no camera, microphone, or location access — and works completely without network connectivity.

    Key features

    • Intelligent logging: predefine custom beverages or use internationally common presets, and log drinks instantly or retroactively with precise timestamp corrections.
    • Concurrent limit tracking: set three simultaneous boundaries — a daily limit (grams of pure alcohol), a rolling 7-day weekly limit (grams), and a maximum number of drinking days per week — with visual progress bars in real time.
    • Blood-alcohol (BAC) estimation: enter your body weight for a live BAC approximation based on the established Widmark formula.
    • Addiction-counseling reports: generate a clear, well-organized two-page PDF report designed for consultations and counseling appointments.
    • Data portability: export your complete dataset as a standard CSV file for external processing (e.g. in LibreOffice Calc), or create secure JSON backups to migrate data between devices.
    • Granular adjustments: customize your "day start" time so late-night drinks count toward the correct evening, and define custom evaluation start dates for clean restarts.

    A comprehensive User's Guide is fully accessible in-app. The app is available on F-Droid.

    请使用 SPDX许可证表达格式;例子包括“Apache-2.0”,“BSD-2-Clause”,“BSD-3-Clause”,“GPL-2.0+”,“LGPL-3.0 +”,“MIT”和“(BSD-2-Clause OR Ruby)”。
    如果有多种语言,请将它们列为逗号分隔值(可选空格),并将它们从最多到最少使用。如果有长列表,请至少列出前三个最常见的列表。如果没有语言(例如,这是仅文档或仅测试项目),请使用单个字符“ - ”。请使用每种语言的常规大小写,例如“JavaScript”。
    通用平台枚举(CPE)是用于信息技术系统,软件和软件包的结构化命名方案。在报告漏洞时,它可用于多个系统和数据库。

    Libellus Potionis is a privacy-first, offline, ad-free Android app for tracking, pacing, and managing alcohol consumption. It requests no network permission and no camera/microphone/location access; all data stays on the device in the app's private, sandboxed storage, encrypted at rest (AES-256-GCM via the Android Keystore), with an optional biometric lock. It is Free Software under GPL-3.0-or-later, developed openly on Codeberg and distributed through F-Droid. The project is deliberately maintained as a teaching-quality codebase: every source file carries a license header and KDoc, and a release gate (tools/release-check.sh) enforces documentation, version consistency, English-only source, and translation completeness. Quality is guarded by a broad automated test suite (JVM unit tests plus instrumented Room-migration, Compose-UI, and locale tests) and by Android Lint and Kotlin compiler warnings promoted to build-breaking errors.

 控制 24/24

  • 控制


    当用户尝试读取或修改项目权威存储库中的敏感资源时,系统必须要求用户完成多因素认证过程。 [OSPS-AC-01.01]
    为项目的版本控制系统强制执行多因素认证,要求协作者在访问敏感数据或修改存储库设置时提供第二种形式的认证。通行密钥对于此控制是可接受的。

    Write (push) access to the canonical repository (hosted on GitLab) requires two-factor authentication as a documented project policy: docs/GOVERNANCE.md ("Repository access and account security") states that any account with write access MUST have cryptographic 2FA enabled. Currently the sole maintainer is the only account with write access and has 2FA enabled; the policy binds any future account granted write access. GitLab additionally accepts no account password for git over HTTP/S at all — an access token or an SSH key is required — so a stolen password alone cannot push. Per-project 2FA enforcement is a group-level setting the project's plan does not offer, so the requirement is enforced by written policy.



    当添加新的协作者时,版本控制系统必须要求手动分配权限,或默认将协作者权限限制为可用的最低权限。 [OSPS-AC-02.01]
    大多数公共版本控制系统都是这样配置的。确保项目的版本控制系统在添加协作者时始终默认分配最低可用权限,仅在必要时授予额外权限。

    On GitLab, project members are never added automatically: a user with the Owner role must explicitly invite each member and assign a role (Guest/Reporter/Developer/Maintainer/Owner), and no role grants itself an escalation. The project also currently has a single maintainer, so no additional members with elevated access exist. The set of accounts with write access is documented in docs/GOVERNANCE.md. Any future collaborator therefore requires a deliberate, manual permission grant by the owner.



    当尝试直接提交到项目的主分支时,强制机制必须阻止该更改的应用。 [OSPS-AC-03.01]
    如果VCS是集中式的,请在项目的VCS中对主分支设置分支保护。或者,使用去中心化方法,如Linux内核的方法,即先在另一个仓库中提出更改,将更改合并到主仓库需要特定的单独操作。

    The primary branch (main) on the project's GitLab repository is a protected branch whose "Allowed to push and merge" setting is "No one", so direct pushes are rejected server-side for every role including the project Owner, and changes reach main only through a merge request. All changes to main therefore go through a merge request, satisfying the enforcement requirement even though the project currently has a single maintainer.



    当尝试删除项目的主分支时,版本控制系统必须将此视为敏感活动,并要求明确确认意图。 [OSPS-AC-03.02]
    在项目的版本控制系统中对主分支设置分支保护以防止删除。

    The primary branch (main) is the repository's default branch and is additionally a protected branch. On GitLab a protected branch cannot be deleted while the protection rule is active, and the default branch cannot be deleted at all; removing the protection is itself a deliberate, separately audited settings change. Deleting the primary branch is therefore treated as a blocked, non-accidental action, exceeding the "require explicit confirmation of intent" requirement.



    当CI/CD管道接受输入参数时,该参数必须在管道中使用之前进行清理和验证。 [OSPS-BR-01.01]
    CI/CD 流水线应对所有来自不可信来源的元数据输入进行清理(引用、转义或在期望值时退出)。这包括分支名称、提交消息、标签、拉取请求标题和作者信息等数据。

    The project's CI/CD pipeline consumes no untrusted input, by construction rather than by sanitizing after the fact. .gitlab-ci.yml interpolates no forge-supplied string anywhere: no merge request title, branch name, commit message, fork payload or user-supplied variable appears in any job's script. The jobs run three fixed commands — tools/release-check.sh --Werror, make check-static and an osv-scanner source scan — each of which reads only the checked-out tree. The single CI variable the file references, CI_MERGE_REQUEST_TARGET_BRANCH_NAME, appears in a workflow: rule comparison, never in a shell command, so it cannot be interpreted as code. There is therefore no injection path from a proposed change into pipeline execution.



    当 CI/CD 流水线对不可信代码快照进行操作时,它必须阻止访问特权 CI/CD 凭据和资产。 [OSPS-BR-01.03]
    CI/CD 流水线应将不可信代码快照与特权凭据和资产隔离。特别是,项目应谨慎确保在协作者审查之前构建或执行代码的工作流无法访问 CI/CD 凭据。

    Untrusted code snapshots cannot reach privileged credentials, because the pipeline holds none. .gitlab-ci.yml defines no secret, no protected or masked variable and no deployment credential; its three jobs are read-only checks on a plain python:3-slim image. The project's privileged credentials — the release-signing keystore, the Google Play and App Store upload keys, and the GitLab release token in fastlane/gitlab-credentials.txt — exist only in the maintainer's local, git-ignored files and are never present in a CI environment; releases are built and published manually on a trusted local checkout. A merge request from a fork therefore executes only the fixed check commands, with nothing privileged in reach. The automatic CI job token is scoped to this project alone under Settings > CI/CD > Token Access.



    当项目将URI列为官方项目渠道时,该URI必须仅通过加密渠道交付。 [OSPS-BR-03.01]
    配置项目的网站和版本控制系统使用SSH或HTTPS等加密渠道进行数据传输。确保项目文档中引用的所有工具和域名只能通过加密渠道访问。

    All official project channels are served exclusively over encrypted transport. The canonical repository and issue tracker (gitlab.com/godisch/potillus) are reached over HTTPS (and Git over HTTPS/SSH), and the distribution page (f-droid.org/packages/de.godisch.potillus) is HTTPS-only; both GitLab and F-Droid enforce HTTPS with HSTS. No project URL uses plain HTTP.



    当项目将URI列为官方分发渠道时,该URI必须仅通过加密渠道交付。 [OSPS-BR-03.02]
    配置项目的发布管道,仅从使用SSH或HTTPS等加密渠道进行数据传输的网站、API响应和其他服务获取数据。

    The distribution channel is protected against adversary-in-the-middle attacks by cryptographically authenticated delivery, not transport security alone. The app is published on F-Droid (f-droid.org/packages/de.godisch.potillus) over HTTPS, where F-Droid cryptographically signs its repository index and signs the APK. The build is reproducible: F-Droid rebuilds the app from the published GPL-licensed source and verifies the result bit-for-bit against the developer-signed APK before publishing, so the distributed binary is provably the one built from public source. Clients therefore verify a signed index and a signed package whose provenance is independently reproducible. GitLab source access is likewise HTTPS-only. The planned Apple App Store channel likewise delivers Apple-signed packages over HTTPS; the App Store re-signs the binary with an Apple identity, so — like Google Play — the delivered artifact is not third-party-reproducible, though the underlying iOS build is verified reproducible by the two-build check in make release-ios.



    项目必须防止在版本控制系统中意外存储未加密的敏感数据,例如机密和凭据。 [OSPS-BR-07.01]
    配置.gitignore或等效文件以排除可能包含敏感信息的文件。使用预提交钩子和自动扫描工具来检测和防止在提交中包含敏感数据。

    The public repository leaks no valid private credentials. It contains no keystore or private-key files (no .jks/.keystore/.pem/.p12, no real keystore.properties) and no hard-coded passwords or API keys. Release signing material and the Google Play service-account key are explicitly git-ignored (/android/keystore.properties, /fastlane/play-store-credentials.json) and marked "SECRET, never commit"; only a documented placeholder template (android/keystore.properties.example) is committed, and the Play key is referenced only by path/SUPPLY_JSON_KEY, never embedded.



    当项目发布版本后,项目文档必须包含所有基本功能的用户指南。 [OSPS-DO-01.01]
    为项目的所有基本功能创建用户指南或文档,说明如何安装、配置和使用项目的功能。如果存在任何已知的危险或破坏性操作,请包含高度可见的警告。

    The project provides basic user documentation. A comprehensive, screen-by-screen User's Guide (localized into ~20 languages) explains every screen and feature — Today, Calendar, Statistics, Drinks, and Settings (limits, backup/restore, security, appearance) — and is rendered and displayed inside the app itself (via tools/render-guide.py, shown in DocumentViewerScreen). The README additionally documents the app's purpose, feature set, platform requirements (Android 11+), and how to obtain it. The iOS port ships the same screen-by-screen guide (ios/docs/guide/usersguide.md), rendered inside the app, and targets iOS 17+.



    当项目发布版本后,项目文档必须包含缺陷报告指南。 [OSPS-DO-02.01]
    建议项目使用其VCS默认问题跟踪器。如果使用外部来源,请确保项目文档和贡献指南清晰且明显地解释如何使用报告系统。建议项目文档还设定缺陷将如何分类和解决的期望。

    Users submit bug reports through the project's GitLab issue tracker, with android@godisch.de offered as an alternative. This process is documented in the README's "Feedback & Contributing" section.



    在活跃期间,项目必须有一个或多个机制用于公开讨论提议的更改和使用障碍。 [OSPS-GV-02.01]
    在项目中建立一个或多个公开讨论机制,例如邮件列表、即时消息或问题跟踪器,以促进开放的沟通和反馈。

    Discussion of proposed changes and issues takes place in the project's GitLab issue tracker and merge requests (gitlab.com/godisch/potillus/-/issues). This mechanism is full-text searchable; every issue, merge request, and comment is addressable by a stable URL; any person with a free GitLab account can open issues and join the discussion; and it is used entirely through a web browser, requiring no proprietary client-side software (GitLab's core is released as free software under the MIT licence).



    在活跃期间,项目文档必须包含贡献流程的说明。 [OSPS-GV-03.01]
    创建一个CONTRIBUTING.md或CONTRIBUTING/目录来概述贡献流程,包括提交更改的步骤以及与项目维护者互动的方式。

    The contribution process is documented in CONTRIBUTING.md, Section 2 "Submitting changes": contributors open an issue to discuss the change, then submit it as a merge request against main on GitLab (a patch by e-mail is accepted as an alternative); the change must meet the documented architecture, coding, testing, and translation conventions, and is reviewed and merged by the maintainer.



    活跃期间,源代码的许可证必须符合OSI开源定义或FSF自由软件定义。 [OSPS-LE-02.01]
    向项目的代码仓库添加一个LICENSE文件,其中包含开放源代码促进会(OSI)批准的许可证,或自由软件基金会(FSF)批准的自由许可证。此类许可证的示例包括MIT、BSD 2-Clause、BSD 3-Clause修订版、Apache 2.0、较宽松GNU通用公共许可证(LGPL)和GNU通用公共许可证(GPL)。如果没有其他限制(如专利),发布到公共领域可以满足此控制要求。

    The GPL-3.0-or-later license for the repository contents is approved by the Open Source Initiative (OSI).



    活跃期间,已发布软件资产的许可证必须符合OSI开源定义或FSF自由软件定义。 [OSPS-LE-02.02]
    如果已发布软件资产包含不同的许可证,请确保它是开放源代码促进会(OSI)批准的许可证,或自由软件基金会(FSF)批准的自由许可证。此类许可证的示例包括MIT、BSD 2-Clause、BSD 3-Clause修订版、Apache 2.0、较宽松GNU通用公共许可证(LGPL)和GNU通用公共许可证(GPL)。请注意,已发布软件资产的许可证可能与源代码的许可证不同。

    The software is released as Free/Libre and Open Source Software under the GNU General Public License v3.0 or later (GPL-3.0-or-later). The full license text is provided in LICENSE.md, the copyright notice in COPYING.md ("either version 3 of the License, or (at your option) any later version"), and the F-Droid metadata declares License: GPL-3.0-or-later.



    活跃期间,源代码的许可证必须保存在相应仓库的LICENSE文件、COPYING文件或LICENSE/目录中。 [OSPS-LE-03.01]
    将项目的源代码许可证包含在项目的LICENSE文件、COPYING文件或LICENSE/目录中,以提供许可条款的可见性和清晰性。文件名可以有扩展名。如果项目有多个仓库,请确保每个仓库都包含许可证文件。

    The project's license is posted in a standard location at the repository root as LICENSE.md (full GPL-3.0-or-later text), which GitLab auto-detects and displays as the project license; COPYING.md sits alongside it with the copyright notice.



    活跃期间,已发布软件资产的许可证必须包含在已发布的源代码中,或包含在与相应发布资产一起的LICENSE文件、COPYING文件或LICENSE/目录中。 [OSPS-LE-03.02]
    将项目的已发布软件资产许可证包含在已发布的源代码中,或包含在与相应发布资产一起的LICENSE文件、COPYING文件或LICENSE/目录中,以提供许可条款的可见性和清晰性。文件名可以有扩展名。如果项目有多个仓库,请确保每个仓库都包含许可证文件。

    The released software assets carry the same GPL-3.0-or-later license as the source. In the repository the license is posted in a standard location at the root — LICENSE.md (full GPL-3.0-or-later text) with COPYING.md alongside — which GitLab auto-detects. The license also travels with the released application: each package bundles the verbatim text of every license it is obliged to reproduce, copied verbatim from the project-root license files at build time (Android: res/raw/license_gpl3.md, license_apache2.md and license_gpl2.md; iOS: license_gpl3.md), and the in-app About screen states the app's own GPL notice with the App Store Distribution Exception in full and links to each verbatim text. F-Droid builds the published APK from this GPL-licensed source and distributes that source alongside the binary.



    活跃期间,项目的源代码仓库必须在静态URL上可公开读取。 [OSPS-QA-01.01]
    使用常见的版本控制系统(VCS),如GitHub、GitLab或Bitbucket。确保仓库可公开读取。避免重复或镜像仓库,除非有高度可见的文档说明主要来源。避免频繁更改会影响仓库URL的仓库。确保仓库是公开的。

    The project uses a publicly readable, version-controlled Git repository at a stable URL, gitlab.com/godisch/potillus — readable without an account and cloneable over HTTPS.



    版本控制系统必须包含所有更改的可公开读取的记录,包括谁进行了更改以及更改的时间。 [OSPS-QA-01.02]
    使用常见的版本控制系统(VCS),如GitHub、GitLab或Bitbucket来维护可公开读取的提交历史记录。避免压缩或重写提交,以免掩盖任何提交的作者。

    The project's source repository uses Git, which inherently records, for every commit, what changed (the diff/tree), who made the change (author and committer identity), and when (author and commit timestamps). The full history is publicly browsable on GitLab (commit list, diffs, and blame view) at gitlab.com/godisch/potillus/-/commits/main



    当包管理系统支持时,源代码仓库必须包含一个依赖项列表,该列表涵盖直接的语言依赖项。 [OSPS-QA-02.01]
    这可以采用包管理器或语言依赖文件的形式,列举所有直接依赖项,如package.json、Gemfile或go.mod。

    External dependencies are declared in a computer-processable, versioned form and are obtained automatically by a standard build. The Gradle version catalog (android/gradle/libs.versions.toml) pins every library and plugin version in its [versions], [libraries], and [plugins] tables, referenced via alias(libs.…) in the build scripts; settings.gradle.kts configures the repositories (google, mavenCentral, gradlePluginPortal), so ./gradlew resolves and downloads all declared dependencies with no manual steps. The iOS port declares its dependencies the same way: ios/PotillusKit/Package.swift names them and ios/PotillusKit/Package.resolved pins each to an exact version and revision, which SwiftPM resolves automatically. Both builds additionally generate a CycloneDX 1.6 JSON SBOM of the release dependencies as a standardized machine-readable inventory (make sbom, make ios-sbom).



    活跃期间,项目文档必须包含被视为子项目的任何代码库的列表。 [OSPS-QA-04.01]
    记录由项目生成并编译到发布版本中的任何附加子项目代码仓库。此文档应包括相应代码库的状态和意图。

    The project consists of a single source repository (gitlab.com/godisch/potillus) with no Git submodules and no separate subproject repositories. As the project does not span multiple repositories, this requirement's precondition does not apply. Should the project ever split into multiple repositories, the constituent codebases would be documented (e.g. in README.md/docs/).



    活跃期间,版本控制系统中不得包含生成的可执行工件。 [OSPS-QA-05.01]
    删除项目版本控制系统中生成的可执行工件。建议在任何情况下,如果生成的可执行工件对测试等过程至关重要,应该在构建时生成,或单独存储并在特定的、有详细文档记录的管道步骤中获取。

    The version control system contains no artifacts generated by the project's own build. All build outputs (APK/AAB, AAR, .dex, .class, compiled libraries) are produced under git-ignored directories (android/build, android/app/build, android/.gradle) and are never committed. The only committed binary is gradle/wrapper/gradle-wrapper.jar, the upstream Gradle bootstrap wrapper whose in-repository presence is the Gradle-recommended practice; it is not a project-generated artifact. Its integrity is addressed under OSPS-QA-05.02. The iOS port is the same: Xcode build products (DerivedData, .build) and the XcodeGen-generated ios/Potillus.xcodeproj are git-ignored and never committed, and no iOS binary is checked in.



    活跃期间,版本控制系统中不得包含无法审查的二进制工件。 [OSPS-QA-05.02]
    不要将任何无法审查的二进制工件添加到项目的版本控制系统中。这包括可执行应用程序二进制文件、库文件和类似的工件。这不包括资产,如图形图像、声音或音乐文件以及通常以二进制格式存储的类似内容。

    The only executable/library binary committed to version control is gradle/wrapper/gradle-wrapper.jar, the standard Gradle Wrapper bootstrap (committing it is Gradle's recommended practice and is required to build without a pre-installed Gradle). It is not an opaque, unreviewable blob: it is a stock Gradle Wrapper jar whose authenticity is independently verifiable via the OpenSSF/Gradle wrapper-validation tooling. The build additionally pins the Gradle distribution by cryptographic checksum in gradle/wrapper/gradle-wrapper.properties (distributionSha256Sum, with validateDistributionUrl=true), so the wrapper can only bootstrap an authenticated official Gradle release; the pinned checksum was verified against the value Gradle publishes for that release. On every Gradle update the wrapper is regenerated from the verified distribution (documented in CONTRIBUTING.md §7), so the committed jar remains a stock, verifiable wrapper regardless of version. All other binary files are content assets explicitly excluded by this control — graphical images (PNG, SVG), TTF fonts, and sample report PDFs. No executable application binaries or opaque library files are committed. On the iOS side no binary is committed at all: SwiftPM resolves dependencies from source, pinned by exact version and revision in ios/PotillusKit/Package.resolved, so there is no wrapper jar or prebuilt library to review.



    在活动期间,项目文档必须包含安全联系人。 [OSPS-VM-02.01]
    创建一个security.md(或类似名称)文件,其中包含项目的安全联系人。

    The process for reporting vulnerabilities is published in SECURITY.md at the repository root (which GitLab surfaces as the project's security policy) and is linked from the README's "Security" section. Reporters are asked to disclose privately via PGP-encrypted e-mail to android@godisch.de rather than opening a public issue.



该数据可在社区数据许可协议 – 许可性,版本 2.0 (CDLA-Permissive-2.0)下获取。这意味着数据接收方可以共享数据,无论是否经过修改,只要数据接收方在共享数据时提供本协议文本。请注明Martin A. Godisch和OpenSSF最佳实践徽章贡献者。

项目徽章条目拥有者: Martin A. Godisch.
最后更新于 2026-07-04 04:21:04 UTC, 最后更新于 2026-07-25 10:27:51 UTC。 最后在2026-07-19 18:17:51 UTC丢失通过徽章。 最后在 2026-07-19 18:18:14 UTC 获得通过徽章。