Skip to content

Commit a1a6633

Browse files
feat: remove gp extensions
1 parent b24861b commit a1a6633

File tree

157 files changed

+9
-95276
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+9
-95276
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ frontend gp_fe
5959
default_backend gp_be
6060
6161
backend gp_be
62-
server server1 127.0.0.1:8055
62+
server server1 127.0.0.1:8056
6363
EOF
6464
sudo systemctl stop haproxy
6565
sudo systemctl start haproxy

docker-compose.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ services:
88
- MARIADB_PASSWORD=password
99
- MARIADB_ROOT_PASSWORD=root
1010
ports:
11-
- "3306:3306"
11+
- "3307:3306"
1212
volumes:
1313
- ./config/init.sql:/docker-entrypoint-initdb.d/init.sql
1414
healthcheck:
1515
test: ["CMD", "mysqladmin", "ping", "-u", "directus", "-ppassword"]
1616
interval: 3s
1717
timeout: 2s
1818
retries: 10
19-
directus:
19+
dash-directus:
2020
depends_on:
2121
mariadb:
2222
condition: service_healthy
@@ -26,4 +26,4 @@ services:
2626
env_file:
2727
- .env.development
2828
ports:
29-
- "8055:8055"
29+
- "8056:8055"

knexfile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default _.merge({}, ...[ 'development' ].map((environment) => {
1313
user: 'directus',
1414
password: 'password',
1515
database: 'directus',
16-
port: 3306,
16+
port: 3307,
1717
},
1818
pool: {
1919
min: 0,

scripts/init.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ if [ "$is_dev_mode" = true ]; then
5050

5151
perl -pi -e "s/AUTH_GITHUB_DEFAULT_ROLE_ID=.*/AUTH_GITHUB_DEFAULT_ROLE_ID=$user_role_id/" .env.development
5252

53-
docker compose stop directus
53+
docker compose stop dash-directus
5454

55-
docker compose up -d directus
55+
docker compose up -d dash-directus
5656

57-
./scripts/wait-for.sh -t 60 http://localhost:8055/admin/login
57+
./scripts/wait-for.sh -t 60 http://localhost:8056/admin/login
5858

5959
npm run seed
6060
else

seeds/development/admin-layout.js

-36
Original file line numberDiff line numberDiff line change
@@ -18,45 +18,9 @@ export const seed = async (knex) => {
1818
]);
1919

2020
await knex('directus_presets').insert([{
21-
user: admin.id,
22-
collection: 'gp_adopted_probes',
23-
layout_query: { tabular: { fields: [ 'id', 'userId.first_name', 'ip', 'city', 'country', 'name', 'status', 'onlineTimesToday' ] } },
24-
icon: 'bookmark',
25-
},
26-
{
2721
user: admin.id,
2822
collection: 'jsd_purge_tokens',
2923
layout_query: { tabular: { fields: [ 'id', 'user_created', 'name', 'value', 'expire', 'origins', 'date_last_used' ] } },
3024
icon: 'bookmark',
31-
},
32-
{
33-
user: admin.id,
34-
collection: 'gp_tokens',
35-
layout_query: { tabular: { fields: [ 'id', 'user_created', 'name', 'value', 'expire', 'origins', 'date_last_used' ] } },
36-
icon: 'bookmark',
37-
},
38-
{
39-
user: admin.id,
40-
collection: 'gp_credits',
41-
layout_query: { tabular: { fields: [ 'id', 'user_id.first_name', 'amount' ] } },
42-
icon: 'bookmark',
43-
},
44-
{
45-
user: admin.id,
46-
collection: 'gp_credits_additions',
47-
layout_query: { tabular: { fields: [ 'id', 'github_id', 'amount', 'comment', 'adopted_probe.ip' ] } },
48-
icon: 'bookmark',
49-
},
50-
{
51-
user: admin.id,
52-
collection: 'gp_credits_deductions',
53-
layout_query: { tabular: { fields: [ 'id', 'user_id.first_name', 'amount', 'date' ] } },
54-
icon: 'bookmark',
55-
},
56-
{
57-
user: admin.id,
58-
collection: 'sponsors',
59-
layout_query: { tabular: { fields: [ 'id', 'github_login', 'monthly_amount', 'last_earning_date' ] } },
60-
icon: 'bookmark',
6125
}]);
6226
};

seeds/development/user-data.js

-126
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,6 @@ export const seed = async (knex) => {
3939

4040
await Promise.all([
4141
knex('jsd_purge_tokens').delete(),
42-
knex('gp_tokens').delete(),
43-
knex('gp_adopted_probes').delete(),
44-
knex('sponsors').delete(),
45-
knex('gp_credits_additions').delete(),
46-
knex('gp_credits_deductions').delete(),
47-
knex('gp_credits').delete(),
4842
]);
4943

5044
await knex('jsd_purge_tokens').insert([{
@@ -63,124 +57,4 @@ export const seed = async (knex) => {
6357
expire: '2027-02-01',
6458
origins: JSON.stringify([ 'https://www.jsdelivr.com', 'https://www.jsdelivr.com:10000' ]),
6559
}]);
66-
67-
await knex('gp_tokens').insert([{
68-
name: 'gp-token-1',
69-
value: '0gW0wltTSo1g0WOVYxBrxGZM0ifmRH9TFiIG9GWOo8s=', // token: YmCn0sLiTmdjPmR/KQjyl9tdlpirtQKB
70-
date_created: '2024-02-22 10:55:21',
71-
date_last_used: null,
72-
date_updated: null,
73-
expire: null,
74-
origins: null,
75-
user_created: user.id,
76-
user_updated: null,
77-
}, {
78-
name: 'gp-token-2',
79-
value: 'YjVt9t1OiYEa7rHFzAvxH0bLZtd5fYtdzBSvQSyeSiY=', // token: QVJFyYWiEDKx6nGIqo7iMd47mx3yYBEX
80-
date_created: '2024-02-22 10:57:21',
81-
date_last_used: '2024-02-21',
82-
date_updated: '2024-02-22 10:49:45',
83-
expire: '2027-02-01',
84-
origins: JSON.stringify([ 'https://www.jsdelivr.com', 'https://www.jsdelivr.com:10000' ]),
85-
user_created: user.id,
86-
user_updated: user.id,
87-
}]);
88-
89-
const adoptedProbesIds = await knex('gp_adopted_probes').insert([{
90-
asn: 3302,
91-
city: 'Naples',
92-
country: 'IT',
93-
countryOfCustomCity: 'IT',
94-
date_created: '2024-02-22 11:04:30',
95-
date_updated: '2024-02-22 11:05:48',
96-
ip: '213.136.174.80',
97-
isCustomCity: 1,
98-
lastSyncDate: new Date(),
99-
latitude: 40.85216,
100-
longitude: 14.26811,
101-
name: 'adopted-probe-2',
102-
network: 'IRIDEOS S.P.A.',
103-
onlineTimesToday: 120,
104-
state: null,
105-
status: 'ready',
106-
tags: JSON.stringify([{ value: 'tag-1', prefix: 'test-user-bdf-2' }]),
107-
userId: user.id,
108-
uuid: '681023cb-6aec-45a1-adde-e705c4043549',
109-
version: '0.28.0',
110-
hardwareDevice: null,
111-
},
112-
{
113-
asn: 61493,
114-
city: 'Buenos Aires',
115-
country: 'AR',
116-
countryOfCustomCity: null,
117-
date_created: '2024-02-22 11:02:12',
118-
date_updated: null,
119-
ip: '131.255.7.26',
120-
isCustomCity: 0,
121-
lastSyncDate: new Date(),
122-
latitude: -34.6131,
123-
longitude: -58.3772,
124-
name: null,
125-
network: 'InterBS S.R.L. (BAEHOST)',
126-
onlineTimesToday: 0,
127-
state: null,
128-
status: 'ready',
129-
tags: null,
130-
userId: user.id,
131-
uuid: 'b42c4319-6be3-46d4-8a01-d4558f0c070c',
132-
version: '0.28.0',
133-
hardwareDevice: null,
134-
}]);
135-
136-
await knex('sponsors').insert([{
137-
date_created: '2024-02-22 11:48:00',
138-
date_updated: null,
139-
user_created: null,
140-
user_updated: null,
141-
github_id: user.external_identifier,
142-
github_login: user.github_username,
143-
last_earning_date: '2024-02-22 11:48:00',
144-
monthly_amount: 5,
145-
},
146-
{
147-
date_created: '2024-02-22 11:48:00',
148-
date_updated: null,
149-
user_created: null,
150-
user_updated: null,
151-
github_id: '6192491',
152-
github_login: 'MartinKolarik',
153-
last_earning_date: '2024-02-22 11:48:00',
154-
monthly_amount: 100,
155-
}]);
156-
157-
await knex('gp_credits_additions').insert([{
158-
amount: 100000,
159-
comment: 'For 50$ sponsorship',
160-
consumed: 1,
161-
date_created: '2024-02-22 11:46:22',
162-
github_id: user.external_identifier,
163-
user_updated: null,
164-
adopted_probe: null,
165-
},
166-
{
167-
amount: 10000,
168-
comment: 'For $5 recurring sponsorship',
169-
consumed: 1,
170-
date_created: '2024-02-22 11:51:00',
171-
github_id: user.external_identifier,
172-
user_updated: null,
173-
adopted_probe: null,
174-
},
175-
{
176-
amount: 150,
177-
comment: 'For the adopted probe "adopted-probe-2" (213.136.174.80)',
178-
consumed: 1,
179-
date_created: '2024-02-22 11:53:00',
180-
github_id: user.external_identifier,
181-
user_updated: null,
182-
adopted_probe: adoptedProbesIds[0],
183-
}]);
184-
185-
await knex('gp_credits').where({ user_id: user.id }).update({ amount: knex.raw('amount - ?', [ 110000 ]) });
18660
};

seeds/development/user-layout.js

-30
Original file line numberDiff line numberDiff line change
@@ -18,39 +18,9 @@ export const seed = async (knex) => {
1818
]);
1919

2020
await knex('directus_presets').insert([{
21-
user: user.id,
22-
collection: 'gp_adopted_probes',
23-
layout_query: { tabular: { fields: [ 'id', 'userId.first_name', 'ip', 'city', 'country', 'name', 'status' ] } },
24-
icon: 'bookmark',
25-
},
26-
{
2721
user: user.id,
2822
collection: 'jsd_purge_tokens',
2923
layout_query: { tabular: { fields: [ 'id', 'user_created', 'name', 'value', 'expire', 'origins', 'date_last_used' ] } },
3024
icon: 'bookmark',
31-
},
32-
{
33-
user: user.id,
34-
collection: 'gp_tokens',
35-
layout_query: { tabular: { fields: [ 'id', 'user_created', 'name', 'value', 'expire', 'origins', 'date_last_used' ] } },
36-
icon: 'bookmark',
37-
},
38-
{
39-
user: user.id,
40-
collection: 'gp_credits',
41-
layout_query: { tabular: { fields: [ 'amount' ] } },
42-
icon: 'bookmark',
43-
},
44-
{
45-
user: user.id,
46-
collection: 'gp_credits_additions',
47-
layout_query: { tabular: { fields: [ 'amount', 'comment', 'adopted_probe.ip' ] } },
48-
icon: 'bookmark',
49-
},
50-
{
51-
user: user.id,
52-
collection: 'gp_credits_deductions',
53-
layout_query: { tabular: { fields: [ 'amount', 'date' ] } },
54-
icon: 'bookmark',
5525
}]);
5626
};

src/extensions/endpoints/adoption-code/.gitignore

-3
This file was deleted.

src/extensions/endpoints/adoption-code/.mocharc.json

-11
This file was deleted.

0 commit comments

Comments
 (0)