Skip to content

Commit

Permalink
remove snapcraft configurations, move into base class
Browse files Browse the repository at this point in the history
  • Loading branch information
davide-pi committed Sep 14, 2024
1 parent bc2df08 commit 13cefed
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 16 deletions.
2 changes: 0 additions & 2 deletions config/custom-environment-variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ public:
authorizedOrigins: 'OBS_ORIGINS'
pypi:
baseUri: 'PYPI_URL'
snapcraft:
baseUri: 'SNAPCRAFT_URL'
sonar:
authorizedOrigins: 'SONAR_ORIGINS'
teamcity:
Expand Down
2 changes: 0 additions & 2 deletions config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ public:
authorizedOrigins: 'https://api.opensuse.org'
pypi:
baseUri: 'https://pypi.org'
snapcraft:
baseUri: 'https://api.snapcraft.io/v2/snaps/info'
weblate:
authorizedOrigins: 'https://hosted.weblate.org'
trace: false
Expand Down
3 changes: 0 additions & 3 deletions core/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,6 @@ const publicConfigSchema = Joi.object({
pypi: {
baseUri: requiredUrl,
},
snapcraft: {
baseUri: requiredUrl,
},
sonar: defaultService,
teamcity: defaultService,
weblate: defaultService,
Expand Down
6 changes: 0 additions & 6 deletions doc/server-secrets.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,6 @@ Create an account, sign in and obtain generate a key on your
`PYPI_URL` can be used to optionally send all the PyPI requests to a Self-hosted Pypi registry,
users can also override this by query parameter `pypiBaseUrl`.

### Snapcraft

- `SNAPCRAFT_URL` (yml: `public.snapcraft.baseUri`)

`SNAPCRAFT_URL` can be used to optionally send all the Snapcraft requests to a Self-hosted Snapcraft registry.

### SymfonyInsight (formerly Sensiolabs)

- `SL_INSIGHT_USER_UUID` (yml: `private.sl_insight_userUuid`)
Expand Down
5 changes: 2 additions & 3 deletions services/snapcraft/snapcraft-base.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import config from 'config'
import { BaseJsonService, pathParam } from '../index.js'

export const snapcraftPackageParam = pathParam({
Expand All @@ -8,10 +7,10 @@ export const snapcraftPackageParam = pathParam({

export const snapcraftBaseParams = [snapcraftPackageParam]

const snapcraftBaseUrl = 'https://api.snapcraft.io/v2/snaps/info'

export default class SnapcraftBase extends BaseJsonService {
async fetch(schema, { packageName }) {
const snapcraftBaseUrl =
config.util.toObject().public.services.snapcraft.baseUri
return await this._requestJson({
schema,
url: `${snapcraftBaseUrl}/${packageName}`,
Expand Down

0 comments on commit 13cefed

Please sign in to comment.