mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-13 20:57:24 +01:00
Compare commits
26 Commits
v5.41.7
...
fiz/smalle
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
95dfb37512 | ||
|
|
9a1fb18959 | ||
|
|
2ea0b64603 | ||
|
|
bd1aa1e417 | ||
|
|
7c49b845d6 | ||
|
|
1ee172139d | ||
|
|
6447b9ab4b | ||
|
|
5c414099d9 | ||
|
|
5e8e1179aa | ||
|
|
7e86a62624 | ||
|
|
1ba9dda0ed | ||
|
|
227e5ceaa8 | ||
|
|
f77ab5a3ab | ||
|
|
1916faf647 | ||
|
|
80ecb5cef1 | ||
|
|
75c36e6622 | ||
|
|
78330c975a | ||
|
|
95266f6cb3 | ||
|
|
e9b2c1b51a | ||
|
|
2a2bea07ab | ||
|
|
ea60ddbf4c | ||
|
|
1c2ca0e478 | ||
|
|
ef2b7eb928 | ||
|
|
3d16387a61 | ||
|
|
93b7770eaa | ||
|
|
a9f84d3307 |
Submodule habitica-images updated: 992d838120...aa72332019
@@ -117,6 +117,15 @@ describe('Blocker middleware', () => {
|
|||||||
|
|
||||||
checkIPBlockedErrorThrown(next);
|
checkIPBlockedErrorThrown(next);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('throws when the ip is blocked', () => {
|
||||||
|
req.ip = '192.168.1.1';
|
||||||
|
sandbox.stub(nconf, 'get').withArgs('BLOCKED_IPS').returns('192.168.1.1');
|
||||||
|
const attachBlocker = requireAgain(pathToBlocker).default;
|
||||||
|
attachBlocker(req, res, next);
|
||||||
|
|
||||||
|
checkIPBlockedErrorThrown(next);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Blocking clients', () => {
|
describe('Blocking clients', () => {
|
||||||
|
|||||||
@@ -218,13 +218,19 @@
|
|||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
|
max-width: 400px;
|
||||||
// somehow the browser felt like setting this 398px instead
|
width: 100%;
|
||||||
// now its fixed to 400 :)
|
|
||||||
width: 400px;
|
|
||||||
|
|
||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
|
|
||||||
|
@media (max-width: 589px) {
|
||||||
|
max-width: 100%;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 353px) {
|
||||||
|
gap: 0.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
.quest-col {
|
.quest-col {
|
||||||
::v-deep {
|
::v-deep {
|
||||||
.item-wrapper {
|
.item-wrapper {
|
||||||
@@ -251,6 +257,28 @@
|
|||||||
::v-deep & {
|
::v-deep & {
|
||||||
.modal-dialog {
|
.modal-dialog {
|
||||||
width: 448px !important;
|
width: 448px !important;
|
||||||
|
max-width: calc(100vw - 20px);
|
||||||
|
margin: 0.5rem auto;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
@media (max-width: 468px) {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 353px) {
|
||||||
|
width: 100% !important;
|
||||||
|
margin: 0.25rem auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
@media (max-width: 300px) {
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,12 @@
|
|||||||
box-shadow: 0 1px 2px 0 rgba($black, 0.2);
|
box-shadow: 0 1px 2px 0 rgba($black, 0.2);
|
||||||
z-index: 9;
|
z-index: 9;
|
||||||
height: 3rem;
|
height: 3rem;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
@media (max-width: 683px) {
|
||||||
|
height: auto;
|
||||||
|
min-height: 3rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-link {
|
.nav-link {
|
||||||
@@ -23,6 +29,19 @@
|
|||||||
padding: 0.75rem;
|
padding: 0.75rem;
|
||||||
|
|
||||||
color: $gray-50;
|
color: $gray-50;
|
||||||
|
white-space: nowrap;
|
||||||
|
|
||||||
|
@media (max-width: 683px) {
|
||||||
|
padding: 0.5rem;
|
||||||
|
font-size: 13px;
|
||||||
|
flex: 1 1 auto;
|
||||||
|
min-width: fit-content;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 576px) {
|
||||||
|
padding: 0.5rem 0.4rem;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
&.active {
|
&.active {
|
||||||
color: $purple-300;
|
color: $purple-300;
|
||||||
|
|||||||
@@ -269,7 +269,13 @@
|
|||||||
|
|
||||||
.modal-dialog {
|
.modal-dialog {
|
||||||
width: 448px;
|
width: 448px;
|
||||||
|
max-width: calc(100vw - 20px);
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
@media (max-width: 468px) {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.badge-dialog {
|
.badge-dialog {
|
||||||
@@ -346,7 +352,23 @@
|
|||||||
|
|
||||||
.content {
|
.content {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width: 448px;
|
width: 100%;
|
||||||
|
max-width: 448px;
|
||||||
|
margin: 0 auto;
|
||||||
|
|
||||||
|
@media (max-width: 468px) {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
@media (max-width: 300px) {
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-wrapper {
|
.item-wrapper {
|
||||||
|
|||||||
@@ -111,6 +111,22 @@
|
|||||||
|
|
||||||
.modal-dialog {
|
.modal-dialog {
|
||||||
width: 448px;
|
width: 448px;
|
||||||
|
max-width: calc(100vw - 20px);
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
@media (max-width: 468px) {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
@media (max-width: 300px) {
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal-body {
|
.modal-body {
|
||||||
|
|||||||
@@ -165,6 +165,28 @@
|
|||||||
.modal-dialog {
|
.modal-dialog {
|
||||||
margin-top: 8%;
|
margin-top: 8%;
|
||||||
width: 448px !important;
|
width: 448px !important;
|
||||||
|
max-width: calc(100vw - 20px);
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
@media (max-width: 468px) {
|
||||||
|
width: 100% !important;
|
||||||
|
margin: 0.5rem auto;
|
||||||
|
margin-top: 2%;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 353px) {
|
||||||
|
margin: 0.25rem auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
@media (max-width: 300px) {
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
|
|||||||
@@ -187,5 +187,4 @@ api.deleteBlocker = {
|
|||||||
res.respond(200, savedBlocker);
|
res.respond(200, savedBlocker);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default api;
|
export default api;
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import nconf from 'nconf';
|
||||||
import {
|
import {
|
||||||
Forbidden,
|
Forbidden,
|
||||||
} from '../libs/errors';
|
} from '../libs/errors';
|
||||||
@@ -9,7 +10,19 @@ import { model as Blocker } from '../models/blocker';
|
|||||||
// NOTE: it's meant to be used behind a proxy (for example a load balancer)
|
// NOTE: it's meant to be used behind a proxy (for example a load balancer)
|
||||||
// that uses the 'x-forwarded-for' header to forward the original IP addresses.
|
// that uses the 'x-forwarded-for' header to forward the original IP addresses.
|
||||||
|
|
||||||
const blockedIps = [];
|
// A list of comma separated IPs to block
|
||||||
|
// It works fine as long as the list is short,
|
||||||
|
// if the list becomes too long for an env variable we'll switch to Redis.
|
||||||
|
const BLOCKED_IPS_RAW = nconf.get('BLOCKED_IPS');
|
||||||
|
|
||||||
|
const blockedIps = BLOCKED_IPS_RAW
|
||||||
|
? BLOCKED_IPS_RAW
|
||||||
|
.trim()
|
||||||
|
.split(',')
|
||||||
|
.map(blockedIp => blockedIp.trim())
|
||||||
|
.filter(blockedIp => Boolean(blockedIp))
|
||||||
|
: [];
|
||||||
|
|
||||||
const blockedClients = [];
|
const blockedClients = [];
|
||||||
|
|
||||||
Blocker.watchBlockers({
|
Blocker.watchBlockers({
|
||||||
|
|||||||
Reference in New Issue
Block a user