Skip to content

Commit 7fad010

Browse files
authored
Merge pull request #608 from WatWowMap/develop
Sync Main & Develop
2 parents 91f699f + 0450c9d commit 7fad010

39 files changed

+402
-158
lines changed

.configref

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18036
1+
18095

.github/workflows/config.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,16 @@ jobs:
1717
fetch-depth: 2
1818
- name: Get changed files
1919
id: changed-files
20-
uses: tj-actions/changed-files@v19
20+
uses: tj-actions/changed-files@v32
2121
with:
2222
files: |
2323
server/src/configs/default.json
24+
- name: Setup Node.js environment
25+
if: steps.changed-files.outputs.any_changed == 'true'
26+
uses: actions/setup-node@v3
27+
with:
28+
node-version: 16
29+
cache: 'yarn'
2430
- name: Run script
2531
if: steps.changed-files.outputs.any_changed == 'true'
2632
run: |

.github/workflows/docker.yml

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Docker
2-
on: [push, release]
2+
on: [push]
33

44
env:
55
REGISTRY: ghcr.io
@@ -10,18 +10,27 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Check out code
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v3
1414
with:
1515
fetch-depth: 2
16+
- name: Get changed files
17+
id: changed-files
18+
uses: tj-actions/changed-files@v32
19+
with:
20+
files: |
21+
server/src/configs/*.json
1622
- name: Setup Node.js environment
17-
uses: actions/setup-node@v2
23+
if: steps.changed-files.outputs.any_changed == 'true'
24+
uses: actions/setup-node@v3
1825
with:
1926
node-version: 16
20-
cache: "yarn"
27+
cache: 'yarn'
2128
- name: Generate latest env vars
29+
if: steps.changed-files.outputs.any_changed == 'true'
2230
run: |
2331
yarn gen-env-config
2432
- name: Commit and push changes
33+
if: steps.changed-files.outputs.any_changed == 'true'
2534
uses: devops-infra/[email protected]
2635
with:
2736
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -31,33 +40,32 @@ jobs:
3140
needs: Sync
3241
runs-on: ubuntu-latest
3342
steps:
34-
- uses: actions/checkout@v2
35-
36-
- name: Set .gitsha
37-
if: github.event_name == 'push'
38-
run: "echo ${{github.sha}} > .gitsha"
39-
- name: Set .gitref
40-
if: github.event_name == 'push'
41-
run: "echo ${{github.ref}} > .gitref"
43+
- uses: actions/checkout@v3
4244

43-
- name: Log in to the Container registry
44-
uses: docker/login-action@v1
45-
with:
46-
registry: ${{ env.REGISTRY }}
47-
username: ${{ github.actor }}
48-
password: ${{ secrets.GITHUB_TOKEN }}
45+
- name: Set .gitsha
46+
if: github.event_name == 'push'
47+
run: 'echo ${{github.sha}} > .gitsha'
48+
- name: Set .gitref
49+
if: github.event_name == 'push'
50+
run: 'echo ${{github.ref}} > .gitref'
4951

50-
- name: Extract metadata (tags, labels) for Docker
51-
id: meta
52-
uses: docker/metadata-action@v3
53-
with:
54-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
52+
- name: Log in to the Container registry
53+
uses: docker/login-action@v2
54+
with:
55+
registry: ${{ env.REGISTRY }}
56+
username: ${{ github.actor }}
57+
password: ${{ secrets.GITHUB_TOKEN }}
5558

56-
- name: Build and push Docker image
57-
uses: docker/build-push-action@v2
58-
with:
59-
context: .
60-
push: true
61-
tags: ${{ steps.meta.outputs.tags }}
62-
labels: ${{ steps.meta.outputs.labels }}
59+
- name: Extract metadata (tags, labels) for Docker
60+
id: meta
61+
uses: docker/metadata-action@v4
62+
with:
63+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
6364

65+
- name: Build and push Docker image
66+
uses: docker/build-push-action@v3
67+
with:
68+
context: .
69+
push: true
70+
tags: ${{ steps.meta.outputs.tags }}
71+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
with:
1313
fetch-depth: 2
1414
- name: Setup Node.js environment
15-
uses: actions/setup-node@v2
15+
uses: actions/setup-node@v3
1616
with:
1717
node-version: 16
1818
cache: 'yarn'

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
with:
1212
fetch-depth: 2
1313
- name: Setup Node.js environment
14-
uses: actions/setup-node@v2
14+
uses: actions/setup-node@v3
1515
with:
1616
node-version: 16
1717
cache: 'yarn'

docker-compose.example.yml

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,54 @@ services:
66
command: sh -c "yarn start"
77
restart: unless-stopped
88
environment:
9+
# All database values are ignored if you are using a `local.json` file!
10+
11+
# Your Scanner Database
912
SCANNER_DB_HOST: 127.0.0.1
1013
SCANNER_DB_PORT: 3306
1114
SCANNER_DB_USERNAME: scanner_username
1215
SCANNER_DB_PASSWORD: scanner_user_pw
13-
SCANNER_DB_NAME: realdevicemap
16+
SCANNER_DB_NAME: scanner_db
17+
18+
# Your ReactMap Database
19+
# optional, but recommended, if omitted it will default to your manual database
20+
REACT_MAP_DB_HOST: 127.0.0.1
21+
REACT_MAP_DB_PORT: 3306
22+
REACT_MAP_DB_USERNAME: react_map_username
23+
REACT_MAP_DB_PASSWORD: react_map_user_pw
24+
REACT_MAP_DB_NAME: react_map_db
25+
26+
# Your Manual Database (Optional - Nests & Portals)
1427
MANUAL_DB_HOST: 127.0.0.1
1528
MANUAL_DB_PORT: 3306
1629
MANUAL_DB_USERNAME: manual_username
1730
MANUAL_DB_PASSWORD: manual_user_pw
1831
MANUAL_DB_NAME: manual_db
32+
33+
# Other config values - the below env vars will override anything, including `local.json`
34+
# More config values you can add:
35+
# https://github.com/WatWowMap/ReactMap/blob/main/server/src/configs/custom-environment-variables.json
36+
# Config wiki page:
37+
# https://github.com/WatWowMap/ReactMap/wiki/04.-Full-Config-Explanation
38+
# Devs recommened that you use a `local.json` config file though instead of env variables!
1939
MAP_GENERAL_TITLE: ReactMap
2040
MAP_GENERAL_START_LAT: 0
2141
MAP_GENERAL_START_LON: 0
22-
ARRAY_VALUE_EXAMPLE: "[3, 4, 5]"
42+
# ARRAY_VALUE_EXAMPLE: "[3, 4, 5]"
43+
2344
volumes:
45+
# All of these are optional - comment out whichever ones you aren't using
2446
- ./server/src/configs/areas.json:/home/node/server/src/configs/areas.json
2547
- ./server/src/configs/local.json:/home/node/server/src/configs/local.json
2648
- ./server/src/configs/geofence.json/:/home/node/server/src/configs/geofence.json
2749
- ./example.env:/home/node/.env
50+
2851
security_opt:
29-
- no-new-privileges:true #https://nodramadevops.com/2019/06/running-docker-application-containers-more-securely/
52+
# https://nodramadevops.com/2019/06/running-docker-application-containers-more-securely/
53+
- no-new-privileges:true
54+
3055
ports:
31-
- "9090:8080"
56+
- '9090:8080'
3257
# nginx:
3358
# image: nginx
3459
# container_name: nginx

ecosystem.config.example.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
module.exports = {
2+
apps: [
3+
{
4+
name: 'ReactMap',
5+
script: 'ReactMap.js',
6+
instances: 1,
7+
autorestart: false,
8+
cron_restart: '*/60 */24 * * *',
9+
exec_mode: 'fork',
10+
max_memory_restart: '1G',
11+
env_production: {
12+
NODE_ENV: 'production',
13+
},
14+
},
15+
// Advanced, comment out or remove the above block if you uncomment these two
16+
// {
17+
// name: 'RM_Client',
18+
// script: 'yarn build && yarn generate',
19+
// instances: 1,
20+
// autorestart: false,
21+
// cron_restart: '*/60 */24 * * *',
22+
// exec_mode: 'fork',
23+
// max_memory_restart: '1G',
24+
// env_production: {
25+
// NODE_ENV: 'production',
26+
// },
27+
// },
28+
// {
29+
// name: 'RM_Server',
30+
// script: 'server/src/index.js',
31+
// instances: 4,
32+
// cron_restart: '*/60 */24 * * *',
33+
// exec_mode: 'cluster',
34+
// autorestart: true,
35+
// max_memory_restart: '4G',
36+
// env_production: {
37+
// NODE_ENV: 'production',
38+
// },
39+
// },
40+
],
41+
}

