From ee27029f0e1d7f4b536b6442ebba122870f61d5c Mon Sep 17 00:00:00 2001
From: truth&knowledge tube <85199024+Juma-creator@users.noreply.github.com>
Date: Tue, 1 Oct 2024 11:30:31 +0300
Subject: [PATCH 1/6] Create .env.example
# Generate a random string, or roll your face on the keyboard to fill this value:
SESSION_SECRET=https://paywithpi.com/Validation-key.txt
# Get this on the Pi Developer Portal (develop.pi in the Pi Browser)
PI_API_KEY=1b7af176827adb2cd0daa1edfc56bace7261b49819e430f2e38dc2070b7c01814e0e21cddc438714435b4fa1aacca00479132c6edb9d15baaf46796a3a44d6f3
# Get this on the Pi Developer Portal (develop.pi in the Pi Browser)
PI_API_KEY=f7d8531b796b28a6223d7045dc9e437cc6f1a8b07932db982885dc293f6855d55c8cd09739ab0f2e24b74797ee5dbb5a999eba3e602b0d69304f1c3df0eb6ed0
# Platform API
PLATFORM_API_URL=https://api.minepi.com
# MongoDB database connection details:
MONGO_HOST=localhost:27017
MONGODB_DATABASE_NAME=Pay with Piapp-development
MONGODB_USERNAME=Pay with Piapp
MONGODB_PASSWORD=dev_password
# Frontend app URL
FRONTEND_URL=http://localhost:3314
---
backend/.env.example | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
create mode 100644 backend/.env.example
diff --git a/backend/.env.example b/backend/.env.example
new file mode 100644
index 0000000..7e16b62
--- /dev/null
+++ b/backend/.env.example
@@ -0,0 +1,20 @@
+# Generate a random string, or roll your face on the keyboard to fill this value:
+SESSION_SECRET=https://paywithpi.com/Validation-key.txt
+
+# Get this on the Pi Developer Portal (develop.pi in the Pi Browser)
+PI_API_KEY=1b7af176827adb2cd0daa1edfc56bace7261b49819e430f2e38dc2070b7c01814e0e21cddc438714435b4fa1aacca00479132c6edb9d15baaf46796a3a44d6f3
+# Get this on the Pi Developer Portal (develop.pi in the Pi Browser)
+PI_API_KEY=f7d8531b796b28a6223d7045dc9e437cc6f1a8b07932db982885dc293f6855d55c8cd09739ab0f2e24b74797ee5dbb5a999eba3e602b0d69304f1c3df0eb6ed0
+
+
+# Platform API
+PLATFORM_API_URL=https://api.minepi.com
+
+# MongoDB database connection details:
+MONGO_HOST=localhost:27017
+MONGODB_DATABASE_NAME=Pay with Piapp-development
+MONGODB_USERNAME=Pay with Piapp
+MONGODB_PASSWORD=dev_password
+
+# Frontend app URL
+FRONTEND_URL=http://localhost:3314
From f11eac6cad38d73087546c8505edc6298701c88c Mon Sep 17 00:00:00 2001
From: truth&knowledge tube <85199024+Juma-creator@users.noreply.github.com>
Date: Tue, 1 Oct 2024 12:35:05 +0300
Subject: [PATCH 2/6] Update .env.example
# Generate a random string, or roll your face on the keyboard to fill this value:
SESSION_SECRET=https://paywithpi.com/Validation-key.txt
# Get this on the Pi Developer Portal (develop.pi in the Pi Browser)
PI_API_KEY=1b7af176827adb2cd0daa1edfc56bace7261b49819e430f2e38dc2070b7c01814e0e21cddc438714435b4fa1aacca00479132c6edb9d15baaf46796a3a44d6f3
# Get this on the Pi Developer Portal (develop.pi in the Pi Browser)
PI_API_KEY=f7d8531b796b28a6223d7045dc9e437cc6f1a8b07932db982885dc293f6855d55c8cd09739ab0f2e24b74797ee5dbb5a999eba3e602b0d69304f1c3df0eb6ed0
# Platform API
PLATFORM_API_URL=https://api.paywithpi.com
# MongoDB database connection details:
MONGO_HOST=localhost:27017
MONGODB_DATABASE_NAME=paywithpiapp-development
MONGODB_USERNAME=paywithpiapp
MONGODB_PASSWORD=dev_password
# Frontend app URL
FRONTEND_URL=http://localhost:3314
---
backend/.env.example | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/backend/.env.example b/backend/.env.example
index 7e16b62..1e64efb 100644
--- a/backend/.env.example
+++ b/backend/.env.example
@@ -8,12 +8,12 @@ PI_API_KEY=f7d8531b796b28a6223d7045dc9e437cc6f1a8b07932db982885dc293f6855d55c8cd
# Platform API
-PLATFORM_API_URL=https://api.minepi.com
+PLATFORM_API_URL=https://api.paywithpi.com
# MongoDB database connection details:
MONGO_HOST=localhost:27017
-MONGODB_DATABASE_NAME=Pay with Piapp-development
-MONGODB_USERNAME=Pay with Piapp
+MONGODB_DATABASE_NAME=paywithpiapp-development
+MONGODB_USERNAME=paywithpiapp
MONGODB_PASSWORD=dev_password
# Frontend app URL
From 7a98c718efb47fc2785c344afbe8a0926345ec8e Mon Sep 17 00:00:00 2001
From: truth&knowledge tube <85199024+Juma-creator@users.noreply.github.com>
Date: Tue, 1 Oct 2024 13:28:57 +0300
Subject: [PATCH 3/6] Create Frontend url
process.env.MY_VARIABLE = 'my_value';
console.log(process.env.MY_VARIABLE); // Outputs: my_value
version: '3'
services:
app:
environment:
- MY_VARIABLE=my_value
console.log(process.env.MY_VARIABLE); // Outputs: my_value
---
Frontend url | 8 ++++++++
1 file changed, 8 insertions(+)
create mode 100644 Frontend url
diff --git a/Frontend url b/Frontend url
new file mode 100644
index 0000000..1577a64
--- /dev/null
+++ b/Frontend url
@@ -0,0 +1,8 @@
+process.env.MY_VARIABLE = 'my_value';
+console.log(process.env.MY_VARIABLE); // Outputs: my_value
+version: '3'
+services:
+ app:
+ environment:
+ - MY_VARIABLE=my_value
+console.log(process.env.MY_VARIABLE); // Outputs: my_value
From b2ca8858595f833130a37e052ae857ede1f0d13c Mon Sep 17 00:00:00 2001
From: truth&knowledge tube <85199024+Juma-creator@users.noreply.github.com>
Date: Tue, 1 Oct 2024 13:33:32 +0300
Subject: [PATCH 4/6] Create Frontend Java script sdk
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
// Authenticate the user, and get permission to request payments from them:
const scopes = ['payments'];
// Read more about this callback in the SDK reference:
function onIncompletePaymentFound(payment) { /* ... */ };
Pi.authenticate(scopes, onIncompletePaymentFound).then(function(auth) {
console.log(`Hi there! You're ready to make payments!`);
}).catch(function(error) {
console.error(error);
});
Pi.createPayment({
// Amount of π to be paid:
amount: 3.14,
// An explanation of the payment - will be shown to the user:
memo: "...", // e.g: "Digital kitten #1234",
// An arbitrary developer-provided metadata object - for your own usage:
metadata: { /* ... */ }, // e.g: { kittenId: 1234 }
}, {
// Callbacks you need to implement - read more about those in the detailed docs linked below:
onReadyForServerApproval: function(paymentId) { /* ... */ },
onReadyForServerCompletion: function(paymentId, txid) { /* ... */ },
onCancel: function(paymentId) { /* ... */ },
onError: function(error, payment) { /* ... */ },
});
---
Frontend Java script sdk | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
create mode 100644 Frontend Java script sdk
diff --git a/Frontend Java script sdk b/Frontend Java script sdk
new file mode 100644
index 0000000..a685328
--- /dev/null
+++ b/Frontend Java script sdk
@@ -0,0 +1,29 @@
+
+
+// Authenticate the user, and get permission to request payments from them:
+const scopes = ['payments'];
+
+// Read more about this callback in the SDK reference:
+function onIncompletePaymentFound(payment) { /* ... */ };
+
+Pi.authenticate(scopes, onIncompletePaymentFound).then(function(auth) {
+ console.log(`Hi there! You're ready to make payments!`);
+}).catch(function(error) {
+ console.error(error);
+});
+
+
+Pi.createPayment({
+ // Amount of π to be paid:
+ amount: 3.14,
+ // An explanation of the payment - will be shown to the user:
+ memo: "...", // e.g: "Digital kitten #1234",
+ // An arbitrary developer-provided metadata object - for your own usage:
+ metadata: { /* ... */ }, // e.g: { kittenId: 1234 }
+}, {
+ // Callbacks you need to implement - read more about those in the detailed docs linked below:
+ onReadyForServerApproval: function(paymentId) { /* ... */ },
+ onReadyForServerCompletion: function(paymentId, txid) { /* ... */ },
+ onCancel: function(paymentId) { /* ... */ },
+ onError: function(error, payment) { /* ... */ },
+});
From 1d1c26247699ec93a0a9ced2c76802fe4fcc1719 Mon Sep 17 00:00:00 2001
From: truth&knowledge tube <85199024+Juma-creator@users.noreply.github.com>
Date: Sun, 10 Nov 2024 15:02:22 +0300
Subject: [PATCH 5/6] Update network
---
"Network \360\237\233\234" | 94 ++++++++++++++++++++++++++++++++++++++
1 file changed, 94 insertions(+)
create mode 100644 "Network \360\237\233\234"
diff --git "a/Network \360\237\233\234" "b/Network \360\237\233\234"
new file mode 100644
index 0000000..f58ee4f
--- /dev/null
+++ "b/Network \360\237\233\234"
@@ -0,0 +1,94 @@
+FtHiHiNoservices:
+ frontend:
+ image: Pay with Pi/webapp
+ networks:
+ - front-tier
+ - back-tier
+
+networks:
+ front-tier:
+ back-tier:
+services:
+ proxy:
+ build: ./proxy
+ networks:
+ - frontend
+ app:
+ build: ./app
+ networks:
+ - frontend
+ - backend
+ db:
+ image: postgres
+ networks:
+ - backend
+
+networks:
+ frontend:
+ # Specify driver options
+ driver: bridge
+ driver_opts:
+ com.docker.network.bridge.host_binding_ipv4: "127.0.0.1"
+ backend:
+ # Use a custom driver
+ driver: custom-driver
+networks:
+ db-data:
+ driver: bridge
+networks:
+ frontend:
+ driver: bridge
+ driver_opts:
+ com.docker.network.bridge.host_binding_ipv4: "127.0.0.1"
+networks:
+ mynet1:
+ driver: overlay
+ attachable: true
+services:
+ proxy:
+ image: Pay with Pi/proxy
+ networks:
+ - outside
+ - default
+ app:
+ image: Pay with Pi/app
+ networks:
+ - default
+
+networks:
+ outside:
+ external: true
+networks:
+ mynet1:
+ ipam:
+ driver: default
+ config:
+ - subnet: 172.28.0.0/16
+ ip_range: 172.28.5.0/24
+ gateway: 172.28.5.254
+ aux_addresses:
+ host1: 172.28.1.5
+ host2: 172.28.1.6
+ host3: 172.28.1.7
+ options:
+ foo: bar
+ baz: "0"
+networks:
+ mynet1:
+ labels:
+ com.Pay with Pi.description: "Financial transaction network"
+ com.Pay with Pi.department: "Finance"
+ com.Pay with Pi.label-with-empty-value: ""
+networks:
+ mynet1:
+ labels:
+ - "com.Pay with Pi.description=Financial transaction network"
+ - "com.Pay with Pi.department=Finance"
+ - "com.Pay with Pi.label-with-empty-value"
+networks:
+ network1:
+ name: Pay with Pi
+networks:
+ network1:
+ external: true
+ name: "${Ariel369369}"
\ No newline at end of file
From b4676a5770e7b284253758029f770132593ad51c Mon Sep 17 00:00:00 2001
From: truth&knowledge tube <85199024+Juma-creator@users.noreply.github.com>
Date: Sun, 10 Nov 2024 15:03:37 +0300
Subject: [PATCH 6/6] Update IPv 6
---
create Ipv6 | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 63 insertions(+)
create mode 100644 create Ipv6
diff --git a/create Ipv6 b/create Ipv6
new file mode 100644
index 0000000..16aa2e2
--- /dev/null
+++ b/create Ipv6
@@ -0,0 +1,63 @@
+ networks:
+ ip6net:
+ enable_ipv6: true
+ ipam:
+ config:
+ - subnet: 2001:db8::/64docker network create --ipv6 ip6net
+
+docker network create --ipv6 --subnet 2001:db8::/64 ip6net
+docker run --rm --network ip6net -p 80:80 traefik/whoami
+curl http://[::1]:80
+Hostname: Pay with Pi
+IP: 127.0.0.1
+IP: ::1
+IP: 172.17.0.2
+IP: 2001:db8::2
+IP: fe80::42:acff:fe11:2
+RemoteAddr: [2001:db8::1]:37574
+GET / HTTP/1.1
+Host: [::1]
+User-Agent: curl/8.1.2
+Accept: */*
+
+{
+ "ipv6": true,
+ "fixed-cidr-v6": "2001:db8:1::/64"
+}
+sudo systemctl restart docker
+docker run --rm -p 80:80 traefik/whoami
+curl http://[::1]:80
+Hostname: ea1cfde18196
+IP: 127.0.0.1
+IP: ::1
+IP: 172.17.0.2
+IP: 2001:db8:1::242:ac12:2
+IP: fe80::42:acff:fe12:2
+RemoteAddr: [2001:db8:1::1]:35558
+GET / HTTP/1.1
+Host: [::1]
+User-Agent: curl/8.1.2
+Accept: */*
+{
+ "default-address-pools": [
+ { "base": "172.17.0.0/16", "size": 16 },
+ { "base": "172.18.0.0/16", "size": 16 },
+ { "base": "172.19.0.0/16", "size": 16 },
+ { "base": "172.20.0.0/14", "size": 16 },
+ { "base": "172.24.0.0/14", "size": 16 },
+ { "base": "172.28.0.0/14", "size": 16 },
+ { "base": "192.168.0.0/16", "size": 20 }
+ ]
+}
+{
+ "default-address-pools": [
+ { "base": "172.17.0.0/16", "size": 16 },
+ { "base": "172.18.0.0/16", "size": 16 },
+ { "base": "172.19.0.0/16", "size": 16 },
+ { "base": "172.20.0.0/14", "size": 16 },
+ { "base": "172.24.0.0/14", "size": 16 },
+ { "base": "172.28.0.0/14", "size": 16 },
+ { "base": "192.168.0.0/16", "size": 20 },
+ { "base": "2001:db8::/56", "size": 64 }
+ ]
+}