Author SHA1 Message Date
mycodedoesnotcompile2 7025eb1b43 Merge 13b3abbcab into 0cd9fd70cb 2025-12-13 13:12:32 +00:00
mycodedoesnotcompile2 13b3abbcab Rename postcss.config.ts to postcss.config.cjs 2025-12-13 13:12:29 +00:00
mycodedoesnotcompile2 b5784f609e Update medium_client.go 2025-12-13 12:45:06 +00:00
mycodedoesnotcompile2 e549b25e3a Update api.go 2025-12-13 12:44:03 +00:00
mycodedoesnotcompile2 b387a6d8f8 Update api.go 2025-12-13 12:43:46 +00:00
mycodedoesnotcompile2 9a6d287607 Update id_converter.go 2025-12-13 12:42:34 +00:00
mycodedoesnotcompile2 8b00007fb5 Update medium_client.go 2025-12-13 12:41:04 +00:00
mycodedoesnotcompile2 348e4e2527 Update medium_client.go 2025-12-13 12:39:16 +00:00
mycodedoesnotcompile2 d055ff6c72 Update medium_client.go 2025-12-13 12:31:48 +00:00
mycodedoesnotcompile2 6c9ba437a8 Update medium_client.go 2025-12-13 12:29:45 +00:00
mycodedoesnotcompile2 e50177599e Update medium_client.go 2025-12-13 12:29:15 +00:00
mycodedoesnotcompile2 d416ebad0f Update medium_client.go 2025-12-13 12:28:35 +00:00
mycodedoesnotcompile2 93f30a5a9a Update medium_client.go 2025-12-13 12:26:57 +00:00
mycodedoesnotcompile2 2965aeb592 Update medium_client.go 2025-12-13 12:26:05 +00:00
mycodedoesnotcompile2 f3beb86ec1 Update medium_client.go 2025-12-13 12:22:43 +00:00
mycodedoesnotcompile2 6c0f2a15c9 Update id_converter.go 2025-12-13 12:21:36 +00:00
mycodedoesnotcompile2 9bb6d7e79e Update medium_client.go 2025-12-13 12:21:27 +00:00
mycodedoesnotcompile2 36e5fe60e7 Update id_converter.go 2025-12-13 12:20:37 +00:00
mycodedoesnotcompile2 fd56a322f3 Update medium_client.go 2025-12-13 12:19:52 +00:00
mycodedoesnotcompile2 94a0f174d6 Update api.go 2025-12-13 12:05:50 +00:00
mycodedoesnotcompile2 49c695a291 Update id_converter.go 2025-12-13 12:05:19 +00:00
mycodedoesnotcompile2 39a72c9197 Update id_converter.go 2025-12-13 12:04:55 +00:00
mycodedoesnotcompile2 7d6e0c0aa8 Update api.go 2025-12-13 12:00:48 +00:00
mycodedoesnotcompile2 3e95bb581e Update api.go 2025-12-13 11:56:33 +00:00
mycodedoesnotcompile2 500eca390f Update api.go 2025-12-13 11:55:48 +00:00
mycodedoesnotcompile2 21bea85895 Update api.go 2025-12-13 11:53:17 +00:00
mycodedoesnotcompile2 4ae0b3c242 Update api.go 2025-12-13 11:50:04 +00:00
mycodedoesnotcompile2 c59e028ccd Update api.go 2025-12-13 11:46:40 +00:00
mycodedoesnotcompile2 2d48af0882 Update api.go 2025-12-13 11:46:09 +00:00
mycodedoesnotcompile2 3c9cda56d4 Update api.go 2025-12-13 11:45:38 +00:00
mycodedoesnotcompile2 0a4e286b24 Update api.go 2025-12-13 11:44:49 +00:00
mycodedoesnotcompile2 07949db7d5 Update api.go 2025-12-13 11:33:12 +00:00
mycodedoesnotcompile2 f2b44c6050 Update api.go 2025-12-13 11:32:28 +00:00
mycodedoesnotcompile2 e0e8a19963 Update api.go 2025-12-13 11:24:20 +00:00
mycodedoesnotcompile2 8f75e96acf Update api.go 2025-12-13 11:23:37 +00:00
mycodedoesnotcompile2 29b5f5fdcd Update api.go 2025-12-13 11:22:53 +00:00
mycodedoesnotcompile2 56458d4fdb Update api.go 2025-12-13 11:20:47 +00:00
mycodedoesnotcompile2 86823cb2e6 Update api.go 2025-12-13 11:12:49 +00:00
mycodedoesnotcompile2 3b4c17e744 Update api.go 2025-12-13 11:07:30 +00:00
mycodedoesnotcompile2 9607e4fd17 Update config.go 2025-12-13 11:01:19 +00:00
mycodedoesnotcompile2 20e2679dbd Update api.go 2025-06-03 18:15:57 +00:00
mycodedoesnotcompile2 b21a4c7e31 Update api.go 2025-06-03 18:15:27 +00:00
5 changed files with 76 additions and 253 deletions

