Published 2025-09-11
Forked version of 'pub_server' (0.1.6-dev) for HuigHaverlag.

This repo has been archived, and is no longer maintained.
Issues and PRs will not be responded to.
Should there be community interest in alternate package servers for Dart, we recommend these are handled as community projects.
Provides re-usable code for making a Dart package repository server.
The package:pub_server/shelf_pubserver.dart library provides a shelf HTTP
handler which provides the HTTP API used by the pub client.
One can use different backend implementations by implementing the
PackageRepository interface of the package:pub_server/repository.dart
library.
An experimental pub server based on a file system can be found in
example/example.dart. It uses a filesystem-based PackageRepository for
storing packages and has a read-only fallback to the real pub.dartlang.org
site, if a package is not available locally. This allows one to use all
pub.dartlang.org packages and have additional ones, on top of the publicly
available packages, available only locally.
It can be run as follows
~ $ git clone https://github.com/dart-lang/pub_server.git
~ $ cd pub_server
~/pub_server $ pub get
...
~/pub_server $ dart example/example.dart -d /tmp/package-db
Listening on http://localhost:8080
To make the pub client use this repository configure your shell via:
$ export PUB_HOSTED_URL=http://localhost:8080
Using it for uploading new packages to the locally running server or downloading
packages locally available or via a fallback to pub.dartlang.org is as easy
as:
~/foobar $ export PUB_HOSTED_URL=http://localhost:8080
~/foobar $ pub get
...
~/foobar $ pub publish
Publishing x 0.1.0 to http://localhost:8080:
|-- ...
'-- pubspec.yaml
Looks great! Are you ready to upload your package (y/n)? y
Uploading...
Successfully uploaded package.
The fact that the pub publish command requires you to grant it oauth2 access -
which requires a Google account - is due to the fact that the pub publish
cannot work without authentication or with another authentication scheme.
But the information sent by the pub client is not used for this local server
at the moment.
Add to /etc/hosts:
127.0.0.1 pub.dev.huighaverlag.nl
Create /etc/nginx/conf.c/pub.dev.huighaverlag.conf:
server {
listen 80;
proxy_http_version 1.1;
server_name pub.dev.huighaverlag.nl dev.huighaverlag.nl;
location / {
proxy_pass http://192.168.22.124:8080/;
}
}
Requests go from localhost http://pub.dev.huighaverlag.nl (port 80) to remote http://192.168.22.124:8080.
ssh into the server:
# (192.168.22.190)
ssh -p 2224 root@pub.dev.huighaverlag.nl
and do:
cd /Users/Shared/work_dart/dart_pub_server
svn up
./restart
https://pub.dev.huighaverlag.nl/api/record/[package]/[semver]/[username]/[host.name]/[host.os]
https://pub.dev.huighaverlag.nl/api/list/names
https://pub.dev.huighaverlag.nl/api/list/latest
https://pub.dev.huighaverlag.nl/api/packages/[package]
https://pub.dev.huighaverlag.nl/api/packages/[package]/versions/[semver]
https://pub.dev.huighaverlag.nl/packages/[package]/versions/[semver].tar.gz
https://pub.dev.huighaverlag.nl/api/installers/[package]/versions/[semver]/[installerfilename]
https://pub.dev.huighaverlag.nl/packages/[package]
https://pub.dev.huighaverlag.nl/installers/[package]/versions/[semver]/[installerfilename]
timeago for get_time_ago.tsv download (usage report).arm64) installers.pubspec dependency (discontinued)./api/record package usage registration API.status to package list API result.screenshot and graph to package list API result.package_authors (now hh_package_authors) pubspec.yaml fields.tar files.async constructs.2.19.await unawaited futures.unawaited.marker, replaced with markdown.README.md from package tar file.executables pubspec section.PubSpecExtension.CHANGELOG.md files.serverpod projects.tp_change to this code tree to eliminate external local package dependencies.finals due to new linter rules.dart_hh.dart_hh to this project.dart_hh.style.css, rule .package__timeago:not(:empty)::after.web installer type.timeago for upload age (like: Uploaded 29 minutes ago).css grid layout (less vertical space).yaml dependency, and change to pubspec.String version and changed to Version version.PackageVersion.pubspec['name']', but usepackageVersion.name` (etc.).HEAD on / (to test if the server is alive for example).packages entry in pubspec.yaml to the official notation.shelf_hotreload for easier development (switch with kDebugMode).platforms from pubspec.yaml, not platforms.yaml.package_authors from `pubspec.yaml'.sidebar HTML template now contains the right platforms.htmlprovider somewhat generic.README.md about proxying through a VPN.CHANGELOG.md files.