Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
be963c7c54 | |||
661e676fd2 | |||
08b56d1c77 | |||
2c42204f90 | |||
dc31122c05 | |||
08d73d72e1 | |||
b559f15eb1 | |||
d864a8c486 | |||
0655700d15 | |||
4cff36e54f |
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,3 +3,4 @@ release
|
|||||||
dist
|
dist
|
||||||
.env
|
.env
|
||||||
dist/
|
dist/
|
||||||
|
.DS_Store
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
|
version: 2
|
||||||
|
|
||||||
before:
|
before:
|
||||||
hooks:
|
hooks:
|
||||||
- go mod tidy
|
- go mod tidy
|
||||||
- go test ./...
|
- go test ./...
|
||||||
- golangci-lint run
|
|
||||||
|
|
||||||
builds:
|
builds:
|
||||||
- env:
|
- env:
|
||||||
@ -13,11 +14,11 @@ builds:
|
|||||||
- darwin
|
- darwin
|
||||||
|
|
||||||
archives:
|
archives:
|
||||||
- format: tar.gz
|
- formats: [tar.gz]
|
||||||
# this name template makes the OS and Arch compatible with the results of `uname`.
|
# this name template makes the OS and Arch compatible with the results of `uname`.
|
||||||
name_template: >-
|
name_template: >-
|
||||||
{{ .ProjectName }}_
|
{{ .ProjectName }}_
|
||||||
{{- .Os }}_
|
{{- title .Os }}_
|
||||||
{{- if eq .Arch "amd64" }}x86_64
|
{{- if eq .Arch "amd64" }}x86_64
|
||||||
{{- else if eq .Arch "386" }}i386
|
{{- else if eq .Arch "386" }}i386
|
||||||
{{- else }}{{ .Arch }}{{ end }}
|
{{- else }}{{ .Arch }}{{ end }}
|
||||||
@ -25,16 +26,28 @@ archives:
|
|||||||
# use zip for windows archives
|
# use zip for windows archives
|
||||||
format_overrides:
|
format_overrides:
|
||||||
- goos: windows
|
- goos: windows
|
||||||
format: zip
|
formats: [zip]
|
||||||
|
|
||||||
changelog:
|
changelog:
|
||||||
skip: true
|
disable: true
|
||||||
|
|
||||||
dockers:
|
dockers:
|
||||||
- image_templates:
|
- image_templates:
|
||||||
- "tardisx/gropple:{{ .Tag }}"
|
- "tardisx/gropple:{{ .Tag }}-amd64"
|
||||||
- "tardisx/gropple:v{{ .Major }}"
|
use: buildx
|
||||||
- "tardisx/gropple:v{{ .Major }}.{{ .Minor }}"
|
build_flag_templates:
|
||||||
- "tardisx/gropple:latest"
|
- "--pull"
|
||||||
|
- "--platform=linux/amd64"
|
||||||
|
- image_templates:
|
||||||
|
- "tardisx/gropple:{{ .Tag }}-arm64"
|
||||||
|
use: buildx
|
||||||
|
build_flag_templates:
|
||||||
|
- "--pull"
|
||||||
|
- "--platform=linux/arm64"
|
||||||
|
goarch: arm64
|
||||||
|
|
||||||
|
docker_manifests:
|
||||||
|
- name_template: "tardisx/gropple:{{ .Tag }}"
|
||||||
|
image_templates:
|
||||||
|
- "tardisx/gropple:{{ .Tag }}-amd64"
|
||||||
|
- "tardisx/gropple:{{ .Tag }}-arm64"
|
||||||
|
@ -2,6 +2,12 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
## [v1.1.4] - 2025-04-25
|
||||||
|
|
||||||
|
- Minor refactorings, upgrade dependencies
|
||||||
|
- Migrate to goreleaser v2 configuration
|
||||||
|
- Generate arm64 docker builds
|
||||||
|
|
||||||
## [v1.1.3] - 2024-03-17
|
## [v1.1.3] - 2024-03-17
|
||||||
|
|
||||||
- Code cleanups, better error checking
|
- Code cleanups, better error checking
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM ubuntu:mantic
|
FROM ubuntu:noble
|
||||||
COPY gropple /
|
COPY gropple /
|
||||||
|
|
||||||
RUN apt update && apt install -y curl python3 ffmpeg
|
RUN apt update && apt install -y curl python3 ffmpeg
|
||||||
|
@ -266,14 +266,14 @@ func (cs *ConfigService) LoadConfig() error {
|
|||||||
path := cs.ConfigPath
|
path := cs.ConfigPath
|
||||||
b, err := os.ReadFile(path)
|
b, err := os.ReadFile(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Could not read config '%s': %v", path, err)
|
return fmt.Errorf("could not read config '%s': %v", path, err)
|
||||||
}
|
}
|
||||||
c := Config{}
|
c := Config{}
|
||||||
cs.Config = &c
|
cs.Config = &c
|
||||||
|
|
||||||
err = yaml.Unmarshal(b, &c)
|
err = yaml.Unmarshal(b, &c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Could not parse YAML config '%s': %v", path, err)
|
return fmt.Errorf("could not parse YAML config '%s': %v", path, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// do migrations
|
// do migrations
|
||||||
|
@ -2,7 +2,7 @@ version: "3.9"
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
gropple:
|
gropple:
|
||||||
image: tardisx/gropple:latest
|
image: tardisx/gropple:v1.1.4
|
||||||
volumes:
|
volumes:
|
||||||
- /tmp/gropple-config-dir/:/config
|
- /tmp/gropple-config-dir/:/config
|
||||||
- /tmp/downloads/:/downloads/
|
- /tmp/downloads/:/downloads/
|
||||||
|
@ -277,7 +277,7 @@ func (dl *Download) Begin() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// only add the url if it's not empty or an example URL. This helps us with testing
|
// only add the url if it's not empty or an example URL. This helps us with testing
|
||||||
if !(dl.Url == "" || strings.Contains(dl.domain(), "example.org")) {
|
if dl.Url != "" && !strings.Contains(dl.domain(), "example.org") {
|
||||||
cmdSlice = append(cmdSlice, dl.Url)
|
cmdSlice = append(cmdSlice, dl.Url)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
6
go.mod
6
go.mod
@ -1,11 +1,13 @@
|
|||||||
module github.com/tardisx/gropple
|
module github.com/tardisx/gropple
|
||||||
|
|
||||||
go 1.22
|
go 1.23.0
|
||||||
|
|
||||||
|
toolchain go1.24.1
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/gorilla/mux v1.8.1
|
github.com/gorilla/mux v1.8.1
|
||||||
github.com/stretchr/testify v1.9.0
|
github.com/stretchr/testify v1.9.0
|
||||||
golang.org/x/mod v0.16.0
|
golang.org/x/mod v0.24.0
|
||||||
gopkg.in/yaml.v2 v2.4.0
|
gopkg.in/yaml.v2 v2.4.0
|
||||||
)
|
)
|
||||||
|
|
||||||
|
4
go.sum
4
go.sum
@ -6,8 +6,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
|
|||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||||
golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic=
|
golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU=
|
||||||
golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||||
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.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||||
|
11
main.go
11
main.go
@ -9,13 +9,18 @@ import (
|
|||||||
|
|
||||||
"github.com/tardisx/gropple/config"
|
"github.com/tardisx/gropple/config"
|
||||||
"github.com/tardisx/gropple/download"
|
"github.com/tardisx/gropple/download"
|
||||||
"github.com/tardisx/gropple/version"
|
v "github.com/tardisx/gropple/version"
|
||||||
"github.com/tardisx/gropple/web"
|
"github.com/tardisx/gropple/web"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
version = "dev"
|
||||||
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
versionInfo := &version.Manager{
|
versionInfo := &v.Manager{
|
||||||
VersionInfo: version.Info{CurrentVersion: "v1.1.3"},
|
// version from goreleaser has no leading 'v', even if the tag does
|
||||||
|
VersionInfo: v.Info{CurrentVersion: "v" + version},
|
||||||
}
|
}
|
||||||
log.Printf("Starting gropple %s - https://github.com/tardisx/gropple", versionInfo.GetInfo().CurrentVersion)
|
log.Printf("Starting gropple %s - https://github.com/tardisx/gropple", versionInfo.GetInfo().CurrentVersion)
|
||||||
|
|
||||||
|
@ -416,7 +416,7 @@ func fetchHandler(cs *config.ConfigService, vm *version.Manager, dm *download.Ma
|
|||||||
|
|
||||||
if !present {
|
if !present {
|
||||||
w.WriteHeader(400)
|
w.WriteHeader(400)
|
||||||
fmt.Fprint(w, "No url supplied")
|
_, _ = fmt.Fprint(w, "No url supplied")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -447,7 +447,8 @@ func bulkHandler(cs *config.ConfigService, vm *version.Manager, dm *download.Man
|
|||||||
log.Printf("bulkHandler")
|
log.Printf("bulkHandler")
|
||||||
|
|
||||||
method := r.Method
|
method := r.Method
|
||||||
if method == "GET" {
|
switch method {
|
||||||
|
case "GET":
|
||||||
|
|
||||||
t, err := template.ParseFS(webFS, "data/templates/layout.tmpl", "data/templates/menu.tmpl", "data/templates/bulk.tmpl")
|
t, err := template.ParseFS(webFS, "data/templates/layout.tmpl", "data/templates/menu.tmpl", "data/templates/bulk.tmpl")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -467,8 +468,7 @@ func bulkHandler(cs *config.ConfigService, vm *version.Manager, dm *download.Man
|
|||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
|
case "POST":
|
||||||
} else if method == "POST" {
|
|
||||||
type reqBulkType struct {
|
type reqBulkType struct {
|
||||||
URLs string `json:"urls"`
|
URLs string `json:"urls"`
|
||||||
ProfileChosen string `json:"profile"`
|
ProfileChosen string `json:"profile"`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user