Skip to content

Commit 9005dde

Browse files
authored
Merge pull request #96 from TorMap/dev
Merge dev into master
2 parents 5c76e31 + 2c8ea92 commit 9005dde

23 files changed

+2540
-13462
lines changed

.github/workflows/backend-push.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ jobs:
1010
backend-push:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1414
- uses: gradle/wrapper-validation-action@v1
1515

1616
- name: Set up JDK 11
17-
uses: actions/setup-java@v2
17+
uses: actions/setup-java@v3
1818
with:
1919
java-version: '11'
2020
distribution: 'adopt'

.github/workflows/frontend-pull-request.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
frontend-pull-request:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1414

1515
- name: Check yarn cache and build
1616
run: |

.github/workflows/frontend-push.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
frontend-push:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1414

1515
- name: Build
1616
run: |

backend/build.gradle.kts

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
22

33
group = "org.tormap"
4-
version = "0.0.1"
4+
version = "0.0.2"
55
java.sourceCompatibility = JavaVersion.VERSION_11
66

77
plugins {
8-
kotlin("jvm") version "1.6.10"
9-
kotlin("kapt") version "1.6.10"
10-
kotlin("plugin.spring") version "1.6.10"
11-
kotlin("plugin.allopen") version "1.6.10"
12-
kotlin("plugin.jpa") version "1.6.10"
8+
kotlin("jvm") version "1.6.20"
9+
kotlin("kapt") version "1.6.20"
10+
kotlin("plugin.spring") version "1.6.20"
11+
kotlin("plugin.allopen") version "1.6.20"
12+
kotlin("plugin.jpa") version "1.6.20"
1313

1414
// Generate code documentation https://kotlin.github.io/dokka
1515
id("org.jetbrains.dokka") version "1.6.10"
1616

1717
// Spring https://spring.io/projects/spring-boot
18-
id("org.springframework.boot") version "2.6.3"
18+
id("org.springframework.boot") version "2.6.6"
1919
id("io.spring.dependency-management") version "1.0.11.RELEASE"
2020
}
2121

