|
@ -32,13 +32,25 @@ func NewScriptFromPath(path string) (*Script, error) {
|
||||||
return NewScriptFromString(content), nil
|
return NewScriptFromString(content), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
// IgnoreSpacesBash is the amount of (spaces - 1) that we see in common \\n delimited commands
|
||||||
|
IgnoreSpacesBash string = " "
|
||||||
|
|
||||||
|
// IgnoreTabs is the tab character
|
||||||
|
IgnoreTabs string = "\t"
|
||||||
|
)
|
||||||
|
|
||||||
// NewScriptFromString is used to build an executable script from the content in string form.
|
// NewScriptFromString is used to build an executable script from the content in string form.
|
||||||
func NewScriptFromString(str string) *Script {
|
func NewScriptFromString(str string) *Script {
|
||||||
script := &Script{}
|
script := &Script{}
|
||||||
|
removeRuleF := func(str string, rs []string) string {
|
||||||
// "\\\n"
|
for _, r := range rs {
|
||||||
// ""
|
str = strings.Replace(str, r, "", -1)
|
||||||
//str = strings.Replace(str, "\\\n", "", -1)
|
}
|
||||||
|
return str
|
||||||
|
}
|
||||||
|
str = strings.Replace(str, "\\\n", "", -1)
|
||||||
|
str = removeRuleF(str, []string{IgnoreSpacesBash, IgnoreTabs})
|
||||||
spl := strings.Split(str, "\n")
|
spl := strings.Split(str, "\n")
|
||||||
//logger.Info("Script lines: %d", len(spl))
|
//logger.Info("Script lines: %d", len(spl))
|
||||||
for _, line := range spl {
|
for _, line := range spl {
|
||||||
|
@ -53,14 +65,13 @@ func (s *Script) Interpret() error {
|
||||||
//logger.Info("Running script...")
|
//logger.Info("Running script...")
|
||||||
for i, cmdStr := range s.commands {
|
for i, cmdStr := range s.commands {
|
||||||
// Exec will hang for output
|
// Exec will hang for output
|
||||||
|
|
||||||
// Ignore newlines
|
// Ignore newlines
|
||||||
// Ignore comments starting with #
|
// Ignore comments starting with #
|
||||||
// Ignore comments starting with //
|
// Ignore comments starting with //
|
||||||
if cmdStr == "\n" || cmdStr == "" || strings.HasPrefix(cmdStr, "#") || strings.HasPrefix(cmdStr, "//") {
|
if cmdStr == "\n" || cmdStr == "" || strings.HasPrefix(cmdStr, "#") || strings.HasPrefix(cmdStr, "//") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
//logger.Info("Executing: [%s]", cmdStr)
|
logger.Info("Executing: [%s]", cmdStr)
|
||||||
result, err := Exec(cmdStr)
|
result, err := Exec(cmdStr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error executing running command [%s] on line [%d]\n%v\n", cmdStr, i+1, err)
|
return fmt.Errorf("error executing running command [%s] on line [%d]\n%v\n", cmdStr, i+1, err)
|
||||||
|
|
|
@ -12,7 +12,14 @@ echo "Creating [SampleApp]"
|
||||||
|
|
||||||
# TODO Nova
|
# TODO Nova
|
||||||
# TODO Per edude03ontwitch we want to actually mount /photoprism/whatever
|
# TODO Per edude03ontwitch we want to actually mount /photoprism/whatever
|
||||||
# TODO Need to fix the `\\\n` string replace to respect a happy command here
|
docker run -d \
|
||||||
docker run -d --name photoprism -p 8080:2342 -e PHOTOPRISM_UPLOAD_NSFW="true" -e PHOTOPRISM_ADMIN_PASSWORD="missy" -v photoprism:/photoprism photoprism/photoprism:latest
|
--name photoprism \
|
||||||
z
|
-p 8080:2342 \
|
||||||
|
-e PHOTOPRISM_UPLOAD_NSFW="true" \
|
||||||
|
-e PHOTOPRISM_ADMIN_PASSWORD="missy" \
|
||||||
|
-v ${GOPATH}/src/github.com/kris-nova/client-go/sample-app/photoprism/import:/photoprism/import \
|
||||||
|
-v ${GOPATH}/src/github.com/kris-nova/client-go/sample-app/photoprism/originals:/photoprism/originals \
|
||||||
|
-v ${GOPATH}/src/github.com/kris-nova/client-go/sample-app/photoprism/storage:/photoprism/storage \
|
||||||
|
photoprism/photoprism:latest
|
||||||
|
|
||||||
|
|
||||||
|
|
Before Width: | Height: | Size: 592 KiB After Width: | Height: | Size: 592 KiB |
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 114 KiB |
Before Width: | Height: | Size: 380 KiB After Width: | Height: | Size: 380 KiB |
Before Width: | Height: | Size: 134 KiB After Width: | Height: | Size: 134 KiB |
After Width: | Height: | Size: 380 KiB |
After Width: | Height: | Size: 592 KiB |
After Width: | Height: | Size: 114 KiB |
After Width: | Height: | Size: 134 KiB |
|
@ -0,0 +1,17 @@
|
||||||
|
UID: aqnzih81icziiyae
|
||||||
|
Slug: february-2021
|
||||||
|
Type: album
|
||||||
|
Title: February 2021
|
||||||
|
Order: oldest
|
||||||
|
Country: zz
|
||||||
|
CreatedAt: 2021-02-04T03:17:32Z
|
||||||
|
UpdatedAt: 2021-02-04T03:17:32Z
|
||||||
|
Photos:
|
||||||
|
- UID: pqnzigq156lndozm
|
||||||
|
CreatedAt: 2021-02-04T03:17:40.83892969Z
|
||||||
|
- UID: pqnzigq1jb1bibrz
|
||||||
|
CreatedAt: 2021-02-04T03:17:40.846632301Z
|
||||||
|
- UID: pqnzigq351j2fqgn
|
||||||
|
CreatedAt: 2021-02-04T03:17:40.851856107Z
|
||||||
|
- UID: pqnzigq3sidxb0j0
|
||||||
|
CreatedAt: 2021-02-04T03:17:40.857083572Z
|
|
@ -0,0 +1,12 @@
|
||||||
|
UID: aqnzigj1x4er0ld0
|
||||||
|
Slug: 2021-02
|
||||||
|
Type: folder
|
||||||
|
Title: February 2021
|
||||||
|
Filter: path:2021/02 public:true
|
||||||
|
Order: added
|
||||||
|
Country: zz
|
||||||
|
Year: 2021
|
||||||
|
Month: 2
|
||||||
|
Day: 1
|
||||||
|
CreatedAt: 2021-02-04T03:17:07Z
|
||||||
|
UpdatedAt: 2021-02-04T03:17:07Z
|
|
@ -0,0 +1,11 @@
|
||||||
|
UID: aqnzigu3qbx4y34d
|
||||||
|
Slug: "2021"
|
||||||
|
Type: folder
|
||||||
|
Title: "2021"
|
||||||
|
Filter: path:2021 public:true
|
||||||
|
Order: added
|
||||||
|
Country: zz
|
||||||
|
Year: 2021
|
||||||
|
Month: 2
|
||||||
|
CreatedAt: 2021-02-04T03:17:19Z
|
||||||
|
UpdatedAt: 2021-02-04T03:17:19Z
|
|
@ -0,0 +1,28 @@
|
||||||
|
[{
|
||||||
|
"SourceFile": "/photoprism/import/upload/1612408626903/IMG_3044.jpg",
|
||||||
|
"ExifToolVersion": 11.88,
|
||||||
|
"FileName": "IMG_3044.jpg",
|
||||||
|
"Directory": "/photoprism/import/upload/1612408626903",
|
||||||
|
"FileSize": "114 kB",
|
||||||
|
"FileModifyDate": "2021:02:04 03:17:06+00:00",
|
||||||
|
"FileAccessDate": "2021:02:04 03:17:06+00:00",
|
||||||
|
"FileInodeChangeDate": "2021:02:04 03:17:06+00:00",
|
||||||
|
"FilePermissions": "rw-r--r--",
|
||||||
|
"FileType": "JPEG",
|
||||||
|
"FileTypeExtension": "jpg",
|
||||||
|
"MIMEType": "image/jpeg",
|
||||||
|
"JFIFVersion": 1.01,
|
||||||
|
"ResolutionUnit": "None",
|
||||||
|
"XResolution": 1,
|
||||||
|
"YResolution": 1,
|
||||||
|
"ExifByteOrder": "Little-endian (Intel, II)",
|
||||||
|
"Software": "Google",
|
||||||
|
"ImageWidth": 520,
|
||||||
|
"ImageHeight": 924,
|
||||||
|
"EncodingProcess": "Baseline DCT, Huffman coding",
|
||||||
|
"BitsPerSample": 8,
|
||||||
|
"ColorComponents": 3,
|
||||||
|
"YCbCrSubSampling": "YCbCr4:2:0 (2 2)",
|
||||||
|
"ImageSize": "520x924",
|
||||||
|
"Megapixels": 0.480
|
||||||
|
}]
|
|
@ -0,0 +1,26 @@
|
||||||
|
[{
|
||||||
|
"SourceFile": "/photoprism/import/upload/1612408626903/EpTcef3VoAEiaS4.jpeg",
|
||||||
|
"ExifToolVersion": 11.88,
|
||||||
|
"FileName": "EpTcef3VoAEiaS4.jpeg",
|
||||||
|
"Directory": "/photoprism/import/upload/1612408626903",
|
||||||
|
"FileSize": "592 kB",
|
||||||
|
"FileModifyDate": "2021:02:04 03:17:06+00:00",
|
||||||
|
"FileAccessDate": "2021:02:04 03:17:06+00:00",
|
||||||
|
"FileInodeChangeDate": "2021:02:04 03:17:06+00:00",
|
||||||
|
"FilePermissions": "rw-r--r--",
|
||||||
|
"FileType": "JPEG",
|
||||||
|
"FileTypeExtension": "jpg",
|
||||||
|
"MIMEType": "image/jpeg",
|
||||||
|
"JFIFVersion": 1.01,
|
||||||
|
"ResolutionUnit": "None",
|
||||||
|
"XResolution": 72,
|
||||||
|
"YResolution": 72,
|
||||||
|
"ImageWidth": 1536,
|
||||||
|
"ImageHeight": 2048,
|
||||||
|
"EncodingProcess": "Progressive DCT, Huffman coding",
|
||||||
|
"BitsPerSample": 8,
|
||||||
|
"ColorComponents": 3,
|
||||||
|
"YCbCrSubSampling": "YCbCr4:2:0 (2 2)",
|
||||||
|
"ImageSize": "1536x2048",
|
||||||
|
"Megapixels": 3.1
|
||||||
|
}]
|
|
@ -0,0 +1,26 @@
|
||||||
|
[{
|
||||||
|
"SourceFile": "/photoprism/import/upload/1612408626903/ElgexEiU8AA-pQO.jpeg",
|
||||||
|
"ExifToolVersion": 11.88,
|
||||||
|
"FileName": "ElgexEiU8AA-pQO.jpeg",
|
||||||
|
"Directory": "/photoprism/import/upload/1612408626903",
|
||||||
|
"FileSize": "380 kB",
|
||||||
|
"FileModifyDate": "2021:02:04 03:17:06+00:00",
|
||||||
|
"FileAccessDate": "2021:02:04 03:17:06+00:00",
|
||||||
|
"FileInodeChangeDate": "2021:02:04 03:17:06+00:00",
|
||||||
|
"FilePermissions": "rw-r--r--",
|
||||||
|
"FileType": "JPEG",
|
||||||
|
"FileTypeExtension": "jpg",
|
||||||
|
"MIMEType": "image/jpeg",
|
||||||
|
"JFIFVersion": 1.01,
|
||||||
|
"ResolutionUnit": "None",
|
||||||
|
"XResolution": 72,
|
||||||
|
"YResolution": 72,
|
||||||
|
"ImageWidth": 1152,
|
||||||
|
"ImageHeight": 2048,
|
||||||
|
"EncodingProcess": "Progressive DCT, Huffman coding",
|
||||||
|
"BitsPerSample": 8,
|
||||||
|
"ColorComponents": 3,
|
||||||
|
"YCbCrSubSampling": "YCbCr4:2:0 (2 2)",
|
||||||
|
"ImageSize": "1152x2048",
|
||||||
|
"Megapixels": 2.4
|
||||||
|
}]
|
|
@ -0,0 +1,30 @@
|
||||||
|
[{
|
||||||
|
"SourceFile": "/photoprism/import/upload/1612408626903/NVA05562.JPG",
|
||||||
|
"ExifToolVersion": 11.88,
|
||||||
|
"FileName": "NVA05562.JPG",
|
||||||
|
"Directory": "/photoprism/import/upload/1612408626903",
|
||||||
|
"FileSize": "134 kB",
|
||||||
|
"FileModifyDate": "2021:02:04 03:17:06+00:00",
|
||||||
|
"FileAccessDate": "2021:02:04 03:17:06+00:00",
|
||||||
|
"FileInodeChangeDate": "2021:02:04 03:17:06+00:00",
|
||||||
|
"FilePermissions": "rw-r--r--",
|
||||||
|
"FileType": "JPEG",
|
||||||
|
"FileTypeExtension": "jpg",
|
||||||
|
"MIMEType": "image/jpeg",
|
||||||
|
"JFIFVersion": 1.01,
|
||||||
|
"ResolutionUnit": "None",
|
||||||
|
"XResolution": 1,
|
||||||
|
"YResolution": 1,
|
||||||
|
"ExifByteOrder": "Little-endian (Intel, II)",
|
||||||
|
"Software": "Google",
|
||||||
|
"ExifVersion": "0220",
|
||||||
|
"UserComment": "",
|
||||||
|
"ImageWidth": 1664,
|
||||||
|
"ImageHeight": 936,
|
||||||
|
"EncodingProcess": "Baseline DCT, Huffman coding",
|
||||||
|
"BitsPerSample": 8,
|
||||||
|
"ColorComponents": 3,
|
||||||
|
"YCbCrSubSampling": "YCbCr4:2:0 (2 2)",
|
||||||
|
"ImageSize": "1664x936",
|
||||||
|
"Megapixels": 1.6
|
||||||
|
}]
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"e33287a631810f290267be9f8c3940b401bea9f58ffc2b22": {
|
||||||
|
"user": "uqnzie01i1nypnt9",
|
||||||
|
"tokens": null,
|
||||||
|
"expiration": 1613013394435050492
|
||||||
|
}
|
||||||
|
}
|
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 146 KiB |
After Width: | Height: | Size: 146 KiB |
After Width: | Height: | Size: 146 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 100 B |
After Width: | Height: | Size: 76 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 86 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 270 KiB |
After Width: | Height: | Size: 361 KiB |
After Width: | Height: | Size: 867 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 100 B |
After Width: | Height: | Size: 112 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 141 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 164 KiB |
After Width: | Height: | Size: 230 KiB |
After Width: | Height: | Size: 559 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 100 B |
After Width: | Height: | Size: 74 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 83 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 129 KiB |
After Width: | Height: | Size: 185 KiB |
After Width: | Height: | Size: 185 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 101 B |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 49 KiB |
|
@ -0,0 +1,6 @@
|
||||||
|
Key: 11cddc94aa7b4bd8e0a0fb9cd9b26f73682dc182
|
||||||
|
Secret: b0f3077d6d0a96e1a9b5f46d6cd9677d
|
||||||
|
Session: 9be9016f1444e71f653924d94413eee404f913dbdb925fad0d28fd5b40bda689b63bed4005ba1c9cb8ba5f297861690960d6481c831e4ef32c91906aefd7500bb5e3561d480d22fa83278d64ae7503580898cd
|
||||||
|
Status: unregistered
|
||||||
|
Version: 210121-07e559df-Linux-x86_64
|
||||||
|
Serial: zqnzidyoy2xby5bs
|
|
@ -0,0 +1,45 @@
|
||||||
|
UI:
|
||||||
|
Scrollbar: true
|
||||||
|
Zoom: false
|
||||||
|
Theme: default
|
||||||
|
Language: en
|
||||||
|
Templates:
|
||||||
|
Default: index.tmpl
|
||||||
|
Maps:
|
||||||
|
Animate: 0
|
||||||
|
Style: streets
|
||||||
|
Features:
|
||||||
|
Upload: true
|
||||||
|
Download: true
|
||||||
|
Private: true
|
||||||
|
Review: true
|
||||||
|
Files: true
|
||||||
|
Folders: true
|
||||||
|
Albums: true
|
||||||
|
Moments: true
|
||||||
|
Estimates: true
|
||||||
|
People: true
|
||||||
|
Labels: true
|
||||||
|
Places: true
|
||||||
|
Edit: true
|
||||||
|
Archive: true
|
||||||
|
Delete: false
|
||||||
|
Share: true
|
||||||
|
Library: true
|
||||||
|
Import: true
|
||||||
|
Logs: true
|
||||||
|
Import:
|
||||||
|
Path: /
|
||||||
|
Move: false
|
||||||
|
Index:
|
||||||
|
Path: /
|
||||||
|
Convert: true
|
||||||
|
Rescan: true
|
||||||
|
Stack:
|
||||||
|
UUID: true
|
||||||
|
Meta: true
|
||||||
|
Name: false
|
||||||
|
Share:
|
||||||
|
Title: ""
|
||||||
|
Download:
|
||||||
|
Name: file
|
|
@ -0,0 +1 @@
|
||||||
|
zqnzidyoy2xby5bs
|
|
@ -0,0 +1,12 @@
|
||||||
|
TakenAt: 2021-02-04T03:17:07Z
|
||||||
|
UID: pqnzigq3sidxb0j0
|
||||||
|
Type: image
|
||||||
|
Title: Eptcef Voaeias
|
||||||
|
OriginalName: EpTcef3VoAEiaS4
|
||||||
|
Year: -1
|
||||||
|
Month: -1
|
||||||
|
Day: -1
|
||||||
|
Details:
|
||||||
|
Keywords: black, cat, eptcef, voaeias
|
||||||
|
CreatedAt: 2021-02-04T03:17:14.849461459Z
|
||||||
|
UpdatedAt: 2021-02-04T03:17:19.316067097Z
|
|
@ -0,0 +1,12 @@
|
||||||
|
TakenAt: 2021-02-04T03:17:07Z
|
||||||
|
UID: pqnzigq351j2fqgn
|
||||||
|
Type: image
|
||||||
|
Title: Unknown
|
||||||
|
OriginalName: IMG_3044
|
||||||
|
Year: -1
|
||||||
|
Month: -1
|
||||||
|
Day: -1
|
||||||
|
Details:
|
||||||
|
Keywords: green
|
||||||
|
CreatedAt: 2021-02-04T03:17:14.613092062Z
|
||||||
|
UpdatedAt: 2021-02-04T03:17:19.229760864Z
|
|
@ -0,0 +1,12 @@
|
||||||
|
TakenAt: 2021-02-04T03:17:07Z
|
||||||
|
UID: pqnzigq156lndozm
|
||||||
|
Type: image
|
||||||
|
Title: Elgexeiu Aa Pqo
|
||||||
|
OriginalName: ElgexEiU8AA-pQO
|
||||||
|
Year: -1
|
||||||
|
Month: -1
|
||||||
|
Day: -1
|
||||||
|
Details:
|
||||||
|
Keywords: blue, elgexeiu, portrait
|
||||||
|
CreatedAt: 2021-02-04T03:17:14.668332772Z
|
||||||
|
UpdatedAt: 2021-02-04T03:17:19.250144986Z
|
|
@ -0,0 +1,12 @@
|
||||||
|
TakenAt: 2021-02-04T03:17:07Z
|
||||||
|
UID: pqnzigq1jb1bibrz
|
||||||
|
Type: image
|
||||||
|
Title: Seashore
|
||||||
|
OriginalName: NVA05562
|
||||||
|
Year: -1
|
||||||
|
Month: -1
|
||||||
|
Day: -1
|
||||||
|
Details:
|
||||||
|
Keywords: grey, seashore
|
||||||
|
CreatedAt: 2021-02-04T03:17:14.738798274Z
|
||||||
|
UpdatedAt: 2021-02-04T03:17:19.271986797Z
|