- put credentials.json into the pub cache folder to make a fake credentials for prevent pub command to promot to google oauth
- dart main.dart
- pub publish
Created
April 29, 2020 08:23
-
-
Save lymanlai/e57b5cb62ef17ca391318fa837da97b9 to your computer and use it in GitHub Desktop.
setup dart private mirror
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"accessToken":"fake","refreshToken":"fake","tokenEndpoint":"https://accounts.google.com/o/oauth2/token","scopes":["openid","https://www.googleapis.com/auth/userinfo.email"],"expiration":2588150347472} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:unpub/unpub.dart' as unpub; | |
main(List<String> args) async { | |
var basedir = './data'; // Base directory to save pacakges | |
var db = 'mongodb://user:pwd@ip:port/dart_pub?authSource=admin'; // MongoDB uri | |
var metaStore = unpub.MongoStore(db); | |
await metaStore.db.open(); | |
var packageStore = unpub.FileStore(basedir); | |
var app = unpub.App( | |
metaStore: metaStore, | |
packageStore: packageStore, | |
upstream: 'https://pub.flutter-io.cn', | |
overrideUploaderEmail: '[email protected]' | |
); | |
var server = await app.serve('0.0.0.0', 4000); | |
print('Serving at http://${server.address.host}:${server.port}'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment