No description
  • Java 87.9%
  • HTML 10%
  • CSS 1.6%
  • Shell 0.2%
  • Dockerfile 0.2%
  • Other 0.1%
Find a file
giosueanastasi 7aeb92b317
All checks were successful
Container images / images (push) Successful in 2m47s
Merge branch '548-killmode-aggiornamento'
2026-11-05 16:49:04 +01:00
.forgejo/workflows refs #546 The images are built from the public repository 2026-11-05 13:31:46 +01:00
deploy/node refs #548 The update service stops only its script, not the node it restarted 2026-11-05 16:49:04 +01:00
scripts refs #501 SPDX licence and copyright notice at the top of every source file 2026-11-04 18:56:29 +01:00
src refs #547 The guided session keeps the content key until the package seal 2026-11-05 16:40:06 +01:00
.dockerignore refs #498 Remove docs/, load-tests/ and presentation/ from the repository; point report, document page and package to the public verification page 2026-10-16 20:22:01 +02:00
.gitignore The storage package was never in the repository 2026-09-29 01:21:34 +02:00
docker-compose.yml refs #501 SPDX licence and copyright notice at the top of every source file 2026-11-04 18:56:29 +01:00
Dockerfile refs #501 SPDX licence and copyright notice at the top of every source file 2026-11-04 18:56:29 +01:00
LICENSE Licenza AGPL-3.0-only 2026-08-21 14:36:47 +02:00
pom.xml refs #500 Version 1.1.0-SNAPSHOT, not 0.1.0 2026-11-04 17:40:21 +01:00
README.md refs #546 The images are built from the public repository 2026-11-05 13:31:46 +01:00
THIRD-PARTY.md refs #532 Third-party inventory, written source offer, no EPL-only dependency, new guide images 2026-11-04 12:58:28 +01:00

FedArchive

Web archiving with verifiable integrity — PITTYSOFT S.R.L. — AGPL-3.0-only

FedArchive captures web pages and guided browsing sessions into self-contained evidence packages (WARC, screenshot, network capture, signed metadata) and makes their integrity demonstrable to third parties:

  • three independent hashes of the content (SHA-256, SHA3-256, BLAKE3);
  • a federation of independent nodes that re-capture the same address, or witness the package, and counter-sign with Ed25519;
  • an RFC 3161 timestamp on the integrity certificate;
  • a custody log chained by hashes, and optionally anchoring on Bitcoin through OpenTimestamps.

Every check can be redone without FedArchive, with sha256sum, openssl and standard tools.

What this file is for: building, running and changing the code. What the program does, how to install a node, how to join the federation and how to verify a document are on the website:

Topic Where
How it works, use cases https://fedarchive.eu/en/how-it-works/
Installing and configuring a node https://fedarchive.eu/en/documentation/
Joining the federation https://fedarchive.eu/en/federation/
Verifying a document by yourself https://fedarchive.eu/en/documentation/redoing-the-checks/
What each integrity check catches https://fedarchive.eu/en/integrity-checks/

Requirements

For You need
building JDK 25, Maven 3.9
the full test suite Docker or rootless Podman (Testcontainers starts PostgreSQL)
the development federation Docker Compose or podman-compose, OpenSSL
the network capture, outside containers tcpdump, unshare and nsenter (util-linux), pasta (passt), microsocks, /dev/net/tun, unprivileged user namespaces
guided sessions and screenshots Chromium and chromedriver

Without the capture programs the node still works: the pcap is declared missing in the metadata of every document, never silently left out.

Build and test

mvn package                  # jar in target/
mvn test                     # all the tests, PostgreSQL included

With rootless Podman, Testcontainers has to be told where the socket is:

export DOCKER_HOST=unix:///run/user/$(id -u)/podman/podman.sock
export TESTCONTAINERS_RYUK_DISABLED=true

Without a container engine the tests that need PostgreSQL fail with NoClassDefFoundError: PostgresTestSupport: it is the engine that is missing, not the code.

Tests that need something outside the JVM are skipped where it is missing (capture network, tcpdump, Chrome).

Coverage report: target/site/jacoco/index.html. There is no threshold: the report says where nobody is looking, it is not a target.

Development federation (5 nodes)

./scripts/generate-node-keys.sh 5     # keys/node1 … keys/node5, never committed
GIT_COMMIT=$(git rev-parse HEAD) docker compose up --build   # or: podman-compose

The image is built without .git: GIT_COMMIT is the commit that the documents and the footer of the pages declare, otherwise «unknown».

Node Port Country
Bologna http://localhost:8081 IT
Florence http://localhost:8082 IT
Trieste http://localhost:8083 IT
Munich http://localhost:8084 DE
Berlin http://localhost:8085 DE

Quorum 3. Two countries on purpose: a witness outside the area tells «the page changes by country» apart from «the page was altered». The timestamp authority is a mock (valid structure, no legal value). Administrator API key, the same on every node and for localhost only: fedarchive-dev-admin-key-for-localhost-only.

A first capture:

