mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-08-17 21:25:54 +02:00
feat: update official docker images
This commit is contained in:
+1
-1
@@ -7,7 +7,7 @@ PUBLIC_URL=http://localhost:3000
|
||||
# Set it to true if you want to generate the Sourcemap for debugging
|
||||
GENERATE_SOURCEMAP=false
|
||||
# Set it to the URL from where APIs will be accessible, for local development it should be localhost:3000/api/app (use your local port number instead)
|
||||
REACT_APP_SERVERURL=http://localhost:8080/app
|
||||
# REACT_APP_SERVERURL=http://localhost:8080/app
|
||||
# A 12 character long random app identifier. The value of this should be same as APP_ID which is a variable used by backend API.
|
||||
REACT_APP_APPID=opensign
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ name: ci
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'staging'
|
||||
- 'docker_beta'
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{$HOST} {
|
||||
reverse_proxy client:3000
|
||||
handle_path /app/* {
|
||||
reverse_proxy server:8080
|
||||
rewrite * /app{uri}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
build:
|
||||
@echo "Building with HOST=${HOST}"
|
||||
cp .env.local_dev .env
|
||||
cd apps/OpenSign && cp ../../.env.local_dev .env && npm install && npm run build
|
||||
docker compose up --build --force-recreate
|
||||
HOST=${HOST} docker compose up --build --force-recreate
|
||||
|
||||
run:
|
||||
cp .env.local_dev .env
|
||||
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -20,6 +20,7 @@ import SSOVerify from "./pages/SSOVerify";
|
||||
import Loader from "./primitives/Loader";
|
||||
import TeamList from "./pages/TeamList";
|
||||
import UserList from "./pages/UserList";
|
||||
import { serverUrl_fn } from "./constant/appinfo";
|
||||
const DebugPdf = lazy(() => import("./pages/DebugPdf"));
|
||||
const ForgetPassword = lazy(() => import("./pages/ForgetPassword"));
|
||||
const GuestLogin = lazy(() => import("./pages/GuestLogin"));
|
||||
@@ -53,9 +54,7 @@ function App() {
|
||||
const appId = process.env.REACT_APP_APPID
|
||||
? process.env.REACT_APP_APPID
|
||||
: "opensign";
|
||||
const baseurl = process.env.REACT_APP_SERVERURL
|
||||
? process.env.REACT_APP_SERVERURL
|
||||
: window.location.origin + "/api/app";
|
||||
const baseurl = serverUrl_fn();
|
||||
try {
|
||||
localStorage.setItem("baseUrl", `${baseurl}/`);
|
||||
localStorage.setItem("parseAppId", appId);
|
||||
|
||||
@@ -1,10 +1,23 @@
|
||||
import logo from "../assets/images/logo.png";
|
||||
import { isEnableSubscription } from "./const";
|
||||
|
||||
export function serverUrl_fn() {
|
||||
let baseUrl;
|
||||
if (isEnableSubscription) {
|
||||
baseUrl = process.env.REACT_APP_SERVERURL
|
||||
? process.env.REACT_APP_SERVERURL
|
||||
: window.location.origin + "/api/app";
|
||||
} else {
|
||||
baseUrl = process.env.REACT_APP_SERVERURL
|
||||
? process.env.REACT_APP_SERVERURL
|
||||
: window.location.origin + "/app";
|
||||
}
|
||||
return baseUrl;
|
||||
}
|
||||
export const appInfo = {
|
||||
applogo: logo,
|
||||
appId: process.env.REACT_APP_APPID ? process.env.REACT_APP_APPID : "opensign",
|
||||
baseUrl: process.env.REACT_APP_SERVERURL
|
||||
? process.env.REACT_APP_SERVERURL
|
||||
: window.location.origin + "/api/app",
|
||||
baseUrl: serverUrl_fn(),
|
||||
defaultRole: "contracts_User",
|
||||
fbAppId: process.env.REACT_APP_FBAPPID
|
||||
? `${process.env.REACT_APP_FBAPPID}`
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import axios from "axios";
|
||||
import { serverUrl_fn } from "./appinfo";
|
||||
const parseAppId = process.env.REACT_APP_APPID
|
||||
? process.env.REACT_APP_APPID
|
||||
: "opensign";
|
||||
const serverUrl = process.env.REACT_APP_SERVERURL
|
||||
? process.env.REACT_APP_SERVERURL
|
||||
: window.location.origin + "/api/app";
|
||||
|
||||
const serverUrl = serverUrl_fn()
|
||||
export const SaveFileSize = async (size, imageUrl, tenantId) => {
|
||||
//checking server url and save file's size
|
||||
const tenantPtr = {
|
||||
|
||||
@@ -16,13 +16,12 @@ import {
|
||||
import DragElement from "./components/pdf/DragElement";
|
||||
import TagManager from "react-gtm-module";
|
||||
import Parse from "parse";
|
||||
import './polyfills'
|
||||
import "./polyfills";
|
||||
import { serverUrl_fn } from "./constant/appinfo";
|
||||
const appId = process.env.REACT_APP_APPID
|
||||
? process.env.REACT_APP_APPID
|
||||
: "opensign";
|
||||
const serverUrl = process.env.REACT_APP_SERVERURL
|
||||
? process.env.REACT_APP_SERVERURL
|
||||
: window.location.origin + "/api/app";
|
||||
const serverUrl = serverUrl_fn();
|
||||
Parse.initialize(appId);
|
||||
Parse.serverURL = serverUrl;
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ import BulkSendUi from "../components/BulkSendUi";
|
||||
import Loader from "./Loader";
|
||||
import Select from "react-select";
|
||||
import SubscribeCard from "./SubscribeCard";
|
||||
import { serverUrl_fn } from "../constant/appinfo";
|
||||
|
||||
const ReportTable = (props) => {
|
||||
const navigate = useNavigate();
|
||||
@@ -393,9 +394,7 @@ const ReportTable = (props) => {
|
||||
Templates: "contracts_Template"
|
||||
};
|
||||
try {
|
||||
const serverUrl = process.env.REACT_APP_SERVERURL
|
||||
? process.env.REACT_APP_SERVERURL
|
||||
: window.location.origin + "/api/app";
|
||||
const serverUrl = serverUrl_fn()
|
||||
const cls = clsObj[props.ReportName] || "contracts_Document";
|
||||
const url = serverUrl + `/classes/${cls}/`;
|
||||
const body =
|
||||
|
||||
@@ -28,7 +28,7 @@ const refreshAccessToken = async refreshToken => {
|
||||
|
||||
// Function to create a raw email message
|
||||
const makeEmail = async (to, from, subject, html, url, pdfName) => {
|
||||
const protocol = new URL(process.env.SERVER_URL);
|
||||
const publicUrl = new URL(process.env.SERVER_URL);
|
||||
const htmlContent = html;
|
||||
const boundary = 'boundary_' + Date.now().toString(16);
|
||||
let str;
|
||||
@@ -37,7 +37,7 @@ const makeEmail = async (to, from, subject, html, url, pdfName) => {
|
||||
let Pdf = fs.createWriteStream('test.pdf');
|
||||
const writeToLocalDisk = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (useLocal !== 'true' && protocol.hostname !== 'localhost') {
|
||||
if (useLocal !== 'true' && publicUrl.protocol !== 'http:') {
|
||||
https.get(url, async function (response) {
|
||||
response.pipe(Pdf);
|
||||
response.on('end', () => resolve('success'));
|
||||
|
||||
@@ -7,7 +7,8 @@ import { smtpenable, smtpsecure, updateMailCount, useLocal } from '../../Utils.j
|
||||
import sendMailGmailProvider from './sendMailGmailProvider.js';
|
||||
import { createTransport } from 'nodemailer';
|
||||
async function sendMailProvider(req) {
|
||||
const protocol = new URL(process.env.SERVER_URL);
|
||||
const publicUrl = new URL(process.env.SERVER_URL);
|
||||
const mailgunApiKey = process.env.MAILGUN_API_KEY;
|
||||
try {
|
||||
let transporterSMTP;
|
||||
let mailgunClient;
|
||||
@@ -23,18 +24,17 @@ async function sendMailProvider(req) {
|
||||
},
|
||||
});
|
||||
} else {
|
||||
const mailgun = new Mailgun(formData);
|
||||
mailgunClient = mailgun.client({
|
||||
username: 'api',
|
||||
key: process.env.MAILGUN_API_KEY,
|
||||
});
|
||||
mailgunDomain = process.env.MAILGUN_DOMAIN;
|
||||
if (mailgunApiKey) {
|
||||
const mailgun = new Mailgun(formData);
|
||||
mailgunClient = mailgun.client({ username: 'api', key: mailgunApiKey });
|
||||
mailgunDomain = process.env.MAILGUN_DOMAIN;
|
||||
}
|
||||
}
|
||||
if (req.params.url) {
|
||||
let Pdf = fs.createWriteStream('test.pdf');
|
||||
const writeToLocalDisk = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (useLocal !== 'true' && protocol.hostname !== 'localhost') {
|
||||
if (useLocal !== 'true' && publicUrl.protocol !== 'http:') {
|
||||
https.get(req.params.url, async function (response) {
|
||||
response.pipe(Pdf);
|
||||
response.on('end', () => resolve('success'));
|
||||
@@ -108,20 +108,27 @@ async function sendMailProvider(req) {
|
||||
return { status: 'success' };
|
||||
}
|
||||
} else {
|
||||
const res = await mailgunClient.messages.create(mailgunDomain, messageParams);
|
||||
console.log('Res ', res);
|
||||
if (res.status === 200) {
|
||||
if (req.params?.extUserId) {
|
||||
await updateMailCount(req.params.extUserId);
|
||||
if (mailgunApiKey) {
|
||||
const res = await mailgunClient.messages.create(mailgunDomain, messageParams);
|
||||
console.log('Res ', res);
|
||||
if (res.status === 200) {
|
||||
if (req.params?.extUserId) {
|
||||
await updateMailCount(req.params.extUserId);
|
||||
}
|
||||
try {
|
||||
fs.unlinkSync('./exports/certificate.pdf');
|
||||
} catch (err) {
|
||||
console.log('Err in unlink certificate sendmailv3');
|
||||
}
|
||||
return { status: 'success' };
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
fs.unlinkSync('./exports/certificate.pdf');
|
||||
} catch (err) {
|
||||
console.log('Err in unlink certificate sendmailv3');
|
||||
}
|
||||
return {
|
||||
status: 'success',
|
||||
};
|
||||
return { status: 'error' };
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -147,13 +154,17 @@ async function sendMailProvider(req) {
|
||||
return { status: 'success' };
|
||||
}
|
||||
} else {
|
||||
const res = await mailgunClient.messages.create(mailgunDomain, messageParams);
|
||||
console.log('Res ', res);
|
||||
if (res.status === 200) {
|
||||
if (req.params?.extUserId) {
|
||||
await updateMailCount(req.params.extUserId);
|
||||
if (mailgunApiKey) {
|
||||
const res = await mailgunClient.messages.create(mailgunDomain, messageParams);
|
||||
console.log('Res ', res);
|
||||
if (res.status === 200) {
|
||||
if (req.params?.extUserId) {
|
||||
await updateMailCount(req.params.extUserId);
|
||||
}
|
||||
return { status: 'success' };
|
||||
}
|
||||
return { status: 'success' };
|
||||
} else {
|
||||
return { status: 'error' };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ export const config = {
|
||||
cloud: function () {
|
||||
import('./cloud/main.js');
|
||||
},
|
||||
appId: process.env.APP_ID || 'myAppId',
|
||||
appId: process.env.APP_ID || 'opensign',
|
||||
logLevel: ['error'],
|
||||
maxLimit: 500,
|
||||
maxUploadSize: '30mb',
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
FROM mongo:latest
|
||||
|
||||
# Create a directory to host initialization scripts
|
||||
RUN mkdir -p /docker-entrypoint-initdb.d
|
||||
# RUN mkdir -p /docker-entrypoint-initdb.d
|
||||
|
||||
# Copy default data JSON files to the initialization directory
|
||||
# COPY ./default-data/*.json /docker-entrypoint-initdb.d/
|
||||
|
||||
+27
-30
@@ -1,31 +1,20 @@
|
||||
version: '3.7'
|
||||
|
||||
services:
|
||||
server:
|
||||
build:
|
||||
context: ./apps/OpenSignServer
|
||||
dockerfile: Dockerfile
|
||||
image: opensignserver-image
|
||||
image: opensign/opensignserver:staging
|
||||
container_name: OpenSignServer-container
|
||||
command: /usr/src/app/node_modules/.bin/nodemon server.js
|
||||
volumes:
|
||||
- ./apps/OpenSignServer/:/usr/src/app
|
||||
- /usr/src/app/node_modules
|
||||
ports:
|
||||
- "8080:8080"
|
||||
depends_on:
|
||||
- mongo
|
||||
env_file: .env
|
||||
environment:
|
||||
- NODE_ENV=development
|
||||
- NODE_ENV=production
|
||||
- SERVER_URL=${HOST:-https://localhost:3001/app}
|
||||
networks:
|
||||
- app-network
|
||||
mongo:
|
||||
build:
|
||||
context: ./apps/mongo
|
||||
dockerfile: Dockerfile
|
||||
image: mongo:latest
|
||||
container_name: mongo-container
|
||||
image: opensign-mongo
|
||||
volumes:
|
||||
- data-volume:/data/db
|
||||
ports:
|
||||
@@ -33,29 +22,37 @@ services:
|
||||
networks:
|
||||
- app-network
|
||||
client:
|
||||
build:
|
||||
context: ./apps/OpenSign
|
||||
dockerfile: Dockerfile
|
||||
image: opensign-image
|
||||
image: opensign/opensign:staging
|
||||
container_name: OpenSign-container
|
||||
command: npm start
|
||||
env_file: .env
|
||||
volumes:
|
||||
- ./apps/OpenSign/:/usr/app
|
||||
- /usr/app/node_modules
|
||||
depends_on:
|
||||
- server
|
||||
ports:
|
||||
- "3000:3000"
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
caddy:
|
||||
image: caddy:latest
|
||||
container_name: caddy-container
|
||||
ports:
|
||||
- "3001:3001"
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
- "443:443/udp"
|
||||
volumes:
|
||||
- ./Caddyfile:/etc/caddy/Caddyfile
|
||||
- caddy_data:/data
|
||||
- caddy_config:/config
|
||||
networks:
|
||||
- app-network
|
||||
environment:
|
||||
- HOST=${HOST:-localhost:3001}
|
||||
networks:
|
||||
app-network:
|
||||
driver: bridge
|
||||
app-network:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
data-volume:
|
||||
node_modules:
|
||||
web-root:
|
||||
driver: local
|
||||
data-volume:
|
||||
web-root:
|
||||
caddy_data:
|
||||
caddy_config:
|
||||
|
||||
Reference in New Issue
Block a user