-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from PretendoNetwork/dev
Merge dev to master
- Loading branch information
Showing
44 changed files
with
4,866 additions
and
2,106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,7 +60,8 @@ typings/ | |
# custom | ||
sign.js | ||
t.js | ||
p.js | ||
config.json | ||
servers.json | ||
certs | ||
/cdn | ||
/cdn | ||
dump.rdb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Account server | ||
|
||
## What is this? | ||
The account server is a replacement for several account-based services used by the WiiU and 3DS. It replaces the NNID api as well as NASC for the 3DS. It also contains a dedicated PNID api service for getting details of PNIDs outside of the consoles | ||
|
||
## Setup | ||
TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"http": { | ||
"port": 7070 | ||
}, | ||
"mongoose": { | ||
"connection_string": "mongodb://localhost:27017/database_name", | ||
"options": { | ||
"useNewUrlParser": true | ||
} | ||
}, | ||
"redis": { | ||
"client": { | ||
"url": "redis://localhost:6379" | ||
} | ||
}, | ||
"email": { | ||
"host": "smtp.gmail.com", | ||
"port": 587, | ||
"secure": false, | ||
"auth": { | ||
"user": "username", | ||
"pass": "password" | ||
}, | ||
"from": "Company Name <[email protected]>" | ||
}, | ||
"s3": { | ||
"endpoint": "nyc3.digitaloceanspaces.com", | ||
"key": "ACCESS_KEY", | ||
"secret": "ACCESS_SECRET" | ||
}, | ||
"hcaptcha": { | ||
"secret": "0x0000000000000000000000000000000000000000" | ||
}, | ||
"cdn": { | ||
"base_url": "https://local-cdn.example.com", | ||
"subdomain": "local-cdn", | ||
"disk_path": "/home/jon/pretend-cdn" | ||
}, | ||
"website_base": "https://example.com" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
PN_ACT_PREFER_ENV_CONFIG=true # Load config from ENV instead of config.json | ||
PN_ACT_CONFIG_HTTP_PORT=7070 | ||
PN_ACT_CONFIG_MONGO_CONNECTION_STRING=mongodb://localhost:27017/database_name | ||
PN_ACT_CONFIG_MONGOOSE_OPTION_useNewUrlParser=true | ||
PN_ACT_CONFIG_MONGOOSE_OPTION_useUnifiedTopology=true | ||
PN_ACT_CONFIG_REDIS_URL=redis://localhost:6379 | ||
PN_ACT_CONFIG_EMAIL_HOST=smtp.gmail.com | ||
PN_ACT_CONFIG_EMAIL_PORT=587 | ||
PN_ACT_CONFIG_EMAIL_SECURE=false | ||
PN_ACT_CONFIG_EMAIL_USERNAME=username | ||
PN_ACT_CONFIG_EMAIL_PASSWORD=password | ||
PN_ACT_CONFIG_EMAIL_FROM=Company Name <[email protected]> | ||
PN_ACT_CONFIG_S3_ENDPOINT=nyc3.digitaloceanspaces.com | ||
PN_ACT_CONFIG_S3_ACCESS_KEY=ACCESS_KEY | ||
PN_ACT_CONFIG_S3_ACCESS_SECRET=ACCESS_SECRET | ||
PN_ACT_CONFIG_HCAPTCHA_SECRET=0x0000000000000000000000000000000000000000 | ||
PN_ACT_CONFIG_CDN_BASE_URL=https://local-cdn.example.com | ||
PN_ACT_CONFIG_CDN_SUBDOMAIN=local-cdn | ||
PN_ACT_CONFIG_CDN_DISK_PATH=/home/jon/pretend-cdn | ||
PN_ACT_CONFIG_WEBSITE_BASE=https://example.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const database = require('../../src/database'); | ||
const { NEXAccount } = require('../../src/models/nex-account'); | ||
|
||
database.connect().then(async function () { | ||
const nexAccounts = await NEXAccount.find({}); | ||
const nexAccounts3DS = await NEXAccount.find({ device_type: '3ds' }); | ||
const nexAccountsWiiU = await NEXAccount.find({ device_type: 'wiiu' }); | ||
|
||
console.log('NEX accounts:', nexAccounts.length); | ||
console.log('NEX accounts (3DS):', nexAccounts3DS.length); | ||
console.log('NEX accounts (WiiU):', nexAccountsWiiU.length); | ||
|
||
for (const nexAccount of nexAccounts) { | ||
let deviceType = ''; | ||
|
||
if (nexAccount.owning_pid !== nexAccount.pid) { | ||
// 3DS account | ||
deviceType = '3ds'; | ||
} else { | ||
// WiiU account | ||
deviceType = 'wiiu'; | ||
} | ||
|
||
nexAccount.device_type = deviceType; | ||
|
||
await nexAccount.save(); | ||
} | ||
|
||
console.log('Migrated accounts'); | ||
|
||
process.exit(0); | ||
}); |
Oops, something went wrong.