mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-10-30 12:44:45 +01:00
Compare commits
6 Commits
fiz/task-m
...
fiz/update
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2cf181c95c | ||
|
|
cd9615d731 | ||
|
|
1df8f12541 | ||
|
|
6c766aeaff | ||
|
|
039af36344 | ||
|
|
1a7ba0a84c |
Submodule habitica-images updated: aa72332019...cf18a04339
@@ -117,15 +117,6 @@ describe('Blocker middleware', () => {
|
||||
|
||||
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', () => {
|
||||
|
||||
@@ -56203,13 +56203,13 @@
|
||||
width: 81px;
|
||||
height: 99px;
|
||||
}
|
||||
.Pet-PandaCub-Cryptid {
|
||||
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/Pet-PandaCub-Cryptid.png');
|
||||
.Pet-PandaCub-Cupid {
|
||||
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/Pet-PandaCub-Cupid.png');
|
||||
width: 81px;
|
||||
height: 99px;
|
||||
}
|
||||
.Pet-PandaCub-Cupid {
|
||||
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/Pet-PandaCub-Cupid.png');
|
||||
.Pet-PandaCub-Cyptid {
|
||||
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/Pet-PandaCub-Cyptid.png');
|
||||
width: 81px;
|
||||
height: 99px;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-secondary d-flex align-items-center justify-content-center"
|
||||
:class="{'btn-disabled': !canSave}"
|
||||
:class="{disabled: !canSave}"
|
||||
type="button"
|
||||
@click="submit()"
|
||||
>
|
||||
@@ -162,13 +162,13 @@
|
||||
>
|
||||
<div
|
||||
class="habit-option-icon svg-icon no-transition"
|
||||
:class="task.up ? '' : 'icon-disabled'"
|
||||
:class="task.up ? '' : 'disabled'"
|
||||
v-html="icons.positive"
|
||||
></div>
|
||||
</div>
|
||||
<div
|
||||
class="habit-option-label no-transition"
|
||||
:class="task.up ? cssClass('icon') : 'label-disabled'"
|
||||
:class="task.up ? cssClass('icon') : 'disabled'"
|
||||
>
|
||||
{{ $t('positive') }}
|
||||
</div>
|
||||
@@ -188,13 +188,13 @@
|
||||
>
|
||||
<div
|
||||
class="habit-option-icon no-transition svg-icon negative mx-auto"
|
||||
:class="task.down ? '' : 'icon-disabled'"
|
||||
:class="task.down ? '' : 'disabled'"
|
||||
v-html="icons.negative"
|
||||
></div>
|
||||
</div>
|
||||
<div
|
||||
class="habit-option-label no-transition"
|
||||
:class="task.down ? cssClass('icon') : 'label-disabled'"
|
||||
:class="task.down ? cssClass('icon') : 'disabled'"
|
||||
>
|
||||
{{ $t('negative') }}
|
||||
</div>
|
||||
@@ -592,7 +592,7 @@
|
||||
<button
|
||||
class="btn btn-primary btn-footer
|
||||
d-flex align-items-center justify-content-center"
|
||||
:class="{'btn-disabled': !canSave}"
|
||||
:class="{disabled: !canSave}"
|
||||
type="button"
|
||||
@click="submit()"
|
||||
>
|
||||
@@ -881,14 +881,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
.btn-disabled {
|
||||
.disabled {
|
||||
background-color: $white;
|
||||
border: 2px solid transparent;
|
||||
color: $gray-200;
|
||||
line-height: 1.714;
|
||||
box-shadow: 0px 1px 3px 0px rgba(26, 24, 29, 0.12), 0px 1px 2px 0px rgba(26, 24, 29, 0.24);
|
||||
cursor: not-allowed;
|
||||
opacity: 0.6;
|
||||
|
||||
&:focus {
|
||||
background-color: $white;
|
||||
@@ -950,7 +948,7 @@
|
||||
height: 10px;
|
||||
color: $white;
|
||||
|
||||
&.icon-disabled {
|
||||
&.disabled {
|
||||
color: $gray-200;
|
||||
}
|
||||
|
||||
@@ -964,7 +962,7 @@
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
|
||||
&.label-disabled {
|
||||
&.disabled {
|
||||
color: $gray-100;
|
||||
font-weight: normal;
|
||||
}
|
||||
@@ -1020,7 +1018,7 @@
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.input-group-outer.disabled .input-group-text {
|
||||
.disabled .input-group-text {
|
||||
color: $gray-200;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
"newsroom": "Newsroom",
|
||||
"adminBlockerTypeDescription": "<b>IP-Address</b> - Block access for a specific IP-Address\n\nClient - Block access for a client based on the \"x-client\" header.\n\nE-Mail - Blocks e-mails from being used for signup.",
|
||||
"adminBlockerAreaDescription": "A blocker can either apply to the full site, completely blocking any access. Or it can apply to purchases, which still allows the site to be accessed."
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1038,7 +1038,6 @@
|
||||
"backgrounds082025": "SET 135: Released August 2025",
|
||||
"backgroundSunnyStreetWithShopsText": "Sunny Street with Shops",
|
||||
"backgroundSunnyStreetWithShopsNotes": "Enjoy the sights and sounds of a Sunny Street with Shops.",
|
||||
|
||||
"timeTravelBackgrounds": "Steampunk Backgrounds",
|
||||
"backgroundAirshipText": "Airship",
|
||||
"backgroundAirshipNotes": "Become a sky sailor on board your very own Airship.",
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
"commGuideList05F": "Creation of a duplicate account to avoid consequences",
|
||||
"commGuideList05G": "Intentional deception of Staff in order to avoid consequences or to get another user in trouble",
|
||||
"commGuideList05H": "Severe or repeated attempts to defraud or pressure other players for real-money items",
|
||||
"commGuideList05A": "Other breaches of the Terms and Conditions not specified here",
|
||||
"commGuideList05A": "Other breaches of the Terms of Service not specified here",
|
||||
|
||||
"commGuideHeadingModerateInfractions": "Moderate Infractions",
|
||||
"commGuidePara054": "These infractions will have moderate consequences. When in conjunction with multiple infractions, the consequences may grow more severe.",
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
"sync": "Sync",
|
||||
"tasks": "Tasks",
|
||||
"teams": "Teams",
|
||||
"terms": "Terms and Conditions",
|
||||
"terms": "Terms of Service",
|
||||
"tumblr": "Tumblr",
|
||||
"localStorageTryFirst": "If you are experiencing problems with Habitica, click the button below to clear local storage and most cookies for this website (other websites will not be affected). You will need to log in again after doing this, so first be sure that you know your log-in details, which can be found at Settings -> <%= linkStart %>Site<%= linkEnd %>.",
|
||||
"localStorageTryNext": "If the problem persists, please <%= linkStart %>Report a Bug<%= linkEnd %> if you haven't already.",
|
||||
|
||||
@@ -1739,7 +1739,7 @@
|
||||
"armorArmoireFlyFishingWadersText": "Fly Fishing Waders",
|
||||
"armorArmoireFlyFishingWadersNotes": "Stay perfectly warm and dry when you wade into a stream, pond, lake, or river. Increases Strength and Constitution by <%= attrs %> each. Enchanted Armoire: Fly Fishing Set (Item 2 of 3)",
|
||||
"armorArmoireRedWaistcoatText": "Red Waistcoat",
|
||||
"armorArmoireRedWaistcoatNotes": "Look smart and stunning as you tackle your tasks. There’s something secret hidden in the vest pocket—what do you think it could be? Increases Constitution and Strength by <%= attrs %> each. Enchanted Armoire: Red Waistcoat Set (Item 2 of 2)",
|
||||
"armorArmoireRedWaistcoatNotes": "Look smart and stunning as you tackle your tasks. There's something secret hidden in the vest pocket—what do you think it could be? Increases Constitution and Strength by <%= attrs %> each. Enchanted Armoire: Red Waistcoat Set (Item 2 of 2)",
|
||||
|
||||
"headgear": "helm",
|
||||
"headgearCapitalized": "Headgear",
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
"commGuideHeadingSevereInfractions": "Severe Infractions",
|
||||
"commGuidePara052": "Severe infractions greatly harm the safety of Habitica's community and users, and therefore have severe consequences as a result.",
|
||||
"commGuidePara053": "The following are examples of some severe infractions. This is not a comprehensive list.",
|
||||
"commGuideList05A": "Other breaches of the Terms and Conditions not specified here",
|
||||
"commGuideList05A": "Other breaches of the Terms of Service not specified here",
|
||||
"commGuideList05B": "Hate Speech/Images, Harassment/Stalking, Cyber-Bullying, Flaming, and Trolling",
|
||||
"commGuideList05C": "Violation of Probation",
|
||||
"commGuideList05D": "Impersonation of Staff - this includes claiming player-created spaces not affiliated with Habitica are official and/or moderated by Habitica or its Staff",
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
"sync": "Sync",
|
||||
"tasks": "Tasks",
|
||||
"teams": "Teams",
|
||||
"terms": "Terms and Conditions",
|
||||
"terms": "Terms of Service",
|
||||
"tumblr": "Tumblr",
|
||||
"localStorageTryFirst": "If you are experiencing problems with Habitica, click the button below to clear local storage and most cookies for this website (other websites will not be affected). You will need to log in again after doing this, so first be sure that you know your login details, which can be found at Settings -> <%= linkStart %>Site<%= linkEnd %>.",
|
||||
"localStorageTryNext": "If the problem persists, please <%= linkStart %>Report a Bug<%= linkEnd %> if you haven't already.",
|
||||
|
||||
@@ -187,4 +187,5 @@ api.deleteBlocker = {
|
||||
res.respond(200, savedBlocker);
|
||||
},
|
||||
};
|
||||
|
||||
export default api;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import nconf from 'nconf';
|
||||
import {
|
||||
Forbidden,
|
||||
} from '../libs/errors';
|
||||
@@ -10,19 +9,7 @@ import { model as Blocker } from '../models/blocker';
|
||||
// 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.
|
||||
|
||||
// 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 blockedIps = [];
|
||||
const blockedClients = [];
|
||||
|
||||
Blocker.watchBlockers({
|
||||
|
||||
Reference in New Issue
Block a user