8 Commits

Author SHA1 Message Date
9d12338630 1.0.6 2021-12-20 16:38:52 +01:00
3c75bfedfc fix(core): update 2021-12-20 16:38:51 +01:00
d9e80caa6f 1.0.5 2021-12-20 16:33:13 +01:00
e44b7875e6 fix(core): update 2021-12-20 16:33:13 +01:00
52bad357fe 1.0.4 2021-12-18 02:17:42 +01:00
3ffc38dac5 fix(core): update 2021-12-18 02:17:42 +01:00
f35dd1e050 1.0.3 2021-12-18 01:48:03 +01:00
66eba9eef7 fix(core): update 2021-12-18 01:48:03 +01:00
4 changed files with 29 additions and 8 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "@pushrocks/smarts3", "name": "@pushrocks/smarts3",
"version": "1.0.2", "version": "1.0.6",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@pushrocks/smarts3", "name": "@pushrocks/smarts3",
"version": "1.0.2", "version": "1.0.6",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@pushrocks/smartfile": "^9.0.3", "@pushrocks/smartfile": "^9.0.3",

View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smarts3", "name": "@pushrocks/smarts3",
"version": "1.0.2", "version": "1.0.6",
"private": false, "private": false,
"description": "create an s3 endpoint that maps to a local directory", "description": "create an s3 endpoint that maps to a local directory",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
@ -15,7 +15,6 @@
"@gitzone/tsbuild": "^2.1.25", "@gitzone/tsbuild": "^2.1.25",
"@gitzone/tsbundle": "^1.0.78", "@gitzone/tsbundle": "^1.0.78",
"@gitzone/tstest": "^1.0.44", "@gitzone/tstest": "^1.0.44",
"@pushrocks/smartbucket": "^1.0.44",
"@pushrocks/tapbundle": "^3.2.9", "@pushrocks/tapbundle": "^3.2.9",
"@types/node": "^17.0.0", "@types/node": "^17.0.0",
"tslint": "^6.1.3", "tslint": "^6.1.3",
@ -37,6 +36,7 @@
"readme.md" "readme.md"
], ],
"dependencies": { "dependencies": {
"@pushrocks/smartbucket": "^1.0.44",
"@pushrocks/smartfile": "^9.0.3", "@pushrocks/smartfile": "^9.0.3",
"@types/s3rver": "^3.7.0", "@types/s3rver": "^3.7.0",
"s3rver": "^3.7.1" "s3rver": "^3.7.1"

View File

@ -8,10 +8,20 @@ export interface ISmarts3ContructorOptions {
export class Smarts3 { export class Smarts3 {
public options: ISmarts3ContructorOptions; public options: ISmarts3ContructorOptions;
public dataForClient = {
s3AccessKey: 'S3RVER',
s3AccessSecret: 'S3RVER',
port: 3000,
useSsl: false
}
public s3Instance: plugins.s3rver; public s3Instance: plugins.s3rver;
constructor(optionsArg: ISmarts3ContructorOptions) { constructor(optionsArg: ISmarts3ContructorOptions) {
this.options = optionsArg; this.options = optionsArg;
this.options = {
...this.options,
...optionsArg
}
} }
public async start() { public async start() {
@ -24,13 +34,22 @@ export class Smarts3 {
port: this.options.port || 3000, port: this.options.port || 3000,
address: '0.0.0.0', address: '0.0.0.0',
silent: false, silent: false,
directory: paths.bucketsDir, directory: paths.bucketsDir
allowMismatchedSignatures: true,
}) })
await this.s3Instance.run(); await this.s3Instance.run();
console.log('s3 server is running'); console.log('s3 server is running');
} }
public async getS3Descriptor(): Promise<plugins.smartbucket.ISmartBucketConfig> {
return {
accessKey: this.dataForClient.s3AccessKey,
accessSecret: this.dataForClient.s3AccessSecret,
endpoint: 'localhost',
port: this.dataForClient.port,
useSsl: this.dataForClient.useSsl,
}
}
public async stop() { public async stop() {
await this.s3Instance.close(); await this.s3Instance.close();
} }

View File

@ -6,10 +6,12 @@ export {
} }
// pushrocks scope // pushrocks scope
import * as samrtfile from '@pushrocks/smartfile'; import * as smartbucket from '@pushrocks/smartbucket';
import * as smartfile from '@pushrocks/smartfile';
export { export {
samrtfile as smartfile smartbucket,
smartfile,
} }
// thirdparty scope // thirdparty scope