Skip to content
Merged
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
2 changes: 2 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ module.exports = {
PINO_PRETTY: process.env.PINO_PRETTY,
ENVIRONMENT: process.env.ENVIRONMENT,
APP_HOST: process.env.APP_HOST,
SECRET_BOOTSTRAP_NAME: process.env.SECRET_BOOTSTRAP_NAME,
SECRET_COMMON_NAME: process.env.SECRET_COMMON_NAME,
},
typescript: {
ignoreBuildErrors: true,
Expand Down
3 changes: 2 additions & 1 deletion scripts/k8-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.


set -e

cd /app
Expand All @@ -28,6 +27,8 @@ required_vars=(
GITHUB_PRIVATE_KEY
GITHUB_CLIENT_SECRET
GITHUB_WEBHOOK_SECRET
SECRET_BOOTSTRAP_NAME
APP_HOST
)

missing=()
Expand Down
3 changes: 2 additions & 1 deletion src/pages/api/v1/setup/callback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import type { NextApiRequest, NextApiResponse } from 'next';
import { updateSecret, getCurrentNamespaceFromFile } from 'server/lib/kubernetes';
import logger from 'server/lib/logger';
import GlobalConfigService from 'server/services/globalConfig';
import { SECRET_BOOTSTRAP_NAME } from 'shared/config';

export default async function handler(req: NextApiRequest, res: NextApiResponse) {
try {
Expand Down Expand Up @@ -64,7 +65,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const namespace = getCurrentNamespaceFromFile();

await updateSecret(
'app-secrets',
SECRET_BOOTSTRAP_NAME,
{
GITHUB_APP_ID: id,
GITHUB_CLIENT_ID: client_id,
Expand Down
3 changes: 2 additions & 1 deletion src/pages/api/v1/setup/installed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import type { NextApiRequest, NextApiResponse } from 'next';
import { updateSecret, getCurrentNamespaceFromFile } from 'server/lib/kubernetes';
import logger from 'server/lib/logger';
import GlobalConfigService from 'server/services/globalConfig';
import { SECRET_BOOTSTRAP_NAME } from 'shared/config';

export default async function handler(req: NextApiRequest, res: NextApiResponse) {
const { installation_id, setup_action } = req.query;
Expand Down Expand Up @@ -50,7 +51,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
logger.info(`Successfully recorded installation ID: ${installation_id}`);
const namespace = getCurrentNamespaceFromFile();
await updateSecret(
'app-secrets',
SECRET_BOOTSTRAP_NAME,
{
GITHUB_APP_INSTALLATION_ID: installation_id as string,
},
Expand Down
3 changes: 3 additions & 0 deletions src/shared/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,6 @@ export const DD_ENVS = {
};
export const ENVIRONMENT = getServerRuntimeConfig('ENVIRONMENT', 'production');
export const APP_HOST = getServerRuntimeConfig('APP_HOST', 'http://localhost:5001');

export const SECRET_BOOTSTRAP_NAME = getServerRuntimeConfig('SECRET_BOOTSTRAP_NAME', 'lifecycle-app-secrets');
export const SECRET_COMMON_NAME = getServerRuntimeConfig('SECRET_COMMON_NAME', 'lifecycle-common-secrets');