No files matched your search

+8 -1
View File
@@ -4,6 +4,7 @@ import (
"context"
"fmt"
"net/http"
"sync"
"github.com/medium.rip/api/routes"
@@ -16,12 +17,14 @@ import (
)
func RegisterRoutes(ctx context.Context, wg *sync.WaitGroup, engine *html.Engine, fs http.FileSystem) {
// more Fiber options at https://docs.gofiber.io/api/fiber/
app := fiber.New(fiber.Config{
StreamRequestBody: true,
ServerHeader: "Katbox",
AppName: "Katbox",
DisableStartupMessage: true,
Views: engine,
Network: "tcp",
})
// static file server
@@ -30,6 +33,10 @@ func RegisterRoutes(ctx context.Context, wg *sync.WaitGroup, engine *html.Engine
Browse: config.Conf.Env == "dev",
}))
if config.Conf.Proxy != "" {
log.Printf("Using proxy: %s", config.Conf.Proxy)
}
routes.RegisterRoutes(app)
go func(app *fiber.App) {
@@ -48,4 +55,4 @@ func RegisterRoutes(ctx context.Context, wg *sync.WaitGroup, engine *html.Engine
log.Warn("Server shutdown Failed: ", err)
}
wg.Done()
}
}
+39 -248
View File
@@ -1,9 +1,5 @@
lockfileVersion: '6.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
devDependencies:
'@tailwindcss/typography':
specifier: ^0.5.9
@@ -13,16 +9,16 @@ devDependencies:
version: 20.2.5
autoprefixer:
specifier: ^10.4.14
version: 10.4.14(postcss@8.5.23)
version: 10.4.14(postcss@8.4.23)
postcss:
specifier: ^8.4.23
version: 8.5.23
version: 8.4.23
tailwindcss:
specifier: ^3.3.2
version: 3.3.2(ts-node@10.9.1)
ts-node:
specifier: ^10.9.1
version: 10.9.1(@types/node@20.2.5)(typescript@7.0.2)
version: 10.9.1(@types/node@20.2.5)(typescript@5.0.4)
vite:
specifier: ^4.3.9
version: 4.3.9(@types/node@20.2.5)
@@ -333,186 +329,6 @@ packages:
resolution: {integrity: sha512-JJulVEQXmiY9Px5axXHeYGLSjhkZEnD+MDPDGbCbIAbMslkKwmygtZFy1X6s/075Yo94sf8GuSlFfPzysQrWZQ==}
dev: true
/@typescript/typescript-aix-ppc64@7.0.2:
resolution: {integrity: sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==}
engines: {node: '>=16.20.0'}
cpu: [ppc64]
os: [aix]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-darwin-arm64@7.0.2:
resolution: {integrity: sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [darwin]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-darwin-x64@7.0.2:
resolution: {integrity: sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [darwin]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-freebsd-arm64@7.0.2:
resolution: {integrity: sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [freebsd]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-freebsd-x64@7.0.2:
resolution: {integrity: sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [freebsd]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-linux-arm64@7.0.2:
resolution: {integrity: sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-linux-arm@7.0.2:
resolution: {integrity: sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==}
engines: {node: '>=16.20.0'}
cpu: [arm]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-linux-loong64@7.0.2:
resolution: {integrity: sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==}
engines: {node: '>=16.20.0'}
cpu: [loong64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-linux-mips64el@7.0.2:
resolution: {integrity: sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==}
engines: {node: '>=16.20.0'}
cpu: [mips64el]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-linux-ppc64@7.0.2:
resolution: {integrity: sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==}
engines: {node: '>=16.20.0'}
cpu: [ppc64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-linux-riscv64@7.0.2:
resolution: {integrity: sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==}
engines: {node: '>=16.20.0'}
cpu: [riscv64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-linux-s390x@7.0.2:
resolution: {integrity: sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==}
engines: {node: '>=16.20.0'}
cpu: [s390x]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-linux-x64@7.0.2:
resolution: {integrity: sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-netbsd-arm64@7.0.2:
resolution: {integrity: sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [netbsd]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-netbsd-x64@7.0.2:
resolution: {integrity: sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [netbsd]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-openbsd-arm64@7.0.2:
resolution: {integrity: sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [openbsd]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-openbsd-x64@7.0.2:
resolution: {integrity: sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [openbsd]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-sunos-x64@7.0.2:
resolution: {integrity: sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [sunos]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-win32-arm64@7.0.2:
resolution: {integrity: sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [win32]
requiresBuild: true
dev: true
optional: true
/@typescript/typescript-win32-x64@7.0.2:
resolution: {integrity: sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [win32]
requiresBuild: true
dev: true
optional: true
/acorn-walk@8.2.0:
resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==}
engines: {node: '>=0.4.0'}
@@ -544,7 +360,7 @@ packages:
resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==}
dev: true
/autoprefixer@10.4.14(postcss@8.5.23):
/autoprefixer@10.4.14(postcss@8.4.23):
resolution: {integrity: sha512-FQzyfOsTlwVzjHxKEqRIAdJx9niO6VCBCoEwax/VLSoQF29ggECcPuBqUMZ+u8jCZOPSy8b8/8KnuFbp0SaFZQ==}
engines: {node: ^10 || ^12 || >=14}
hasBin: true
@@ -556,7 +372,7 @@ packages:
fraction.js: 4.2.0
normalize-range: 0.1.2
picocolors: 1.0.0
postcss: 8.5.23
postcss: 8.4.23
postcss-value-parser: 4.2.0
dev: true
@@ -615,7 +431,7 @@ packages:
normalize-path: 3.0.0
readdirp: 3.6.0
optionalDependencies:
fsevents: 2.3.3
fsevents: 2.3.2
dev: true
/commander@4.1.1:
@@ -721,8 +537,8 @@ packages:
resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
dev: true
/fsevents@2.3.3:
resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==}
/fsevents@2.3.2:
resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==}
engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
os: [darwin]
requiresBuild: true
@@ -863,8 +679,8 @@ packages:
thenify-all: 1.6.0
dev: true
/nanoid@3.3.18:
resolution: {integrity: sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==}
/nanoid@3.3.6:
resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==}
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
hasBin: true
dev: true
@@ -912,10 +728,6 @@ packages:
resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==}
dev: true
/picocolors@1.1.1:
resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==}
dev: true
/picomatch@2.3.1:
resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==}
engines: {node: '>=8.6'}
@@ -931,29 +743,29 @@ packages:
engines: {node: '>= 6'}
dev: true
/postcss-import@15.1.0(postcss@8.5.23):
/postcss-import@15.1.0(postcss@8.4.23):
resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==}
engines: {node: '>=14.0.0'}
peerDependencies:
postcss: ^8.0.0
dependencies:
postcss: 8.5.23
postcss: 8.4.23
postcss-value-parser: 4.2.0
read-cache: 1.0.0
resolve: 1.22.2
dev: true
/postcss-js@4.0.1(postcss@8.5.23):
/postcss-js@4.0.1(postcss@8.4.23):
resolution: {integrity: sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==}
engines: {node: ^12 || ^14 || >= 16}
peerDependencies:
postcss: ^8.4.21
dependencies:
camelcase-css: 2.0.1
postcss: 8.5.23
postcss: 8.4.23
dev: true
/postcss-load-config@4.0.1(postcss@8.5.23)(ts-node@10.9.1):
/postcss-load-config@4.0.1(postcss@8.4.23)(ts-node@10.9.1):
resolution: {integrity: sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==}
engines: {node: '>= 14'}
peerDependencies:
@@ -966,18 +778,18 @@ packages:
optional: true
dependencies:
lilconfig: 2.1.0
postcss: 8.5.23
ts-node: 10.9.1(@types/node@20.2.5)(typescript@7.0.2)
postcss: 8.4.23
ts-node: 10.9.1(@types/node@20.2.5)(typescript@5.0.4)
yaml: 2.3.1
dev: true
/postcss-nested@6.0.1(postcss@8.5.23):
/postcss-nested@6.0.1(postcss@8.4.23):
resolution: {integrity: sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==}
engines: {node: '>=12.0'}
peerDependencies:
postcss: ^8.2.14
dependencies:
postcss: 8.5.23
postcss: 8.4.23
postcss-selector-parser: 6.0.13
dev: true
@@ -1001,13 +813,13 @@ packages:
resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==}
dev: true
/postcss@8.5.23:
resolution: {integrity: sha512-g50586zr4bZmwFiTlflMu8E0bDTb5I5gertgwAKmsdUlTQIhZtunzUlD1WSzwcVWPoAVpsrA6vlfCD7oXvRwgg==}
/postcss@8.4.23:
resolution: {integrity: sha512-bQ3qMcpF6A/YjR55xtoTr0jGOlnPOKAIMdOWiv0EIT6HVPEaJiJB4NLljSbiHoC2RX7DN5Uvjtpbg1NPdwv1oA==}
engines: {node: ^10 || ^12 || >=14}
dependencies:
nanoid: 3.3.18
picocolors: 1.1.1
source-map-js: 1.2.1
nanoid: 3.3.6
picocolors: 1.0.0
source-map-js: 1.0.2
dev: true
/queue-microtask@1.2.3:
@@ -1046,7 +858,7 @@ packages:
engines: {node: '>=14.18.0', npm: '>=8.0.0'}
hasBin: true
optionalDependencies:
fsevents: 2.3.3
fsevents: 2.3.2
dev: true
/run-parallel@1.2.0:
@@ -1055,8 +867,8 @@ packages:
queue-microtask: 1.2.3
dev: true
/source-map-js@1.2.1:
resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==}
/source-map-js@1.0.2:
resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==}
engines: {node: '>=0.10.0'}
dev: true
@@ -1098,11 +910,11 @@ packages:
normalize-path: 3.0.0
object-hash: 3.0.0
picocolors: 1.0.0
postcss: 8.5.23
postcss-import: 15.1.0(postcss@8.5.23)
postcss-js: 4.0.1(postcss@8.5.23)
postcss-load-config: 4.0.1(postcss@8.5.23)(ts-node@10.9.1)
postcss-nested: 6.0.1(postcss@8.5.23)
postcss: 8.4.23
postcss-import: 15.1.0(postcss@8.4.23)
postcss-js: 4.0.1(postcss@8.4.23)
postcss-load-config: 4.0.1(postcss@8.4.23)(ts-node@10.9.1)
postcss-nested: 6.0.1(postcss@8.4.23)
postcss-selector-parser: 6.0.13
postcss-value-parser: 4.2.0
resolve: 1.22.2
@@ -1135,7 +947,7 @@ packages:
resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==}
dev: true
/ts-node@10.9.1(@types/node@20.2.5)(typescript@7.0.2):
/ts-node@10.9.1(@types/node@20.2.5)(typescript@5.0.4):
resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==}
hasBin: true
peerDependencies:
@@ -1161,36 +973,15 @@ packages:
create-require: 1.1.1
diff: 4.0.2
make-error: 1.3.6
typescript: 7.0.2
typescript: 5.0.4
v8-compile-cache-lib: 3.0.1
yn: 3.1.1
dev: true
/typescript@7.0.2:
resolution: {integrity: sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==}
engines: {node: '>=16.20.0'}
/typescript@5.0.4:
resolution: {integrity: sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==}
engines: {node: '>=12.20'}
hasBin: true
optionalDependencies:
'@typescript/typescript-aix-ppc64': 7.0.2
'@typescript/typescript-darwin-arm64': 7.0.2
'@typescript/typescript-darwin-x64': 7.0.2
'@typescript/typescript-freebsd-arm64': 7.0.2
'@typescript/typescript-freebsd-x64': 7.0.2
'@typescript/typescript-linux-arm': 7.0.2
'@typescript/typescript-linux-arm64': 7.0.2
'@typescript/typescript-linux-loong64': 7.0.2
'@typescript/typescript-linux-mips64el': 7.0.2
'@typescript/typescript-linux-ppc64': 7.0.2
'@typescript/typescript-linux-riscv64': 7.0.2
'@typescript/typescript-linux-s390x': 7.0.2
'@typescript/typescript-linux-x64': 7.0.2
'@typescript/typescript-netbsd-arm64': 7.0.2
'@typescript/typescript-netbsd-x64': 7.0.2
'@typescript/typescript-openbsd-arm64': 7.0.2
'@typescript/typescript-openbsd-x64': 7.0.2
'@typescript/typescript-sunos-x64': 7.0.2
'@typescript/typescript-win32-arm64': 7.0.2
'@typescript/typescript-win32-x64': 7.0.2
dev: true
/update-browserslist-db@1.0.11(browserslist@4.21.5):
@@ -1239,10 +1030,10 @@ packages:
dependencies:
'@types/node': 20.2.5
esbuild: 0.17.19
postcss: 8.5.23
postcss: 8.4.23
rollup: 3.23.0
optionalDependencies:
fsevents: 2.3.3
fsevents: 2.3.2
dev: true
/wrappy@1.0.2:
File renamed without changes.
+1
View File
@@ -17,6 +17,7 @@ type Config struct {
S3Endpoint string `koanf:"S3_ENDPOINT"`
Env string `koanf:"ENV"`
SecretKey string `koanf:"SECRET_KEY"`
Proxy string `koanf:"PROXY"`
}
var Conf *Config
+28 -4
View File
@@ -6,6 +6,8 @@ import (
"net/http"
"os"
"strings"
"net/url"
"crypto/tls"
log "github.com/sirupsen/logrus"
@@ -30,13 +32,35 @@ func PostData(postId string) (*entities.MediumResponse, error) {
}
// http client to post data
url := "https://medium.com/_/graphql"
urlreq := "https://medium.com/_/graphql"
method := "POST"
payload := strings.NewReader(fmt.Sprintf("{\"query\":\"query {\\n post(id: \\\"%s\\\") {\\n title\\n createdAt\\n creator {\\n id\\n name\\n }\\n content {\\n bodyModel {\\n paragraphs {\\n name\\n text\\n type\\n href\\n layout\\n markups {\\n title\\n type\\n href\\n userId\\n start\\n end\\n anchorType\\n }\\n iframe {\\n mediaResource {\\n href\\n iframeSrc\\n iframeWidth\\n iframeHeight\\n }\\n }\\n metadata {\\n id\\n originalWidth\\n originalHeight\\n }\\n }\\n }\\n }\\n }\\n }\",\"variables\":{}}", postId))
client := &http.Client{}
req, err := http.NewRequest(method, url, payload)
//log.Printf("Article ID: %s", postId)
//log.Printf("PAYLOAD: %s", payload)
var client *http.Client
if config.Conf.Proxy != "" {
proxyURL, err := url.Parse(config.Conf.Proxy)
if err != nil {
panic(err)
}
client = &http.Client{
Transport: &http.Transport{
Proxy: http.ProxyURL(proxyURL),
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true,
},
},
}
} else {
client = &http.Client{}
}
req, err := http.NewRequest(method, urlreq, payload)
req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36")
if err != nil {
log.Printf("Error constructing request %v\n", err)
return nil, err