1
0
mirror of https://github.com/Infisical/infisical.git synced 2025-03-22 14:05:22 +00:00

Compare commits

..

4 Commits

Author SHA1 Message Date
d11fda3be5 Merge pull request from Infisical/railway-integration
Update Railway integration get services query, make services optional
2024-03-08 14:25:14 -08:00
0df5f845fb Update docker-swarm-with-agent.mdx 2024-03-08 17:07:11 -05:00
ca59488b62 Update Railway integration get services query, make services optional 2024-03-08 11:46:51 -08:00
3a05ae4b27 Merge pull request from Infisical/docker-swarm-docs
docs: docker swarm with infisical agent
2024-03-08 14:42:56 -05:00
4 changed files with 31 additions and 55 deletions
backend/src/services/integration-auth
docs/infisical-agent/guides
frontend/src/pages/integrations/railway

@ -649,33 +649,21 @@ export const integrationAuthServiceFactory = ({
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.Integrations);
const botKey = await projectBotService.getBotKey(integrationAuth.projectId);
const { accessToken } = await getIntegrationAccessToken(integrationAuth, botKey);
if (appId) {
if (appId && appId !== "") {
const query = `
query project($id: String!) {
project(id: $id) {
createdAt
deletedAt
id
description
expiredAt
isPublic
isTempProject
isUpdatable
name
prDeploys
teamId
updatedAt
upstreamUrl
services {
edges {
node {
id
name
}
}
}
query project($id: String!) {
project(id: $id) {
services {
edges {
node {
id
name
}
}
}
}
}
}
`;
const variables = {
@ -711,6 +699,7 @@ export const integrationAuthServiceFactory = ({
);
return edges.map(({ node: { name, id: serviceId } }) => ({ name, serviceId }));
}
return [];
};

@ -1204,21 +1204,21 @@ const syncSecretsRailway = async ({
}
`;
const input = {
projectId: integration.appId,
environmentId: integration.targetEnvironmentId,
...(integration.targetServiceId ? { serviceId: integration.targetServiceId } : {}),
replace: true,
variables: getSecretKeyValuePair(secrets)
const variables = {
input: {
projectId: integration.appId,
environmentId: integration.targetEnvironmentId,
...(integration.targetServiceId ? { serviceId: integration.targetServiceId } : {}),
replace: true,
variables: getSecretKeyValuePair(secrets)
}
};
await request.post(
IntegrationUrls.RAILWAY_API_URL,
{
query,
variables: {
input
}
variables
},
{
headers: {

@ -23,7 +23,7 @@ Our goal is to deploy an Nginx instance in your Docker Swarm cluster, configured
</Step>
<Step title="Setting Up Authentication with Infisical">
To allow the Infisical agent to your Infisical secrets, choose an authentication method for the agent. For this guide, we will use [Universal Auth](/documentation/platform/identities/universal-auth) for authentication. Follow the instructions [here](/documentation/platform/identities/universal-auth) to generate a client ID and client secret.
To allow the agent to fetch your Infisical secrets, choose an authentication method for the agent. For this guide, we will use [Universal Auth](/documentation/platform/identities/universal-auth) for authentication. Follow the instructions [here](/documentation/platform/identities/universal-auth) to generate a client ID and client secret.
</Step>
<Step title="Entering Universal Auth Credentials">
@ -161,4 +161,4 @@ Our goal is to deploy an Nginx instance in your Docker Swarm cluster, configured
## Considerations
- Secret Updates: Applications that access secrets directly from the volume mount will receive updates in real-time, in accordance with the `polling-interval` set in agent config.
- In-Memory Secrets: If your application loads secrets into memory, the new secrets will be available to the application on the next deployment.
- In-Memory Secrets: If your application loads secrets into memory, the new secrets will be available to the application on the next deployment.

@ -74,16 +74,6 @@ export default function RailwayCreateIntegrationPage() {
}
}, [targetEnvironments]);
useEffect(() => {
if (targetServices) {
if (targetServices.length > 0) {
setTargetServiceId(targetServices[0].serviceId);
} else {
setTargetServiceId("none");
}
}
}, [targetServices]);
const handleButtonClick = async () => {
try {
setIsLoading(true);
@ -124,11 +114,14 @@ export default function RailwayCreateIntegrationPage() {
}
};
const filteredTargetServices = targetServices ? [ { name: "", serviceId: "none" }, ...targetServices ] : [ { name: "", serviceId: "none" } ];
return workspace &&
selectedSourceEnvironment &&
integrationAuthApps &&
targetEnvironments &&
targetServices ? (
targetServices &&
filteredTargetServices ? (
<div className="flex h-full w-full items-center justify-center">
<Card className="max-w-md rounded-md p-8">
<CardTitle className="text-center">Railway Integration</CardTitle>
@ -208,20 +201,14 @@ export default function RailwayCreateIntegrationPage() {
className="w-full border border-mineshaft-500"
isDisabled={targetServices.length === 0}
>
{targetServices.length > 0 ? (
targetServices.map((targetService) => (
{filteredTargetServices.map((targetService) => (
<SelectItem
value={targetService.serviceId as string}
key={`target-service-${targetService.serviceId as string}`}
>
{targetService.name}
</SelectItem>
))
) : (
<SelectItem value="none" key="target-service-none">
No services found
</SelectItem>
)}
))}
</Select>
</FormControl>
<Button