make canvases.json and proxies.json externals

This commit is contained in:
HF 2020-04-27 04:23:50 +02:00
parent 1de40034a6
commit 43d914ed3c
11 changed files with 14 additions and 10 deletions

View File

@ -94,7 +94,7 @@ Configuration takes place in the environment variables that are defined in ecosy
Notes:
- to be able to use USE_PROXYCHECK, you have to have an account on proxycheck.io or getipintel or another checker setup and you might set some proxies in `src/proxies.json` (before building) that get used for making proxycheck requests. Look into `src/isProxy.js` to see how things work, but keep in mind that this isn't neccessarily how pixelplanet.fun uses it.
- to be able to use USE_PROXYCHECK, you have to have an account on proxycheck.io or getipintel or another checker setup and you might set some proxies in`proxies.json that get used for making proxycheck requests. Look into `src/isProxy.js` to see how things work, but keep in mind that this isn't neccessarily how pixelplanet.fun uses it.
- Admins are users with 0cd and access to `./admintools` for image-upload and whatever
- You can find out the id of a user by looking into the logs (i.e. `info: {ip} / {id} wants to place 2 in (1701, -8315)`) when he places a pixel or by checking the MySql Users database
- If you use gmail as mail transport, make sure that less-secure apps are allowed to access it in your settings [here](https://myaccount.google.com/lesssecureapps)
@ -120,7 +120,7 @@ Notes:
- The HTML for SocialMedia logins is in src/componets/UserAreaModal.js , delete stuff from there if you don't need it
- The HTML for the Help Screen is in src/components/HelpModal.js
Canvas specific configuartion like colors and cooldown is in `src/canvases.json` for all canvases.
Canvas specific configuartion like colors and cooldown is in canvases.json` for all canvases.
The CanvasSize is expected to be a power of 4 (4096, 16384, 65536) and not smaller than 256 and not larger than 65536 (you can however change the websocket packages in src/socket/packages/ to send chunk coordinates in 16bit and surpas that limit).
bcd is base cooldown for unset pixels, pcd is cooldown for placing on top of others, cds is stacktime, ranked if it counts towards the pixelPlaced stats, req is the requirement to be allowed to set on canvas in total pixels placed (or -1 for no requirement or 0 for having to be registered). `sd` is the start-date of the canvas, its used to know the oldest available backup (see Backup & Historical View section). All the cooldown values are in ms.
cli is the numbers of colors to ignore for the player palette, i.e. the given world is made out of blue ocean and white continents with those two colors being the first two in the palette and they are used to know if a pixel got set by a player or not, so cli = 2 here.

View File

@ -8,7 +8,7 @@ import RedisCanvas from '../data/models/RedisCanvas';
import logger from './logger';
import { getChunkOfPixel } from './utils';
import { TILE_SIZE } from './constants';
import canvases from '../canvases.json';
import canvases from './canvases.json';
import Palette from './Palette';

View File

@ -8,7 +8,7 @@ import { getChunkOfPixel, getOffsetOfPixel } from './utils';
import webSockets from '../socket/websockets';
import logger from './logger';
import RedisCanvas from '../data/models/RedisCanvas';
import canvases from '../canvases.json';
import canvases from './canvases.json';
import { THREE_CANVAS_HEIGHT } from './constants';

View File

@ -5,7 +5,7 @@
*
* @flow
*/
import canvases from '../canvases.json';
import canvases from './canvases.json';
export default async function getMe(user) {

View File

@ -8,7 +8,7 @@ import fs from 'fs';
import type { Cell } from './Cell';
import logger from './logger';
import canvases from '../canvases.json';
import canvases from './canvases.json';
import Palette from './Palette';
import RedisCanvas from '../data/models/RedisCanvas';

View File

@ -6,7 +6,7 @@ import {
THREE_TILE_SIZE,
THREE_CANVAS_HEIGHT,
} from '../../core/constants';
import canvases from '../../canvases.json';
import canvases from './canvases.json';
import logger from '../../core/logger';
import redis from '../redis';

View File

@ -20,7 +20,7 @@ import logger from '../core/logger';
import { Blacklist, Whitelist } from '../data/models';
import { MINUTE } from '../core/constants';
import canvases from '../canvases.json';
import canvases from './canvases.json';
import { imageABGR2Canvas } from '../core/Image';
import adminHtml from '../components/Admin';

View File

@ -9,7 +9,7 @@
import type { Request, Response } from 'express';
import canvases from '../../canvases.json';
import canvases from './canvases.json';
import webSockets from '../../socket/websockets';
const CANVAS_MAX_XY = (canvases[0].size / 2);

View File

@ -7,7 +7,7 @@
import isoFetch from 'isomorphic-fetch';
import HttpProxyAgent from 'http-proxy-agent';
import proxylist from '../proxies.json';
import proxylist from './proxies.json';
import logger from '../core/logger';

View File

@ -14,6 +14,8 @@ async function copy() {
await Promise.all([
copyFile('LICENSE', 'build/LICENSE'),
copyDir('public', 'build/public'),
copyFile('src/canvases.json', 'build/canvases.json'),
copyFile('src/proxies.json', 'build/proxies.json'),
copyFile('tools/example-ecosystem.yml', 'build/ecosystem.example.yml'),
copyFile('tools/example-ecosystem-backup.yml', 'build/ecosystem-backup.example.yml'),
]);

View File

@ -333,6 +333,8 @@ const webConfig = {
// needed because webpack tries to pack socket.io
externals: [
/\/proxies\.json$/,
/\/canvases\.json$/,
/^\.\/assets\.json$/,
(context, request, callback) => {
const isExternal = request.match(/^[@a-z][a-z/.\-0-9]*$/i)