pub_proxy_server 0.1.2

  • README.md
  • Installing
  • Versions
  • 6

pub_proxy_server

Private pub repository and proxy server.

Publish private package to your local server.

Act as proxy for pub.dartlang.org or any pub server.

Private and public packages all accessible through pub command line.

pub publish --server http://me:mypassword@127.0.0.1:8042

pub publish --server https://me:mypassword@127.0.0.1

pub get

Installation

Add this package to your pubspec.yaml file:

dependencies:
  pub_proxy_server: any

Then, run pub install to download and link in the package.

Set PUB_HOSTED_URL environent variable to http://me:mypassword@127.0.0.1:8042

import 'package:logging/logging.dart';
import 'package:pub_proxy_server/pub_proxy_server.dart';
import 'dart:io';

void main() {
  initLog();
  PermissionStore store = new PermissionStore();
  store.addPermission(new UserPermission("me", "mypassword"));
  store.addPermission(new UserPermission("me@gmail.com", "")); //necessary to publish

  var repos = [new PubRepoImpl(new Store(new StoreSettings.fromDir("C:/Users/me/Google Drive/pub_repo","C:/Users/me/pub_repo_tmp"))), 
                 new DartLangRemoteRepo(new Store(new StoreSettings.fromRepoDirPrefix('cache')), new HttpClient())];
  PubFederatedRepo pubrepo = new PubFederatedRepo(repos);
  start_pub_proxy_server(pubrepo, port:8042, permissionStore:store, isSecure:false);
//  InitializeSSL();
//  start_pub_proxy_server(pubrepo, port:443, permissionStore:store, isSecure:true);
}
 
initLog(){
  Logger.root.level = Level.ALL;
  Logger.root.onRecord.listen((LogRecord rec) {
    print('${rec.level.name}:${rec.loggerName}: ${rec.time}: ${rec.message}');
    if (rec.error != null) print(rec.error);
    if (rec.stackTrace != null) print(rec.stackTrace);
  });
}

void InitializeSSL() {
  var testPkcertDatabase = Platform.script.resolve('pkcert').toFilePath();
  SecureSocket.initialize(database: testPkcertDatabase, password: 'a');
}
}

Roadmap

Web admin pages

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  pub_proxy_server: ^0.1.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:pub_proxy_server/pub_proxy_server.dart';
  
Version Uploaded Documentation Archive
0.1.2 Mar 23, 2014 Go to the documentation of pub_proxy_server 0.1.2 Download pub_proxy_server 0.1.2 archive
0.0.6 Feb 28, 2014 Go to the documentation of pub_proxy_server 0.0.6 Download pub_proxy_server 0.0.6 archive
0.0.4 Feb 27, 2014 Go to the documentation of pub_proxy_server 0.0.4 Download pub_proxy_server 0.0.4 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
13
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0
Overall:
Weighted score of the above. [more]
6
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Fix dependencies in pubspec.yaml.

Running pub upgrade failed with the following output:

ERR: The current Dart SDK version is 2.0.0.
 
 Because pub_proxy_server depends on route_hierarchical >=0.4.7 which requires SDK version <2.0.0, version solving failed.

Health suggestions

Format bin/pub_proxy_main.dart.

Run dartfmt to format bin/pub_proxy_main.dart.

Format bin/pub_proxy_main_example.dart.

Run dartfmt to format bin/pub_proxy_main_example.dart.

Format lib/pub_proxy_server.dart.

Run dartfmt to format lib/pub_proxy_server.dart.

Fix additional 9 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/async.dart (Run dartfmt to format lib/src/async.dart.)
  • lib/src/cache.dart (Run dartfmt to format lib/src/cache.dart.)
  • lib/src/federatedrepo.dart (Run dartfmt to format lib/src/federatedrepo.dart.)
  • lib/src/io.dart (Run dartfmt to format lib/src/io.dart.)
  • lib/src/permissions.dart (Run dartfmt to format lib/src/permissions.dart.)
  • lib/src/remoterepo.dart (Run dartfmt to format lib/src/remoterepo.dart.)
  • lib/src/repo.dart (Run dartfmt to format lib/src/repo.dart.)
  • lib/src/server.dart (Run dartfmt to format lib/src/server.dart.)
  • lib/src/store.dart (Run dartfmt to format lib/src/store.dart.)

Maintenance issues and suggestions

Fix platform conflicts. (-20 points)

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Package is too old. (-100 points)

The package was released more than two years ago.

Maintain CHANGELOG.md. (-20 points)

Changelog entries help clients to follow the progress in your code.

Add SDK constraint in pubspec.yaml. (-5 points)

For information about setting SDK constraint, please see https://www.dartlang.org/tools/pub/pubspec#sdk-constraints.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use pub_proxy_server.dart.