-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance/translations and wallet issues and other (#1030)
* issue #1006 #1021 * `update` .github/deploy script * issue #1019 * `renaming` * `aesthetic` `doc` * `update` for `docker:dev` + `package.json` scripts * `update` with `main` * `update` settings.json * issue #951 * issue #951 * issue #951 * issue #951 `redundant` code * issue #951 * issue #1028 * issue #951 `styles` update * `deepsource` JS-0128
- Loading branch information
Showing
50 changed files
with
2,881 additions
and
582 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
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
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 |
---|---|---|
|
@@ -31,4 +31,4 @@ COPY . . | |
|
||
EXPOSE 5055 | ||
# CMD ["node", "./build"] | ||
CMD ["npm", "start"] | ||
CMD ["npm", "run", "start:docker"] |
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
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 @@ | ||
web: npm run start:heroku |
File renamed without changes.
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
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,93 @@ | ||
// DOC: https://github.com/sveltejs/kit/tree/master/packages/adapter-node#custom-server | ||
// DOC: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import | ||
|
||
import express from 'express'; | ||
import { handler } from './build/handler.js'; | ||
// import sslRedirect from 'heroku-ssl-redirect'; | ||
// DOC: https://expressjs.com/en/resources/middleware/compression.html | ||
import compression from 'compression'; | ||
import * as sslify from 'express-sslify'; | ||
// DOC: https://www.npmjs.com/package/request-ip | ||
|
||
const app = express(); | ||
|
||
/** | ||
* [ℹ] enable ssl redirect | ||
* DOC: https://www.npmjs.com/package/heroku-ssl-redirect | ||
* => does not seem to be working | ||
*/ | ||
// app.use(sslRedirect()); | ||
|
||
/** | ||
* [ℹ] separate from SvelteKit endpoint in attempts to | ||
* [ℹ] identify clients (IP - address) | ||
*/ | ||
/** | ||
app.get('/getClientIP', (req, res, next) => { | ||
const ip = req.headers['x-forwarded-for'] || | ||
req.socket.remoteAddress || | ||
null; | ||
console.log('ip', ip); | ||
const ip2 = req.ip | ||
console.log('ip2', ip2); | ||
const ip3 = requestIp.getClientIp(req); | ||
console.log('ip3', ip3); | ||
let ipAddr = req.headers["x-forwarded-for"]; | ||
if (ipAddr){ | ||
const list = ipAddr.split(","); | ||
ipAddr = list[list.length-1]; | ||
} else { | ||
ipAddr = req.connection.remoteAddress; | ||
} | ||
console.log('ipAddr', ipAddr); | ||
res.json( | ||
{ | ||
"ip": ip.toString().replace(/,/g, '') | ||
} | ||
); | ||
res.end() | ||
}) | ||
*/ | ||
|
||
/** | ||
* [ℹ] [FORCE] https-redirect | ||
* DOC: https://jaketrent.com/post/https-redirect-node-heroku | ||
* DOC: https://webdva.github.io/how-to-force-express-https-tutorial | ||
* [HEROKU] | ||
*/ | ||
app.use((req, res, next) => { | ||
if (req.header('x-forwarded-proto') !== 'https') | ||
res.redirect(`https://${req.header('host')}${req.url}`); | ||
else | ||
next(); | ||
}); | ||
|
||
/** | ||
* DOC: https://www.npmjs.com/package/express-sslify | ||
* DOC: https://stackoverflow.com/questions/51234023/heroku-nodejs-redirect-http-to-http | ||
*/ | ||
app.use(sslify.HTTPS({ trustProtoHeader: true })) | ||
|
||
// [ℹ] compress all responses | ||
app.use(compression()) | ||
|
||
/** | ||
* [ℹ] let SvelteKit handle everything else, | ||
* [ℹ] including serving prerendered pages and static assets | ||
*/ | ||
app.use(handler); | ||
|
||
/** | ||
* [ℹ] initialize app; | ||
* DOC: https://stackoverflow.com/questions/15693192/heroku-node-js-error-web-process-failed-to-bind-to-port-within-60-seconds-o | ||
*/ | ||
app.listen(process.env.PORT || 5000, () => { | ||
console.log('listening on port 5000'); | ||
}); |
Oops, something went wrong.