83 Commits

Author SHA1 Message Date
wiz
8f5f10fb2b Modify nginx.conf to cache HTML for 10m and static resources for 1h
Fixes #61
2021-03-08 18:50:57 +09:00
wiz
6fa12ec753 Proxy /api/v1/contributors from mempool.space, also fix HTTP headers
Fixes #366
2021-03-08 18:34:04 +09:00
wiz
313bbf0288 Enable sending CORS headers from electrs backend in startup script
Fixes #367
2021-03-03 21:29:18 +09:00
softsimon
7c74440c00 Adding Hebrew language 2021-02-25 17:16:22 +07:00
wiz
3152ac22f7 Don't start production instances if backend folder doesn't exist 2021-02-25 02:38:38 +09:00
wiz
99eedf106f Improve production high availability using structured failover and cache 2021-02-23 13:33:52 +09:00
wiz
9c1cd1cf4d Update nginx and mempool backend configuration for active failover HA 2021-02-22 20:22:38 +09:00
wiz
1cf675217f Don't use rust from rustup, use OS package rust instead 2021-02-21 03:44:54 +09:00
wiz
79879bffe5 Modify production startup scripts to support signet 2021-02-21 03:44:33 +09:00
wiz
2820cdb69e Update production frontend/backend config to support signet 2021-02-21 03:41:52 +09:00
wiz
f9d71aca39 Update nginx.conf for signet, services, and disable SSR for now 2021-02-21 03:39:19 +09:00
softsimon
8dc4cba01d Updating mempool logo and adding new mempool space logo. New frontend config OFFICIAL_MEMPOOL_SPACE to enable the latter.
fixes #336
2021-02-18 13:34:05 +07:00
wiz
0a0edc0315 Reduce backend heap size setting to 2G since cache memory usage was optimized (#345)
On powerful servers, nodejs automatically sets the limit at 4GB
```
% node -e 'console.log(`node heap limit = ${require("v8").getHeapStatistics().heap_size_limit / (1024 * 1024)} Mb`)'
node heap limit = 4144 Mb
```

On a Raspberry Pi with 8GB RAM, nodejs automatically sets the limit at 1GB
```
% node -e 'console.log(`node heap limit = ${require("v8").getHeapStatistics().heap_size_limit / (1024 * 1024)} Mb`)'
node heap limit = 1048 Mb
```

On a Raspberry Pi with 4GB RAM, nodejs automatically sets the limit at 740MB
```
% node -e 'console.log(`node heap limit = ${require("v8").getHeapStatistics().heap_size_limit / (1024 * 1024)} Mb`)'
node heap limit = 739.4694900512695 Mb
```

After testing with manually setting the limit to 768MB, mempool starts
up fine, but crashes when saving the cache when the mempool is quite
large (over 400MB with custom bitcoin.conf setting).

So it's probably safe to reduce the 4GB limit setting to 2GB for
all devices and and just use the automatically set values, now that the
backend's disk cache memory usage was recently optimized.

However, a new npm script for `npm run start-production` will be added
so we can keep our production mempool.space servers running with a very
large bitcoin.conf mempool
2021-02-14 22:25:29 +07:00
wiz
f42b52d37b Set production electrs scripts to store db in /electrs 2021-02-04 15:53:08 +09:00
wiz
45092f580f Modify production electrs scripts to use relative paths from homedir 2021-02-04 12:17:28 +09:00
wiz
da2f9aa80d Fix production nginx.conf and backend config to always use unique ports 2021-01-31 01:16:32 +09:00
wiz
882ca34fcc Rename production syslog notifications channel 2021-01-30 23:40:46 +09:00
wiz
c13d128d9c Configure production backends and nginx for high availability electrs 2021-01-30 23:01:01 +09:00
softsimon
42fa7c67bb Replacing localhost with 127.0.0.1 2021-01-30 18:43:58 +07:00
wiz
476948e70e Update production upgrade script notification command 2021-01-30 20:31:47 +09:00
wiz
dfeb8c2d15 Update production syslog scripts 2021-01-30 20:09:47 +09:00
softsimon
02c4ad2688 Adding Italian language. Updating nginx conf with some missing languages. 2021-01-27 20:24:32 +07:00
softsimon
6e5404f2a3 Adding hungarian language. 2021-01-24 04:19:50 +07:00
wiz
b4faf90de3 Don't create empty cache.json on startup anymore 2021-01-18 12:20:55 +09:00
wiz
61c21c954e Add missing production/mempool-frontend-config.json 2021-01-11 23:14:08 +09:00
wiz
68e9fa46f5 Update production/mempool-config.*.json files for new backend config 2021-01-11 17:42:35 +09:00
wiz
3b5d7078e8 Rewrite server.ts to fix i18n and implement proper HTTP 404 responses 2020-12-23 13:26:11 +09:00
wiz
1c8f7ecc1e Fixes after merging master into AU branch, add nginx.conf for SSR 2020-12-22 11:31:49 +09:00
wiz
1f7a455abd Adjust build scripts for new AU frontend build output in /browser/ 2020-12-22 07:09:45 +09:00
wiz
b170df0dfc Enable 'ka' locale for Georgian 2020-12-07 00:20:05 +09:00
wiz
384b541a3d Enable 'ar' locale for Arabic 2020-12-04 04:11:14 +09:00
wiz
80552fcd78 Replace nginx.conf try_files for /$lang/index.html with rewrite (fixes #250) 2020-12-03 18:52:03 +09:00
wiz
e4b5305936 Enable locale 'vi' for Vietnamese 2020-12-03 10:16:02 +09:00
wiz
ee49b911cb Change nginx.conf Tor HS port from 81 to 80 to fix i18n bug 2020-12-03 09:56:29 +09:00
wiz
2b8ef7a13a Exempt localhost from nginx rate limits for Tor and AU usage 2020-12-03 09:47:39 +09:00
wiz
1898dba1fc Update list of supported locales 2020-12-02 21:33:53 +09:00
wiz
8a31558959 Add one more fix to nginx.conf for i18n 2020-12-02 21:21:44 +09:00
wiz
46ad261d84 Implement i18n support in frontend using Angular + Transifex + NGINX
This PR adds basic i18n support into the mempool frontend, together with
a smooth workflow for developers and translators to collaborate:

* Using the existing @angular/localize module, developers add i18n
metadata to any frontend strings their new features or changes modify

* Using the new npm script `i18n-extract-from-source`, developers
extract the i18n data from source code into `src/locale/messages.xlf`

* After pushing the updated `src/locale/messages.xlf` to GitHub, the
Transifex service will update its database from the new source data

* Using the Transifex website UI, translators can work together to
translate all the mempool frontend strings into their native languages

* Using the new npm script `i18n-pull-from-transifex`, developers can
pull in completed translations from Transifex, and commit them into git.

This flow requires an API key from Transifex, which can be obtained at
https://www.transifex.com/user/settings/api/ to be used with the python
script installed by `pip install transifex-client` - after preparing
these, run the npm script which will ask you for the API key the first
time. When downloading is complete, you can test building the frontend,
and if successful, commit the new strings files into git.

This PR implements a new locale selector in the footer of the homepage
dashboard, and includes WIP translations for the following languages:

* Czech (cs)
* German (de)
* Japanese (ja)
* Norwegian (nn)
* Spanish (es)
* Swedish (sv)
* Ukrainian (uk)
* Persian (fa)
* Portugese (pt)
* Turkish (tr)
* Dutch (nl)
* French (fr)
* Chinese (zh)
* Slovenian (sl)
* Korean (ko)
* Polish (pl)

The user-agent's `Accept-Language` header is used to automatically
detect their preferred language, which can be manually overriden by the
pull-down selector, which saves their preference to a cookie, which is
used by nginx to serve the correct HTML bundle to the user.

Remaining tasks include adding i18n metadata for strings in the Bisq and
Liquid frontend code, mouseover hover tooltip strings, hard-coded og
metadata inside HTML templates, and many other places. This will be done
in a separate PR.

When upgrading to add i18n support, mempool instance operators must take
care to install the new nginx.conf and nginx-mempool.conf files, and
tweak for their specific site configuration.

Fixes #81
2020-12-02 04:19:33 +09:00
wiz
c8dc2d3287 Modify upgrade script to append repo before tag name 2020-11-23 09:46:50 +09:00
wiz
73d09da5d2 Modify upgrade script to include "tag @ hash" in notification msg 2020-11-16 23:44:32 +09:00
wiz
2ccd218c00 Fix nginx.conf reverse proxy cache URL path for sponsor images 2020-11-16 00:43:10 +09:00
wiz
22cece394c Enable nginx reverse proxy cache for sponsor profile images + misc tweaks 2020-11-06 14:09:04 +09:00
wiz
8a1598137e Don't call npm install with --only=prod 2020-10-26 04:24:05 +09:00
wiz
3eac6b8996 Don't rate limit /api/v1/donations URL prefix for sponsor photos 2020-10-19 20:56:46 +09:00
wiz
5405a06324 Update production backend configuration files for all 4 instances 2020-10-19 20:40:56 +09:00
wiz
2f0b132fe5 Fix typo in previous commit 2020-10-19 19:49:02 +09:00
wiz
34c43a8fd2 Modify upgrade script to allow reverting to a specific git hash or tag 2020-10-19 19:43:30 +09:00
wiz
615abe0c60 Route /api and /<network/api URLs to HTML for API documentation 2020-10-18 13:11:02 +09:00
wiz
c347ed1dbb Update mempool-logger and syslog.conf to separate info and notice msgs 2020-10-13 19:58:11 +09:00
wiz
853fe58d28 Add newsyslog.conf to rotate mempool logfiles regularly 2020-10-13 19:56:10 +09:00