Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions bin/dc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ sub_help () {
echo
echo "Commands:"
echo " help This help message"
echo " up Start standalone docker-compose version of web without dependent services $info"
echo " up-all Start docker-compose version of web with dependent services $info"
echo " up-deps Start docker-compose version of only dependent services $info"
echo " up Start docker-compose version of web $info"
echo " down Stop and clean docker-compose containers"
}

Expand All @@ -23,18 +21,8 @@ sub_up () {
docker-compose -f docker-compose.yml up ${1}
}

sub_up-all () {
local files='-f docker-compose.yml -f docker-compose-deps.yml'

docker-compose $files up ${1}
}

sub_up-deps () {
docker-compose -f docker-compose-deps.yml up ${1}
}

sub_down () {
docker-compose -f docker-compose.yml -f docker-compose-deps.yml down --remove-orphans -v
docker-compose -f docker-compose.yml down --remove-orphans -v
}

case $command in
Expand Down
19 changes: 0 additions & 19 deletions docker-compose-deps.yml

This file was deleted.

1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ services:
- /tmp:/tmp:rw
working_dir: /app
environment:
TOOLS_HOST: tools
HOME: /app
env_file:
- .env
17 changes: 0 additions & 17 deletions src/api.authz.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,23 +184,6 @@ describe('API authz tests', () => {
await agent.post('/v1/teams').send(data).set('Authorization', `Bearer ${platformAdminToken}`).expect(200)
})

test('platform admin can get all values', async () => {
jest.spyOn(otomiStack, 'getValues').mockResolvedValue({})
await agent.get('/v1/otomi/values').set('Authorization', `Bearer ${platformAdminToken}`).expect(200)
})

test('team member cannot get all values', async () => {
await agent.get('/v1/otomi/values').set('Authorization', `Bearer ${teamMemberToken}`).expect(403)
})

test('authenticated user cannot get all values', async () => {
await agent.get('/v1/otomi/values').set('Authorization', `Bearer ${userToken}`).expect(403)
})

test('unauthenticated user cannot get all values', async () => {
await agent.get('/v1/otomi/values').expect(401)
})

test('platform admin can see values from an app', async () => {
const values = { shown: true } as App['values']
jest.spyOn(otomiStack, 'getApp').mockImplementation(() => ({ id: 'adminapp', values }))
Expand Down
20 changes: 0 additions & 20 deletions src/api/v1/otomi/values.ts

This file was deleted.

8 changes: 0 additions & 8 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
import { TOOLS_HOST, cleanEnv } from './validators'

const env = cleanEnv({
TOOLS_HOST,
})

export const BASEURL = `http://${env.TOOLS_HOST}:17771`

export const APL_SECRETS_NAMESPACE = 'apl-secrets'
export const APL_USERS_NAMESPACE = 'apl-users'
export const PLATFORM_SECRETS_NAME = 'otomi-secrets'
13 changes: 0 additions & 13 deletions src/git.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import axios, { AxiosResponse } from 'axios'
import Debug from 'debug'
import diff from 'deep-diff'
import { rmSync } from 'fs'
Expand All @@ -16,10 +15,8 @@ import {
GIT_PUSH_RETRIES,
GIT_REPO_URL,
GIT_USER,
TOOLS_HOST,
} from 'src/validators'
import { parse as parseYaml, stringify as stringifyYaml } from 'yaml'
import { BASEURL } from './constants'
import { GitPullError } from './error'
import { Core } from './otomi-models'
import { getSanitizedErrorMessage, removeBlankAttributes, sanitizeGitPassword } from './utils'
Expand All @@ -33,12 +30,8 @@ const env = cleanEnv({
GIT_REPO_URL,
GIT_USER,
GIT_PUSH_RETRIES,
TOOLS_HOST,
})

const baseUrl = BASEURL
const valuesUrl = `${baseUrl}/otomi/values`

const getProtocol = (url): string => (url && url.includes('://') ? url.split('://')[0] : 'http')

const getUrl = (url): string => (!url || url.includes('://') ? url : `${getProtocol(url)}://${url}`)
Expand Down Expand Up @@ -92,12 +85,6 @@ export class Git {
return getProtocol(this.url)
}

async requestValues(params): Promise<AxiosResponse> {
debug(`Tools: requesting "otomi/values" ${this.path}`)
const res = await axios.get(valuesUrl, { params: { envDir: this.path, ...params } })
return res
}

async addConfig(): Promise<void> {
debug(`Adding git config`)
await this.git.addConfig('user.name', this.user)
Expand Down
33 changes: 0 additions & 33 deletions src/openapi/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,6 @@ externalDocs:

# -------------------------------------------- Paths
paths:
/v1/otomi/values:
get:
operationId: getValues
x-eov-operation-handler: v1/otomi/values
description: Get otomi values
x-aclSchema: OtomiCliValues
parameters:
- name: filesOnly
in: query
description: IDs of settings to return
schema:
type: string
enum: ['true', 'false']
- name: excludeSecrets
in: query
schema:
type: string
enum: ['true', 'false']
- name: withWorkloadValues
in: query
schema:
type: string
enum: ['true', 'false']
responses:
'200':
description: Successfully obtained otomi values
content:
application/yaml:
schema:
$ref: '#/components/schemas/OtomiCliValues'

/v1/teams:
get:
operationId: getTeams
Expand Down Expand Up @@ -3595,8 +3564,6 @@ components:
$ref: 'error.yaml#/OpenApiValidationError'
OtomiStackError:
$ref: 'error.yaml#/OtomiStackError'
OtomiCliValues:
$ref: 'otomi/cli.yaml#/OtomiCliValues'
Policy:
$ref: 'policies.yaml#/Policy'
Policies:
Expand Down
6 changes: 0 additions & 6 deletions src/openapi/otomi/cli.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions src/otomi-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ import {
OBJ_STORAGE_APPS,
OBJECT_STORAGE_UI_EXCLUSIONS,
PREINSTALLED_EXCLUDED_APPS,
TOOLS_HOST,
VERSIONS,
} from 'src/validators'
import { v4 as uuidv4 } from 'uuid'
Expand Down Expand Up @@ -193,7 +192,6 @@ const env = cleanEnv({
GIT_REPO_URL,
GIT_USER,
HELM_CHART_CATALOG,
TOOLS_HOST,
VERSIONS,
PREINSTALLED_EXCLUDED_APPS,
HIDDEN_APPS,
Expand Down Expand Up @@ -281,10 +279,6 @@ export default class OtomiStack {
return getAppList()
}

async getValues(query): Promise<Record<string, any>> {
return (await this.git.requestValues(query)).data
}

getRepoPath() {
if (env.isTest || this.sessionId === undefined) return env.GIT_LOCAL_PATH
return `${rootPath}/${this.sessionId}`
Expand Down
1 change: 0 additions & 1 deletion src/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ export const GIT_PROVIDER_URL_PATTERNS = json({
})
export const REGION = str({ desc: 'The cloud region' })
export const ROARR_LOG = bool({ desc: 'To enable Lightship logs', default: false })
export const TOOLS_HOST = str({ desc: 'The host of the tools server', default: '127.0.0.1' })
export const PREINSTALLED_EXCLUDED_APPS = json({
desc: 'Applications that are managed by Linode, so they should be excluded from the apps page',
default: {
Expand Down
Loading