public ImportIntoS3Tasks()
        {
            appHost = new BasicAppHost().Init();

            var s3Client = new AmazonS3Client(AwsConfig.AwsAccessKey, AwsConfig.AwsSecretKey, RegionEndpoint.USEast1);
            s3 = new S3VirtualPathProvider(s3Client, AwsConfig.S3BucketName, appHost);
        }
Exemple #2
0
        public override void Configure(Container container)
        {
            JsConfig.EmitCamelCaseNames = true;
            Plugins.Add(new RazorFormat());

            //Comment out 2 lines below to change to use local FileSystem instead of S3
            var s3Client = new AmazonS3Client(AwsConfig.AwsAccessKey, AwsConfig.AwsSecretKey, RegionEndpoint.USEast1);
            VirtualFiles = new S3VirtualPathProvider(s3Client, AwsConfig.S3BucketName, this);

            container.Register<IPocoDynamo>(c => new PocoDynamo(AwsConfig.CreateAmazonDynamoDb()));
            var db = container.Resolve<IPocoDynamo>();
            db.RegisterTable<Todos.Todo>();
            db.RegisterTable<EmailContacts.Email>();
            db.RegisterTable<EmailContacts.Contact>();
            db.InitSchema();

            //AWS Auth
            container.Register<ICacheClient>(new DynamoDbCacheClient(db, initSchema:true));
            container.Register<IAuthRepository>(new DynamoDbAuthRepository(db, initSchema:true));
            Plugins.Add(CreateAuthFeature());

            //EmailContacts
            ConfigureSqsMqServer(container);
            ConfigureEmailer(container);
            Plugins.Add(new ValidationFeature());
            container.RegisterValidators(typeof(EmailContacts.CreateContact).Assembly);
        }
        public override void Configure(Container container)
        {
            //RockstarsService is powered by PocoDynamo and DynamoDB
            container.Register<IPocoDynamo>(c => new PocoDynamo(AwsConfig.CreateAmazonDynamoDb()));

            //Add S3 Bucket as lowest priority Virtual Path Provider
            //All Razor Views, Markdown Content, imgs, js, css, etc are being served from an S3 Bucket
            var s3Client = new AmazonS3Client(AwsConfig.AwsAccessKey, AwsConfig.AwsSecretKey, RegionEndpoint.USEast1);
            VirtualFiles = new S3VirtualPathProvider(s3Client, AwsConfig.S3BucketName, this);

            //Register and Create Missing DynamoDB Tables
            var db = container.Resolve<IPocoDynamo>();
            db.RegisterTable<Rockstar>();
            db.InitSchema();

            //Insert Rockstar POCOs in DynamoDB
            db.PutItems(RockstarsService.SeedData);

            Plugins.Add(new RazorFormat());

            //Uncomment to check LastModified in S3 for changes and recompile Razor + Markdown pages if needed
            //GetPlugin<MarkdownFormat>().CheckLastModifiedForChanges = true;
            //Plugins.Add(new RazorFormat { CheckLastModifiedForChanges = true });
        }
 public S3VirtualFile(S3VirtualPathProvider pathProvider, IVirtualDirectory directory)
     : base(pathProvider, directory)
 {
     this.PathProvider = pathProvider;
 }
 public S3VirtualDirectory(S3VirtualPathProvider pathProvider, string dirPath, S3VirtualDirectory parentDir)
     : base(pathProvider, parentDir)
 {
     this.PathProvider = pathProvider;
     this.DirPath      = dirPath;
 }
 public S3VirtualDirectory(S3VirtualPathProvider pathProvider, string dirPath)
     : base(pathProvider)
 {
     this.PathProvider = pathProvider;
     this.DirPath = dirPath;
 }
 public AdminTasks()
 {
     appHost = new BasicAppHost().Init();
     s3 = AwsConfig.CreateS3VirtualPathProvider(appHost, AwsConfig.S3BucketName);
 }
 public S3VirtualFile(S3VirtualPathProvider pathProvider, IVirtualDirectory directory)
     : base(pathProvider, directory)
 {
     this.PathProvider = pathProvider;
 }