diff --git a/apis/api.go b/apis/api.go index d9cd712..96aa402 100644 --- a/apis/api.go +++ b/apis/api.go @@ -1,9 +1,9 @@ package apis import ( - "github.com/samuelncui/tapewriter/entity" - "github.com/samuelncui/tapewriter/executor" - "github.com/samuelncui/tapewriter/library" + "github.com/samuelncui/tapemanager/entity" + "github.com/samuelncui/tapemanager/executor" + "github.com/samuelncui/tapemanager/library" ) var ( diff --git a/apis/converts.go b/apis/converts.go index 1995646..ad68750 100644 --- a/apis/converts.go +++ b/apis/converts.go @@ -6,9 +6,9 @@ import ( "path/filepath" "time" - "github.com/samuelncui/tapewriter/entity" - "github.com/samuelncui/tapewriter/executor" - "github.com/samuelncui/tapewriter/library" + "github.com/samuelncui/tapemanager/entity" + "github.com/samuelncui/tapemanager/executor" + "github.com/samuelncui/tapemanager/library" ) func convertFiles(files ...*library.File) []*entity.File { diff --git a/apis/device_list.go b/apis/device_list.go index cf19092..cc51dda 100644 --- a/apis/device_list.go +++ b/apis/device_list.go @@ -3,7 +3,7 @@ package apis import ( "context" - "github.com/samuelncui/tapewriter/entity" + "github.com/samuelncui/tapemanager/entity" ) func (api *API) DeviceList(ctx context.Context, req *entity.DeviceListRequest) (*entity.DeviceListReply, error) { diff --git a/apis/file_delete.go b/apis/file_delete.go index 55bf931..5aa223e 100644 --- a/apis/file_delete.go +++ b/apis/file_delete.go @@ -4,7 +4,7 @@ import ( "context" mapset "github.com/deckarep/golang-set/v2" - "github.com/samuelncui/tapewriter/entity" + "github.com/samuelncui/tapemanager/entity" ) func (api *API) FileDelete(ctx context.Context, req *entity.FileDeleteRequest) (*entity.FileDeleteReply, error) { diff --git a/apis/file_edit.go b/apis/file_edit.go index a3aca07..abeffca 100644 --- a/apis/file_edit.go +++ b/apis/file_edit.go @@ -7,7 +7,7 @@ import ( "path" "strings" - "github.com/samuelncui/tapewriter/entity" + "github.com/samuelncui/tapemanager/entity" ) func (api *API) FileEdit(ctx context.Context, req *entity.FileEditRequest) (*entity.FileEditReply, error) { diff --git a/apis/file_get.go b/apis/file_get.go index e10b6e9..e97afee 100644 --- a/apis/file_get.go +++ b/apis/file_get.go @@ -4,8 +4,8 @@ import ( "context" "errors" - "github.com/samuelncui/tapewriter/entity" - "github.com/samuelncui/tapewriter/library" + "github.com/samuelncui/tapemanager/entity" + "github.com/samuelncui/tapemanager/library" ) func (api *API) FileGet(ctx context.Context, req *entity.FileGetRequest) (*entity.FileGetReply, error) { diff --git a/apis/file_list_parents.go b/apis/file_list_parents.go index 4de4aaf..4a95c92 100644 --- a/apis/file_list_parents.go +++ b/apis/file_list_parents.go @@ -3,7 +3,7 @@ package apis import ( "context" - "github.com/samuelncui/tapewriter/entity" + "github.com/samuelncui/tapemanager/entity" ) func (api *API) FileListParents(ctx context.Context, req *entity.FileListParentsRequest) (*entity.FileListParentsReply, error) { diff --git a/apis/file_mkdir.go b/apis/file_mkdir.go index a6393d5..a711c23 100644 --- a/apis/file_mkdir.go +++ b/apis/file_mkdir.go @@ -5,7 +5,7 @@ import ( "fmt" "io/fs" - "github.com/samuelncui/tapewriter/entity" + "github.com/samuelncui/tapemanager/entity" ) func (api *API) FileMkdir(ctx context.Context, req *entity.FileMkdirRequest) (*entity.FileMkdirReply, error) { diff --git a/apis/job_create.go b/apis/job_create.go index 717ed4d..08b1d17 100644 --- a/apis/job_create.go +++ b/apis/job_create.go @@ -3,8 +3,8 @@ package apis import ( "context" - "github.com/samuelncui/tapewriter/entity" - "github.com/samuelncui/tapewriter/executor" + "github.com/samuelncui/tapemanager/entity" + "github.com/samuelncui/tapemanager/executor" ) func (api *API) JobCreate(ctx context.Context, req *entity.JobCreateRequest) (*entity.JobCreateReply, error) { diff --git a/apis/job_delete.go b/apis/job_delete.go index 4026c71..86bd5c0 100644 --- a/apis/job_delete.go +++ b/apis/job_delete.go @@ -3,7 +3,7 @@ package apis import ( "context" - "github.com/samuelncui/tapewriter/entity" + "github.com/samuelncui/tapemanager/entity" ) func (api *API) JobDelete(ctx context.Context, req *entity.JobDeleteRequest) (*entity.JobDeleteReply, error) { diff --git a/apis/job_display.go b/apis/job_display.go index b9ea983..9ea79f9 100644 --- a/apis/job_display.go +++ b/apis/job_display.go @@ -3,7 +3,7 @@ package apis import ( "context" - "github.com/samuelncui/tapewriter/entity" + "github.com/samuelncui/tapemanager/entity" "github.com/sirupsen/logrus" ) diff --git a/apis/job_get_log.go b/apis/job_get_log.go index 599e72e..2b9425b 100644 --- a/apis/job_get_log.go +++ b/apis/job_get_log.go @@ -5,7 +5,7 @@ import ( "fmt" "io" - "github.com/samuelncui/tapewriter/entity" + "github.com/samuelncui/tapemanager/entity" ) func (api *API) JobGetLog(ctx context.Context, req *entity.JobGetLogRequest) (*entity.JobGetLogReply, error) { diff --git a/apis/job_list.go b/apis/job_list.go index 2bd9a29..2f4f942 100644 --- a/apis/job_list.go +++ b/apis/job_list.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/samuelncui/tapewriter/entity" + "github.com/samuelncui/tapemanager/entity" ) func (api *API) JobList(ctx context.Context, req *entity.JobListRequest) (*entity.JobListReply, error) { diff --git a/apis/job_next.go b/apis/job_next.go index 8a033f9..f995477 100644 --- a/apis/job_next.go +++ b/apis/job_next.go @@ -3,7 +3,7 @@ package apis import ( "context" - "github.com/samuelncui/tapewriter/entity" + "github.com/samuelncui/tapemanager/entity" ) func (api *API) JobNext(ctx context.Context, req *entity.JobNextRequest) (*entity.JobNextReply, error) { diff --git a/apis/library_export.go b/apis/library_export.go index a5403de..b68d96a 100644 --- a/apis/library_export.go +++ b/apis/library_export.go @@ -3,7 +3,7 @@ package apis import ( "context" - "github.com/samuelncui/tapewriter/entity" + "github.com/samuelncui/tapemanager/entity" ) func (api *API) LibraryExport(ctx context.Context, req *entity.LibraryExportRequest) (*entity.LibraryExportReply, error) { diff --git a/apis/source_list.go b/apis/source_list.go index fa63060..9dec007 100644 --- a/apis/source_list.go +++ b/apis/source_list.go @@ -8,7 +8,7 @@ import ( "path" "strings" - "github.com/samuelncui/tapewriter/entity" + "github.com/samuelncui/tapemanager/entity" ) func (api *API) SourceList(ctx context.Context, req *entity.SourceListRequest) (*entity.SourceListReply, error) { diff --git a/apis/tape_delete.go b/apis/tape_delete.go index ecdad2a..f0d6051 100644 --- a/apis/tape_delete.go +++ b/apis/tape_delete.go @@ -3,7 +3,7 @@ package apis import ( "context" - "github.com/samuelncui/tapewriter/entity" + "github.com/samuelncui/tapemanager/entity" ) func (api *API) TapeDelete(ctx context.Context, req *entity.TapeDeleteRequest) (*entity.TapeDeleteReply, error) { diff --git a/apis/tape_list.go b/apis/tape_list.go index 80e5172..0860061 100644 --- a/apis/tape_list.go +++ b/apis/tape_list.go @@ -5,8 +5,8 @@ import ( "fmt" "github.com/samber/lo" - "github.com/samuelncui/tapewriter/entity" - "github.com/samuelncui/tapewriter/library" + "github.com/samuelncui/tapemanager/entity" + "github.com/samuelncui/tapemanager/library" ) func (api *API) TapeList(ctx context.Context, req *entity.TapeListRequest) (*entity.TapeListReply, error) { diff --git a/build.sh b/build.sh index 0584139..e9c50b7 100755 --- a/build.sh +++ b/build.sh @@ -1,9 +1,11 @@ #!/usr/bin/env bash -set -e; +set -ex; CURDIR=$(cd $(dirname $0); pwd); cd ${CURDIR}; +export TARGET_FILE="tapemanager-linux-amd64-${RELEASE_VERSION}.tar.gz" + rm -rf output; mkdir -p output; @@ -18,4 +20,4 @@ cp ./README.md ./output/ ./build_backend.sh ./build_frontend.sh -tar -czvf tapemanager-linux-amd64-${RELEASE_VERSION}.tar.gz ./output/* +tar -czvf "${TARGET_FILE}" -C ./output . diff --git a/cmd/tape-httpd/main.go b/cmd/tape-httpd/main.go index 9424e34..1bfcc0e 100644 --- a/cmd/tape-httpd/main.go +++ b/cmd/tape-httpd/main.go @@ -15,12 +15,12 @@ import ( "github.com/improbable-eng/grpc-web/go/grpcweb" rotatelogs "github.com/lestrrat-go/file-rotatelogs" "github.com/rifflock/lfshook" - "github.com/samuelncui/tapewriter/apis" - "github.com/samuelncui/tapewriter/entity" - "github.com/samuelncui/tapewriter/executor" - "github.com/samuelncui/tapewriter/library" - "github.com/samuelncui/tapewriter/resource" - "github.com/samuelncui/tapewriter/tools" + "github.com/samuelncui/tapemanager/apis" + "github.com/samuelncui/tapemanager/entity" + "github.com/samuelncui/tapemanager/executor" + "github.com/samuelncui/tapemanager/library" + "github.com/samuelncui/tapemanager/resource" + "github.com/samuelncui/tapemanager/tools" "github.com/sirupsen/logrus" "google.golang.org/grpc" "google.golang.org/grpc/codes" diff --git a/cmd/tape-httpd/tape-writer.service b/cmd/tape-httpd/tape-writer.service index a86af34..be6210d 100644 --- a/cmd/tape-httpd/tape-writer.service +++ b/cmd/tape-httpd/tape-writer.service @@ -1,13 +1,13 @@ [Unit] Description=Tape Writer Service -Documentation=https://github.com/samuelncui/tapewriter/ +Documentation=https://github.com/samuelncui/tapemanager/ After=network.target [Service] User=root Type=simple -WorkingDirectory=/opt/tapewriter -ExecStart=/opt/tapewriter/httpd +WorkingDirectory=/opt/tapemanager +ExecStart=/opt/tapemanager/httpd Restart=always RestartSec=15 StartLimitInterval=0 diff --git a/entity/copy_status.proto b/entity/copy_status.proto index f572bfe..d74cef8 100644 --- a/entity/copy_status.proto +++ b/entity/copy_status.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package copy_status; -option go_package = "github.com/samuelncui/tapewriter/entity"; +option go_package = "github.com/samuelncui/tapemanager/entity"; enum CopyStatus { DRAFT = 0; diff --git a/entity/file.proto b/entity/file.proto index ff38b43..191d9b4 100644 --- a/entity/file.proto +++ b/entity/file.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package file; -option go_package = "github.com/samuelncui/tapewriter/entity"; +option go_package = "github.com/samuelncui/tapemanager/entity"; message File { int64 id = 1; diff --git a/entity/job.proto b/entity/job.proto index 254aebc..aa04d05 100644 --- a/entity/job.proto +++ b/entity/job.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package job; -option go_package = "github.com/samuelncui/tapewriter/entity"; +option go_package = "github.com/samuelncui/tapemanager/entity"; import "job_archive.proto"; import "job_restore.proto"; diff --git a/entity/job_archive.proto b/entity/job_archive.proto index f1fc4f0..59dba16 100644 --- a/entity/job_archive.proto +++ b/entity/job_archive.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package job_archive; -option go_package = "github.com/samuelncui/tapewriter/entity"; +option go_package = "github.com/samuelncui/tapemanager/entity"; import "source.proto"; diff --git a/entity/job_restore.proto b/entity/job_restore.proto index 8e72b21..cfe0cd2 100644 --- a/entity/job_restore.proto +++ b/entity/job_restore.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package job_restore; -option go_package = "github.com/samuelncui/tapewriter/entity"; +option go_package = "github.com/samuelncui/tapemanager/entity"; import "copy_status.proto"; diff --git a/entity/library_entity_type.proto b/entity/library_entity_type.proto index 3904670..cd519d7 100644 --- a/entity/library_entity_type.proto +++ b/entity/library_entity_type.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package library_entity_type; -option go_package = "github.com/samuelncui/tapewriter/entity"; +option go_package = "github.com/samuelncui/tapemanager/entity"; enum LibraryEntityType { NONE = 0; diff --git a/entity/position.proto b/entity/position.proto index 528e0cb..470fa9f 100644 --- a/entity/position.proto +++ b/entity/position.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package position; -option go_package = "github.com/samuelncui/tapewriter/entity"; +option go_package = "github.com/samuelncui/tapemanager/entity"; message Position { int64 id = 1; diff --git a/entity/service.proto b/entity/service.proto index b085c13..11d7138 100644 --- a/entity/service.proto +++ b/entity/service.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package service; -option go_package = "github.com/samuelncui/tapewriter/entity"; +option go_package = "github.com/samuelncui/tapemanager/entity"; import "job.proto"; import "file.proto"; diff --git a/entity/source.proto b/entity/source.proto index a312a30..56a3c53 100644 --- a/entity/source.proto +++ b/entity/source.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package source; -option go_package = "github.com/samuelncui/tapewriter/entity"; +option go_package = "github.com/samuelncui/tapemanager/entity"; import "copy_status.proto"; diff --git a/entity/tape.proto b/entity/tape.proto index 8523dab..00790bd 100644 --- a/entity/tape.proto +++ b/entity/tape.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package tape; -option go_package = "github.com/samuelncui/tapewriter/entity"; +option go_package = "github.com/samuelncui/tapemanager/entity"; message Tape { int64 id = 1; diff --git a/executor/executor.go b/executor/executor.go index 2edd72d..8182831 100644 --- a/executor/executor.go +++ b/executor/executor.go @@ -7,8 +7,8 @@ import ( "sync" mapset "github.com/deckarep/golang-set/v2" - "github.com/samuelncui/tapewriter/entity" - "github.com/samuelncui/tapewriter/library" + "github.com/samuelncui/tapemanager/entity" + "github.com/samuelncui/tapemanager/library" "gorm.io/gorm" ) diff --git a/executor/job.go b/executor/job.go index b8d33fb..2c9c9c9 100644 --- a/executor/job.go +++ b/executor/job.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/samuelncui/tapewriter/entity" + "github.com/samuelncui/tapemanager/entity" "gorm.io/gorm" ) diff --git a/executor/job_archive_display.go b/executor/job_archive_display.go index 966109a..71ade86 100644 --- a/executor/job_archive_display.go +++ b/executor/job_archive_display.go @@ -4,7 +4,7 @@ import ( "context" "sync/atomic" - "github.com/samuelncui/tapewriter/entity" + "github.com/samuelncui/tapemanager/entity" ) func (e *Executor) getArchiveDisplay(ctx context.Context, job *Job) (*entity.JobArchiveDisplay, error) { diff --git a/executor/job_archive_exe.go b/executor/job_archive_exe.go index 1cd2c3f..a801511 100644 --- a/executor/job_archive_exe.go +++ b/executor/job_archive_exe.go @@ -16,9 +16,9 @@ import ( mapset "github.com/deckarep/golang-set/v2" "github.com/samber/lo" "github.com/samuelncui/acp" - "github.com/samuelncui/tapewriter/entity" - "github.com/samuelncui/tapewriter/library" - "github.com/samuelncui/tapewriter/tools" + "github.com/samuelncui/tapemanager/entity" + "github.com/samuelncui/tapemanager/library" + "github.com/samuelncui/tapemanager/tools" "github.com/sirupsen/logrus" ) diff --git a/executor/job_archive_param.go b/executor/job_archive_param.go index 94e6a31..67c01e2 100644 --- a/executor/job_archive_param.go +++ b/executor/job_archive_param.go @@ -9,7 +9,7 @@ import ( "strings" "github.com/samuelncui/acp" - "github.com/samuelncui/tapewriter/entity" + "github.com/samuelncui/tapemanager/entity" ) func (e *Executor) createArchive(ctx context.Context, job *Job, param *entity.JobArchiveParam) error { diff --git a/executor/job_archive_start.go b/executor/job_archive_start.go index 083e7b5..11b6764 100644 --- a/executor/job_archive_start.go +++ b/executor/job_archive_start.go @@ -3,7 +3,7 @@ package executor import ( "context" - "github.com/samuelncui/tapewriter/entity" + "github.com/samuelncui/tapemanager/entity" ) func (e *Executor) startArchive(ctx context.Context, job *Job) error { diff --git a/executor/job_restore.go b/executor/job_restore.go index 72d9785..e86a00b 100644 --- a/executor/job_restore.go +++ b/executor/job_restore.go @@ -7,7 +7,7 @@ import ( "os/exec" "time" - "github.com/samuelncui/tapewriter/library" + "github.com/samuelncui/tapemanager/library" "github.com/sirupsen/logrus" ) diff --git a/executor/job_restore_display.go b/executor/job_restore_display.go index 87b31b1..d1a3ef7 100644 --- a/executor/job_restore_display.go +++ b/executor/job_restore_display.go @@ -4,7 +4,7 @@ import ( "context" "sync/atomic" - "github.com/samuelncui/tapewriter/entity" + "github.com/samuelncui/tapemanager/entity" ) func (e *Executor) getRestoreDisplay(ctx context.Context, job *Job) (*entity.JobRestoreDisplay, error) { diff --git a/executor/job_restore_exe.go b/executor/job_restore_exe.go index 0a0bc45..44c919c 100644 --- a/executor/job_restore_exe.go +++ b/executor/job_restore_exe.go @@ -18,8 +18,8 @@ import ( jsoniter "github.com/json-iterator/go" "github.com/samber/lo" "github.com/samuelncui/acp" - "github.com/samuelncui/tapewriter/entity" - "github.com/samuelncui/tapewriter/tools" + "github.com/samuelncui/tapemanager/entity" + "github.com/samuelncui/tapemanager/tools" "github.com/sirupsen/logrus" ) diff --git a/executor/job_restore_param.go b/executor/job_restore_param.go index fcb278a..7dfd0c9 100644 --- a/executor/job_restore_param.go +++ b/executor/job_restore_param.go @@ -9,9 +9,9 @@ import ( mapset "github.com/deckarep/golang-set/v2" "github.com/samber/lo" - "github.com/samuelncui/tapewriter/entity" - "github.com/samuelncui/tapewriter/library" - "github.com/samuelncui/tapewriter/tools" + "github.com/samuelncui/tapemanager/entity" + "github.com/samuelncui/tapemanager/library" + "github.com/samuelncui/tapemanager/tools" "github.com/sirupsen/logrus" ) diff --git a/executor/job_restore_start.go b/executor/job_restore_start.go index 42084b1..65e196a 100644 --- a/executor/job_restore_start.go +++ b/executor/job_restore_start.go @@ -3,7 +3,7 @@ package executor import ( "context" - "github.com/samuelncui/tapewriter/entity" + "github.com/samuelncui/tapemanager/entity" ) func (e *Executor) startRestore(ctx context.Context, job *Job) error { diff --git a/external/external.go b/external/external.go index e65e5ce..02fbeb4 100644 --- a/external/external.go +++ b/external/external.go @@ -1,6 +1,6 @@ package external -import "github.com/samuelncui/tapewriter/library" +import "github.com/samuelncui/tapemanager/library" type External struct { lib *library.Library diff --git a/external/from_json.go b/external/from_json.go index 3f10d2b..f3f118b 100644 --- a/external/from_json.go +++ b/external/from_json.go @@ -9,7 +9,7 @@ import ( "path" "github.com/samuelncui/acp" - "github.com/samuelncui/tapewriter/library" + "github.com/samuelncui/tapemanager/library" ) func (e *External) ImportACPReport(ctx context.Context, barname, name, encryption string, reader io.Reader) error { diff --git a/go.mod b/go.mod index 8ee38fa..1965d05 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/samuelncui/tapewriter +module github.com/samuelncui/tapemanager go 1.20 diff --git a/library/library.go b/library/library.go index 1b48477..5fb8e65 100644 --- a/library/library.go +++ b/library/library.go @@ -7,7 +7,7 @@ import ( "github.com/modern-go/reflect2" "github.com/samber/lo" - "github.com/samuelncui/tapewriter/entity" + "github.com/samuelncui/tapemanager/entity" "gorm.io/gorm" ) diff --git a/library/tape.go b/library/tape.go index a2e905a..8893b15 100644 --- a/library/tape.go +++ b/library/tape.go @@ -6,7 +6,7 @@ import ( "os" "time" - "github.com/samuelncui/tapewriter/entity" + "github.com/samuelncui/tapemanager/entity" ) var ( diff --git a/tapechanger/changer.go b/tapechanger/changer.go index 4451d3b..dc2b8f7 100644 --- a/tapechanger/changer.go +++ b/tapechanger/changer.go @@ -3,7 +3,7 @@ package tapechanger import ( "context" - "github.com/samuelncui/tapewriter/library" + "github.com/samuelncui/tapemanager/library" ) var (