Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
92527e5
chore(deps): bump @babel/traverse in /microfrontends/SignDocuments
dependabot[bot] Dec 15, 2023
b57e17c
chore(deps): bump the npm_and_yarn group group
dependabot[bot] Dec 27, 2023
288365b
chore(deps): bump parse in /microfrontends/SignDocuments
dependabot[bot] Dec 27, 2023
07a5796
build(deps-dev): bump @babel/runtime-corejs2 in /apps/OpenSign
dependabot[bot] Jan 29, 2024
ca17f1c
chore(deps): bump react-pdf in /microfrontends/SignDocuments
dependabot[bot] Feb 1, 2024
db4b5f0
build(deps-dev): bump postcss from 8.4.31 to 8.4.35 in /apps/OpenSign
dependabot[bot] Feb 12, 2024
dbeb513
Merge pull request #262 from OpenSignLabs/dependabot/npm_and_yarn/mic…
prafull-opensignlabs Feb 22, 2024
74e275c
Merge pull request #266 from OpenSignLabs/dependabot/npm_and_yarn/mic…
prafull-opensignlabs Feb 22, 2024
cb10137
build(deps): bump @react-pdf/renderer in /microfrontends/SignDocuments
dependabot[bot] Feb 22, 2024
3f16e97
Merge pull request #325 from OpenSignLabs/dependabot/npm_and_yarn/mic…
prafull-opensignlabs Feb 22, 2024
a3fd738
Merge pull request #390 from OpenSignLabs/dependabot/npm_and_yarn/app…
prafull-opensignlabs Feb 22, 2024
c581222
build(deps-dev): bump lint-staged in /apps/OpenSign
dependabot[bot] Feb 22, 2024
f3f79ed
refactor: remove openai pacakge
prafull-opensignlabs Feb 22, 2024
20d37e1
Merge pull request #416 from OpenSignLabs/remove_openai
nxglabs Feb 22, 2024
740d2e5
build(deps): bump the npm_and_yarn group across 3 directories with 9 …
dependabot[bot] Feb 22, 2024
f31023e
Merge pull request #415 from OpenSignLabs/dependabot/npm_and_yarn/app…
prafull-opensignlabs Feb 22, 2024
8dd5e90
build(deps): bump mongoose from 7.2.1 to 8.1.3 in /apps/OpenSignServer
dependabot[bot] Feb 22, 2024
86df98a
build(deps): bump axios from 1.3.5 to 1.6.7 in /apps/OpenSignServer
dependabot[bot] Feb 22, 2024
47150cc
Merge pull request #361 from OpenSignLabs/dependabot/npm_and_yarn/app…
prafull-opensignlabs Feb 22, 2024
ede0eea
Merge pull request #291 from OpenSignLabs/dependabot/npm_and_yarn/mic…
prafull-opensignlabs Feb 22, 2024
bb849f1
Merge pull request #358 from OpenSignLabs/dependabot/npm_and_yarn/app…
prafull-opensignlabs Feb 22, 2024
569c7f4
refactor: update jwt-decode package
prafull-opensignlabs Feb 22, 2024
01aee7c
Merge pull request #417 from OpenSignLabs/remove_openai
nxglabs Feb 22, 2024
ef5c20a
Merge pull request #389 from OpenSignLabs/dependabot/npm_and_yarn/app…
prafull-opensignlabs Feb 22, 2024
2581500
Merge pull request #405 from OpenSignLabs/dependabot/npm_and_yarn/app…
prafull-opensignlabs Feb 22, 2024
b9b329d
Merge pull request #388 from OpenSignLabs/dependabot/npm_and_yarn/mic…
prafull-opensignlabs Feb 22, 2024
de5b58f
Update .env.local_dev
prafull-opensignlabs Feb 22, 2024
26b54f0
Update INSTALLATION.md
prafull-opensignlabs Feb 22, 2024
8ad396d
Update INSTALLATION.md
prafull-opensignlabs Feb 22, 2024
a335d02
Update Docker.yml
prafull-opensignlabs Feb 22, 2024
351ed79
Merge pull request #420 from OpenSignLabs/prafull-opensignlabs-patch-3
nxglabs Feb 22, 2024
934823f
Merge pull request #419 from OpenSignLabs/prafull-opensignlabs-patch-2-1
nxglabs Feb 22, 2024
a283f2e
Merge pull request #418 from OpenSignLabs/prafull-opensignlabs-patch-2
andrew-opensignlabs Feb 22, 2024
3fab1d9
Update Docker.yml
prafull-opensignlabs Feb 22, 2024
5974515
Merge pull request #422 from OpenSignLabs/prafull-opensignlabs-patch-5
andrew-opensignlabs Feb 22, 2024
2a46b02
Update Docker.yml
prafull-opensignlabs Feb 22, 2024
1c7c3a4
Create Dockerhubfile
prafull-opensignlabs Feb 22, 2024
addc762
Create Dockerhubfile
prafull-opensignlabs Feb 22, 2024
5ec9d59
Update Dockerhubfile
prafull-opensignlabs Feb 22, 2024
666636d
Merge pull request #424 from OpenSignLabs/prafull-opensignlabs-patch-7
andrew-opensignlabs Feb 22, 2024
44b87f1
Merge pull request #423 from OpenSignLabs/prafull-opensignlabs-patch-6
andrew-opensignlabs Feb 22, 2024
134444c
chore: add build command for docker-hub
prafull-opensignlabs Feb 22, 2024
2a24d71
Update Dockerhubfile
prafull-opensignlabs Feb 22, 2024
9dbde43
Merge pull request #425 from OpenSignLabs/prafull-opensignlabs-patch-8
andrew-opensignlabs Feb 22, 2024
11ab37b
Update package.json
prafull-opensignlabs Feb 22, 2024
b8f32a6
Update Dockerhubfile
prafull-opensignlabs Feb 22, 2024
2e8d844
Merge pull request #426 from OpenSignLabs/prafull-opensignlabs-patch-9
andrew-opensignlabs Feb 22, 2024
cd68697
Update package.json
prafull-opensignlabs Feb 22, 2024
6f1a5fd
Update package.json
prafull-opensignlabs Feb 22, 2024
7cfca0a
Merge pull request #427 from OpenSignLabs/prafull-opensignlabs-patch-9
andrew-opensignlabs Feb 22, 2024
59fed8a
Update Dockerhubfile
prafull-opensignlabs Feb 22, 2024
2feee80
Merge pull request #428 from OpenSignLabs/prafull-opensignlabs-patch-9
andrew-opensignlabs Feb 22, 2024
ff4fb19
Update Dockerhubfile
prafull-opensignlabs Feb 22, 2024
41e192a
Update Dockerhubfile
prafull-opensignlabs Feb 22, 2024
a47dc8e
Update Dockerfile
prafull-opensignlabs Feb 22, 2024
564f57b
Update Dockerfile
prafull-opensignlabs Feb 22, 2024
ed88ae0
Merge pull request #429 from OpenSignLabs/prafull-opensignlabs-patch-9
andrew-opensignlabs Feb 23, 2024
b4c5b3c
fix: mount server app on /api for local development
prafull-opensignlabs Feb 23, 2024
f48444f
Merge pull request #431 from OpenSignLabs/fix_server_route
nxglabs Feb 23, 2024
523ea7f
Revert "fix: mount server app on /api for local development"
nxglabs Feb 23, 2024
692ec8e
Merge pull request #432 from OpenSignLabs/revert-431-fix_server_route
nxglabs Feb 23, 2024
71b06f9
Update Dockerhubfile
prafull-opensignlabs Feb 23, 2024
c55a8d0
Merge pull request #433 from OpenSignLabs/prafull-opensignlabs-patch-11
nxglabs Feb 23, 2024
6b9b2af
Update Dockerhubfile
prafull-opensignlabs Feb 23, 2024
58cd049
Merge pull request #434 from OpenSignLabs/prafull-opensignlabs-patch-2
nxglabs Feb 23, 2024
780c3f5
fix: file name is not visible in form for local development
prafull-opensignlabs Feb 28, 2024
4f417cc
Merge pull request #452 from OpenSignLabs/fix_filename_form
nxglabs Feb 28, 2024
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: 1 addition & 1 deletion .env.local_dev
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ SMTP_ENABLE=
SMTP_HOST=smtp.yourhost.com
SMTP_PORT=443
SMTP_USER_EMAIL=mailer@yourdomain.com
SMTP_PASS=password
SMTP_PASS=password # if your password includes spaces then write password in single quotes ('asdf pasd asdf bgds').


