Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create .env.example #452

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
29 changes: 29 additions & 0 deletions Frontend Java script sdk
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<script src="https://sdk.minepi.com/pi-sdk.js"></script>
<script>Pi.init({ version: "2.0" })</script>
// 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) { /* ... */ },
});
8 changes: 8 additions & 0 deletions Frontend url
Original file line number Diff line number Diff line change
@@ -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
94 changes: 94 additions & 0 deletions Network 🛜
Original file line number Diff line number Diff line change
@@ -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}"
20 changes: 20 additions & 0 deletions backend/.env.example
Original file line number Diff line number Diff line change
@@ -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.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
63 changes: 63 additions & 0 deletions create Ipv6
Original file line number Diff line number Diff line change
@@ -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 }
]
}