@@ -37,23 +37,23 @@ dependencies {
3737
kapt("org.springframework.boot:spring-boot-configuration-processor")
3838

3939
// OpenAPI generation and Swagger UI https://springdoc.org/
40-
implementation("org.springdoc:springdoc-openapi-ui:1.6.6")
41-
implementation("org.springdoc:springdoc-openapi-kotlin:1.6.6")
40+
implementation("org.springdoc:springdoc-openapi-ui:1.6.7")
41+
implementation("org.springdoc:springdoc-openapi-kotlin:1.6.7")
4242

4343
// Serialization
44-
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.13.1")
44+
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.13.2")
4545

4646
// Latest stable H2 database driver https://www.h2database.com/
4747
runtimeOnly("com.h2database:h2:1.4.200")
4848

4949
// Run Flyway DB migration tool on startup https://flywaydb.org/
50-
implementation("org.flywaydb:flyway-core:8.4.4")
50+
implementation("org.flywaydb:flyway-core:8.5.7")
5151

5252
// Read .mmdb (MaxMind) DB files for IP lookups https://maxmind.github.io/MaxMind-DB/
53-
implementation("com.maxmind.geoip2:geoip2:3.0.0")
53+
implementation("com.maxmind.geoip2:geoip2:3.0.1")
5454

5555
// Anaylz user agent https://yauaa.basjes.nl/
56-
implementation("nl.basjes.parse.useragent:yauaa:6.8")
56+
implementation("nl.basjes.parse.useragent:yauaa:6.12")
5757

5858
// Packages required by metrics-lib (org.torproject.descriptor in java module) (JavaDoc: https://metrics.torproject.org/metrics-lib/index.html)
5959
implementation("commons-codec:commons-codec:1.10")
@@ -68,8 +68,8 @@ dependencies {
6868
testImplementation("org.springframework.boot:spring-boot-starter-test") {
6969
exclude(group = "org.junit.vintage", module = "junit-vintage-engine")
7070
}
71-
testImplementation("io.kotest:kotest-runner-junit5:5.1.0")
72-
testImplementation("io.kotest:kotest-assertions-core:5.1.0")
71+
testImplementation("io.kotest:kotest-runner-junit5:5.2.3")
72+
testImplementation("io.kotest:kotest-assertions-core:5.2.3")
7373
testImplementation("io.kotest.extensions:kotest-extensions-spring:1.1.0")
7474
}
7575

Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

frontend/.env

+1-10
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,2 @@
1-
# In which browser the frontend should be opened
2-
# BROWSER=none
3-
4-
# The port on which the frontend will be reachable (e.g. http://localhost:3000/)
5-
PORT=3000
6-
71
# The URL pointing to the backend instance (e.g. http://localhost:8080/)
8-
REACT_APP_BACKEND_API_URL=https://api.tormap.org
9-
10-
# The frontend version defined in package.json
11-
REACT_APP_VERSION=$npm_package_version
2+
VITE_BACKEND_API_URL=https://api.tormap.org

frontend/.env.production

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# The URL pointing to the backend instance
2-
REACT_APP_BACKEND_API_URL=https://api.tormap.org
2+
VITE_BACKEND_API_URL=https://api.tormap.org
Binary file not shown.

frontend/.yarnrc.yml

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
1+
defaultSemverRangePrefix: ""
2+
13
nodeLinker: node-modules
24

35
plugins:
46
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
57
spec: "@yarnpkg/plugin-typescript"
68

7-
yarnPath: .yarn/releases/yarn-3.1.1.cjs
9+
supportedArchitectures:
10+
os:
11+
- "current"
12+
- "darwin"
13+
- "linux"
14+
- "win32"
15+
16+
cpu:
17+
- "current"
18+
- "arm64"
19+
- "x64"
20+
21+
yarnPath: .yarn/releases/yarn-3.2.0.cjs

frontend/public/index.html frontend/index.html

+12-11
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,33 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8"/>
5-
<link rel="apple-touch-icon" sizes="180x180" href="%PUBLIC_URL%/apple-touch-icon.png">
6-
<link rel="icon" type="image/png" sizes="32x32" href="%PUBLIC_URL%/favicon-32x32.png">
7-
<link rel="icon" type="image/png" sizes="16x16" href="%PUBLIC_URL%/favicon-16x16.png">
8-
<link rel="mask-icon" href="%PUBLIC_URL%/safari-pinned-tab.svg" color="#5bbad5">
5+
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
6+
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
7+
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
8+
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
99
<meta name="msapplication-TileColor" content="#da532c">
1010
<meta name="theme-color" content="#ffffff">
1111
<!--
1212
manifest.json provides metadata used when your web app is installed on a
1313
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
1414
-->
15-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json"/>
15+
<link rel="manifest" href="/manifest.json"/>
1616
<meta
1717
name="description"
1818
content="TorMap visualises the location of Tor relays on a world map. View details about any relay since October 2007."
1919
/>
2020
<meta name="viewport" content="width=device-width, initial-scale=1"/>
2121
<meta property="og:title" content="TorMap"/>
2222
<meta property="og:type" content="website"/>
23-
<meta property="og:url" content="%PUBLIC_URL%"/>
24-
<meta property="og:image" content="%PUBLIC_URL%/og-image.png"/>
23+
<meta property="og:url" content=""/>
24+
<meta property="og:image" content="/og-image.png"/>
2525
<meta property="og:description" content="TorMap visualises the location of Tor relays on a world map. View details about any relay since October 2007." />
2626
<!--
27-
Notice the use of %PUBLIC_URL% in the tags above.
27+
Notice the use of in the tags above.
2828
It will be replaced with the URL of the `public` folder during the build.
2929
Only files inside the `public` folder can be referenced from the HTML.
3030
31-
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
31+
Unlike "/favicon.ico" or "favicon.ico", "/favicon.ico" will
3232
work correctly both with client-side routing and a non-root public URL.
3333
Learn how to configure a non-root public URL by running `npm run build`.
3434
-->
@@ -40,7 +40,8 @@
4040
<title>TorMap</title>
4141
</head>
4242
<body>
43-
<noscript>You need to enable JavaScript to run this app.</noscript>
44-
<div id="root"></div>
43+
<noscript>You need to enable JavaScript to run this app.</noscript>
44+
<div id="root"></div>
45+
<script type="module" src="./src/index.tsx"></script>
4546
</body>
4647
</html>

frontend/package.json

+25-43
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,42 @@
11
{
22
"name": "tormap",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"private": true,
5+
"scripts": {
6+
"start": "vite",
7+
"build": "tsc && vite build",
8+
"preview": "vite preview"
9+
},
510
"dependencies": {
6-
"@emotion/react": "11.7.1",
7-
"@emotion/styled": "11.6.0",
8-
"@mui/icons-material": "5.4.1",
9-
"@mui/lab": "5.0.0-alpha.68",
10-
"@mui/material": "5.4.1",
11-
"@mui/styles": "5.4.1",
11+
"@emotion/react": "11.9.0",
12+
"@emotion/styled": "11.8.1",
13+
"@mui/icons-material": "5.6.1",
14+
"@mui/lab": "5.0.0-alpha.77",
15+
"@mui/material": "5.6.1",
16+
"@mui/styles": "5.6.1",
1217
"@react-leaflet/core": "1.1.1",
13-
"@testing-library/jest-dom": "5.16.2",
14-
"@testing-library/react": "12.1.2",
15-
"@testing-library/user-event": "13.5.0",
16-
"@types/geojson": "7946.0.8",
17-
"@types/jest": "27.4.0",
18-
"@types/node": "16.11.24",
19-
"@types/react": "17.0.39",
20-
"@types/react-dom": "17.0.11",
21-
"axios": "0.25.0",
18+
"axios": "0.26.1",
2219
"date-fns": "2.28.0",
2320
"leaflet": "1.7.1",
2421
"leaflet.heat": "0.2.0",
25-
"notistack": "2.0.3",
26-
"react": "17.0.2",
27-
"react-dom": "17.0.2",
22+
"notistack": "2.0.4",
23+
"react": "18.0.0",
24+
"react-dom": "18.0.0",
2825
"react-leaflet": "3.2.5",
2926
"react-leaflet-heatmap-layer": "2.0.0",
3027
"react-leaflet-shapefile": "2.0.0",
31-
"react-scripts": "5.0.0",
3228
"react-sliding-pane": "7.1.0",
33-
"typescript": "4.5.5"
29+
"typescript": "4.6.3"
3430
},
35-
"scripts": {
36-
"start": "react-scripts start",
37-
"build": "react-scripts build",
38-
"test": "react-scripts test",
39-
"eject": "react-scripts eject"
40-
},
41-
"eslintConfig": {
42-
"extends": [
43-
"react-app",
44-
"react-app/jest"
45-
]
46-
},
47-
"browserslist": [
48-
">0.2%",
49-
"not dead",
50-
"not ie <= 11",
51-
"not op_mini all"
52-
],
5331
"devDependencies": {
54-
"@babel/plugin-proposal-nullish-coalescing-operator": "7.16.7",
32+
"@types/geojson": "7946.0.8",
5533
"@types/leaflet": "1.7.9",
56-
"css-loader": "6.6.0",
57-
"style-loader": "3.3.1"
34+
"@types/node": "16.11.26",
35+
"@types/react": "18.0.1",
36+
"@types/react-dom": "18.0.0",
37+
"@vitejs/plugin-react-refresh": "1.3.6",
38+
"vite": "2.9.1",
39+
"vite-plugin-checker": "0.4.5"
5840
},
59-
"packageManager": "yarn@3.1.1"
41+
"packageManager": "yarn@3.2.0"
6042
}

frontend/src/components/App.tsx

+23-19
Original file line numberDiff line numberDiff line change
@@ -41,28 +41,32 @@ export const App: FunctionComponent = () => {
4141

4242
return (
4343
<>
44-
{isLoading ? <LoadingAnimation/> : null}
44+
<React.StrictMode>
45+
{isLoading ? <LoadingAnimation/> : null}
46+
</React.StrictMode>
4547
<LeafletWorldMap
4648
setIsLoading={useCallback(setIsLoading, [setIsLoading])}
4749
/>
48-
{isLargeScreen ? <OverlayLarge /> : <OverlaySmall />}
49-
<Box sx={{
50-
color: "#b4b4b4",
51-
background: "#262626",
52-
position: "fixed",
53-
right: "2px",
54-
bottom: "2px",
55-
fontSize: ".7rem",
56-
}}>
57-
<span>
58-
<ExternalLink href="https://leafletjs.com" label={"Leaflet"}/>
59-
{" | © "}
60-
<ExternalLink href="https://www.openstreetmap.org/copyright" label={"OpenStreetMap"}/>
61-
{" contributors © "}
62-
<ExternalLink href="https://carto.com/attributions" label={"CARTO"}/>
63-
</span>
64-
</Box>
65-
<AboutInformation/>
50+
<React.StrictMode>
51+
{isLargeScreen ? <OverlayLarge/> : <OverlaySmall/>}
52+
<Box sx={{
53+
color: "#b4b4b4",
54+
background: "#262626",
55+
position: "fixed",
56+
right: "2px",
57+
bottom: "2px",
58+
fontSize: ".7rem",
59+
}}>
60+
<span>
61+
<ExternalLink href="https://leafletjs.com" label={"Leaflet"}/>
62+
{" | © "}
63+
<ExternalLink href="https://www.openstreetmap.org/copyright" label={"OpenStreetMap"}/>
64+
{" contributors © "}
65+
<ExternalLink href="https://carto.com/attributions" label={"CARTO"}/>
66+
</span>
67+
</Box>
68+
<AboutInformation/>
69+
</React.StrictMode>
6670
</>
6771
)
6872
}

frontend/src/components/dialogs/AboutInformation.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,8 @@ export const AboutInformation: React.FunctionComponent = () => {
233233
and GeoJSON data from <ExternalLink href={"https://geojson-maps.ash.ms/"}
234234
label={"https://geojson-maps.ash.ms/"}/>.
235235
</Typography>
236-
{process.env.REACT_APP_VERSION && <Typography variant={"body2"}>
237-
This frontend version is based on TorMap <ExternalLink href={"https://github.com/TorMap/tormap/releases"} label={process.env.REACT_APP_VERSION}/>.
236+
{APP_VERSION && <Typography variant={"body2"}>
237+
This is TorMap version <ExternalLink href={"https://github.com/TorMap/tormap/releases"} label={APP_VERSION}/>.
238238
</Typography>}
239239
</DialogContent>
240240
{!isLargeScreen ? <DialogActions sx={{

frontend/src/components/leaflet/LeafletWorldMap.tsx

+11-9
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,17 @@ export const LeafletWorldMap: FunctionComponent<Props> = ({setIsLoading}) => {
7878
maxBounds={[[-180, -360], [180, 360]]}
7979
tap={isAtLeastMediumScreen ? false : undefined} // fixes macOS/Safari bug for Leaflet v1.7.1
8080
>
81-
<LeafletLayers
82-
relays={relays}
83-
reloadSelectedDay={useCallback(() => setRefreshDayCount(prev => prev + 1), [])}
84-
/>
85-
<TileLayer
86-
maxZoom={19}
87-
url="https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png"
88-
noWrap={true}
89-
/>
81+
<React.StrictMode>
82+
<LeafletLayers
83+
relays={relays}
84+
reloadSelectedDay={useCallback(() => setRefreshDayCount(prev => prev + 1), [])}
85+
/>
86+
<TileLayer
87+
maxZoom={19}
88+
url="https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png"
89+
noWrap={true}
90+
/>
91+
</React.StrictMode>
9092
</MapContainer>
9193
);
9294
};

frontend/src/config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {Settings} from "./types/settings";
22
import {RelayFlag, RelayType} from "./types/relay";
33

4-
export const backendApiUrl = process.env.REACT_APP_BACKEND_API_URL
4+
export const backendApiUrl = import.meta.env.VITE_BACKEND_API_URL?.toString()
55

66
// Default settings, that are selected on page load
77
export const defaultSettings: Settings = {

frontend/src/global.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
declare const APP_VERSION: string;

0 commit comments

Comments
 (0)