# Base64 encoded PFX or p12 document signing certificate file *********************************************************************************************************************
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/Docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: ci
on:
push:
branches:
- 'main'
- 'staging'

jobs:
docker:
Expand All @@ -11,9 +11,9 @@ jobs:
matrix:
include:
- image: amolshejole/OpenSign
dockerfile: apps/OpenSign/Dockerfile
dockerfile: apps/OpenSign/Dockerhubfile
- image: amolshejole/OpenSignServer
dockerfile: apps/OpenSignServer/Dockerfile
dockerfile: apps/OpenSignServer/Dockerhubfile
steps:
-
name: Checkout
Expand All @@ -31,8 +31,11 @@ jobs:
with:
images: ${{ matrix.image }}
-
name: Debug - List files
name: Debug - List files opensign
run: ls -R apps/OpenSign/ # Adjust the path as needed
-
name: Debug - List files opensignserver
run: ls -R apps/OpenSignServer/ # Adjust the path as needed
-
name: Build and push
uses: docker/build-push-action@v4
Expand Down
152 changes: 16 additions & 136 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
@@ -1,149 +1,29 @@

# INSTALLATON INSTRUCTIONS
# INSTALLATON INSTRUCTIONS HAS A NEW HOME

You can use our app as a cloud version from [OpenSignLabs](https://www.opensignlabs.com)
We've updated our installation instructions and moved them to our dedicated documentation portal to provide you with a better experience and updated guidance. Whether you're looking to self-host OpenSign™ or contribute to its development, you can find detailed instructions tailored to your needs at [docs.opensignlabs.com](https://docs.opensignlabs.com).

or follow below instructions to install it on your own infrastructure.
## Self Hosting

- Localhost(Frontend only)
- Digital Ocean
- Localhost(Docker)
If you're interested in self-hosting OpenSign™, our new documentation portal provides comprehensive, step-by-step instructions to help you set up OpenSign™ in your own environment. This section is designed for system administrators and those looking to deploy OpenSign™ within their organization or for personal use.

## Localhost(Frontend only)
- **Access Self Hosting Instructions:** [Self Hosting Guide](https://docs.opensignlabs.com/docs/category/docker)

This is the easiest way to run the frontend application for development or testing purpose without the hassle of installing backend & DB. All the features including document upload, signing, email notifications will work seamlessly from staging backend.
## Contributors

**Warning:** All data, including user accounts and documents, is stored in the staging backend. This data will be erased every time there is a merge to the main branch. As a result, you may need to recreate user accounts repeatedly. If you find that login attempts are failing, it is likely because the data has been cleared due to a recent merge.
For developers and contributors who are looking to build upon or contribute to OpenSign™, we've prepared a separate section that covers the setup, development environment configuration, and guidelines for contributing to the OpenSign™ project.

Below are the steps to follow -
- [Clone the repository](https://help.github.com/articles/cloning-a-repository/) to your local machine using below command -
```
git clone https://github.com/OpenSignLabs/OpenSign.git
```
- Copy the .env.frontend_dev file to apps/OpenSign/.env using below command(on mac & linux). For windows use COPY command instead.
```
cp .env.frontend_dev apps/OpenSign/.env
```
- CD to /apps/OpenSign directory
- Install NPM packages using
```
npm install
```
- Run the project locally using
```
npm run start
```
You should be able to access the application from http://localhost:3000 after this.
Create an account by signing-up and start contributing.
- **Access Contributor Instructions:** [Contributors Guide](https://docs.opensignlabs.com/docs/contribute/INSTALLATION)

## Additional Resources

## Digital Ocean
Should you need further assistance or have any questions, please feel free to reach out to us through our support channels:

OpenSign application consistes of 3 components -
- ReactJS frontend
- NodeJS API
- MongoDB database
- **Twitter:** [OpenSignHQ on Twitter](https://twitter.com/OpenSignHQ)
- **Facebook:** [OpenSign on Facebook](https://www.facebook.com/profile.php?id=61551030403669)
- **LinkedIn:** [OpenSign™ on LinkedIn](https://www.linkedin.com/company/opensign%E2%84%A2/)
- **Discord:** [Join our Discord Community](https://discord.com/invite/opensign)
- **YouTube:** [OpenSignHQ on YouTube](https://www.youtube.com/@opensignhq)

You can install all 3 components on digital ocean using the button below -
We are committed to providing you with the support you need to successfully install and use OpenSign™. Visit our website at [www.opensignlabs.com](https://www.opensignlabs.com) for more information about our project and its features.

[![Deploy on DigitalOcean](https://www.deploytodo.com/do-btn-blue.svg)](https://cloud.digitalocean.com/apps/new?repo=https://github.com/OpenSignLabs/Deploy-OpenSign-to-Digital-Ocean/tree/main&refcode=30db1c901ab0)

## You will need to create an AWS S3 bucket or digital ocean space in order to store your uploaded documents

### AWS S3 -
- Step 1 : Create a S3 bucket
- Login to AWS console
- Navigate to S3 under services
- Hit "Create Bucket" button on upper right corner
- Remove the check from "block all public access" checkbox(we need this in order to provide access to not-logged in users after OTP verification)
- Set bucket versioning and tags as per your requirements
- Hit "Create bucket" button
- Step 2 : Create IAM user and provide access to AWS bucket
- Search for "IAM" on the search bar in AWS console
- On IAM dashboard, click the number of users(count) under IAM resources table
- Hit "create user" button on the upper right corner of the page
- Enter the user name & click next
- Click create policy, search for S3 and provide the Read, Write & list permissions
- Click next and click "Create user"
- Step 3 : Generate Credentials
- Go to IAM/Users in AWS console
- Hit the hyperlink for the user created in the previous step
- Click the "Security credentials" tab
- Scroll down to "Access keys" and hit "Create access key"
- In the next step select "Application running outside AWS"
- Add a description tag if needed & hit "Create access key"
- In the next step you will see "Access key" and "Secret Access key". Copy both the values.
- Set the value of "Access key" to "DO_ACCESS_KEY_ID" environment variable
- Set the value of "Secret Access key" to "DO_SECRET_ACCESS_KEY" environment variable
- Step 3 : Copy bucket credentials
- Visit "Amazon S3 -> Buckets" in aws console
- Click the bucket created in previous steps & visit the properties tab
- Under "Bucket overview" you will find the value of AWS region(for ex. ap-south-1). Set that value to env variable "DO_REGION"
- You can create the value for "DO_ENDPOINT" env variable by appending the region value to amazonaws.com (for ex. s3.ap-south-1.amazonaws.com)
- You can create the value for "DO_BASEURL" by adding the bucketname in front of the endpoint value(for ex. https://bucketname.s3.ap-south-1.amazonaws.com)

Visit below link if you face any issues while following the above instructions -
- https://repost.aws/knowledge-center/create-access-key


## Localhost(Docker)

For local Setup we need to need following prerequisite:

Environment Varaibles:

| Environment Varibale | Value | Description |
| ------------- | ------------- | ------------- |
| CI | false | Set CI to false while running the app locally |
| PUBLIC_URL | http://localhost:3000 | Set it to the URL form where the app home page will be accessed |
| GENERATE_SOURCEMAP | false | Set it to true if you want to generate the Sourcemap for debugging |
| REACT_APP_SERVERURL | http://localhost:8080/app | 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_APPID | opensignstgn | 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. |
| APP_ID | opensignstgn | A 12 character long random app identifier. The value of this should be same as REACT_APP_APPID which is a variable used by Frontend React App. |
| appName | open_sign_server | Name of the app. It will be visible in the verification emails sent out. |
| MASTER_KEY | XnAadwKxxByMr | A 12 character long random secret key that allows access to all the data. It is used in Parse dashboard config to view all the data in the database. |
| MONGODB_URI | mongodb://host.docker.internal:27017/OpenSignDB | Mongodb URI to connect to |
| PARSE_MOUNT |/app | Path on which APIs should be mounted. Do not change this. This variable shall be removed & value hardcoded in the source code in coming versions. |
| SERVER_URL | http://127.0.0.1:8080/app | Set it to the URL from where APIs will be accessible to the NodeJS functions, for local development it should be localhost:3000/api/app (use your local port number instead) |
| DO_SPACE | DOSPACENAME | Digital ocean space name or AWS S3 bucket name for uploading documents |
| DO_ENDPOINT | ams3.digitaloceanspaces.com | Digital ocean spaces endpoint or AWS S3 endpoint for uploading documents |
| DO_BASEURL |https://DOSPACENAME.ams3.digitaloceanspaces.com | Digital ocean baseurl or AWS S3 base URL |
| DO_ACCESS_KEY_ID | YOUR_S3_ACCESS_ID | Digital ocean spaces access key ID or AWS s3 Access key ID for uploading the docs |
| DO_SECRET_ACCESS_KEY | YOUR_S3_ACCESS_KEY | Digital ocean spaces secret access key or AWS s3 secret access key for uploading the docs |
| DO_REGION | YOUR_S3_REGION | Digital ocean spaces region or AWS s3 region |
| USE_LOCAL | FALSE | To use local file storage to save file |
| MAILGUN_API_KEY | YOUR_MAILGUNAPI_KEY | Mailgun API Key |
| MAILGUN_DOMAIN | YOUR_MAILGUNAPI_DOMAIN | Mailgun API Domain |
| MAILGUN_SENDER | - | Mailgun Sender Mail ID |
| PFX_BASE64 | - | Base64 encoded PFX or p12 document signing certificate file. You can generate base64 encoded self sign certificate using the passphrase `emudhra` |

# Steps to Generate Self Sign Certificate
```
# execute below command and use passphrase emudhra
openssl genrsa -des3 -out ./cert/local_dev.key 2048
openssl req -key ./cert/local_dev.key -new -x509 -days 365 -out ./cert/local_dev.crt
openssl pkcs12 -inkey ./cert/local_dev.key -in ./cert/local_dev.crt -export -out ./cert/local_dev.pfx
openssl base64 -in ./cert/local_dev.pfx -out ./cert/base64_pfx
```

# CORS Configuration

As document storage is delegated to S3-compatible services that reside in a different host than the OpenSign one, document operations (loading, storing, deleting) are subject to [Cross-Origin Resource Sharing](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) restriction policies; as a consequence, OpenSign app may fail with (browser console) errors like the following:
```
Access to fetch at 'https://foo.nyc3.digitaloceanspaces.com/exported_file_4627_0000-00-00T00%3A45%3A43.344Z.pdf'
from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header
is present on the requested resource. If an opaque response serves your needs, set the request's mode to
'no-cors' to fetch the resource with CORS disabled.
```

In order to address this, your document storage system must be instructed to accept requests from other hosts; below the relevant documentation links:
- [How to Configure CORS on DigitalOcean Spaces](https://docs.digitalocean.com/products/spaces/how-to/configure-cors/)
- [Configuring cross-origin resource sharing on AWS S3](https://docs.aws.amazon.com/AmazonS3/latest/userguide/enabling-cors-examples.html)

# Build Local Environment

Command to build project -
- Execute `make build`

Command to run project -
- Execute `make run`
2 changes: 1 addition & 1 deletion apps/OpenSign/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Use an official Node runtime as the base image
FROM node:16
FROM node:18

# Set the working directory inside the container
WORKDIR /usr/src/app
Expand Down
25 changes: 25 additions & 0 deletions apps/OpenSign/Dockerhubfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Use an official Node runtime as the base image
FROM node:18

# Set the working directory inside the container
WORKDIR /usr/src/app

# Copy package.json and package-lock.json first to leverage Docker cache
COPY apps/OpenSign/package*.json ./

# Install application dependencies
RUN npm install

# Copy the current directory contents into the container
COPY apps/OpenSign/ .
COPY microfrontends/ .
COPY apps/OpenSign/.husky .

# Make port 3000 available to the world outside this container
EXPOSE 3000

# Define environment variables if needed
# ENV NODE_ENV production

# Run the application
CMD ["npm", "start"]
Loading