Skip to content

Commit

Permalink
Merge branch 'main' of github.com:teambtcmap/btcmap.org into reports-…
Browse files Browse the repository at this point in the history
…compress
  • Loading branch information
secondl1ght committed Dec 21, 2023
2 parents 68b23f6 + ee7a5d6 commit e543236
Show file tree
Hide file tree
Showing 34 changed files with 99 additions and 289 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ Tagger profile badges by [AndrejCibik](https://twitter.com/AndrejCibik)

<a href="https://www.flaticon.com/free-icons/satoshi-nakamoto" title="satoshi nakamoto icons">Satoshi nakamoto icons created by Vitaly Gorbachev - Flaticon</a>

Treasure Chest icon by [Bonsaiheldin](https://opengameart.org/content/treasure-chests-32x32)

---

![Untitled](https://user-images.githubusercontent.com/85003930/194117128-2f96bafd-2379-407a-a584-6c03396a42cc.png)
9 changes: 9 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Security Policy

## Supported Versions

All versions.

## Reporting a Vulnerability

Please report all issues to [[email protected]](mailto:[email protected]) and I will get back to you as soon as possible. If a legitimate vulnerability is found that requires fixing, some sats may be sent in return. Keeping in mind that this is an open source project without funding. If you could include suggested actions to patch the problem that would also be helpful. Thanks.
2 changes: 2 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[images]
remote_images = ["https://static.btcmap.org/images/communities/.*", "https://www.openstreetmap.org/.*", "https://avatars.githubusercontent.com/.*" ]
4 changes: 0 additions & 4 deletions src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,4 @@
.boosted-icon {
background-image: url('/icons/boosted-icon-pin.svg');
}

.treasure-icon {
background-image: url('/icons/treasure-icon.png');
}
}
2 changes: 1 addition & 1 deletion src/components/AboutCommunity.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<a bind:this={communityTooltip} href="/community/{community.id}">
<img
src={community.tags['icon:square']}
src={`https://btcmap.org/.netlify/images?url=${community.tags['icon:square']}&fit=cover&w=256&h=256`}
alt="avatar"
class="h-24 w-24 rounded-full object-cover"
on:error={function () {
Expand Down
4 changes: 3 additions & 1 deletion src/components/CommunityCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
<div class="my-4 space-y-2 p-4">
<a href="/community/{id}" class="space-y-2 text-link transition-colors hover:text-hover">
<img
src={image ? image : '/images/communities/bitcoin.svg'}
src={image
? `https://btcmap.org/.netlify/images?url=${image}&fit=cover&w=256&h=256`
: '/images/communities/bitcoin.svg'}
alt={tags.name}
class="mx-auto h-20 w-20 rounded-full object-cover"
on:error={function () {
Expand Down
2 changes: 1 addition & 1 deletion src/components/CommunityLeaderboardItem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

<div class="my-5 lg:my-0">
<img
src={avatar}
src={`https://btcmap.org/.netlify/images?url=${avatar}&fit=cover&w=256&h=256`}
alt="avatar"
class="mx-auto mb-2 h-20 w-20 rounded-full object-cover lg:h-14 lg:w-14"
on:error={function () {
Expand Down
12 changes: 5 additions & 7 deletions src/components/Header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,12 @@
</script>

<!-- desktop header -->
<header
class="relative z-30 mx-auto hidden w-10/12 items-center justify-between py-5 lg:flex xl:w-[1200px]"
>
<header class="relative z-30 mx-auto hidden w-[1200px] items-center justify-between py-5 xl:flex">
<a href="/">
<img src="/images/logo.svg" alt="logo" class="w-16" />
</a>

<nav class="flex flex-wrap lg:space-x-4 xl:space-x-16">
<nav class="flex flex-wrap space-x-16">
{#each navLinks as link}
<!-- dropdown menu -->
{#if link.title === 'Contribute'}
Expand Down Expand Up @@ -111,7 +109,7 @@

<!-- mobile header -->
<header
class="sticky top-0 z-30 flex w-full items-center justify-between px-4 py-5 lg:hidden {showMobileMenu
class="sticky top-0 z-30 flex w-full items-center justify-between px-4 py-5 xl:hidden {showMobileMenu
? 'bg-teal dark:bg-dark'
: 'bg-teal/90 dark:bg-dark/90'}"
>
Expand All @@ -137,9 +135,9 @@

<!-- menu -->
<nav
class="absolute top-[122.45px] z-30 {showMobileMenu
class="hide-scroll absolute top-[122.45px] z-30 {showMobileMenu
? 'left-0'
: 'left-[-100%]'} h-[100vh] w-full space-y-2 border-t border-[#BDD2D4] bg-teal px-8 pt-8 transition-all ease-in-out dark:bg-dark"
: 'left-[-100%]'} h-[calc(100dvh-122.45px)] w-full space-y-2 overflow-y-auto border-t border-[#BDD2D4] bg-teal p-8 transition-all ease-in-out dark:bg-dark"
>
{#each navLinks as link}
<!-- dropdown menu -->
Expand Down
2 changes: 1 addition & 1 deletion src/lib/map/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type { DivIcon, Map } from 'leaflet';
import Time from 'svelte-time';
import { get } from 'svelte/store';

axiosRetry(axios, { retries: 3 });
axiosRetry(axios, { retries: 3, retryDelay: axiosRetry.exponentialDelay });

export const toggleMapButtons = () => {
const zoomInBtn: HTMLAnchorElement | null = document.querySelector('.leaflet-control-zoom-in');
Expand Down
2 changes: 1 addition & 1 deletion src/lib/sync/areas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import axios from 'axios';
import axiosRetry from 'axios-retry';
import localforage from 'localforage';

axiosRetry(axios, { retries: 3 });
axiosRetry(axios, { retries: 3, retryDelay: axiosRetry.exponentialDelay });

const limit = 500;

Expand Down
2 changes: 1 addition & 1 deletion src/lib/sync/elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import axiosRetry from 'axios-retry';
import localforage from 'localforage';
import { get } from 'svelte/store';

axiosRetry(axios, { retries: 3 });
axiosRetry(axios, { retries: 3, retryDelay: axiosRetry.exponentialDelay });

const limit = 5000;

Expand Down
2 changes: 1 addition & 1 deletion src/lib/sync/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import axios from 'axios';
import axiosRetry from 'axios-retry';
import localforage from 'localforage';

axiosRetry(axios, { retries: 3 });
axiosRetry(axios, { retries: 3, retryDelay: axiosRetry.exponentialDelay });

const limit = 50000;

Expand Down
2 changes: 1 addition & 1 deletion src/lib/sync/reports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import axios from 'axios';
import axiosRetry from 'axios-retry';
import localforage from 'localforage';

axiosRetry(axios, { retries: 3 });
axiosRetry(axios, { retries: 3, retryDelay: axiosRetry.exponentialDelay });

const limit = 20000;

Expand Down
2 changes: 1 addition & 1 deletion src/lib/sync/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import axios from 'axios';
import axiosRetry from 'axios-retry';
import localforage from 'localforage';

axiosRetry(axios, { retries: 3 });
axiosRetry(axios, { retries: 3, retryDelay: axiosRetry.exponentialDelay });

const limit = 7500;

Expand Down
3 changes: 2 additions & 1 deletion src/routes/about-us/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@
{ name: 'Fedi', icon: 'fedi', url: 'https://www.fedi.xyz/' },
{ name: 'Osmo', icon: 'osmo', url: 'https://www.osmowallet.com/' },
{ name: 'Bitcoin Rocks!', icon: 'bitcoin-rocks', url: 'https://bitcoin.rocks/' },
{ name: 'lipa', icon: 'lipa', url: 'https://lipa.swiss/' }
{ name: 'lipa', icon: 'lipa', url: 'https://lipa.swiss/' },
{ name: 'Spirit of Satoshi', icon: 'spirit', url: 'https://www.spiritofsatoshi.ai/' }
];
const projectIntegrations = [
Expand Down
2 changes: 1 addition & 1 deletion src/routes/add-location/endpoint/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import axios from 'axios';
import axiosRetry from 'axios-retry';
import crypto from 'crypto';

axiosRetry(axios, { retries: 3 });
axiosRetry(axios, { retries: 3, retryDelay: axiosRetry.exponentialDelay });

const used: string[] = [];
// @ts-expect-error
Expand Down
2 changes: 1 addition & 1 deletion src/routes/boost/invoice/generate/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { error } from '@sveltejs/kit';
import axios from 'axios';
import axiosRetry from 'axios-retry';

axiosRetry(axios, { retries: 3 });
axiosRetry(axios, { retries: 3, retryDelay: axiosRetry.exponentialDelay });

// generate and return invoice
// @ts-expect-error
Expand Down
2 changes: 1 addition & 1 deletion src/routes/boost/post/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { error, json } from '@sveltejs/kit';
import axios from 'axios';
import axiosRetry from 'axios-retry';

axiosRetry(axios, { retries: 3 });
axiosRetry(axios, { retries: 3, retryDelay: axiosRetry.exponentialDelay });

const used: string[] = [];

Expand Down
6 changes: 1 addition & 5 deletions src/routes/communities/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@
.filter(
(area) =>
area.tags.type === 'community' &&
((area.tags['box:east'] &&
area.tags['box:north'] &&
area.tags['box:south'] &&
area.tags['box:west']) ||
area.tags.geo_json) &&
area.tags.geo_json &&
area.tags.name &&
area.tags['icon:square'] &&
area.tags.continent &&
Expand Down
2 changes: 1 addition & 1 deletion src/routes/communities/add/endpoint/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import axios from 'axios';
import axiosRetry from 'axios-retry';
import crypto from 'crypto';

axiosRetry(axios, { retries: 3 });
axiosRetry(axios, { retries: 3, retryDelay: axiosRetry.exponentialDelay });

const used: string[] = [];

Expand Down
6 changes: 1 addition & 5 deletions src/routes/communities/leaderboard/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@
? $areas.filter(
(area) =>
area.tags.type === 'community' &&
((area.tags['box:east'] &&
area.tags['box:north'] &&
area.tags['box:south'] &&
area.tags['box:west']) ||
area.tags.geo_json) &&
area.tags.geo_json &&
area.tags.name &&
area.tags['icon:square'] &&
area.tags.continent &&
Expand Down
4 changes: 1 addition & 3 deletions src/routes/communities/map/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@
popupContainer.innerHTML = `
<div class='text-center space-y-2'>
<img loading='lazy' src=${
community.tags['icon:square']
} alt='avatar' class='w-24 h-24 rounded-full mx-auto' title='Community icon' onerror="this.src='/images/communities/bitcoin.svg'" />
<img loading='lazy' src=${`https://btcmap.org/.netlify/images?url=${community.tags['icon:square']}&fit=cover&w=256&h=256`} alt='avatar' class='w-24 h-24 rounded-full mx-auto' title='Community icon' onerror="this.src='/images/communities/bitcoin.svg'" />
<span class='text-primary dark:text-white font-semibold text-xl' title='Community name'>${
community.tags.name
Expand Down
2 changes: 1 addition & 1 deletion src/routes/community/[area]/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { error } from '@sveltejs/kit';
import axios from 'axios';
import axiosRetry from 'axios-retry';

axiosRetry(axios, { retries: 3 });
axiosRetry(axios, { retries: 3, retryDelay: axiosRetry.exponentialDelay });

// @ts-expect-error
export async function load({ params }) {
Expand Down
31 changes: 4 additions & 27 deletions src/routes/community/[area]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,7 @@
(area) =>
area.id == data.id &&
area.tags.type === 'community' &&
((area.tags['box:east'] &&
area.tags['box:north'] &&
area.tags['box:south'] &&
area.tags['box:west']) ||
area.tags.geo_json) &&
area.tags.geo_json &&
area.tags.name &&
area.tags['icon:square'] &&
area.tags.continent &&
Expand All @@ -117,7 +113,7 @@
const community = communityFound.tags;
avatar = community['icon:square'];
avatar = `https://btcmap.org/.netlify/images?url=${community['icon:square']}&fit=cover&w=256&h=256`;
org = community.organization;
sponsor = community.sponsor;
continent = community.continent;
Expand Down Expand Up @@ -175,18 +171,7 @@
let lat = latCalc(element['osm_json']);
let long = longCalc(element['osm_json']);
if (community.geo_json) {
if (geoContains(rewoundPoly, [long, lat])) {
return true;
} else {
return false;
}
} else if (
lat >= Number(community['box:south']) &&
lat <= Number(community['box:north']) &&
long >= Number(community['box:west']) &&
long <= Number(community['box:east'])
) {
if (geoContains(rewoundPoly, [long, lat])) {
return true;
} else {
return false;
Expand Down Expand Up @@ -656,15 +641,7 @@
map.addLayer(outdatedLayer);
map.addLayer(legacyLayer);
map.fitBounds(
// @ts-expect-error
community.geo_json
? leaflet.geoJSON(community.geo_json).getBounds()
: [
[community['box:south'], community['box:west']],
[community['box:north'], community['box:east']]
]
);
map.fitBounds(leaflet.geoJSON(community.geo_json).getBounds());
mapLoaded = true;
};
Expand Down
6 changes: 1 addition & 5 deletions src/routes/dashboard/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,7 @@
? $areas.filter(
(area) =>
area.tags.type === 'community' &&
((area.tags['box:east'] &&
area.tags['box:north'] &&
area.tags['box:south'] &&
area.tags['box:west']) ||
area.tags.geo_json) &&
area.tags.geo_json &&
area.tags.name &&
area.tags['icon:square'] &&
area.tags.continent &&
Expand Down
Loading

0 comments on commit e543236

Please sign in to comment.