Skip to content

Commit

Permalink
refactor: rename env variables and do service name to spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Aug 11, 2024
1 parent 97d3dba commit 7b14759
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
18 changes: 9 additions & 9 deletions configure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ const STORAGE_SERVICES = {
],
dependencies: ['@aws-sdk/client-s3', '@aws-sdk/s3-request-presigner'],
},
do: {
spaces: {
name: 'Digital Ocean Spaces',
env: [
{ name: 'DO_ACCESS_KEY_ID', value: '', schema: 'Env.schema.string()' },
{ name: 'DO_SECRET_ACCESS_KEY', value: '', schema: 'Env.schema.string()' },
{ name: 'DO_REGION', value: '', schema: 'Env.schema.string()' },
{ name: 'DO_BUCKET', value: '', schema: 'Env.schema.string()' },
{ name: 'SPACES_KEY', value: '', schema: 'Env.schema.string()' },
{ name: 'SPACES_SECRET', value: '', schema: 'Env.schema.string()' },
{ name: 'SPACES_REGION', value: '', schema: 'Env.schema.string()' },
{ name: 'SPACES_BUCKET', value: '', schema: 'Env.schema.string()' },
{
name: 'DO_ENDPOINT',
value: `https://\${DO_REGION}.digitaloceanspaces.com`,
name: 'SPACES_ENDPOINT',
value: `https://\${SPACES_REGION}.digitaloceanspaces.com`,
schema: 'Env.schema.string()',
},
],
Expand All @@ -48,8 +48,8 @@ const STORAGE_SERVICES = {
r2: {
name: 'Cloudflare R2',
env: [
{ name: 'R2_ACCESS_KEY_ID', value: '', schema: 'Env.schema.string()' },
{ name: 'R2_SECRET_ACCESS_KEY', value: '', schema: 'Env.schema.string()' },
{ name: 'R2_KEY', value: '', schema: 'Env.schema.string()' },
{ name: 'R2_SECRET', value: '', schema: 'Env.schema.string()' },
{ name: 'R2_BUCKET', value: '', schema: 'Env.schema.string()' },
{ name: 'R2_ENDPOINT', value: '', schema: 'Env.schema.string()' },
],
Expand Down
18 changes: 9 additions & 9 deletions stubs/config/drive.stub
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@ const driveConfig = defineConfig({
}),{{/if}}{{#if services.includes('r2')}}
r2: services.s3({
credentials: {
accessKeyId: env.get('R2_ACCESS_KEY_ID'),
secretAccessKey: env.get('R2_SECRET_ACCESS_KEY'),
accessKeyId: env.get('R2_KEY'),
secretAccessKey: env.get('R2_SECRET'),
},
region: 'auto',
bucket: env.get('R2_BUCKET'),
endpoint: env.get('R2_ENDPOINT'),
visibility: 'public',
}),{{/if}}{{#if services.includes('do')}}
do: services.s3({
}),{{/if}}{{#if services.includes('spaces')}}
spaces: services.s3({
credentials: {
accessKeyId: env.get('DO_ACCESS_KEY_ID'),
secretAccessKey: env.get('DO_SECRET_ACCESS_KEY'),
accessKeyId: env.get('SPACES_KEY'),
secretAccessKey: env.get('SPACES_SECRET'),
},
region: env.get('DO_REGION'),
bucket: env.get('DO_BUCKET'),
endpoint: env.get('DO_ENDPOINT'),
region: env.get('SPACES_REGION'),
bucket: env.get('SPACES_BUCKET'),
endpoint: env.get('SPACES_ENDPOINT'),
visibility: 'public',
}),{{/if}}{{#if services.includes('gcs')}}
gcs: services.gcs({
Expand Down

0 comments on commit 7b14759

Please sign in to comment.