Skip to content

Commit

Permalink
Merge pull request #605 from bitholla/2.0
Browse files Browse the repository at this point in the history
2.0
  • Loading branch information
abeikverdi authored Mar 11, 2021
2 parents d3b7375 + 94cc2a1 commit e0d3458
Show file tree
Hide file tree
Showing 32 changed files with 169 additions and 59 deletions.
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ COPY ./server /app

WORKDIR /app

# Changing the default image user to 'appuser'
RUN groupadd -g 999 appuser && \
useradd -r -u 999 -g appuser appuser && \
mkdir /home/appuser && \
chown -R appuser /home/appuser && \
chown -R appuser /app

USER appuser

RUN npm install --loglevel=error && \
pm2 update && \
cd /app/mail && npm install --loglevel=error
Expand Down
2 changes: 1 addition & 1 deletion server/api/swagger/swagger.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
swagger: "2.0"
info:
version: "2.0.9"
version: "2.0.10"
title: HollaEx Kit
host: api.hollaex.com
basePath: /v2
Expand Down
6 changes: 5 additions & 1 deletion server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ var options = {
'https://rm-content.s3.amazonaws.com/5aead825bb456c005e2322dd/upload-c116da40-ebd2-11e8-9c84-e32cc39c32d1_57.png'
};

app.use('/docs', swaggerUi.serve, swaggerUi.setup(swaggerDoc, options));
app.get('/', (req, res) => {
res.redirect('/v2/health');
});

app.use('/explorer', swaggerUi.serve, swaggerUi.setup(swaggerDoc, options));