esbuild.config.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@ const esbuildMxnCopy = require('esbuild-plugin-mxn-copy')
1111
const aliasPlugin = require('esbuild-plugin-path-alias')
1212
const { eslintPlugin } = require('esbuild-plugin-eslinter')
1313

14+
const pkg = require('./package.json')
15+
1416
const env = fs.existsSync(resolve(__dirname, '.env'))
1517
? dotenv.config()
1618
: { parsed: process.env }
17-
const { version } = JSON.parse(
18-
fs.readFileSync(resolve(__dirname, 'package.json')),
19-
)
2019
const isDevelopment = Boolean(process.argv.includes('--dev'))
2120
const isRelease = Boolean(process.argv.includes('--release'))
2221
const isServing = Boolean(process.argv.includes('--serve'))
@@ -112,7 +111,7 @@ ${customPaths.map((x, i) => ` ${i + 1}. src/${x.split('src/')[1]}`).join('\n')}
112111
},
113112
})
114113
}
115-
console.log(`[BUILD] Building production version: ${version}`)
114+
console.log(`[BUILD] Building production version: ${pkg.version}`)
116115
}
117116

118117
const esbuild = {
@@ -121,7 +120,7 @@ const esbuild = {
121120
bundle: true,
122121
outdir: 'dist/',
123122
publicPath: '/',
124-
entryNames: isDevelopment ? undefined : `[name]-${version}-[hash]`,
123+
entryNames: isDevelopment ? undefined : `[name]-${pkg.version}-[hash]`,
125124
metafile: true,
126125
minify: env.parsed.NO_MINIFIED ? false : isRelease || !isDevelopment,
127126
logLevel: isDevelopment ? 'info' : 'error',
@@ -143,7 +142,7 @@ const esbuild = {
143142
SENTRY_DSN: env.parsed.SENTRY_DSN || '',
144143
SENTRY_TRACES_SAMPLE_RATE: env.parsed.SENTRY_TRACES_SAMPLE_RATE || 0.1,
145144
SENTRY_DEBUG: env.parsed.SENTRY_DEBUG || false,
146-
VERSION: version,
145+
VERSION: pkg.version,
147146
DEVELOPMENT: isDevelopment,
148147
CUSTOM: hasCustom,
149148
LOCALES: fs.readdirSync(resolve(__dirname, 'public/locales')),

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "reactmap",
3-
"version": "1.6.5",
3+
"version": "1.6.8",
44
"description": "React based frontend map.",
55
"main": "ReactMap.js",
66
"author": "TurtIeSocks <[email protected]>",
@@ -25,8 +25,8 @@
2525
"migrate:latest": "knex --knexfile server/knexfile.cjs migrate:latest",
2626
"migrate:rollback": "knex --knexfile server/knexfile.cjs migrate:rollback",
2727
"release": "node server/scripts/newRelease.js",
28-
"prettier:check": "prettier --check \"**/*.{css,html,js,jsx}\"",
29-
"prettier:fix": "prettier --write \"**/*.{css,html,js,jsx}\"",
28+
"prettier:check": "prettier --check \"**/*.{css,html,js,jsx,yml}\"",
29+
"prettier:fix": "prettier --write \"**/*.{css,html,js,jsx,yml}\"",
3030
"eslint:check": "eslint \"**/*.{js,jsx}\"",
3131
"eslint:fix": "eslint \"**/*.{js,jsx}\" --fix"
3232
},
@@ -113,7 +113,7 @@
113113
"react-virtualized-auto-sizer": "^1.0.5",
114114
"react-window": "^1.8.6",
115115
"require-from-string": "^2.0.2",
116-
"suncalc": "^1.8.0",
116+
"suncalc": "^1.9.0",
117117
"zustand": "^4.0.0-rc.1"
118118
}
119119
}

public/base-locales/en.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,5 +558,7 @@
558558
"seen_nearby_cell": "Seen in this Cell",
559559
"seen_lure_encounter": "Lure Encounter",
560560
"seen_lure_wild": "Lure Spawn",
561-
"seen_wild": "Wild Spawn"
562-
}
561+
"seen_wild": "Wild Spawn",
562+
"event_stops": "Event Stops",
563+
"event_stop_timers": "Event Stop Timers"
564+
}

0 commit comments

Comments
 (0)