diff --git a/.travis.yml b/.travis.yml index a7702e0..3edb6e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,6 @@ go_import_path: github.com/mxpv/podsync go: - 1.8.3 install: - - cd $TRAVIS_BUILD_DIR/web - go get -u github.com/golang/dep/cmd/dep - dep ensure services: diff --git a/web/Dockerfile b/Dockerfile similarity index 63% rename from web/Dockerfile rename to Dockerfile index efb721e..45b263e 100644 --- a/web/Dockerfile +++ b/Dockerfile @@ -1,15 +1,15 @@ FROM golang:1.8 AS build -WORKDIR /go/src/github.com/mxpv/podsync/web +WORKDIR /go/src/github.com/mxpv/podsync COPY . . ENV GOOS=linux ENV GOARCH=amd64 ENV CGO_ENABLED=0 RUN go get -u github.com/golang/dep/cmd/dep RUN dep ensure -RUN go install -v . +RUN go install -v ./cmd/app FROM alpine RUN apk --update --no-cache add ca-certificates WORKDIR /app/ -COPY --from=build /go/bin/web . -ENTRYPOINT ["/app/web"] \ No newline at end of file +COPY --from=build /go/bin/app . +ENTRYPOINT ["/app/app"] \ No newline at end of file diff --git a/web/Gopkg.toml b/Gopkg.toml similarity index 100% rename from web/Gopkg.toml rename to Gopkg.toml diff --git a/web/www/css/site.css b/assets/css/site.css similarity index 100% rename from web/www/css/site.css rename to assets/css/site.css diff --git a/web/www/favicon.ico b/assets/favicon.ico similarity index 100% rename from web/www/favicon.ico rename to assets/favicon.ico diff --git a/web/www/img/become_patreon.png b/assets/img/become_patreon.png similarity index 100% rename from web/www/img/become_patreon.png rename to assets/img/become_patreon.png diff --git a/web/www/img/man.png b/assets/img/man.png similarity index 100% rename from web/www/img/man.png rename to assets/img/man.png diff --git a/web/www/img/mobile_bg.png b/assets/img/mobile_bg.png similarity index 100% rename from web/www/img/mobile_bg.png rename to assets/img/mobile_bg.png diff --git a/web/www/img/mobile_footer.png b/assets/img/mobile_footer.png similarity index 100% rename from web/www/img/mobile_footer.png rename to assets/img/mobile_footer.png diff --git a/web/www/img/og_image.png b/assets/img/og_image.png similarity index 100% rename from web/www/img/og_image.png rename to assets/img/og_image.png diff --git a/web/www/img/patreon_logo.png b/assets/img/patreon_logo.png similarity index 100% rename from web/www/img/patreon_logo.png rename to assets/img/patreon_logo.png diff --git a/web/www/img/pc_bg.png b/assets/img/pc_bg.png similarity index 100% rename from web/www/img/pc_bg.png rename to assets/img/pc_bg.png diff --git a/web/www/img/pc_footer.png b/assets/img/pc_footer.png similarity index 100% rename from web/www/img/pc_footer.png rename to assets/img/pc_footer.png diff --git a/web/www/js/site.js b/assets/js/site.js similarity index 100% rename from web/www/js/site.js rename to assets/js/site.js diff --git a/web/www/robots.txt b/assets/robots.txt similarity index 100% rename from web/www/robots.txt rename to assets/robots.txt diff --git a/backup.sh b/backup.sh deleted file mode 100755 index 3f044bd..0000000 --- a/backup.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -BACKUP_DIR=${1:-"$HOME/PodsyncBackups"} - -mkdir -p $BACKUP_DIR -docker-machine scp podsync:/data/redis/appendonly.aof $BACKUP_DIR/redis.$(date '+%Y_%m_%d__%H_%M_%S').aof \ No newline at end of file diff --git a/bower.json b/bower.json deleted file mode 100644 index 55b76ac..0000000 --- a/bower.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "Podsync", - "homepage": "Podsync.net", - "authors": [ - "Maksym Pavlenko " - ], - "description": "", - "main": "", - "moduleType": [], - "license": "MIT", - "private": true, - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ] -} diff --git a/web/main.go b/cmd/app/main.go similarity index 81% rename from web/main.go rename to cmd/app/main.go index 207b7bf..39b8630 100644 --- a/web/main.go +++ b/cmd/app/main.go @@ -9,13 +9,13 @@ import ( "os/signal" "syscall" - "github.com/mxpv/podsync/web/pkg/api" - "github.com/mxpv/podsync/web/pkg/builders" - "github.com/mxpv/podsync/web/pkg/config" - "github.com/mxpv/podsync/web/pkg/feeds" - "github.com/mxpv/podsync/web/pkg/id" - "github.com/mxpv/podsync/web/pkg/server" - "github.com/mxpv/podsync/web/pkg/storage" + "github.com/mxpv/podsync/pkg/api" + "github.com/mxpv/podsync/pkg/builders" + "github.com/mxpv/podsync/pkg/config" + "github.com/mxpv/podsync/pkg/feeds" + "github.com/mxpv/podsync/pkg/id" + "github.com/mxpv/podsync/pkg/server" + "github.com/mxpv/podsync/pkg/storage" ) func main() { diff --git a/nginx/Dockerfile b/cmd/nginx/Dockerfile similarity index 100% rename from nginx/Dockerfile rename to cmd/nginx/Dockerfile diff --git a/nginx/nginx.conf b/cmd/nginx/nginx.conf similarity index 100% rename from nginx/nginx.conf rename to cmd/nginx/nginx.conf diff --git a/ytdl/Dockerfile b/cmd/ytdl/Dockerfile similarity index 100% rename from ytdl/Dockerfile rename to cmd/ytdl/Dockerfile diff --git a/ytdl/requirements.txt b/cmd/ytdl/requirements.txt similarity index 100% rename from ytdl/requirements.txt rename to cmd/ytdl/requirements.txt diff --git a/ytdl/ytdl.py b/cmd/ytdl/ytdl.py similarity index 100% rename from ytdl/ytdl.py rename to cmd/ytdl/ytdl.py diff --git a/web/pkg/api/api.go b/pkg/api/api.go similarity index 100% rename from web/pkg/api/api.go rename to pkg/api/api.go diff --git a/web/pkg/builders/common.go b/pkg/builders/common.go similarity index 92% rename from web/pkg/builders/common.go rename to pkg/builders/common.go index db9fcb1..f818659 100644 --- a/web/pkg/builders/common.go +++ b/pkg/builders/common.go @@ -4,7 +4,7 @@ import ( "fmt" itunes "github.com/mxpv/podcast" - "github.com/mxpv/podsync/web/pkg/api" + "github.com/mxpv/podsync/pkg/api" ) const ( diff --git a/web/pkg/builders/vimeo.go b/pkg/builders/vimeo.go similarity index 99% rename from web/pkg/builders/vimeo.go rename to pkg/builders/vimeo.go index 1727fe4..d0e8cca 100644 --- a/web/pkg/builders/vimeo.go +++ b/pkg/builders/vimeo.go @@ -6,7 +6,7 @@ import ( "strconv" itunes "github.com/mxpv/podcast" - "github.com/mxpv/podsync/web/pkg/api" + "github.com/mxpv/podsync/pkg/api" "github.com/pkg/errors" "github.com/silentsokolov/go-vimeo" "golang.org/x/net/context" diff --git a/web/pkg/builders/vimeo_test.go b/pkg/builders/vimeo_test.go similarity index 98% rename from web/pkg/builders/vimeo_test.go rename to pkg/builders/vimeo_test.go index 3e50120..3a112f2 100644 --- a/web/pkg/builders/vimeo_test.go +++ b/pkg/builders/vimeo_test.go @@ -6,7 +6,7 @@ import ( "testing" itunes "github.com/mxpv/podcast" - "github.com/mxpv/podsync/web/pkg/api" + "github.com/mxpv/podsync/pkg/api" "github.com/stretchr/testify/require" ) diff --git a/web/pkg/builders/youtube.go b/pkg/builders/youtube.go similarity index 99% rename from web/pkg/builders/youtube.go rename to pkg/builders/youtube.go index 5f2e2a8..2c665cb 100644 --- a/web/pkg/builders/youtube.go +++ b/pkg/builders/youtube.go @@ -8,7 +8,7 @@ import ( "github.com/BrianHicks/finch/duration" itunes "github.com/mxpv/podcast" - "github.com/mxpv/podsync/web/pkg/api" + "github.com/mxpv/podsync/pkg/api" "github.com/pkg/errors" "google.golang.org/api/youtube/v3" ) diff --git a/web/pkg/builders/youtube_test.go b/pkg/builders/youtube_test.go similarity index 96% rename from web/pkg/builders/youtube_test.go rename to pkg/builders/youtube_test.go index 136dc1d..36fec74 100644 --- a/web/pkg/builders/youtube_test.go +++ b/pkg/builders/youtube_test.go @@ -4,7 +4,7 @@ import ( "os" "testing" - "github.com/mxpv/podsync/web/pkg/api" + "github.com/mxpv/podsync/pkg/api" "github.com/stretchr/testify/require" ) diff --git a/web/pkg/config/config.go b/pkg/config/config.go similarity index 100% rename from web/pkg/config/config.go rename to pkg/config/config.go diff --git a/web/pkg/config/config_test.go b/pkg/config/config_test.go similarity index 100% rename from web/pkg/config/config_test.go rename to pkg/config/config_test.go diff --git a/web/pkg/feeds/feeds.go b/pkg/feeds/feeds.go similarity index 98% rename from web/pkg/feeds/feeds.go rename to pkg/feeds/feeds.go index 24a0e5a..9188d7d 100644 --- a/web/pkg/feeds/feeds.go +++ b/pkg/feeds/feeds.go @@ -6,7 +6,7 @@ import ( "time" itunes "github.com/mxpv/podcast" - "github.com/mxpv/podsync/web/pkg/api" + "github.com/mxpv/podsync/pkg/api" "github.com/pkg/errors" ) diff --git a/web/pkg/feeds/feeds_test.go b/pkg/feeds/feeds_test.go similarity index 97% rename from web/pkg/feeds/feeds_test.go rename to pkg/feeds/feeds_test.go index 8ea73f5..addf52d 100644 --- a/web/pkg/feeds/feeds_test.go +++ b/pkg/feeds/feeds_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/mxpv/podsync/web/pkg/api" + "github.com/mxpv/podsync/pkg/api" "github.com/stretchr/testify/require" ) diff --git a/web/pkg/feeds/interfaces.go b/pkg/feeds/interfaces.go similarity index 89% rename from web/pkg/feeds/interfaces.go rename to pkg/feeds/interfaces.go index b2e3410..f85355e 100644 --- a/web/pkg/feeds/interfaces.go +++ b/pkg/feeds/interfaces.go @@ -2,7 +2,7 @@ package feeds import ( itunes "github.com/mxpv/podcast" - "github.com/mxpv/podsync/web/pkg/api" + "github.com/mxpv/podsync/pkg/api" ) type id interface { diff --git a/web/pkg/feeds/interfaces_mock_test.go b/pkg/feeds/interfaces_mock_test.go similarity index 98% rename from web/pkg/feeds/interfaces_mock_test.go rename to pkg/feeds/interfaces_mock_test.go index 4374c45..a76822c 100644 --- a/web/pkg/feeds/interfaces_mock_test.go +++ b/pkg/feeds/interfaces_mock_test.go @@ -6,7 +6,7 @@ package feeds import ( gomock "github.com/golang/mock/gomock" podcast "github.com/mxpv/podcast" - api "github.com/mxpv/podsync/web/pkg/api" + api "github.com/mxpv/podsync/pkg/api" reflect "reflect" ) diff --git a/web/pkg/feeds/url.go b/pkg/feeds/url.go similarity index 98% rename from web/pkg/feeds/url.go rename to pkg/feeds/url.go index a658d1f..81b0bd4 100644 --- a/web/pkg/feeds/url.go +++ b/pkg/feeds/url.go @@ -4,7 +4,7 @@ import ( "net/url" "strings" - "github.com/mxpv/podsync/web/pkg/api" + "github.com/mxpv/podsync/pkg/api" "github.com/pkg/errors" ) diff --git a/web/pkg/feeds/url_test.go b/pkg/feeds/url_test.go similarity index 98% rename from web/pkg/feeds/url_test.go rename to pkg/feeds/url_test.go index 10a2969..fb6fc6a 100644 --- a/web/pkg/feeds/url_test.go +++ b/pkg/feeds/url_test.go @@ -4,7 +4,7 @@ import ( "net/url" "testing" - "github.com/mxpv/podsync/web/pkg/api" + "github.com/mxpv/podsync/pkg/api" "github.com/stretchr/testify/require" ) diff --git a/web/pkg/id/hashids.go b/pkg/id/hashids.go similarity index 96% rename from web/pkg/id/hashids.go rename to pkg/id/hashids.go index 0df931c..16e6c86 100644 --- a/web/pkg/id/hashids.go +++ b/pkg/id/hashids.go @@ -3,7 +3,7 @@ package id import ( "hash/fnv" - "github.com/mxpv/podsync/web/pkg/api" + "github.com/mxpv/podsync/pkg/api" hd "github.com/speps/go-hashids" ) diff --git a/web/pkg/id/hashids_test.go b/pkg/id/hashids_test.go similarity index 94% rename from web/pkg/id/hashids_test.go rename to pkg/id/hashids_test.go index 9b04789..b702a92 100644 --- a/web/pkg/id/hashids_test.go +++ b/pkg/id/hashids_test.go @@ -3,7 +3,7 @@ package id import ( "testing" - "github.com/mxpv/podsync/web/pkg/api" + "github.com/mxpv/podsync/pkg/api" "github.com/stretchr/testify/require" ) diff --git a/web/pkg/server/server.go b/pkg/server/server.go similarity index 97% rename from web/pkg/server/server.go rename to pkg/server/server.go index b553f64..d1f7799 100644 --- a/web/pkg/server/server.go +++ b/pkg/server/server.go @@ -6,7 +6,7 @@ import ( "github.com/gin-gonic/gin" itunes "github.com/mxpv/podcast" - "github.com/mxpv/podsync/web/pkg/api" + "github.com/mxpv/podsync/pkg/api" "github.com/pkg/errors" ) diff --git a/web/pkg/server/server_mock_test.go b/pkg/server/server_mock_test.go similarity index 98% rename from web/pkg/server/server_mock_test.go rename to pkg/server/server_mock_test.go index 9524c26..c7644f3 100644 --- a/web/pkg/server/server_mock_test.go +++ b/pkg/server/server_mock_test.go @@ -7,7 +7,7 @@ import ( context "context" gomock "github.com/golang/mock/gomock" podcast "github.com/mxpv/podcast" - api "github.com/mxpv/podsync/web/pkg/api" + api "github.com/mxpv/podsync/pkg/api" reflect "reflect" ) diff --git a/web/pkg/server/server_test.go b/pkg/server/server_test.go similarity index 99% rename from web/pkg/server/server_test.go rename to pkg/server/server_test.go index cf013be..f8ea11f 100644 --- a/web/pkg/server/server_test.go +++ b/pkg/server/server_test.go @@ -11,7 +11,7 @@ import ( "github.com/golang/mock/gomock" itunes "github.com/mxpv/podcast" - "github.com/mxpv/podsync/web/pkg/api" + "github.com/mxpv/podsync/pkg/api" "github.com/stretchr/testify/require" ) diff --git a/web/pkg/storage/pg.go b/pkg/storage/pg.go similarity index 97% rename from web/pkg/storage/pg.go rename to pkg/storage/pg.go index d3ba1e7..a88cb6c 100644 --- a/web/pkg/storage/pg.go +++ b/pkg/storage/pg.go @@ -8,7 +8,7 @@ import ( "github.com/GoogleCloudPlatform/cloudsql-proxy/proxy/proxy" "github.com/go-pg/pg" - "github.com/mxpv/podsync/web/pkg/api" + "github.com/mxpv/podsync/pkg/api" "github.com/pkg/errors" ) diff --git a/web/pkg/storage/pg_sql.go b/pkg/storage/pg_sql.go similarity index 100% rename from web/pkg/storage/pg_sql.go rename to pkg/storage/pg_sql.go diff --git a/web/pkg/storage/pg_test.go b/pkg/storage/pg_test.go similarity index 98% rename from web/pkg/storage/pg_test.go rename to pkg/storage/pg_test.go index 2decf96..ce2629b 100644 --- a/web/pkg/storage/pg_test.go +++ b/pkg/storage/pg_test.go @@ -3,7 +3,7 @@ package storage import ( "testing" - "github.com/mxpv/podsync/web/pkg/api" + "github.com/mxpv/podsync/pkg/api" "github.com/stretchr/testify/require" ) diff --git a/web/pkg/storage/redis.go b/pkg/storage/redis.go similarity index 99% rename from web/pkg/storage/redis.go rename to pkg/storage/redis.go index 7c355a0..31e6294 100644 --- a/web/pkg/storage/redis.go +++ b/pkg/storage/redis.go @@ -8,7 +8,7 @@ import ( "time" "github.com/go-redis/redis" - "github.com/mxpv/podsync/web/pkg/api" + "github.com/mxpv/podsync/pkg/api" "github.com/pkg/errors" ) diff --git a/web/pkg/storage/redis_test.go b/pkg/storage/redis_test.go similarity index 97% rename from web/pkg/storage/redis_test.go rename to pkg/storage/redis_test.go index edb943e..579720b 100644 --- a/web/pkg/storage/redis_test.go +++ b/pkg/storage/redis_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/mxpv/podsync/web/pkg/api" + "github.com/mxpv/podsync/pkg/api" "github.com/stretchr/testify/require" )