Skip to content

Commit 4718c65

Browse files
authored
Merge pull request #454 from OpenSignLabs/staging
minor package updates
2 parents f9b8437 + 4f417cc commit 4718c65

File tree

15 files changed

+1048
-2170
lines changed

15 files changed

+1048
-2170
lines changed

.env.local_dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ SMTP_ENABLE=
5252
SMTP_HOST=smtp.yourhost.com
5353
SMTP_PORT=443
5454
55-
SMTP_PASS=password
55+
SMTP_PASS=password # if your password includes spaces then write password in single quotes ('asdf pasd asdf bgds').
5656

5757

5858
# Base64 encoded PFX or p12 document signing certificate file *********************************************************************************************************************

.github/workflows/Docker.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ jobs:
1111
matrix:
1212
include:
1313
- image: amolshejole/OpenSign
14-
dockerfile: apps/OpenSign/Dockerfile
14+
dockerfile: apps/OpenSign/Dockerhubfile
1515
- image: amolshejole/OpenSignServer
16-
dockerfile: apps/OpenSignServer/Dockerfile
16+
dockerfile: apps/OpenSignServer/Dockerhubfile
1717
steps:
1818
-
1919
name: Checkout
@@ -31,8 +31,11 @@ jobs:
3131
with:
3232
images: ${{ matrix.image }}
3333
-
34-
name: Debug - List files
34+
name: Debug - List files opensign
3535
run: ls -R apps/OpenSign/ # Adjust the path as needed
36+
-
37+
name: Debug - List files opensignserver
38+
run: ls -R apps/OpenSignServer/ # Adjust the path as needed
3639
-
3740
name: Build and push
3841
uses: docker/build-push-action@v4

INSTALLATION.md

Lines changed: 16 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -1,149 +1,29 @@
11

2-
# INSTALLATON INSTRUCTIONS
2+
# INSTALLATON INSTRUCTIONS HAS A NEW HOME
33

4-
You can use our app as a cloud version from [OpenSignLabs](https://www.opensignlabs.com)
4+
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).
55

6-
or follow below instructions to install it on your own infrastructure.
6+
## Self Hosting
77

8-
- Localhost(Frontend only)
9-
- Digital Ocean
10-
- Localhost(Docker)
8+
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.
119

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

14-
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.
12+
## Contributors
1513

16-
**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.
14+
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.
1715

