added web/ with some html and updated go.mod and go.sum to use gin

This commit is contained in:
2025-09-20 13:04:32 -03:00
parent 910cad2734
commit ac236342b6
19 changed files with 1819 additions and 7 deletions

37
go.mod
View File

@@ -3,24 +3,59 @@ module packets
go 1.25.1 go 1.25.1
require ( require (
github.com/gin-contrib/cors v1.7.6
github.com/gin-gonic/gin v1.11.0
github.com/golang-jwt/jwt/v5 v5.3.0
github.com/google/uuid v1.6.0
github.com/jackc/pgx/v5 v5.7.6
github.com/joho/godotenv v1.5.1
github.com/klauspost/compress v1.18.0 github.com/klauspost/compress v1.18.0
github.com/pelletier/go-toml/v2 v2.2.4 github.com/pelletier/go-toml/v2 v2.2.4
github.com/spf13/cobra v1.10.1 github.com/spf13/cobra v1.10.1
github.com/yuin/gopher-lua v1.1.1 github.com/yuin/gopher-lua v1.1.1
golang.org/x/crypto v0.42.0
golang.org/x/net v0.44.0 golang.org/x/net v0.44.0
modernc.org/sqlite v1.38.2 modernc.org/sqlite v1.38.2
) )
require ( require (
github.com/bytedance/sonic v1.14.0 // indirect
github.com/bytedance/sonic/loader v0.3.0 // indirect
github.com/cloudwego/base64x v0.1.6 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect github.com/dustin/go-humanize v1.0.1 // indirect
github.com/google/uuid v1.6.0 // indirect github.com/gabriel-vasile/mimetype v1.4.9 // indirect
github.com/gin-contrib/sse v1.1.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.27.0 // indirect
github.com/goccy/go-json v0.10.5 // indirect
github.com/goccy/go-yaml v1.18.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
github.com/jackc/puddle/v2 v2.2.2 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-isatty v0.0.20 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/ncruces/go-strftime v0.1.9 // indirect github.com/ncruces/go-strftime v0.1.9 // indirect
github.com/quic-go/qpack v0.5.1 // indirect
github.com/quic-go/quic-go v0.54.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/spf13/pflag v1.0.10 // indirect github.com/spf13/pflag v1.0.10 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.3.0 // indirect
go.uber.org/mock v0.5.0 // indirect
golang.org/x/arch v0.20.0 // indirect
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b // indirect golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b // indirect
golang.org/x/mod v0.27.0 // indirect
golang.org/x/sync v0.17.0 // indirect
golang.org/x/sys v0.36.0 // indirect golang.org/x/sys v0.36.0 // indirect
golang.org/x/text v0.29.0 // indirect
golang.org/x/tools v0.36.0 // indirect
google.golang.org/protobuf v1.36.9 // indirect
modernc.org/libc v1.66.3 // indirect modernc.org/libc v1.66.3 // indirect
modernc.org/mathutil v1.7.1 // indirect modernc.org/mathutil v1.7.1 // indirect
modernc.org/memory v1.11.0 // indirect modernc.org/memory v1.11.0 // indirect

99
go.sum
View File

@@ -1,20 +1,81 @@
github.com/bytedance/sonic v1.14.0 h1:/OfKt8HFw0kh2rj8N0F6C/qPGRESq0BbaNZgcNXXzQQ=
github.com/bytedance/sonic v1.14.0/go.mod h1:WoEbx8WTcFJfzCe0hbmyTGrfjt8PzNEBdxlNUO24NhA=
github.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA=
github.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=
github.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=
github.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/gabriel-vasile/mimetype v1.4.9 h1:5k+WDwEsD9eTLL8Tz3L0VnmVh9QxGjRmjBvAG7U/oYY=
github.com/gabriel-vasile/mimetype v1.4.9/go.mod h1:WnSQhFKJuBlRyLiKohA/2DtIlPFAbguNaG7QCHcyGok=
github.com/gin-contrib/cors v1.7.6 h1:3gQ8GMzs1Ylpf70y8bMw4fVpycXIeX1ZemuSQIsnQQY=
github.com/gin-contrib/cors v1.7.6/go.mod h1:Ulcl+xN4jel9t1Ry8vqph23a60FwH9xVLd+3ykmTjOk=
github.com/gin-contrib/sse v1.1.0 h1:n0w2GMuUpWDVp7qSpvze6fAu9iRxJY4Hmj6AmBOU05w=
github.com/gin-contrib/sse v1.1.0/go.mod h1:hxRZ5gVpWMT7Z0B0gSNYqqsSCNIJMjzvm6fqCz9vjwM=
github.com/gin-gonic/gin v1.11.0 h1:OW/6PLjyusp2PPXtyxKHU0RbX6I/l28FTdDlae5ueWk=
github.com/gin-gonic/gin v1.11.0/go.mod h1:+iq/FyxlGzII0KHiBGjuNn4UNENUlKbGlNmc+W50Dls=
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
github.com/go-playground/validator/v10 v10.27.0 h1:w8+XrWVMhGkxOaaowyKH35gFydVHOvC0/uWoy2Fzwn4=
github.com/go-playground/validator/v10 v10.27.0/go.mod h1:I5QpIEbmr8On7W0TktmJAumgzX4CA1XNl4ZmDuVHKKo=
github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4=
github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
github.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=
github.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo=
github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e h1:ijClszYn+mADRFY17kjQEVQ1XRhq2/JR1M3sGqeJoxs= github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e h1:ijClszYn+mADRFY17kjQEVQ1XRhq2/JR1M3sGqeJoxs=
github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA= github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo=
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
github.com/jackc/pgx/v5 v5.7.6 h1:rWQc5FwZSPX58r1OQmkuaNicxdmExaEz5A2DO2hUuTk=
github.com/jackc/pgx/v5 v5.7.6/go.mod h1:aruU7o91Tc2q2cFp5h4uP3f6ztExVpyVv88Xl/8Vl8M=
github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo=
github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
github.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=
github.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4= github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4=
github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=
github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/quic-go/qpack v0.5.1 h1:giqksBPnT/HDtZ6VhtFKgoLOWmlyo9Ei6u9PqzIMbhI=
github.com/quic-go/qpack v0.5.1/go.mod h1:+PC4XFrEskIVkcLzpEkbLqq1uCoxPhQuvK5rH1ZgaEg=
github.com/quic-go/quic-go v0.54.0 h1:6s1YB9QotYI6Ospeiguknbp2Znb/jZYjZLRXn9kMQBg=
github.com/quic-go/quic-go v0.54.0/go.mod h1:e68ZEaCdyviluZmy44P6Iey98v/Wfz6HCjQEm+l8zTY=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
@@ -23,22 +84,48 @@ github.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4
github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=
github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
github.com/ugorji/go/codec v1.3.0 h1:Qd2W2sQawAfG8XSvzwhBeoGq71zXOC/Q1E9y/wUcsUA=
github.com/ugorji/go/codec v1.3.0/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=
github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M= github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M=
github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw=
go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU=
go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM=
golang.org/x/arch v0.20.0 h1:dx1zTU0MAE98U+TQ8BLl7XsJbgze2WnNKF/8tGp/Q6c=
golang.org/x/arch v0.20.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=
golang.org/x/crypto v0.42.0 h1:chiH31gIWm57EkTXpwnqf8qeuMUi0yekh6mT2AvFlqI=
golang.org/x/crypto v0.42.0/go.mod h1:4+rDnOTJhQCx2q7/j6rAN5XDw8kPjeaXEUR2eL94ix8=
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b h1:M2rDM6z3Fhozi9O7NWsxAkg/yqS/lQJ6PmkyIV3YP+o= golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b h1:M2rDM6z3Fhozi9O7NWsxAkg/yqS/lQJ6PmkyIV3YP+o=
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b/go.mod h1:3//PLf8L/X+8b4vuAfHzxeRUl04Adcb341+IGKfnqS8= golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b/go.mod h1:3//PLf8L/X+8b4vuAfHzxeRUl04Adcb341+IGKfnqS8=
golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w= golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ=
golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc=
golang.org/x/net v0.44.0 h1:evd8IRDyfNBMBTTY5XRF1vaZlD+EmWx6x8PkhR04H/I= golang.org/x/net v0.44.0 h1:evd8IRDyfNBMBTTY5XRF1vaZlD+EmWx6x8PkhR04H/I=
golang.org/x/net v0.44.0/go.mod h1:ECOoLqd5U3Lhyeyo/QDCEVQ4sNgYsqvCZ722XogGieY= golang.org/x/net v0.44.0/go.mod h1:ECOoLqd5U3Lhyeyo/QDCEVQ4sNgYsqvCZ722XogGieY=
golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8= golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug=
golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k= golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k=
golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo= golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk=
golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg= golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4=
golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg=
golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s=
google.golang.org/protobuf v1.36.9 h1:w2gp2mA27hUeUzj9Ex9FBjsBm40zfaDtEWow293U7Iw=
google.golang.org/protobuf v1.36.9/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
modernc.org/cc/v4 v4.26.2 h1:991HMkLjJzYBIfha6ECZdjrIYz2/1ayr+FL8GN+CNzM= modernc.org/cc/v4 v4.26.2 h1:991HMkLjJzYBIfha6ECZdjrIYz2/1ayr+FL8GN+CNzM=
modernc.org/cc/v4 v4.26.2/go.mod h1:uVtb5OGqUKpoLWhqwNQo/8LwvoiEBLvZXIQ/SmO6mL0= modernc.org/cc/v4 v4.26.2/go.mod h1:uVtb5OGqUKpoLWhqwNQo/8LwvoiEBLvZXIQ/SmO6mL0=

1
web/app/main.go Normal file
View File

@@ -0,0 +1 @@
package main

BIN
web/static/img/3037106.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

BIN
web/static/img/box.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

BIN
web/static/img/favico.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
web/static/img/github.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

BIN
web/static/img/gopher.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

BIN
web/static/img/lua.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
web/static/img/watch.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

150
web/templates/index.html Normal file
View File

@@ -0,0 +1,150 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Packets Custom Package Manager</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: Arial, sans-serif;
line-height: 1.6;
background: #fefefe;
color: #222;
padding: 20px;
}
header {
text-align: center;
margin-bottom: 20px;
}
header h1 {
font-size: 2.2em;
color: #333;
}
header p {
font-size: 1.1em;
color: #555;
}
nav {
text-align: center;
margin: 15px 0;
}
nav a {
margin: 0 10px;
text-decoration: none;
color: #0066cc;
font-weight: bold;
}
main {
max-width: 900px;
margin: auto;
}
section {
margin-bottom: 30px;
padding-bottom: 10px;
border-bottom: 1px solid #ddd;
}
h2 {
color: #222;
margin-bottom: 10px;
}
pre {
background: #f4f4f4;
padding: 10px;
border-radius: 5px;
overflow-x: auto;
}
hr {
border: none;
height: 1px;
background: linear-gradient(to right, transparent, #ccc, transparent);
margin: 20px 0;
}
@media (max-width: 600px) {
header h1 {
font-size: 1.8em;
}
nav a {
display: block;
margin: 5px 0;
}
}
</style>
</head>
<body>
<header>
<h1>📦 Packets</h1>
<p>Fast, lightweight and compatible</p>
</header>
<nav>
<a href="#download">Download</a>
<a href="/package">Packages</a>
<a href="/upload">Upload</a>
<a href="/account">Account</a>
</nav>
<hr>
<main>
<section id="overview">
<h2>Overview</h2>
<p> Packets is a lightweight and fast package manager for Linux, developed in Go. It allows you to install, remove, and update software in a simple, efficient, and secure way, using packages compressed in <code>.tar.zst</code> with metadata in <code>manifest.toml</code>. Additionally, it supports integration with Lua scripts for custom actions during installation and removal, and advanced features like local network (LAN) package discovery and remote synchronization via HTTP.</p>
</section>
<section id="features">
<h2>Key Features</h2>
<ul>
<li><strong>Lightweight & Fast</strong> Minimal resource usage, optimized for speed.</li>
<li><strong>Efficient Compression</strong> Uses <code>.tar.zst</code> format for smaller packages and faster transfers.</li>
<li><strong>Clear Metadata</strong> Each package contains a <code>manifest.toml</code> for versioning and dependency details.</li>
<li><strong>Lua Integration</strong> Execute custom scripts during install and removal.</li>
<li><strong>LAN & HTTP Support</strong> Discover packages in your local network or download remotely.</li>
<li><strong>Security</strong> All packages are verified with SHA-256 checksums.</li>
</ul>
</section>
<section id="why-use">
<h2>Why Use Packets?</h2>
<ul>
<li><strong>Open Source and Transparent</strong> Fully open on GitHub, allowing you to audit, modify, and contribute.</li>
<li><strong>Modern Design</strong> Written in Go with Lua hooks to enable flexible and safe package lifecycle scripts.</li>
<li><strong>Local Network Efficiency</strong> Peer-to-peer package discovery reduces bandwidth and speeds up installations.</li>
<li><strong>Security Focused</strong> SHA-256 validation and sandboxed Lua scripts keep your system safe.</li>
<li><strong>Customizable</strong> Easy to create and manage your own packages or community repositories.</li>
<li><strong>Light on Resources</strong> Perfect for minimal Linux setups or embedded devices.</li>
</ul>
</section>
<section id="contribute">
<h2>How to Contribute</h2>
<p>
Packets is an open project and welcomes contributions! Whether you want to:
</p>
<ul>
<li>Report issues or suggest new features</li>
<li>Submit pull requests with improvements or bug fixes</li>
<li>Create and share new packages</li>
<li>Help with documentation and translations</li>
<li>Test on different Linux distributions and hardware</li>
</ul>
<p>
Check the repository for contribution guidelines and start collaborating today.
</p>
</section>
<section id="github">
<h2>GitHub Repository</h2>
<p>
Find the source code, issues, documentation, and more at the official GitHub repository:
</p>
<a class="github-link" href="https://github.com/roboogg133/packets" target="_blank" rel="noopener noreferrer">
https://github.com/roboogg133/packets
</a>
</section>
</main>
</body>
</html>

221
web/templates/invalid.html Normal file
View File

@@ -0,0 +1,221 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Packets - Login/Register</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: Arial, sans-serif;
background: #fefefe;
color: #222;
padding: 20px;
display: flex;
flex-direction: column;
align-items: center;
min-height: 100vh;
line-height: 1.6;
}
header {
text-align: center;
margin-bottom: 20px;
}
header h1 {
font-size: 2.2em;
color: #333;
}
header p {
font-size: 1.1em;
color: #555;
}
nav {
text-align: center;
margin: 15px 0;
}
nav a {
margin: 0 10px;
text-decoration: none;
color: #0066cc;
font-weight: bold;
}
.container {
background: #f9f9f9;
border: 1px solid #ccc;
border-radius: 5px;
width: 700px;
max-width: 100%;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.tabs {
display: flex;
border-bottom: 1px solid #ccc;
}
.tab {
flex: 1;
text-align: center;
padding: 15px 0;
cursor: pointer;
font-weight: bold;
color: #555;
user-select: none;
transition: background 0.3s, color 0.3s;
}
.tab.active {
background: white;
color: #0066cc;
border-bottom: 3px solid #0066cc;
}
.forms {
display: flex;
padding: 20px;
gap: 20px;
}
form {
flex: 1;
}
form h2 {
margin-bottom: 20px;
color: #222;
text-align: center;
}
label {
display: block;
margin-bottom: 6px;
font-weight: bold;
font-size: 0.9rem;
}
input {
width: 100%;
padding: 8px;
margin-bottom: 15px;
font-size: 1rem;
border: 1px solid #ccc;
border-radius: 4px;
font-family: inherit;
transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus {
outline: none;
border-color: #0066cc;
box-shadow: 0 0 5px rgba(0,102,204,0.5);
}
button {
width: 100%;
padding: 10px;
background: #0066cc;
color: white;
border: none;
cursor: pointer;
font-weight: bold;
}
button:hover{
background: #004999;
}
form:not(.active) {
display: none;
}
hr {
border: none;
height: 1px;
background: linear-gradient(to right, transparent, #ccc, transparent);
margin: 20px 0;
}
@media (max-width: 720px) {
.forms {
flex-direction: column;
padding: 10px;
gap: 10px;
}
}
</style>
</head>
<body>
<header>
<h1>📦 Packets</h1>
<p>Fast, lightweight and compatible</p>
</header>
<nav>
<a href="#download">Download</a>
<a href="/package">Packages</a>
<a href="/upload">Upload</a>
<a href="/account">Account</a>
</nav>
<hr>
<div class="container" role="main" aria-label="Login and Registration forms">
<div class="tabs" role="tablist">
<div class="tab active" role="tab" tabindex="0" aria-selected="true" aria-controls="loginForm" id="loginTab" data-target="loginForm">Login</div>
<div class="tab" role="tab" tabindex="-1" aria-selected="false" aria-controls="registerForm" id="registerTab" data-target="registerForm">Register</div>
</div>
<div class="forms">
<form id="loginForm" class="active" action="/login" method="POST" novalidate role="tabpanel" aria-labelledby="loginTab">
<h2>Login to Packets</h2>
<label for="username">Username</label>
<input type="text" id="username" name="username" required autocomplete="username" />
<label for="loginPassword">Password</label>
<input type="password" id="loginPassword" name="password" required autocomplete="current-password" />
<button type="submit">Login</button>
</form>
<form id="registerForm" action="/register" method="POST" novalidate role="tabpanel" aria-labelledby="registerTab">
<h2>Create an Account</h2>
<label for="regUsername">Username</label>
<input type="text" id="regUsername" name="username" required autocomplete="username" minlength="3" />
<label for="regEmail">Email</label>
<input type="email" id="regEmail" name="email" required autocomplete="email" />
<label for="regPassword">Password</label>
<input type="password" id="regPassword" name="password" required autocomplete="new-password" minlength="6" />
<label for="regPasswordConfirm">Confirm Password</label>
<input type="password" id="regPasswordConfirm" name="password_confirm" required autocomplete="new-password" minlength="6" />
<button type="submit">Register</button>
</form>
</div>
</div>
<div style="padding: 10px; margin-top: 5px;">
<h1 style="color: red;">Invalid login!</h1>
</div>
<script>
const tabs = document.querySelectorAll('.tab');
const forms = document.querySelectorAll('form');
tabs.forEach(tab => {
tab.addEventListener('click', (event) => {
event.preventDefault();
tabs.forEach(t => {
t.classList.remove('active');
t.setAttribute('aria-selected', 'false');
t.setAttribute('tabindex', '-1');
});
tab.classList.add('active');
tab.setAttribute('aria-selected', 'true');
tab.setAttribute('tabindex', '0');
forms.forEach(form => form.classList.remove('active'));
const target = tab.getAttribute('data-target');
document.getElementById(target).classList.add('active');
});
tab.addEventListener('keydown', e => {
let index = Array.from(tabs).indexOf(e.target);
if (e.key === 'ArrowRight') {
e.preventDefault();
tabs[(index + 1) % tabs.length].focus();
} else if (e.key === 'ArrowLeft') {
e.preventDefault();
tabs[(index - 1 + tabs.length) % tabs.length].focus();
}
});
});
</script>
</body>
</html>

239
web/templates/login.html Normal file
View File

@@ -0,0 +1,239 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Packets - Login</title>
<link rel="icon" href="/favicon.ico" type="image/x-icon">
</head>
<body>
<header>
<img src="/static/img/box.png" alt="Packets" style="height: 60px;">
<h1>Packets Community Repository</h1>
<nav>
<div class="dropdown">
<a href="/register" class="active">Account</a>
<div class="dropdown-content">
<a href="/register">Register</a>
<a href="/login">Login</a>
<a href="/logout">Logout</a>
</div>
</div>
<div class="dropdown">
<a href="/packages">Packages</a>
<div class="dropdown-content">
<a href="/upload">Upload</a>
<a href="/packages">Search</a>
</div>
</div>
<div class="dropdown">
<a href="#">Help</a>
<div class="dropdown-content">
<a href="#">Documentation</a>
<a href="#">Report a bug</a>
<a href="#">Community</a>
</div>
</div>
<a href="#">Download</a>
</nav>
</header>
<hr>
<div class="main-wrapper">
<main>
<h1>Login</h1>
<input type="text" name="login" id="usrlog" placeholder=" Username">
<br>
<input type="password" name="login" id="passlog" placeholder=" Password">
<br><br>
<button id="submitlog">Submit</button>
</main>
</div>
<script>
const usrlog = document.getElementById("usrlog");
const passlog = document.getElementById("passlog");
const submitlog = document.getElementById("submitlog");
submitlog.addEventListener("click", function(){
fetch("https://servidordomal.fun/login", {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify({
username: usrlog.value,
password: passlog.value})
});
});
</script>
<style>
* {
padding: 0;
margin: 0;
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}
html,body {
background-color: #EDFBFF;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
}
header {
background-color: #2768F5;
width: 100%;
height: 60px;
display: flex;
align-items: center;
}
nav {
margin-left: auto;
margin-right: 50px;
}
nav a, header h1 {
margin-left: 30px;
text-decoration: none;
color: white;
font-weight: bold;
}
header h1 {
margin-left: 20px;
}
hr {
border: none;
height: 3px;
background: #1B1C24;
}
nav {
margin-left: auto;
margin-right: 50px;
display: flex;
align-items: center;
gap: 20px;
position: relative;
}
nav a, header h1 {
text-decoration: none;
color: white;
font-weight: bold;
}
.dropdown {
position: relative;
}
.dropdown-content {
opacity: 0;
visibility: hidden;
position: absolute;
top: 100%;
left: 0;
background-color: white;
min-width: auto;
padding: 8px 0;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
border-radius: 4px;
z-index: 10;
transition: opacity 0.3s ease, transform 0.3s ease;
transform: translateY(10px);
}
.dropdown:hover .dropdown-content {
opacity: 1;
visibility: visible;
transform: translateY(0);
min-width: max-content;
padding: 8px 12px;
}
.dropdown-content a {
color: black;
padding: 8px 12px;
display: block;
text-decoration: none;
white-space: nowrap;
}
.dropdown-content a:hover {
background-color: #f1f1f1;
}
.main-wrapper {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
}
main{
box-sizing: border-box;
border: 2.5px solid #C4EEF2;
width: 90%;
max-width: 400px;
padding: 30px;
background-color: white;
box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
border-radius: 12px;
text-align: center;
margin-top: 80px;
}
button {
color: white;
border: 1px solid transparent;
padding: 12px 24px;
border-radius: 6px;
font-size: 1rem;
font-weight: bold;
cursor: pointer;
transition: border-color 0.3s ease;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
background-color: #2768F5;
}
button:hover {
border-color: black;
}
button:active {
transform: translateY(1px);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
}
input[type="text"], input[type="password"] {
width: 100%;
padding: 12px 1px;
margin: 10px 0;
border: 2px solid gainsboro;
border-radius: 4px;
font-size: 1rem;
transition: all 0.2s ease;
}
input[type="text"]:focus, input[type="password"]:focus {
outline: none;
border-color: #2768F5;
box-shadow: 0 0 0 3px rgba(39, 104, 245, 0.2);
background-color: #f9fcff;
}
nav a.active {
border-bottom: 3px solid white;
color: white;
padding-bottom: 18.93px;
}
</style>
</body>
</html>

230
web/templates/packages.html Normal file
View File

@@ -0,0 +1,230 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Packets Custom Package Manager</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: Arial, sans-serif;
line-height: 1.6;
background: #fefefe;
color: #222;
padding: 20px;
}
header {
text-align: center;
margin-bottom: 20px;
}
header h1 {
font-size: 2.2em;
color: #333;
}
header p {
font-size: 1.1em;
color: #555;
}
nav {
text-align: center;
margin: 15px 0;
}
nav a {
margin: 0 10px;
text-decoration: none;
color: #0066cc;
font-weight: bold;
}
main {
max-width: 1000px;
margin: auto;
}
section {
margin-bottom: 30px;
padding-bottom: 10px;
border-bottom: 1px solid #ddd;
}
h2 {
color: #222;
margin-bottom: 10px;
}
/* table control */
.table-controls {
margin-bottom: 10px;
display: flex;
flex-wrap: wrap;
gap: 12px;
align-items: center;
}
.table-controls label {
font-weight: bold;
margin-right: 6px;
}
.table-controls input[type="search"],
.table-controls select {
padding: 6px 10px;
font-size: 1rem;
border: 1px solid #ccc;
border-radius: 4px;
min-width: 100px;
}
/* table */
.table-container {
overflow-x: auto;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 5px;
background: white;
}
th, td {
padding: 10px;
border: 1px solid #ddd;
text-align: left;
}
th {
background: #f4f4f4;
font-weight: bold;
}
tr:nth-child(even) {
background: #fafafa;
}
table a {
text-decoration: none;
color: #0066cc;
}
/* pagination */
.pagination {
margin-top: 15px;
display: flex;
justify-content: center;
gap: 10px;
}
.pagination button {
padding: 6px 12px;
font-size: 1.2rem;
cursor: pointer;
border: 1px solid #ccc;
border-radius: 4px;
background: #f0f0f0;
color: #333;
user-select: none;
transition: background-color 0.2s;
}
.pagination button:hover:not(:disabled) {
background-color: #ddd;
}
.pagination button:disabled {
cursor: default;
opacity: 0.5;
}
hr {
border: none;
height: 1px;
background: linear-gradient(to right, transparent, #ccc, transparent);
margin: 20px 0;
}
@media (max-width: 600px) {
header h1 {
font-size: 1.8em;
}
nav a {
display: block;
margin: 5px 0;
}
.table-controls {
flex-direction: column;
align-items: stretch;
}
}
</style>
</head>
<body>
<header>
<h1>📦 Packets</h1>
<p>Fast, lightweight and compatible</p>
</header>
<nav>
<a href="#download">Download</a>
<a href="/package">Packages</a>
<a href="/upload">Upload</a>
<a href="/account">Account</a>
</nav>
<hr>
<main>
<section id="packages">
<div class="table-controls">
<label for="searchInput">Search:</label>
<input type="search" id="searchInput" v-model="search" placeholder="Search packages...">
<label for="operatingSelect">Operating:</label>
<select id="operatingSelect" v-model="operating">
<option value="">All</option>
<option value="Linux">Linux</option>
<option value="Windows">Windows</option>
<option value="MacOS">MacOS</option>
</select>
<label for="archSelect">Arch:</label>
<select id="archSelect" v-model="arch">
<option value="">All</option>
<option value="x86_64">x86_64</option>
<option value="arm64">arm64</option>
<option value="i386">i386</option>
</select>
<label for="rowsSelect">Show:</label>
<select id="rowsSelect" v-model="rows">
<option value="10">10 rows</option>
<option value="25">25 rows</option>
<option value="50">50 rows</option>
<option value="100">100 rows</option>
<option value="500" selected>500 rows</option>
</select>
</div>
<hr>
<h2>Package List</h2>
<div class="table-container">
<table>
<thead>
<tr>
<th>Query name</th>
<th>Name</th>
<th>Arch</th>
<th>Operating</th>
<th>Version</th>
<th>Author</th>
<th>Reports</th>
</tr>
</thead>
<tbody id="app">
<tr v-for="package in packages" :key="package.realname">
<td>[[ package.name ]]</td>
<td><a :href="'/package/'+ package.realname">[[ package.realname ]]</a></td>
<td>[[ package.arch ]]</td>
<td>[[ package.operating ]]</td>
<td>[[ package.version ]]</td>
<td>[[ package.author ]]</td>
<td>[[ package.reports ]]</td>
</tr>
</tbody>
</table>
</div>
<div class="pagination">
<button id="prevPage" @click="prevPage" aria-label="Previous page" title="Previous">&lt;</button>
<button id="nextPage" @click="nextPage" aria-label="Next page" title="Next">&gt;</button>
</div>
</section>
</main>
<script src="/static/js/vue.global.js"></script>
<script src="/static/js/table.js"></script>
</body>
</html>

240
web/templates/register.html Normal file
View File

@@ -0,0 +1,240 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Packets - Register</title>
<link rel="icon" href="/favicon.ico" type="image/x-icon">
</head>
<body>
<header>
<img src="/static/img/box.png" alt="Packets" style="height: 60px;">
<h1>Packets Community Repository</h1>
<nav>
<div class="dropdown">
<a href="/register" class="active">Account</a>
<div class="dropdown-content">
<a href="/register">Register</a>
<a href="/login">Login</a>
<a href="/logout">Logout</a>
</div>
</div>
<div class="dropdown">
<a href="/packages">Packages</a>
<div class="dropdown-content">
<a href="/upload">Upload</a>
<a href="/packages">Search</a>
</div>
</div>
<div class="dropdown">
<a href="#">Help</a>
<div class="dropdown-content">
<a href="#">Documentation</a>
<a href="#">Report a bug</a>
<a href="#">Community</a>
</div>
</div>
<a href="#">Download</a>
</nav>
</header>
<hr>
<div class="main-wrapper">
<main>
<h1>Register</h1>
<input type="text" name="register" id="usr" placeholder=" Username">
<br>
<input type="email" name="register" id="email" placeholder=" E-mail">
<br>
<input type="password" name="register" id="pass" placeholder=" Password">
<br><br>
<button id="submit">Submit</button>
</main>
</div>
<script>
const usr = document.getElementById("usr");
const pass = document.getElementById("pass");
const email = document.getElementById("email");
const submitlog = document.getElementById("submit");
submitlog.addEventListener("click", function(){
fetch("https://servidordomal.fun/register", {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify({
username: usr.value,
email: email.value,
password: pass.value})
});
});
</script>
<style>
* {
padding: 0;
margin: 0;
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}
html,body {
background-color: #EDFBFF;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
}
header {
background-color: #2768F5;
width: 100%;
height: 60px;
display: flex;
align-items: center;
}
nav {
margin-left: auto;
margin-right: 50px;
}
nav a, header h1 {
margin-left: 30px;
text-decoration: none;
color: white;
font-weight: bold;
}
header h1 {
margin-left: 20px;
}
hr {
border: none;
height: 3px;
background: #1B1C24;
}
nav {
margin-left: auto;
margin-right: 50px;
display: flex;
align-items: center;
gap: 20px;
position: relative;
}
nav a, header h1 {
text-decoration: none;
color: white;
font-weight: bold;
}
.dropdown {
position: relative;
}
.dropdown-content {
opacity: 0;
visibility: hidden;
position: absolute;
top: 100%;
left: 0;
background-color: white;
min-width: auto;
padding: 8px 0;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
border-radius: 4px;
z-index: 10;
transition: opacity 0.3s ease, transform 0.3s ease;
transform: translateY(10px);
}
.dropdown:hover .dropdown-content {
opacity: 1;
visibility: visible;
transform: translateY(0);
min-width: max-content;
padding: 8px 12px;
}
.dropdown-content a {
color: black;
padding: 8px 12px;
display: block;
text-decoration: none;
white-space: nowrap;
}
.dropdown-content a:hover {
background-color: #f1f1f1;
}
.main-wrapper {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
}
main{
box-sizing: border-box;
border: 2.5px solid #C4EEF2;
width: 90%;
max-width: 400px;
padding: 30px;
background-color: white;
box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
border-radius: 12px;
text-align: center;
margin-top: 80px;
}
button {
color: white;
border: 1px solid transparent;
padding: 12px 24px;
border-radius: 6px;
font-size: 1rem;
font-weight: bold;
cursor: pointer;
transition: border-color 0.3s ease;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
background-color: #2768F5;
}
button:hover {
border-color: black;
}
button:active {
transform: translateY(1px);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
}
input[type="text"], input[type="password"], input[type="email"] {
width: 100%;
padding: 12px 1px;
margin: 10px 0;
border: 2px solid gainsboro;
border-radius: 4px;
font-size: 1rem;
transition: all 0.2s ease;
}
input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus {
outline: none;
border-color: #2768F5;
box-shadow: 0 0 0 3px rgba(39, 104, 245, 0.2);
background-color: #f9fcff;
}
nav a.active {
border-bottom: 3px solid white;
color: white;
padding-bottom: 18.93px;
}
</style>
</body>
</html>

104
web/templates/scripts.html Normal file
View File

@@ -0,0 +1,104 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Packets Custom Package Manager</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: Arial, sans-serif;
line-height: 1.6;
background: #fefefe;
color: #222;
padding: 20px;
}
header {
text-align: center;
margin-bottom: 20px;
}
header h1 {
font-size: 2.2em;
color: #333;
}
header p {
font-size: 1.1em;
color: #555;
}
nav {
text-align: center;
margin: 15px 0;
}
nav a {
margin: 0 10px;
text-decoration: none;
color: #0066cc;
font-weight: bold;
}
main {
max-width: 900px;
margin: auto;
}
section {
margin-bottom: 30px;
padding-bottom: 10px;
border-bottom: 1px solid #ddd;
}
h2 {
color: #222;
margin-bottom: 10px;
}
pre {
background: #f4f4f4;
padding: 10px;
border-radius: 5px;
overflow-x: auto;
}
hr {
border: none;
height: 1px;
background: linear-gradient(to right, transparent, #ccc, transparent);
margin: 20px 0;
}
@media (max-width: 600px) {
header h1 {
font-size: 1.8em;
}
nav a {
display: block;
margin: 5px 0;
}
}
</style>
</head>
<body>
<header>
<h1>📦 Packets</h1>
<p>Fast, lightweight and compatible</p>
</header>
<nav>
<a href="#download">Download</a>
<a href="/package">Packages</a>
<a href="/upload">Upload</a>
<a href="/account">Account</a>
</nav>
<hr>
<main>
<section id="manifest">
<h2>Manifest.toml</h2>
<pre><code>{{ .Manifest }}</code></pre>
</section>
<section>
<h2>Install script</h2>
<pre><code>{{ .Install }}</code></pre>
</section>
<section>
<h2>Remove script</h2>
<pre><code>{{ .Remove }}</code></pre>
</section>
</main>
</body>
</html>

115
web/templates/single.html Normal file
View File

@@ -0,0 +1,115 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Packets Custom Package Manager</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: Arial, sans-serif;
line-height: 1.6;
background: #fefefe;
color: #222;
padding: 20px;
}
header {
text-align: center;
margin-bottom: 20px;
}
header h1 {
font-size: 2.2em;
color: #333;
}
header p {
font-size: 1.1em;
color: #555;
}
nav {
text-align: center;
margin: 15px 0;
}
nav a {
margin: 0 10px;
text-decoration: none;
color: #0066cc;
font-weight: bold;
}
main {
max-width: 900px;
margin: auto;
}
section {
margin-bottom: 30px;
padding-bottom: 10px;
border-bottom: 1px solid #ddd;
}
h2 {
color: #222;
margin-bottom: 10px;
}
pre {
background: #f4f4f4;
padding: 10px;
border-radius: 5px;
overflow-x: auto;
}
hr {
border: none;
height: 1px;
background: linear-gradient(to right, transparent, #ccc, transparent);
margin: 20px 0;
}
@media (max-width: 600px) {
header h1 {
font-size: 1.8em;
}
nav a {
display: block;
margin: 5px 0;
}
}
</style>
</head>
<body>
<header>
<h1>📦 Packets</h1>
<p>Fast, lightweight and compatible</p>
</header>
<nav>
<a href="#download">Download</a>
<a href="/package">Packages</a>
<a href="/upload">Upload</a>
<a href="/account">Account</a>
</nav>
<hr>
<main>
<section id="basic-info">
<h2>Basic Info</h2>
<p><strong>Query Name:</strong> {{ .Name }}</p>
<p><strong>Realname:</strong> {{ .Realname }}</p>
<p><strong>Version:</strong> {{ .Version }}</p>
<p><strong>Description:</strong> {{ .Description }}</p>
<p><strong>Architecture:</strong> {{ .Arch }}</p>
<p><strong>Operating:</strong> {{ .Operating }}</p>
<p><strong>Family:</strong> {{ .Family }}</p>
<br>
<p><strong>Author:</strong> {{ .Author }}</p>
<p><strong>Reports:</strong> {{ .Reports }}</p>
<p><strong>Uploaded at:</strong> {{ .Uploaded }}</p>
<br>
<a href="/package/{{ .Realname }}/scripts">Scripts and manifest</a>
</section>
<section id="dependencies">
<h2>Dependencies</h2>
<p>[
{{range .Dependencies}}
<a href="/package/{{.}}">{{.}}</a>,
{{ end }}
]</p>
</section>
</main>
</body>
</html>

217
web/templates/twoinone.html Normal file
View File

@@ -0,0 +1,217 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Packets - Login/Register</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: Arial, sans-serif;
background: #fefefe;
color: #222;
padding: 20px;
display: flex;
flex-direction: column;
align-items: center;
min-height: 100vh;
line-height: 1.6;
}
header {
text-align: center;
margin-bottom: 20px;
}
header h1 {
font-size: 2.2em;
color: #333;
}
header p {
font-size: 1.1em;
color: #555;
}
nav {
text-align: center;
margin: 15px 0;
}
nav a {
margin: 0 10px;
text-decoration: none;
color: #0066cc;
font-weight: bold;
}
.container {
background: #f9f9f9;
border: 1px solid #ccc;
border-radius: 5px;
width: 700px;
max-width: 100%;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.tabs {
display: flex;
border-bottom: 1px solid #ccc;
}
.tab {
flex: 1;
text-align: center;
padding: 15px 0;
cursor: pointer;
font-weight: bold;
color: #555;
user-select: none;
transition: background 0.3s, color 0.3s;
}
.tab.active {
background: white;
color: #0066cc;
border-bottom: 3px solid #0066cc;
}
.forms {
display: flex;
padding: 20px;
gap: 20px;
}
form {
flex: 1;
}
form h2 {
margin-bottom: 20px;
color: #222;
text-align: center;
}
label {
display: block;
margin-bottom: 6px;
font-weight: bold;
font-size: 0.9rem;
}
input {
width: 100%;
padding: 8px;
margin-bottom: 15px;
font-size: 1rem;
border: 1px solid #ccc;
border-radius: 4px;
font-family: inherit;
transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus {
outline: none;
border-color: #0066cc;
box-shadow: 0 0 5px rgba(0,102,204,0.5);
}
button {
width: 100%;
padding: 10px;
background: #0066cc;
color: white;
border: none;
cursor: pointer;
font-weight: bold;
}
button:hover{
background: #004999;
}
form:not(.active) {
display: none;
}
hr {
border: none;
height: 1px;
background: linear-gradient(to right, transparent, #ccc, transparent);
margin: 20px 0;
}
@media (max-width: 720px) {
.forms {
flex-direction: column;
padding: 10px;
gap: 10px;
}
}
</style>
</head>
<body>
<header>
<h1>📦 Packets</h1>
<p>Fast, lightweight and compatible</p>
</header>
<nav>
<a href="#download">Download</a>
<a href="/package">Packages</a>
<a href="/upload">Upload</a>
<a href="/account">Account</a>
</nav>
<hr>
<div class="container" role="main" aria-label="Login and Registration forms">
<div class="tabs" role="tablist">
<div class="tab active" role="tab" tabindex="0" aria-selected="true" aria-controls="loginForm" id="loginTab" data-target="loginForm">Login</div>
<div class="tab" role="tab" tabindex="-1" aria-selected="false" aria-controls="registerForm" id="registerTab" data-target="registerForm">Register</div>
</div>
<div class="forms">
<form id="loginForm" class="active" action="/login" method="POST" novalidate role="tabpanel" aria-labelledby="loginTab">
<h2>Login to Packets</h2>
<label for="username">Username</label>
<input type="text" id="username" name="username" required autocomplete="username" />
<label for="loginPassword">Password</label>
<input type="password" id="loginPassword" name="password" required autocomplete="current-password" />
<button type="submit">Login</button>
</form>
<form id="registerForm" action="/register" method="POST" novalidate role="tabpanel" aria-labelledby="registerTab">
<h2>Create an Account</h2>
<label for="regUsername">Username</label>
<input type="text" id="regUsername" name="username" required autocomplete="username" minlength="3" />
<label for="regEmail">Email</label>
<input type="email" id="regEmail" name="email" required autocomplete="email" />
<label for="regPassword">Password</label>
<input type="password" id="regPassword" name="password" required autocomplete="new-password" minlength="6" />
<label for="regPasswordConfirm">Confirm Password</label>
<input type="password" id="regPasswordConfirm" name="password_confirm" required autocomplete="new-password" minlength="6" />
<button type="submit">Register</button>
</form>
</div>
</div>
<script>
const tabs = document.querySelectorAll('.tab');
const forms = document.querySelectorAll('form');
tabs.forEach(tab => {
tab.addEventListener('click', (event) => {
event.preventDefault();
tabs.forEach(t => {
t.classList.remove('active');
t.setAttribute('aria-selected', 'false');
t.setAttribute('tabindex', '-1');
});
tab.classList.add('active');
tab.setAttribute('aria-selected', 'true');
tab.setAttribute('tabindex', '0');
forms.forEach(form => form.classList.remove('active'));
const target = tab.getAttribute('data-target');
document.getElementById(target).classList.add('active');
});
tab.addEventListener('keydown', e => {
let index = Array.from(tabs).indexOf(e.target);
if (e.key === 'ArrowRight') {
e.preventDefault();
tabs[(index + 1) % tabs.length].focus();
} else if (e.key === 'ArrowLeft') {
e.preventDefault();
tabs[(index - 1 + tabs.length) % tabs.length].focus();
}
});
});
</script>
</body>
</html>

173
web/templates/upload.html Normal file
View File

@@ -0,0 +1,173 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Packets Custom Package Manager</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: Arial, sans-serif;
line-height: 1.6;
background: #fefefe;
color: #222;
padding: 20px;
}
header {
text-align: center;
margin-bottom: 20px;
}
header h1 {
font-size: 2.2em;
color: #333;
}
header p {
font-size: 1.1em;
color: #555;
}
nav {
text-align: center;
margin: 15px 0;
}
nav a {
margin: 0 10px;
text-decoration: none;
color: #0066cc;
font-weight: bold;
}
main {
max-width: 900px;
margin: auto;
}
section {
margin-bottom: 30px;
padding-bottom: 10px;
border-bottom: 1px solid #ddd;
}
h2 {
color: #222;
margin-bottom: 10px;
}
pre {
background: #f4f4f4;
padding: 10px;
border-radius: 5px;
overflow-x: auto;
}
form {
background: #f9f9f9;
padding: 15px;
border: 1px solid #ccc;
border-radius: 5px;
}
form label {
display: block;
margin-bottom: 5px;
font-weight: bold;
}
form input, form textarea, form select, form button {
width: 100%;
padding: 8px;
margin-bottom: 10px;
font-size: 1rem;
border: 1px solid #ccc;
border-radius: 4px;
font-family: inherit;
transition: border-color 0.2s, box-shadow 0.2s;
}
form input:focus, form textarea:focus, form select:focus {
outline: none;
border-color: #0066cc;
box-shadow: 0 0 5px rgba(0, 102, 204, 0.5);
}
form button {
background: #0066cc;
color: white;
border: none;
cursor: pointer;
font-weight: bold;
}
form button:hover {
background: #004999;
}
hr {
border: none;
height: 1px;
background: linear-gradient(to right, transparent, #ccc, transparent);
margin: 20px 0;
}
@media (max-width: 600px) {
header h1 {
font-size: 1.8em;
}
nav a {
display: block;
margin: 5px 0;
}
}
</style>
</head>
<body>
<header>
<h1>📦 Packets</h1>
<p>Fast, lightweight and compatible</p>
</header>
<nav>
<a href="#download">Download</a>
<a href="/package">Packages</a>
<a href="/upload">Upload</a>
<a href="/account">Account</a>
</nav>
<hr>
<main>
<section id="upload">
<h2>Upload a package</h2>
<form>
<label for="name">Query Name</label>
<input type="text" id="name" name="name" v-model="name" required>
<label for="file">Package link (.tar.zst)</label>
<input type="link" id="file" name="file" v-model="file" placeholder="ex: https://github.com/roboogg133/packets/raw/refs/heads/main/go1.24.5.pkt.tar.zst" required>
<label for="family">Family</label>
<select name="family" id="family" v-model="family">
<option value="New">New</option>
{{range .Families}}
<option value="{{.}}">{{.}}</option>
{{end}}
</select>
<label for="arch">Architecture</label>
<select name="arch" id="arch" v-model="arch">
<option value="x86_64">x86_64</option>
<option value="arm64">Arm64</option>
<option value="i386">i386</option>
</select>
<label for="operating">Operating System</label>
<select name="operating" id="operating" v-model="operating">
<option value="Linux">Linux</option>
<option value="Windows">Windows</option>
<option value="MacOS">MacOS</option>
</select>
<label for="signature">File signature (ed25519)</label>
<input type="file" name="signature" id="signature">
<label for="public_key">Public key (ed25519)</label>
<input type="file" name="public_key" id="public_key">
<button type="submit">Submit</button>
</form>
</section>
</main>
</body>
</html>
<script src="/static/js/refresh.js"></script>