KEY=fedarchive-dev-admin-key-for-localhost-only
curl -s -X POST http://localhost:8081/api/v1/acquisitions \
     -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
     -d '{"url":"https://www.example.com/"}'
# → {"acquisitionId":"<ID>","status":"PENDING"}
curl -s -H "Authorization: Bearer $KEY" http://localhost:8081/api/v1/acquisitions/<ID>
# PENDING → VALIDATED (quorum reached) → CERTIFIED (timestamped)

A single node, without containers

docker run -d --name fedarchive-pg -p 5432:5432 \
    -e POSTGRES_USER=fedarchive -e POSTGRES_PASSWORD=fedarchive \
    -e POSTGRES_DB=fedarchive postgres:16-alpine
FEDARCHIVE_FEDERATION_MODE=standalone mvn spring-boot:run

At the first start the node creates its keys in ./keys/ and prints the initial administrator API key once. Every fedarchive.* property in src/main/resources/application.yml can be overridden with an environment variable. A standalone node declares in every certificate that nobody cross-checked it (independentCrossCheck: false).

Project structure

it.pittysoft.fedarchive
├── acquisition/   fetch, WARC, screenshot, capture network and pcap, SSRF and egress proxy
├── session/       guided sessions: Chrome over CDP, screencast, WebSocket
├── federation/    node-to-node protocol: announcements, cross-checks, consensus
├── crypto/        hashes, Ed25519, canonical JSON, RFC 3161, document encryption
├── custody/       custody log chained by hashes, audit
├── anchoring/     OpenTimestamps
├── report/        PDF report, evidence package
├── export/        signed WACZ
├── replay/        public links, browsing the archived copy
├── storage/       disk and S3 archives
├── account/       users, organizations, sign-up, mail, quotas
├── device/        paired devices, UnifiedPush
├── api/           REST API /api/v1             web/      Thymeleaf + htmx dashboard
├── security/      API keys, security chains    config/   @ConfigurationProperties
└── model/  repository/  common/   JPA entities, Spring Data, shared helpers

The texts of the interface are in src/main/resources/i18n/messages*.properties (Italian is the default, English with ?lang=en). MessagesTest checks that both languages have the same keys and placeholders.

Contributing

  • Every change has an issue; commit messages start with refs #<n>.
  • Branches: one branch per issue, always from main, named <issue>-<short-description>. A finished branch goes to unstable, where it is tried by hand on a federation of test nodes; to testing once those tests are done; to main after a run on a real node. Merges with --no-ff. Issue branches are promoted one by one: unstable and testing are never merged anywhere.
  • Applied Flyway migrations are never edited: a change is a new migration.
  • Code, comments and commits in English; the interface in both languages.

Images and releases

The CI workflow in .forgejo/workflows/ builds two container images: fedarchive (amd64, with Chromium and the capture tools) and fedarchive-helper (arm/v7, JRE and jar only). They are built from this repository, so the commit they declare (in the footer of the pages, in the packages, in the reports) is one of its commits: whoever checks a document can find the exact code that formed it.

  • every push to main → :main and :sha-<commit>;
  • every push to unstable → :unstable and :sha-<commit>, for test nodes only;
  • every tag v* → :vX.Y.Z and :stable.

Versions

The version names a release, not a commit: every commit is already told apart by its hash, which the documents, the images (:sha-…) and the footer of the pages declare next to the version — fedarchive 1.1.0-SNAPSHOT (36b5015).

  • Between two releases the pom stays on X.Y.0-SNAPSHOT.
  • A release: -SNAPSHOT goes, the tag vX.Y.0 is made, and the pom moves on to the next -SNAPSHOT.
  • Whether two nodes, or a node and a package, work together is told by the version of the proof format, not by the number of the program.

The number is written only in pom.xml. 1.0.0 was never a release (there is no tag for it): it was the value left in the pom, and the documents issued until November 2026 declare it. What identifies the program in those documents is the hash, where present. The first release is 1.1.0.

Nodes should follow :stable, and only a tag produces it: witnesses that all updated themselves on the same push would lose the independence their attestations rest on. Releasing is tagging; pushing is not.

deploy/node/ holds what a production node needs around the image: a compose file, and an update script with its systemd timer that pulls the image, dumps the database before restarting and rolls back if the node does not come up.

Use of AI

Parts of the code and of the documentation are written with the help of AI coding assistants. Every change is reviewed, tested and committed by a human maintainer, who answers for it.

Licence and trademark

GNU AGPL-3.0-only (LICENSE). Anyone running a modified node must offer the modified source to its users, and in a federation the peer nodes are users too: every node declares its source on /node (fedarchive.node.source). The licence does not guarantee that a node runs this code: that is ascertained by the federation, through the cross-check.

FedArchive™ is a trademark of PITTYSOFT S.R.L. (EU trademark application No. 019438388). The AGPL covers the code, not the name: a modified node must not present itself as FedArchive in a way that misleads its users.

What the repository, the jar and the images contain from others, and under which licences: THIRD-PARTY.md.