18-
Below are the steps to follow -
19-
- [Clone the repository](https://help.github.com/articles/cloning-a-repository/) to your local machine using below command -
20-
```
21-
git clone https://github.com/OpenSignLabs/OpenSign.git
22-
```
23-
- Copy the .env.frontend_dev file to apps/OpenSign/.env using below command(on mac & linux). For windows use COPY command instead.
24-
```
25-
cp .env.frontend_dev apps/OpenSign/.env
26-
```
27-
- CD to /apps/OpenSign directory
28-
- Install NPM packages using
29-
```
30-
npm install
31-
```
32-
- Run the project locally using
33-
```
34-
npm run start
35-
```
36-
You should be able to access the application from http://localhost:3000 after this.
37-
Create an account by signing-up and start contributing.
16+
- **Access Contributor Instructions:** [Contributors Guide](https://docs.opensignlabs.com/docs/contribute/INSTALLATION)
3817

18+
## Additional Resources
3919

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

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

47-
You can install all 3 components on digital ocean using the button below -
28+
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.
4829

49-
[![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)
50-
51-
## You will need to create an AWS S3 bucket or digital ocean space in order to store your uploaded documents
52-
53-
### AWS S3 -
54-
- Step 1 : Create a S3 bucket
55-
- Login to AWS console
56-
- Navigate to S3 under services
57-
- Hit "Create Bucket" button on upper right corner
58-
- 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)
59-
- Set bucket versioning and tags as per your requirements
60-
- Hit "Create bucket" button
61-
- Step 2 : Create IAM user and provide access to AWS bucket
62-
- Search for "IAM" on the search bar in AWS console
63-
- On IAM dashboard, click the number of users(count) under IAM resources table
64-
- Hit "create user" button on the upper right corner of the page
65-
- Enter the user name & click next
66-
- Click create policy, search for S3 and provide the Read, Write & list permissions
67-
- Click next and click "Create user"
68-
- Step 3 : Generate Credentials
69-
- Go to IAM/Users in AWS console
70-
- Hit the hyperlink for the user created in the previous step
71-
- Click the "Security credentials" tab
72-
- Scroll down to "Access keys" and hit "Create access key"
73-
- In the next step select "Application running outside AWS"
74-
- Add a description tag if needed & hit "Create access key"
75-
- In the next step you will see "Access key" and "Secret Access key". Copy both the values.
76-
- Set the value of "Access key" to "DO_ACCESS_KEY_ID" environment variable
77-
- Set the value of "Secret Access key" to "DO_SECRET_ACCESS_KEY" environment variable
78-
- Step 3 : Copy bucket credentials
79-
- Visit "Amazon S3 -> Buckets" in aws console
80-
- Click the bucket created in previous steps & visit the properties tab
81-
- Under "Bucket overview" you will find the value of AWS region(for ex. ap-south-1). Set that value to env variable "DO_REGION"
82-
- 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)
83-
- 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)
84-
85-
Visit below link if you face any issues while following the above instructions -
86-
- https://repost.aws/knowledge-center/create-access-key
87-
88-
89-
## Localhost(Docker)
90-
91-
For local Setup we need to need following prerequisite:
92-
93-
Environment Varaibles:
94-
95-
| Environment Varibale | Value | Description |
96-
| ------------- | ------------- | ------------- |
97-
| CI | false | Set CI to false while running the app locally |
98-
| PUBLIC_URL | http://localhost:3000 | Set it to the URL form where the app home page will be accessed |
99-
| GENERATE_SOURCEMAP | false | Set it to true if you want to generate the Sourcemap for debugging |
100-
| 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) |
101-
| 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. |
102-
| 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. |
103-
| appName | open_sign_server | Name of the app. It will be visible in the verification emails sent out. |
104-
| 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. |
105-
| MONGODB_URI | mongodb://host.docker.internal:27017/OpenSignDB | Mongodb URI to connect to |
106-
| 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. |
107-
| 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) |
108-
| DO_SPACE | DOSPACENAME | Digital ocean space name or AWS S3 bucket name for uploading documents |
109-
| DO_ENDPOINT | ams3.digitaloceanspaces.com | Digital ocean spaces endpoint or AWS S3 endpoint for uploading documents |
110-
| DO_BASEURL |https://DOSPACENAME.ams3.digitaloceanspaces.com | Digital ocean baseurl or AWS S3 base URL |
111-
| DO_ACCESS_KEY_ID | YOUR_S3_ACCESS_ID | Digital ocean spaces access key ID or AWS s3 Access key ID for uploading the docs |
112-
| DO_SECRET_ACCESS_KEY | YOUR_S3_ACCESS_KEY | Digital ocean spaces secret access key or AWS s3 secret access key for uploading the docs |
113-
| DO_REGION | YOUR_S3_REGION | Digital ocean spaces region or AWS s3 region |
114-
| USE_LOCAL | FALSE | To use local file storage to save file |
115-
| MAILGUN_API_KEY | YOUR_MAILGUNAPI_KEY | Mailgun API Key |
116-
| MAILGUN_DOMAIN | YOUR_MAILGUNAPI_DOMAIN | Mailgun API Domain |
117-
| MAILGUN_SENDER | - | Mailgun Sender Mail ID |
118-
| PFX_BASE64 | - | Base64 encoded PFX or p12 document signing certificate file. You can generate base64 encoded self sign certificate using the passphrase `emudhra` |
119-
120-
# Steps to Generate Self Sign Certificate
121-
```
122-
# execute below command and use passphrase emudhra
123-
openssl genrsa -des3 -out ./cert/local_dev.key 2048
124-
openssl req -key ./cert/local_dev.key -new -x509 -days 365 -out ./cert/local_dev.crt
125-
openssl pkcs12 -inkey ./cert/local_dev.key -in ./cert/local_dev.crt -export -out ./cert/local_dev.pfx
126-
openssl base64 -in ./cert/local_dev.pfx -out ./cert/base64_pfx
127-
```
128-
129-
# CORS Configuration
130-
131-
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:
132-
```
133-
Access to fetch at 'https://foo.nyc3.digitaloceanspaces.com/exported_file_4627_0000-00-00T00%3A45%3A43.344Z.pdf'
134-
from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header
135-
is present on the requested resource. If an opaque response serves your needs, set the request's mode to
136-
'no-cors' to fetch the resource with CORS disabled.
137-
```
138-
139-
In order to address this, your document storage system must be instructed to accept requests from other hosts; below the relevant documentation links:
140-
- [How to Configure CORS on DigitalOcean Spaces](https://docs.digitalocean.com/products/spaces/how-to/configure-cors/)
141-
- [Configuring cross-origin resource sharing on AWS S3](https://docs.aws.amazon.com/AmazonS3/latest/userguide/enabling-cors-examples.html)
142-
143-
# Build Local Environment
144-
145-
Command to build project -
146-
- Execute `make build`
147-
148-
Command to run project -
149-
- Execute `make run`

apps/OpenSign/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Use an official Node runtime as the base image
2-
FROM node:16
2+
FROM node:18
33

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

apps/OpenSign/Dockerhubfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Use an official Node runtime as the base image
2+
FROM node:18
3+
4+
# Set the working directory inside the container
5+
WORKDIR /usr/src/app
6+
7+
# Copy package.json and package-lock.json first to leverage Docker cache
8+
COPY apps/OpenSign/package*.json ./
9+
10+
# Install application dependencies
11+
RUN npm install
12+
13+
# Copy the current directory contents into the container
14+
COPY apps/OpenSign/ .
15+
COPY microfrontends/ .
16+
COPY apps/OpenSign/.husky .
17+
18+
# Make port 3000 available to the world outside this container
19+
EXPOSE 3000
20+
21+
# Define environment variables if needed
22+
# ENV NODE_ENV production
23+
24+
# Run the application
25+
CMD ["npm", "start"]

0 commit comments

Comments
 (0)