[chore] Update setup.sh, with removed replacement script & added project-level ENVs (#2115)
* chore: Updated Setup Script for Splitting Env File * chore: updated dockerfile for using inproject env varaibles * chore: removed husky replacement script * chore: updated shell script using sed * chore: updated dockerfiles with removed cp statement * chore: added example env for apiserver * chore: refactored secret generation for backend * chore: removed replacement script * chore: updated docker-compose with removed env variables * chore: resolved comments in setup.sh and docker-compose * chore: removed secret key placeholder in apiserver example env * chore: updated root env for project less env variables * chore: removed project level env update from root env logic * chore: updated API_BASE_URL in .env.example * chore: restored docker argument as env NEXT_PUBLIC_API_BASE_URL * chore: added pg missing env variables * [chore] Updated web and deploy backend configuration for reverse proxy & decoupled Plane Deploy URL generation for web (#2135) * chore: removed api url build arg from compose * chore: set public api default argument to black string for self hosted * chore: updated web services to accept blank string as API URL * chore: added env variables for pg compose service * chore: modified space app services to use accept empty string as api base * chore: conditionally trigger web url value based on argument * fix: made web to use identical host with spaces suffix on absense of Deploy URL for deploy * chore: added example env for PUBLIC_DEPLOY Env * chore: updated web dockerfile with addition as PLANE_DEPLOY Argument * API BASE URL global update * API BASE URL replace with api server * api base url fixes * typo fixes --------- Co-authored-by: sriram veeraghanta <veeraghanta.sriram@gmail.com> * dev: remove API_BASE_URL from environment variable --------- Co-authored-by: sriram veeraghanta <veeraghanta.sriram@gmail.com> Co-authored-by: pablohashescobar <nikhilschacko@gmail.com>
This commit is contained in:
parent
af73bbe718
commit
d0f6ca3bac
43 changed files with 179 additions and 286 deletions
|
|
@ -1,18 +1,16 @@
|
|||
// services
|
||||
import APIService from "services/api.service";
|
||||
import trackEventServices from "services/track-event.service";
|
||||
|
||||
// types
|
||||
import { ICurrentUserResponse, IGptResponse } from "types";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
// helpers
|
||||
import { API_BASE_URL } from "helpers/common.helper";
|
||||
|
||||
const trackEvent =
|
||||
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";
|
||||
|
||||
class AiServices extends APIService {
|
||||
constructor() {
|
||||
super(NEXT_PUBLIC_API_BASE_URL || "http://localhost:8000");
|
||||
super(API_BASE_URL);
|
||||
}
|
||||
|
||||
async createGptTask(
|
||||
|
|
|
|||
|
|
@ -8,12 +8,11 @@ import {
|
|||
IExportAnalyticsFormData,
|
||||
ISaveAnalyticsFormData,
|
||||
} from "types";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import { API_BASE_URL } from "helpers/common.helper";
|
||||
|
||||
class AnalyticsServices extends APIService {
|
||||
constructor() {
|
||||
super(NEXT_PUBLIC_API_BASE_URL || "http://localhost:8000");
|
||||
super(API_BASE_URL);
|
||||
}
|
||||
|
||||
async getAnalytics(workspaceSlug: string, params: IAnalyticsParams): Promise<IAnalyticsResponse> {
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
// services
|
||||
import axios from "axios";
|
||||
import APIService from "services/api.service";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import { API_BASE_URL } from "helpers/common.helper";
|
||||
|
||||
class AppInstallationsService extends APIService {
|
||||
constructor() {
|
||||
super(NEXT_PUBLIC_API_BASE_URL || "http://localhost:8000");
|
||||
super(API_BASE_URL);
|
||||
}
|
||||
|
||||
async addInstallationApp(workspaceSlug: string, provider: string, data: any): Promise<any> {
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
// services
|
||||
import APIService from "services/api.service";
|
||||
import { ICurrentUserResponse } from "types";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import { API_BASE_URL } from "helpers/common.helper";
|
||||
|
||||
class AuthService extends APIService {
|
||||
constructor() {
|
||||
super(NEXT_PUBLIC_API_BASE_URL || "http://localhost:8000");
|
||||
super(API_BASE_URL);
|
||||
}
|
||||
|
||||
async emailLogin(data: any) {
|
||||
|
|
|
|||
|
|
@ -1,18 +1,16 @@
|
|||
// services
|
||||
import APIService from "services/api.service";
|
||||
import trackEventServices from "services/track-event.service";
|
||||
|
||||
// types
|
||||
import type { CycleDateCheckData, ICurrentUserResponse, ICycle, IIssue } from "types";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import { API_BASE_URL } from "helpers/common.helper";
|
||||
|
||||
const trackEvent =
|
||||
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";
|
||||
|
||||
class ProjectCycleServices extends APIService {
|
||||
constructor() {
|
||||
super(NEXT_PUBLIC_API_BASE_URL || "http://localhost:8000");
|
||||
super(API_BASE_URL);
|
||||
}
|
||||
|
||||
async createCycle(
|
||||
|
|
|
|||
|
|
@ -3,15 +3,14 @@ import APIService from "services/api.service";
|
|||
// types
|
||||
import type { ICurrentUserResponse, IEstimate, IEstimateFormData } from "types";
|
||||
import trackEventServices from "services/track-event.service";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import { API_BASE_URL } from "helpers/common.helper";
|
||||
|
||||
const trackEvent =
|
||||
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";
|
||||
|
||||
class ProjectEstimateServices extends APIService {
|
||||
constructor() {
|
||||
super(NEXT_PUBLIC_API_BASE_URL || "http://localhost:8000");
|
||||
super(API_BASE_URL);
|
||||
}
|
||||
|
||||
async createEstimate(
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
// services
|
||||
import APIService from "services/api.service";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import { API_BASE_URL } from "helpers/common.helper";
|
||||
|
||||
interface UnSplashImage {
|
||||
id: string;
|
||||
|
|
@ -29,7 +28,7 @@ interface UnSplashImageUrls {
|
|||
|
||||
class FileServices extends APIService {
|
||||
constructor() {
|
||||
super(NEXT_PUBLIC_API_BASE_URL || "http://localhost:8000");
|
||||
super(API_BASE_URL);
|
||||
}
|
||||
|
||||
async uploadFile(workspaceSlug: string, file: FormData): Promise<any> {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import APIService from "services/api.service";
|
||||
import trackEventServices from "services/track-event.service";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import { API_BASE_URL } from "helpers/common.helper";
|
||||
|
||||
const trackEvent =
|
||||
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";
|
||||
|
|
@ -19,7 +18,7 @@ import type {
|
|||
|
||||
class InboxServices extends APIService {
|
||||
constructor() {
|
||||
super(NEXT_PUBLIC_API_BASE_URL || "http://localhost:8000");
|
||||
super(API_BASE_URL);
|
||||
}
|
||||
|
||||
async getInboxes(workspaceSlug: string, projectId: string): Promise<IInbox[]> {
|
||||
|
|
|
|||
|
|
@ -1,16 +1,14 @@
|
|||
import APIService from "services/api.service";
|
||||
import trackEventServices from "services/track-event.service";
|
||||
|
||||
import { ICurrentUserResponse } from "types";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import { API_BASE_URL } from "helpers/common.helper";
|
||||
|
||||
const trackEvent =
|
||||
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";
|
||||
|
||||
class CSVIntegrationService extends APIService {
|
||||
constructor() {
|
||||
super(NEXT_PUBLIC_API_BASE_URL || "http://localhost:8000");
|
||||
super(API_BASE_URL);
|
||||
}
|
||||
|
||||
async exportCSVService(
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import APIService from "services/api.service";
|
||||
import trackEventServices from "services/track-event.service";
|
||||
import { API_BASE_URL } from "helpers/common.helper";
|
||||
|
||||
import { ICurrentUserResponse, IGithubRepoInfo, IGithubServiceImportFormData } from "types";
|
||||
|
||||
|
|
@ -11,7 +12,7 @@ const trackEvent =
|
|||
const integrationServiceType: string = "github";
|
||||
class GithubIntegrationService extends APIService {
|
||||
constructor() {
|
||||
super(NEXT_PUBLIC_API_BASE_URL || "http://localhost:8000");
|
||||
super(API_BASE_URL);
|
||||
}
|
||||
|
||||
async listAllRepositories(workspaceSlug: string, integrationSlug: string): Promise<any> {
|
||||
|
|
|
|||
|
|
@ -9,15 +9,14 @@ import {
|
|||
IWorkspaceIntegration,
|
||||
IExportServiceResponse,
|
||||
} from "types";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import { API_BASE_URL } from "helpers/common.helper";
|
||||
|
||||
const trackEvent =
|
||||
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";
|
||||
|
||||
class IntegrationService extends APIService {
|
||||
constructor() {
|
||||
super(NEXT_PUBLIC_API_BASE_URL || "http://localhost:8000");
|
||||
super(API_BASE_URL);
|
||||
}
|
||||
|
||||
async getAppIntegrationsList(): Promise<IAppIntegration[]> {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import APIService from "services/api.service";
|
||||
import trackEventServices from "services/track-event.service";
|
||||
|
||||
import { API_BASE_URL } from "helpers/common.helper";
|
||||
// types
|
||||
import { IJiraMetadata, IJiraResponse, IJiraImporterForm, ICurrentUserResponse } from "types";
|
||||
|
||||
|
|
@ -11,7 +11,7 @@ const trackEvent =
|
|||
|
||||
class JiraImportedService extends APIService {
|
||||
constructor() {
|
||||
super(NEXT_PUBLIC_API_BASE_URL || "http://localhost:8000");
|
||||
super(API_BASE_URL);
|
||||
}
|
||||
|
||||
async getJiraProjectInfo(workspaceSlug: string, params: IJiraMetadata): Promise<IJiraResponse> {
|
||||
|
|
|
|||
|
|
@ -10,15 +10,14 @@ import type {
|
|||
IIssueLabels,
|
||||
ISubIssueResponse,
|
||||
} from "types";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import { API_BASE_URL } from "helpers/common.helper";
|
||||
|
||||
const trackEvent =
|
||||
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";
|
||||
|
||||
class ProjectIssuesServices extends APIService {
|
||||
constructor() {
|
||||
super(NEXT_PUBLIC_API_BASE_URL || "http://localhost:8000");
|
||||
super(API_BASE_URL);
|
||||
}
|
||||
|
||||
async createIssues(
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
// services
|
||||
import APIService from "services/api.service";
|
||||
import trackEventServices from "./track-event.service";
|
||||
|
||||
// types
|
||||
import type { IModule, IIssue, ICurrentUserResponse } from "types";
|
||||
import type { IIssueViewOptions, IModule, IIssue, ICurrentUserResponse } from "types";
|
||||
import { API_BASE_URL } from "helpers/common.helper";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
|
||||
|
|
@ -12,7 +12,7 @@ const trackEvent =
|
|||
|
||||
class ProjectIssuesServices extends APIService {
|
||||
constructor() {
|
||||
super(NEXT_PUBLIC_API_BASE_URL || "http://localhost:8000");
|
||||
super(API_BASE_URL);
|
||||
}
|
||||
|
||||
async getModules(workspaceSlug: string, projectId: string): Promise<IModule[]> {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
// services
|
||||
import APIService from "services/api.service";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
|
||||
// types
|
||||
import type {
|
||||
IUserNotification,
|
||||
|
|
@ -11,10 +8,12 @@ import type {
|
|||
PaginatedUserNotification,
|
||||
IMarkAllAsReadPayload,
|
||||
} from "types";
|
||||
// helpers
|
||||
import { API_BASE_URL } from "helpers/common.helper";
|
||||
|
||||
class UserNotificationsServices extends APIService {
|
||||
constructor() {
|
||||
super(NEXT_PUBLIC_API_BASE_URL || "http://localhost:8000");
|
||||
super(API_BASE_URL);
|
||||
}
|
||||
|
||||
async getUserNotifications(
|
||||
|
|
|
|||
|
|
@ -1,18 +1,16 @@
|
|||
import { API_BASE_URL } from "helpers/common.helper";
|
||||
// services
|
||||
import APIService from "services/api.service";
|
||||
import trackEventServices from "services/track-event.service";
|
||||
|
||||
// types
|
||||
import { IPage, IPageBlock, RecentPagesResponse, IIssue, ICurrentUserResponse } from "types";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
|
||||
const trackEvent =
|
||||
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";
|
||||
|
||||
class PageServices extends APIService {
|
||||
constructor() {
|
||||
super(NEXT_PUBLIC_API_BASE_URL || "http://localhost:8000");
|
||||
super(API_BASE_URL);
|
||||
}
|
||||
|
||||
async createPage(
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { API_BASE_URL } from "helpers/common.helper";
|
||||
// services
|
||||
import APIService from "services/api.service";
|
||||
import trackEventServices from "services/track-event.service";
|
||||
|
|
@ -5,14 +6,12 @@ import trackEventServices from "services/track-event.service";
|
|||
import { ICurrentUserResponse } from "types";
|
||||
import { IProjectPublishSettings } from "store/project-publish";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
|
||||
const trackEvent =
|
||||
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";
|
||||
|
||||
class ProjectServices extends APIService {
|
||||
constructor() {
|
||||
super(NEXT_PUBLIC_API_BASE_URL || "http://localhost:8000");
|
||||
super(API_BASE_URL);
|
||||
}
|
||||
|
||||
async getProjectSettingsAsync(
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { API_BASE_URL } from "helpers/common.helper";
|
||||
// services
|
||||
import APIService from "services/api.service";
|
||||
import trackEventServices from "services/track-event.service";
|
||||
|
||||
// types
|
||||
import type {
|
||||
GithubRepositoriesResponse,
|
||||
|
|
@ -16,14 +16,12 @@ import type {
|
|||
TProjectIssuesSearchParams,
|
||||
} from "types";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
|
||||
const trackEvent =
|
||||
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";
|
||||
|
||||
export class ProjectServices extends APIService {
|
||||
constructor() {
|
||||
super(NEXT_PUBLIC_API_BASE_URL || "http://localhost:8000");
|
||||
super(API_BASE_URL);
|
||||
}
|
||||
|
||||
async createProject(
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { API_BASE_URL } from "helpers/common.helper";
|
||||
// services
|
||||
import APIService from "services/api.service";
|
||||
import trackEventServices from "services/track-event.service";
|
||||
|
||||
// types
|
||||
import type {
|
||||
ICurrentUserResponse,
|
||||
|
|
@ -11,14 +11,12 @@ import type {
|
|||
IssueCommentReactionForm,
|
||||
} from "types";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
|
||||
const trackEvent =
|
||||
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";
|
||||
|
||||
class ReactionService extends APIService {
|
||||
constructor() {
|
||||
super(NEXT_PUBLIC_API_BASE_URL || "http://localhost:8000");
|
||||
super(API_BASE_URL);
|
||||
}
|
||||
|
||||
async createIssueReaction(
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
// services
|
||||
import APIService from "services/api.service";
|
||||
import trackEventServices from "services/track-event.service";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
// helpers
|
||||
import { API_BASE_URL } from "helpers/common.helper";
|
||||
|
||||
const trackEvent =
|
||||
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";
|
||||
|
|
@ -12,7 +12,7 @@ import type { ICurrentUserResponse, IState, IStateResponse } from "types";
|
|||
|
||||
class ProjectStateServices extends APIService {
|
||||
constructor() {
|
||||
super(NEXT_PUBLIC_API_BASE_URL || "http://localhost:8000");
|
||||
super(API_BASE_URL);
|
||||
}
|
||||
|
||||
async createState(
|
||||
|
|
|
|||
|
|
@ -12,14 +12,14 @@ import type {
|
|||
IUserWorkspaceDashboard,
|
||||
} from "types";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import { API_BASE_URL } from "helpers/common.helper";
|
||||
|
||||
const trackEvent =
|
||||
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";
|
||||
|
||||
class UserService extends APIService {
|
||||
constructor() {
|
||||
super(NEXT_PUBLIC_API_BASE_URL || "http://localhost:8000");
|
||||
super(API_BASE_URL);
|
||||
}
|
||||
|
||||
currentUserConfig() {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ import { ICurrentUserResponse } from "types";
|
|||
// types
|
||||
import { IView } from "types/views";
|
||||
|
||||
import { API_BASE_URL } from "helpers/common.helper";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
|
||||
const trackEvent =
|
||||
|
|
@ -13,7 +15,7 @@ const trackEvent =
|
|||
|
||||
class ViewServices extends APIService {
|
||||
constructor() {
|
||||
super(NEXT_PUBLIC_API_BASE_URL || "http://localhost:8000");
|
||||
super(API_BASE_URL);
|
||||
}
|
||||
|
||||
async createView(
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
// services
|
||||
import APIService from "services/api.service";
|
||||
import trackEventServices from "services/track-event.service";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
|
||||
// helpers
|
||||
import { API_BASE_URL } from "helpers/common.helper";
|
||||
// types
|
||||
import {
|
||||
IWorkspace,
|
||||
|
|
@ -22,7 +21,7 @@ const trackEvent =
|
|||
|
||||
class WorkspaceService extends APIService {
|
||||
constructor() {
|
||||
super(NEXT_PUBLIC_API_BASE_URL || "http://localhost:8000");
|
||||
super(API_BASE_URL);
|
||||
}
|
||||
|
||||
async userWorkspaces(): Promise<IWorkspace[]> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue