Yay we have persistent storage hax

Signed-off-by: Kris Nóva <kris@nivenly.com>
main
Kris Nóva 2021-02-03 19:19:19 -08:00
parent 1f68fd3f4d
commit ba8188c7b9
70 changed files with 284 additions and 9 deletions

View File

@ -32,13 +32,25 @@ func NewScriptFromPath(path string) (*Script, error) {
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.
func NewScriptFromString(str string) *Script {
script := &Script{}
// "\\\n"
// ""
//str = strings.Replace(str, "\\\n", "", -1)
removeRuleF := func(str string, rs []string) string {
for _, r := range rs {
str = strings.Replace(str, r, "", -1)
}
return str
}
str = strings.Replace(str, "\\\n", "", -1)
str = removeRuleF(str, []string{IgnoreSpacesBash, IgnoreTabs})
spl := strings.Split(str, "\n")
//logger.Info("Script lines: %d", len(spl))
for _, line := range spl {
@ -53,14 +65,13 @@ func (s *Script) Interpret() error {
//logger.Info("Running script...")
for i, cmdStr := range s.commands {
// Exec will hang for output
// Ignore newlines
// Ignore comments starting with #
// Ignore comments starting with //
if cmdStr == "\n" || cmdStr == "" || strings.HasPrefix(cmdStr, "#") || strings.HasPrefix(cmdStr, "//") {
continue
}
//logger.Info("Executing: [%s]", cmdStr)
logger.Info("Executing: [%s]", cmdStr)
result, err := Exec(cmdStr)
if err != nil {
return fmt.Errorf("error executing running command [%s] on line [%d]\n%v\n", cmdStr, i+1, err)

View File

@ -12,7 +12,14 @@ echo "Creating [SampleApp]"
# TODO Nova
# 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 --name photoprism -p 8080:2342 -e PHOTOPRISM_UPLOAD_NSFW="true" -e PHOTOPRISM_ADMIN_PASSWORD="missy" -v photoprism:/photoprism photoprism/photoprism:latest
z
docker run -d \
--name photoprism \
-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

View File

Before

Width:  |  Height:  |  Size: 592 KiB

After

Width:  |  Height:  |  Size: 592 KiB

View File

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 114 KiB

View File

Before

Width:  |  Height:  |  Size: 380 KiB

After

Width:  |  Height:  |  Size: 380 KiB

View File

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 380 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
}]

View File

@ -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
}]

View File

@ -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
}]

View File

@ -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
}]

View File

@ -0,0 +1,7 @@
{
"e33287a631810f290267be9f8c3940b401bea9f58ffc2b22": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613013394435050492
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 867 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 559 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

View File

@ -0,0 +1,6 @@
Key: 11cddc94aa7b4bd8e0a0fb9cd9b26f73682dc182
Secret: b0f3077d6d0a96e1a9b5f46d6cd9677d
Session: 9be9016f1444e71f653924d94413eee404f913dbdb925fad0d28fd5b40bda689b63bed4005ba1c9cb8ba5f297861690960d6481c831e4ef32c91906aefd7500bb5e3561d480d22fa83278d64ae7503580898cd
Status: unregistered
Version: 210121-07e559df-Linux-x86_64
Serial: zqnzidyoy2xby5bs

View File

@ -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

Binary file not shown.

View File

@ -0,0 +1 @@
zqnzidyoy2xby5bs

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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