Skip to content

Commit

Permalink
fix: rebuild updated nest-sftp
Browse files Browse the repository at this point in the history
  • Loading branch information
yxuo committed Mar 5, 2024
1 parent 071c9bb commit d50d061
Show file tree
Hide file tree
Showing 13 changed files with 1,565 additions and 25 deletions.
191 changes: 185 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
"rimraf": "5.0.1",
"rxjs": "7.8.1",
"source-map-support": "0.5.21",
"ssh2": "^1.15.0",
"ssh2-sftp-client": "^10.0.3",
"swagger-ui-express": "4.6.3",
"twitter": "1.7.1",
"typeorm": "0.3.16",
Expand Down Expand Up @@ -134,4 +136,4 @@
"engines": {
"node": ">=16.0.0"
}
}
}
21 changes: 11 additions & 10 deletions src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@ import { CronJobsModule } from './cron-jobs/cron-jobs.module';
import { BigqueryModule } from './bigquery/bigquery.module';
import { TestModule } from './test/test.module';
import { CnabModule } from './cnab/cnab.module';
// import { SftpModule } from 'nest-sftp';
import { SftpModule } from './sftp/sftp.module';

@Module({
imports: [
// SftpModule.forRoot(
// {
// host: '34.123.217.7',
// port: 23,
// username: 'cct_devs',
// password: 'EzKWSiqqchX3xdF'
// },
// false,
// ),
SftpModule.forRoot(
{
host: '34.123.217.7',
port: 23,
username: 'cct_devs',
password: 'EzKWSiqqchX3xdF'
},
false,
),
ConfigModule.forRoot({
isGlobal: true,
load: [
Expand Down Expand Up @@ -118,6 +118,7 @@ import { CnabModule } from './cnab/cnab.module';
BigqueryModule,
TestModule,
CnabModule,
SftpModule,
// SftpModule,
],
})
Expand Down
8 changes: 8 additions & 0 deletions src/config/config.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ export type TwitterConfig = {
consumerSecret?: string;
};

export type SftpConfig = {
host: string;
port: number;
username: string;
password: string;
};

export type AllConfigType = {
app: AppConfig;
apple: AppleConfig;
Expand All @@ -95,4 +102,5 @@ export type AllConfigType = {
google: GoogleConfig;
mail: MailConfig;
twitter: TwitterConfig;
sftp: SftpConfig;
};
4 changes: 2 additions & 2 deletions src/config/database.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ class EnvironmentVariablesValidator {
@IsString()
DATABASE_TYPE: string;

@ValidateIf((envValues) => !envValues.DATABASE_HOST)
@ValidateIf((envValues) => !envValues.DATABASE_URL)
@IsString()
DATABASE_HOST: string;

@ValidateIf((envValues) => !envValues.DATABASE_PORT)
@ValidateIf((envValues) => !envValues.DATABASE_URL)
@IsInt()
@Min(0)
@Max(65535)
Expand Down
Loading

0 comments on commit d50d061

Please sign in to comment.