SwaggerExpress.create(config, function(err, swaggerExpress) {
if (err) { throw err; }
Expand Down
4 changes: 2 additions & 2 deletions server/mail/strings/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ const ACCOUNTUPGRADE = {
TITLE: 'Account Upgraded',
GREETING: (name) => COMMON.GREETING(name),
BODY: {
1: (level) =>
`Congratulations. Your account access level is upgraded to level ${level}. You will benefit from lower fees, higher withdrawal limits and other premium features.`,
1: (tier) =>
`Congratulations. Your account access level is upgraded to ${tier} tier. You will benefit from lower fees, higher withdrawal limits and other premium features.`,
2: 'Trade Now'
},
CLOSING: COMMON.CLOSING
Expand Down
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.0.9",
"version": "2.0.10",
"private": false,
"description": "HollaEx Kit",
"keywords": [
Expand Down
11 changes: 11 additions & 0 deletions server/tools/nginx/logs/hollaex.access.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
172.20.0.1 - - [11/Mar/2021:07:01:36 +0000] 404 "GET /docs HTTP/1.1" 143 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36" "-"
172.20.0.1 - - [11/Mar/2021:07:01:38 +0000] 200 "GET /v2/health HTTP/1.1" 55 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36" "-"
172.20.0.1 - - [11/Mar/2021:07:01:38 +0000] 404 "GET /favicon.ico HTTP/1.1" 150 "http://localhost/v2/health" "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36" "-"
172.20.0.1 - - [11/Mar/2021:07:01:43 +0000] 301 "GET /explorer HTTP/1.1" 175 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36" "-"
172.20.0.1 - - [11/Mar/2021:07:01:43 +0000] 200 "GET /explorer/ HTTP/1.1" 3595 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36" "-"
172.20.0.1 - - [11/Mar/2021:07:01:43 +0000] 200 "GET /explorer/swagger-ui-init.js HTTP/1.1" 169875 "http://localhost/explorer/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36" "-"
172.20.0.1 - - [11/Mar/2021:07:01:43 +0000] 200 "GET /explorer/swagger-ui.css HTTP/1.1" 143212 "http://localhost/explorer/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36" "-"
172.20.0.1 - - [11/Mar/2021:07:01:43 +0000] 200 "GET /explorer/swagger-ui-standalone-preset.js HTTP/1.1" 333912 "http://localhost/explorer/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36" "-"
172.20.0.1 - - [11/Mar/2021:07:01:43 +0000] 200 "GET /explorer/swagger-ui-bundle.js HTTP/1.1" 1063738 "http://localhost/explorer/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36" "-"
172.20.0.1 - - [11/Mar/2021:07:01:48 +0000] 302 "GET / HTTP/1.1" 64 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36" "-"
172.20.0.1 - - [11/Mar/2021:07:01:48 +0000] 200 "GET /v2/health HTTP/1.1" 55 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36" "-"
12 changes: 6 additions & 6 deletions server/tools/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ server {

include /etc/nginx/conf.d/plugin*.conf;

location /api-docs {
proxy_pass http://api;
}

location /docs {
location /explorer {
proxy_pass http://api;
}

Expand All @@ -47,7 +43,7 @@ server {
proxy_pass http://api;
}

location /plugins {
location /plugins {
proxy_pass http://plugins;
}

Expand All @@ -59,6 +55,10 @@ server {
proxy_pass http://socket;
}

location / {
proxy_pass http://api;
}

error_page 429 /429.html;
location = /429.html {
root /usr/share/nginx/html;
Expand Down
2 changes: 1 addition & 1 deletion templates/local/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ server {
proxy_pass http://api;
}

location /v2 {
location / {
limit_req zone=api burst=10 nodelay;
limit_req_log_level info;
limit_req_status 429;
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.9
2.0.10
8 changes: 7 additions & 1 deletion web/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ RUN apk add --update \
COPY --from=build /app/build /usr/share/nginx/html
RUN rm /etc/nginx/conf.d/default.conf
COPY docker/nginx.conf /etc/nginx/conf.d
EXPOSE 80
# Changing the user to 'nginx'
RUN chown -R nginx:nginx /var/cache/nginx && \
chown -R nginx:nginx /var/log/nginx && \
chown -R nginx:nginx /etc/nginx/conf.d && \
touch /var/run/nginx.pid && \
chown -R nginx:nginx /var/run/nginx.pid
EXPOSE 80 443
CMD ["nginx", "-g", "daemon off;"]


Expand Down
2 changes: 1 addition & 1 deletion web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hollaex-kit",
"version": "2.0.9",
"version": "2.0.10",
"private": true,
"dependencies": {
"@ant-design/compatible": "1.0.5",
Expand Down
1 change: 1 addition & 0 deletions web/src/_common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ table th {

.object-fit-contain {
object-fit: contain;
height: 100%;
}

.background-contain {
Expand Down
2 changes: 1 addition & 1 deletion web/src/actions/chartAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const getSparklines = async () => {
const to = moment().format('X');

const { data = {} } = await axios({
url: `/charts?resolution=D&from=${from}&to=${to}`,
url: `/charts?resolution=H&from=${from}&to=${to}`,
method: 'GET',
});

Expand Down
6 changes: 3 additions & 3 deletions web/src/components/AppBar/_AppBar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1174,9 +1174,9 @@ $app-menu-notification-size: 1.2rem;
}
.app-bar-add-tab-menu {
width: 36rem;
position: fixed;
top: 13.7rem;
left: 2.2rem;
position: absolute;
top: 7.8rem;
left: 1.2rem;

.app-bar-add-tab-content,
.app-bar-tab-menu-list,
Expand Down
2 changes: 1 addition & 1 deletion web/src/config/lang/ar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ const nestedContent = {
LABEL_PAIR_MAKER_FEE: '{0} کارمزد سفارش گذار',
LABEL_PAIR_TAKER_FEE: '{0} کارمزد پذیرنده سفارش',
UNLIMITED: 'نامحدود',
BLOCKED: '0',
BLOCKED: 'Disabled',
},
WALLET_ADDRESS_TITLE: 'ساخت کیف پول {0} ',
WALLET_ADDRESS_GENERATE: 'ساخت',
Expand Down
2 changes: 1 addition & 1 deletion web/src/config/lang/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ export default {
LABEL_PAIR_MAKER_FEE: '{0} Maker Gebühr',
LABEL_PAIR_TAKER_FEE: '{0} Taker Gebühr',
UNLIMITED: 'Unbegrenzt',
BLOCKED: '0',
BLOCKED: 'Disabled',
},
WALLET_ADDRESS_TITLE: 'Geldbörse {0} generieren',
WALLET_ADDRESS_GENERATE: 'Erzeugen',
Expand Down
5 changes: 3 additions & 2 deletions web/src/config/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,7 @@ const nestedContent = {
LABEL_PAIR_MAKER_FEE: '{0} Maker Fee',
LABEL_PAIR_TAKER_FEE: '{0} Taker Fee',
UNLIMITED: 'Unlimited',
BLOCKED: '0',
BLOCKED: 'Disabled',
},
WALLET_ADDRESS_TITLE: 'Generate {0} Wallet',
WALLET_ADDRESS_GENERATE: 'Generate',
Expand Down Expand Up @@ -1208,6 +1208,7 @@ const nestedContent = {
ACCOUNT_AGE_OF_MONTHS: 'Account Age of {0} Months',
TRADING_VOLUME_EQUIVALENT: '{0} {1} Trading Volume Equivalent',
LEVEL_OF_ACCOUNT: 'Level {0} Account',
TITLE_OF_ACCOUNT: '{0} Account',
LEVEL_TXT_DEFAULT: 'Add your level description here',
LEVEL_1_TXT:
'Your journey starts here young crypto trader! To obtain bonuses you can verify your identification and also get larger deposit and withdraw limits with reduced trading fees.', // new
Expand Down Expand Up @@ -1421,7 +1422,7 @@ const nestedContent = {
AMOUNT_IN: 'Amount in',
LIMITS_BLOCK: {
HEADER_ROW_DESCRIPTION:
'Deposit and withdrawal allowance for all assets (level {0})',
'Deposit and withdrawal allowance for all assets ({0})',
HEADER_ROW_TYPE: 'Type (All assets)',
HEADER_ROW_AMOUNT: 'Amount ({0})',
},
Expand Down
2 changes: 1 addition & 1 deletion web/src/config/lang/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ export default {
LABEL_PAIR_MAKER_FEE: '{0} Maker Fee',
LABEL_PAIR_TAKER_FEE: '{0} Taker Fee',
UNLIMITED: 'Sin lìmite',
BLOCKED: '0',
BLOCKED: 'Disabled',
},
WALLET_ADDRESS_TITLE: 'Generar {0} Billetera',
WALLET_ADDRESS_GENERATE: 'Generar',
Expand Down
2 changes: 1 addition & 1 deletion web/src/config/lang/fa.js
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ const nestedContent = {
LABEL_PAIR_MAKER_FEE: '{0} کارمزد سفارش گذار',
LABEL_PAIR_TAKER_FEE: '{0} کارمزد پذیرنده سفارش',
UNLIMITED: 'نامحدود',
BLOCKED: '0',
BLOCKED: 'Disabled',
},
WALLET_ADDRESS_TITLE: 'ساخت کیف پول {0} ',
WALLET_ADDRESS_GENERATE: 'ساخت',
Expand Down
2 changes: 1 addition & 1 deletion web/src/config/lang/fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,7 @@ export default {
LABEL_PAIR_MAKER_FEE: '{0} Frais du Maker',
LABEL_PAIR_TAKER_FEE: '{0} Frais du Taker',
UNLIMITED: 'Illimité',
BLOCKED: '0',
BLOCKED: 'Disabled',
},
WALLET_ADDRESS_TITLE: 'Générer {0} portefeuille',
WALLET_ADDRESS_GENERATE: 'Générer',
Expand Down
2 changes: 1 addition & 1 deletion web/src/config/lang/id.js
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,7 @@ export default {
LABEL_PAIR_MAKER_FEE: '{0} Maker Fee',
LABEL_PAIR_TAKER_FEE: '{0} Taker Fee',
UNLIMITED: 'Tidak terbatas',
BLOCKED: '0',
BLOCKED: 'Disabled',
},
WALLET_ADDRESS_TITLE: 'Buat Dompet {0}',
WALLET_ADDRESS_GENERATE: 'Buat',
Expand Down
2 changes: 1 addition & 1 deletion web/src/config/lang/ja.js
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@ export default {
LABEL_PAIR_MAKER_FEE: '{0} Maker Fee',
LABEL_PAIR_TAKER_FEE: '{0} Taker Fee',
UNLIMITED: '無制限',
BLOCKED: '0',
BLOCKED: 'Disabled',
},
WALLET_ADDRESS_TITLE: '{0}ウォレット作成',
WALLET_ADDRESS_GENERATE: '作成',
Expand Down
2 changes: 1 addition & 1 deletion web/src/config/lang/ko.js
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ const nestedContent = {
LABEL_PAIR_MAKER_FEE: '{0} Maker Fee',
LABEL_PAIR_TAKER_FEE: '{0} Taker Fee',
UNLIMITED: '무제한',
BLOCKED: '0',
BLOCKED: 'Disabled',
},
WALLET_ADDRESS_TITLE: '{0} 지갑 생성하기',
WALLET_ADDRESS_GENERATE: '발급',
Expand Down
2 changes: 1 addition & 1 deletion web/src/config/lang/vi.js
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ export default {
LABEL_PAIR_MAKER_FEE: '{0} Maker Fee',
LABEL_PAIR_TAKER_FEE: '{0} Taker Fee',
UNLIMITED: 'Không giới hạn',
BLOCKED: '0',
BLOCKED: 'Disabled',
},
WALLET_ADDRESS_TITLE: 'Tạo ví {0}',
WALLET_ADDRESS_GENERATE: 'Tạo',
Expand Down
2 changes: 1 addition & 1 deletion web/src/config/lang/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ export default {
LABEL_PAIR_MAKER_FEE: '{0} Maker Fee',
LABEL_PAIR_TAKER_FEE: '{0} Taker Fee',
UNLIMITED: '无限制',
BLOCKED: '0',
BLOCKED: 'Disabled',
},
WALLET_ADDRESS_TITLE: '生成{0}钱包',
WALLET_ADDRESS_GENERATE: '生成',
Expand Down
2 changes: 2 additions & 0 deletions web/src/containers/Admin/Plugins/PluginConfigureForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { message, Spin } from 'antd';
import { STATIC_ICONS } from 'config/icons';
import { AdminHocForm } from '../../../components';
import { updatePluginMeta, getPluginMeta } from './action';
import { TOKEN_KEY } from '../../../config/constants';
import './index.css';

const Form = AdminHocForm('PLUGIN_CONFIGURE_FORM');
Expand Down Expand Up @@ -56,6 +57,7 @@ const renderContent = (selectedPlugin, requestPlugin, metaData) => {
</div>
);
} else if (selectedPlugin.admin_view) {
window.plugin_key = TOKEN_KEY;
return (
<div className="config-content mt-5 pb-5">
<div className="mt-2">Configure</div>
Expand Down
2 changes: 1 addition & 1 deletion web/src/containers/Admin/Tiers/Limits.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import withConfig from 'components/ConfigProvider/withConfig';

const limitStatus = (value, nativeCurrency) => {
if (value === -1) {
return 'BLOCKED';
return 'DISABLED';
} else if (value === 0) {
return 'UNLIMITED';
} else if (!value) {
Expand Down
26 changes: 19 additions & 7 deletions web/src/containers/Summary/components/FeesAndLimits.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,34 @@ const FeesAndLimits = ({
pairs,
constants = {},
icons: ICONS,
tiers,
tiers = {},
}) => {
const { verification_level, discount = 0 } = data;
const LEVEL_OF_ACCOUNT = STRINGS.formatString(
STRINGS['SUMMARY.LEVEL_OF_ACCOUNT'],
verification_level
);

const { name } = tiers[verification_level] || {};

const TITLE_OF_ACCOUNT = STRINGS.formatString(
STRINGS['SUMMARY.TITLE_OF_ACCOUNT'],
name
);

const title = TITLE_OF_ACCOUNT || LEVEL_OF_ACCOUNT;

const Discount_percentage =
discount > 0
? STRINGS.formatString(STRINGS['SUMMARY.DISCOUNT'], discount)
: null;
return (
<div className="fee-limits-wrapper">
<IconTitle
stringId="SUMMARY.FEES_AND_LIMIT"
stringId="SUMMARY.TITLE_OF_ACCOUNT,SUMMARY.FEES_AND_LIMIT"
text={
<label>
{STRINGS.formatString(
STRINGS['SUMMARY.FEES_AND_LIMIT'],
LEVEL_OF_ACCOUNT
)}{' '}
{STRINGS.formatString(STRINGS['SUMMARY.FEES_AND_LIMIT'], title)}{' '}
{Discount_percentage}
</label>
}
Expand Down Expand Up @@ -66,7 +73,12 @@ const FeesAndLimits = ({
</div>
</div>
<div>
<LimitsBlock coins={coins} level={verification_level} tiers={tiers} />
<LimitsBlock
coins={coins}
level={verification_level}
title={title}
tiers={tiers}
/>
</div>
<div>
<FeesBlock
Expand Down
4 changes: 2 additions & 2 deletions web/src/containers/Summary/components/LimitsBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const getRows = (coins, level, tiers) => {
);
};

const LimitsBlock = ({ level, coins, tiers }) => {
const LimitsBlock = ({ level, coins, tiers, title }) => {
return (
<div>
<table className="account-limits">
Expand All @@ -112,7 +112,7 @@ const LimitsBlock = ({ level, coins, tiers }) => {
<EditWrapper stringId="LIMITS_BLOCK.HEADER_ROW_DESCRIPTION">
{STRINGS.formatString(
STRINGS['LIMITS_BLOCK.HEADER_ROW_DESCRIPTION'],
level
title
)}
</EditWrapper>
</th>
Expand Down
Loading

0 comments on commit e0d3458

Please sign in to comment.