Skip to content
This repository was archived by the owner on Mar 23, 2020. It is now read-only.

Commit b5ce433

Browse files
author
Zachary DuBois
committed
Merge branch 'dev'
2 parents 590c13f + 2378a3d commit b5ce433

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2351
-264
lines changed

CHANGELOG.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Change Log
22

3+
## v0.4
4+
5+
- Moves most tasks into functions.
6+
- Better output logging.
7+
- Adds different `runType`s.
8+
- Changes generation files names and extensions.
9+
- AWS process conflict now has a variable fail time and sends notifications via Pushover.
10+
- Adds workflows so you can create a custom setup easily.
11+
- Adds a separate place for temporary files.
12+
- Changes a lot of the configuration variables.
13+
- Adds automatic Elastic Transcoding of media files.
14+
- Waits for transcoding to fully finish.
15+
- Fixes and/or logic in the variable check.
16+
- Adds file type icons to the listing based on extention.
17+
- More sleek interface made with Bootstrap and Font Awesome.
18+
319
### v0.3.1
420

521
- Re-Licensed the code correctly this time. Now it is correctly under MIT.
@@ -40,4 +56,3 @@
4056
### v0.1
4157

4258
- Initial release.
43-

INSTALLATION.md

Lines changed: 59 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Installation
22

3-
*v0.3.1*
3+
*v0.4*
44

55
#### 1)
66

@@ -10,9 +10,18 @@ Install and completely configure the AWS CLI.
1010

1111
Documentation on configuring the AWS CLI can be found [here](http://aws.amazon.com/cli/).
1212

13+
If you need an example AWS config file, you can look in `examples/awsconfig`.
14+
1315
#### 2)
1416

15-
Download Night Uploader and make a place for all of the files in the `templates` directory. Take note of the location.
17+
Night Uploader needs four directories:
18+
19+
- An upload directory.
20+
- An dump directory.
21+
- A template directory.
22+
- And a temporary files directory.
23+
24+
Make these and take note of the locations.
1625

1726
#### 3)
1827

@@ -24,16 +33,22 @@ Set the file to permissions of `700`.
2433

2534
Open the `night-uploader` file and look at the variables block.
2635

27-
Set `location` to the directory where files will be put for pending upload.
36+
Set `loc` to the directory where files will be put for pending upload.
2837

2938
Set `s3bucket` to the name of the S3 bucket you would like Night Uploader to upload to.
3039

31-
Set `endLocation` to where the files are moved after the have been uploaded.
40+
Set `endLoc` to where the files are moved after the have been uploaded.
41+
42+
Set `templateLoc` to where the place where you put the template files that came in the `templates` directory of the download (You were told to take a note of it!). This directory must not be located in the `endLocation` or `location` directories and must be accessible to the script.
43+
44+
Set `temporaryDirLoc` to where you want Night Uploader to put temporary files it generates.
3245

33-
Set `templateLocation` to where the place where you put the template files that came in the `templates` directory of the download (You were told to take a note of it!). This directory must not be located in the `endLocation` or `location` directories and must be accessible to the script.
46+
Now, you need to upload everything in the `upload/` folder that comes with Night Uploader to your S3 bucket @ `s3://yourbucketname/assets/`. Otherwise, the Index page will not load the required CSS and JS to work.
3447

3548

36-
#### 6) [Optional]
49+
#### 7) [Optional]
50+
51+
##### Pushover
3752

3853
Setup [Pushover](https://pushover.net) support for sending of notifications about uploads and statuses.
3954

@@ -47,27 +62,59 @@ Set `pushoverURL` to the URL you want Pushover to have a link for.
4762

4863
Set `pushoverURLTitle` for a title to the URL above.
4964

50-
#### 7) [Optional]
65+
##### Fail Time
66+
67+
Set `failTime` to how many seconds you want Night Uploader to wait for a running AWS process to complete.
68+
69+
##### Set File Types
5170

52-
Add a cronjob in your crontab to run the script one a day at 3am.
71+
Preset, there are regular expressions to match file extensions. These can be modified to whatever file types you want.
72+
73+
*Warning: Editing the audio and video types will mess with the `transcodeMedia` function. Make sure you know what AWS ETC supports when editing.*
74+
75+
- `formatVideo`
76+
- `formatAudio`
77+
- `formatCode`
78+
- `formatPDF`
79+
- `formatImage`
80+
- `formatArchive`
81+
82+
#### 8) Workflows
83+
84+
By default, when Night Uploader runs, it runs the workflow ID `1`. To make NightUploader run others, you can run Night Uploader by passing an argument for it (In this case, a workflow ID number). Since Night Uploader comes with two handy workflows, you can run `./nightuploader 1` (or `./nightuploader`) to run the first and `./nightuploader 2` to run the second. You can edit how the workflows run by editing the bottom of the Night Uploader script to your liking.
85+
86+
Currently, the following functions work:
87+
88+
- `makeNewFilesList`
89+
- `uploadFiles`
90+
- `cleanUp`
91+
- `moveFiles`
92+
- `transcodeMedia`
93+
- `makeIndex`
94+
95+
#### 9) CronJob
96+
97+
Add a cronjob in your crontab to run the script one a day at 3am. Make sure to include a workflow ID if you have a specific one you want it to run.
5398

5499
crontab -e
55100
0 3 * * * /path/to/night-updater
56101

57-
#### 8)
102+
#### 10)
58103

59104
Add a test file and let it run over night. Check in the morning to see if it's in S3 and the done folder.
60105

61106
# Customization
62107

63108
If you want to be able to use your own index theme or HTML, you can! Open up the template files and edit away! Just make sure not to change the file names. Below is how these files are loaded by the script.
64109

65-
head
110+
head.html
66111
[List Items]
67-
afterlist
112+
afterlist.html
68113
[Number of files]
69114
[Timestamp]
70115
[Project info]
71-
footer
116+
footer.html
72117

73118
Items in brackets `[]` are added by the script and items not in brackets are added directly from that named template file.
119+
120+
For an easy color or CSS/JS tweak, you can also edit the `assets/night/*` with whatever you want because it is already loaded on the page.

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Night Uploader
22

3-
*v0.3.1*
3+
*v0.4*
44

55
## Features
66

@@ -10,6 +10,7 @@
1010
- Creates an automatic index file that lists everything (minus folders) located in the root of your S3 bucket.
1111
- Index file is customizable to fit your needs.
1212
- Checks to see if there is already an instance of AWS running.
13+
- Automatic use of the ETC (Elastic Transcoder) to render your media into various formats (Follow the `INSTALLATION.md` for setting up the correct pipeline).
1314

1415
## Requirements
1516

@@ -23,3 +24,9 @@
2324
- Currently running this on my Raspberry Pi to upload files over night so I don't have slow internet during the day or need to leave my computer on over night.
2425
- I recommend this to be run by a cronjob once a day at 3am. Example in the `INSTALLATION.md`.
2526
- Recommended file permissions of `700` due to it containing API keys.
27+
28+
## Known Issues
29+
30+
- You currently need to only use filenames containing no special characters or spaces.
31+
- Filenames cannot contain a dot except for the extension.
32+
- Notify me of any others right away :)

TODO.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# TODO
2+

examples/awsconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[default]
2+
output = text
3+
aws_access_key_id = YOURKEYHERE
4+
aws_secret_access_key = YOURKEYHERE
5+
region = us-east-1
6+
[preview]
7+
cloudfront = true

0 commit comments

Comments
 (0)