Compare commits

...

5 commits

Author SHA1 Message Date
dependabot[bot]
0ab10cb3ee
Merge f9e5f4c812 into 322337edea 2024-11-25 17:10:49 +00:00
Fedor Katurov
322337edea add analytics 2023-12-29 12:34:09 +07:00
Fedor Katurov
1dcfd7e9c0 change backend and osrm urls 2023-12-01 10:44:15 +07:00
Fedor Katurov
49a2015510 pass additional args on a build stage 2023-11-30 16:09:23 +07:00
Fedor Katurov
12f27b8307 debug REACT_APP_API_ADDR 2023-11-30 16:03:45 +07:00
6 changed files with 28 additions and 9 deletions

View file

@ -14,8 +14,8 @@ steps:
- master - master
environment: environment:
REACT_APP_PUBLIC_PATH: https://map.vault48.org/ REACT_APP_PUBLIC_PATH: https://map.vault48.org/
REACT_APP_API_ADDR: https://backend.map.vault48.org REACT_APP_API_ADDR: https://backend-map.vault48.org
REACT_APP_OSRM_URL: https://vault48.org:5001/route/v1 REACT_APP_OSRM_URL: https://osrm.vault48.org/route/v1
REACT_APP_OSRM_PROFILE: bike REACT_APP_OSRM_PROFILE: bike
settings: settings:
dockerfile: docker/www/Dockerfile dockerfile: docker/www/Dockerfile

View file

@ -1,4 +1,4 @@
REACT_APP_PUBLIC_PATH = https://alpha-map.vault48.org/ REACT_APP_PUBLIC_PATH = https://map.vault48.org/
REACT_APP_API_ADDR = https://alpha-map.vault48.org:3001 REACT_APP_API_ADDR = https://backend.map.vault48.org
REACT_APP_OSRM_URL = https://vault48.org:5001/route/v1 REACT_APP_OSRM_URL = https://vault48.org:5001/route/v1
REACT_APP_OSRM_PROFILE = bike REACT_APP_OSRM_PROFILE = bike

View file

@ -1,11 +1,26 @@
# stage1 as builder # stage1 as builder
FROM node:erbium-alpine as builder FROM node:erbium-alpine as builder
COPY package.json yarn.lock ./ COPY package.json yarn.lock ./
RUN yarn RUN yarn
COPY . . COPY . .
ARG REACT_APP_PUBLIC_PATH
ARG REACT_APP_API_ADDR
ARG REACT_APP_OSRM_URL
ARG REACT_APP_OSRM_PROFILE
ENV REACT_APP_PUBLIC_PATH $REACT_APP_PUBLIC_PATH
ENV REACT_APP_API_ADDR $REACT_APP_API_ADDR
ENV REACT_APP_OSRM_URL $REACT_APP_OSRM_URL
ENV REACT_APP_OSRM_PROFILE $REACT_APP_OSRM_PROFILE
RUN yarn build RUN yarn build
FROM nginx:alpine FROM nginx:alpine
COPY docker/www/nginx.conf /etc/nginx/nginx.conf COPY docker/www/nginx.conf /etc/nginx/nginx.conf
RUN rm -rf /usr/share/nginx/html/* RUN rm -rf /usr/share/nginx/html/*
COPY --from=builder /build /usr/share/nginx/html COPY --from=builder /build /usr/share/nginx/html

View file

@ -6,6 +6,9 @@
<link href="https://fonts.googleapis.com/css?family=Rubik:300,400,500,700&amp;subset=cyrillic" rel="stylesheet" /> <link href="https://fonts.googleapis.com/css?family=Rubik:300,400,500,700&amp;subset=cyrillic" rel="stylesheet" />
<title>Редактор маршрутов</title> <title>Редактор маршрутов</title>
<!-- analytics, lol -->
<script async src="https://anal.vault48.org/script.js" data-website-id="9f2c8b59-93ff-4bcc-9ab6-11541f68f198"></script>
<link rel="shortcut icon" href="/favicon.png" type="image/png"> <link rel="shortcut icon" href="/favicon.png" type="image/png">
<meta property="og:image" content="/misc/vk_preview.png" /> <meta property="og:image" content="/misc/vk_preview.png" />

View file

@ -63,7 +63,7 @@ export class UserPanelUnconnected extends PureComponent<Props, State> {
}; };
componentDidMount() { componentDidMount() {
window.addEventListener('message', e => { window.addEventListener('message', (e) => {
const { data } = e; const { data } = e;
if ( if (
@ -123,7 +123,7 @@ export class UserPanelUnconnected extends PureComponent<Props, State> {
openGpxDialog = () => { openGpxDialog = () => {
this.props.editorChangeMode(MODES.GPX); this.props.editorChangeMode(MODES.GPX);
} };
render() { render() {
const { const {

View file

@ -5,9 +5,10 @@ const PUBLIC_PATH = process.env.REACT_APP_PUBLIC_PATH || '';
const API_ADDR = process.env.REACT_APP_API_ADDR || ''; const API_ADDR = process.env.REACT_APP_API_ADDR || '';
const OSRM_URL = process.env.REACT_APP_OSRM_URL || ''; const OSRM_URL = process.env.REACT_APP_OSRM_URL || '';
const OSRM_PROFILE = process.env.REACT_APP_OSRM_PROFILE || 'bike'; const OSRM_PROFILE = process.env.REACT_APP_OSRM_PROFILE || 'bike';
const OSRM_TEST_URL = ([south_west, north_east]: LatLngLiteral[]) => ( const OSRM_TEST_URL = ([south_west, north_east]: LatLngLiteral[]) =>
`${OSRM_URL}/${OSRM_PROFILE}/${Object.values(south_west).join(',')};${Object.values(north_east).join(',')}` `${OSRM_URL}/${OSRM_PROFILE}/${Object.values(south_west).join(',')};${Object.values(
); north_east
).join(',')}`;
export const CLIENT = { export const CLIENT = {
OSRM_URL, OSRM_URL,