Skip to content

Commit 87bbb7b

Browse files
authored
2016 Show changes, prepping for metaproject (#45)
* Added name to authors (#4) * Name (#7) * Added Vlad to authors list (#10) * Overhaul of structure to use DAOs and database for backend storage (#11) * Initial database implementations (#12) * Updated README (#14) * Working code for 2016 show (#19) * Created initial 'it works' test * Restructured into separate tests. 'is-working' tests complete? * Restructured 'all working' test * Added more tests. Reorganized again * One more test * Added test for seq sec editor added on perm change. Implemented; passing * All tests implemented except working and 0 sections * All tests passing * Restructured so sequence not returned on resection * Converted main code to new permissions api * Tests using new api. Removed check for sequence section editor. Some tests failing * All tests passing * Removed editor from sequence_section type * Tests now want seq sec in range [0, numSections) * SeqSec now 0-indexed. Removed last traces of editor field * Updated README and fixed error in main * Added checks * Moving towards Fixtures instead of 2d blocks of sequence data * Restructured to use DAOs and database setup instead of storing in flat files * Added initial database backup * Postgres connection working in channel dao * Generalized common functionality * Updated names, public instead of private key, uid for list-permissions * Init project returns generated public key * Updated database definition * Looser Cargo package versions for upgrading/good documentation * Adding initial user mostly implemented. Util function to gen pub/priv keys * Store both pub/priv key. Trim before compare. Get uid from key started * Permission handling stuff. PermissionEnum is string now for simplicity * new-user fully implemented * A little cleanup of tests; moving towards using again * Removed unused imports. New return type for get-uid * PermissionEnum updated. Preliminary work on add_sequence done * new_sequence working? * get_sequence command added to main * new-layout function set up * Reading layout from file. Locations and rotations checked * Adding layout implemented. Transactions/removing not implemented * Layout as of 11/21/2016 added * Project in db behind DAO now as well. General cleanup * set-sequence-layout working * Existential dao functions * Channel data now in separate table * Moved db backups to separate folder * get-layout-id command added, not implemented * Finished implementing add-sequence * get-playlist-data implemented * new-vixen-sequence working. Nullable values changed to options. * Updated Cargo.toml * Added seqid to playlist output * Changed the format of playlist data * Added music file to playlist outputted data * Made functional again after rebase * Added sequence duration to Sequence object for accurate num_frames calc * Added internal channel to Channel type and layout reading * Patching stuff * Added current db backup with internal channel * Patching working now; hackish fix * Added patch file * Updated layout and patch * Working show backed up * Stopped copying music over * Using postgres FUNCTION for patching * Added DB with FUNCTION in last commit added * New patch * Added newer patches * main.rs alphabetized. Added get-project command * Cleaned up warnings * More verbose patching * Added SQL to reset database to clean state * Fixed error with reading file as string * WORKINGgit st! * Working show backup * Adding admin key for 1202 backup * Actual working show backup (whoops) * add-sequence turned into insert-sequence * Udated patch * Print statemets for verbosity * 12_03 patch * Different format for outputting playlist data * Removed public keys from repo * New sequences don't copy their music files to a Music/ directory * Version now 0.19.1 as per SemVer (#33) * Adding beginning of testing framework post-overhaul (#32) * Documentation (#28) * Removed rebase artifacts. Updated version in Cargo.lock (#34) * Permissions checks moved from the second-tier functions to main.rs (#35) * Permissions checks moved from the second-teir functions to main.rs * Fixes issues to moving permissions check * Updated version numbers for dependencies (removing wildcards) (#36)
1 parent 891147e commit 87bbb7b

Some content is hidden

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

83 files changed

+18283
-2690
lines changed

Cargo.lock

Lines changed: 225 additions & 132 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
[package]
22
name = "proton_cli"
3-
version = "0.1.0"
4-
authors = ["Ramith Jayatilleka <[email protected]>"]
3+
version = "0.20.1"
4+
authors = ["Ramith Jayatilleka <[email protected]>, Ryan Fredlund <[email protected]>, Kayla Engelstad <[email protected]> , Vlad Kuksenko <[email protected]>"]
55
description = "Command line utility for managing ProtonLights projects."
66
homepage = "https://github.com/ProtonLights/cli"
77
repository = "https://github.com/ProtonLights/cli"
88
readme = "README.md"
99
license = "MIT"
1010

1111
[dependencies]
12-
docopt = "0.6"
13-
openssl = "~0.7"
14-
sfml = "0.11.2"
15-
git2 = "0.4.2"
16-
rustc-serialize = "0.3.18"
17-
regex = "0.1.71"
12+
docopt = "^0.6"
13+
openssl = "~0.9"
14+
sfml = "~0.11"
15+
rustc-serialize = "^0.3"
16+
regex = "^0.2"
17+
postgres = {version="~0.14", features = ["with-rustc-serialize"]}
1818

1919
[dev-dependencies]
20-
tempdir = "0.3.4"
20+
tempdir = "^0.3"
2121

2222
[[bin]]
2323
name = "proton"
24+
path = "src/main.rs"

README.md

Lines changed: 56 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,67 @@ Command line interface to manipulate ProtonLights projects.
33

44
## Interface
55

6-
- `init <folder> <root-public-key>`: Init empty project
7-
- `new-user <admin-key> <name> <public-key>`: Add user from public key
8-
- `remove-user <admin-key> <name>`: Removes user from project
9-
- `new-sequence <admin-key> <name> <music-file>`: Init a sequence
10-
- `remove-sequence <admin-key> <name>`: Removes a sequence and deletes its files
11-
- `id-user <private-key>`: Identify user by ssh key (public key in repo)
12-
- `list-permissions <private-key>`: Get list of user's permissions
13-
- `set-permission <admin-key> (add | remove) <name> <permission> [<target>]`: Change user permissions
14-
- `resection-sequence [TODO]`: (Re-)Section a sequence
15-
- On init, section as section1.
16-
- Number each section, and don't delete.
17-
- Use patch to copy changes.
18-
- Use git --find-renames=100%?
6+
- `new-project <name> <layout-id>`
7+
- `new-user <admin-key> <name>`
8+
- `remove-user <admin-key> <uid>`
9+
- `new-sequence <admin-key> <name> <music-file> <seq-duration> <layout-id>`
10+
- `new-vixen-sequence <admin-key> <name> <music-file> <seq-duration> <frame-duration> <data-file> <- `layout-id>`
11+
- `add-sequence <admin-key> <proj-name> <seqid>`
12+
- `remove-sequence <admin-key> <proj-name> <seqid>`
13+
- `delete-sequence <admin-key> <seqid>`
14+
- `get-sequence <seqid>`
15+
- `get-playlist-data <proj-name>`
16+
- `set-sequence-layout <admin-key> <seqid> <layout-id>`
17+
- `new-layout <layout-file>`
18+
- `patch-layout <admin-key> <layout-id> <patch-file>`
19+
- `new-section <admin-key> <t_start> <t_end> <seqid> <fixid>..`
20+
- `get-user-id <public-key>`
21+
- `get-layout-id <proj-name>`
22+
- `list-permissions <uid>`
23+
- `set-permission <admin-key> (add | remove) <uid> Administrate`
24+
- `set-permission <admin-key> (add | remove) <uid> EditSequence <target-sequence>`
25+
- `set-permission <admin-key> (add | remove) <uid> EditSection <target-sequence> <target-section>`
26+
- `set-permission <admin-key> (add | remove) <name> EditSeqSec <target-section>`
27+
1928
Permissions include:
20-
- edit sequence
21-
- edit sequence section
2229
- project administration
23-
- edit show [TODO]
30+
- edit sequence [TODO]
31+
- edit sequence section [TODO]
2432

2533
## Native Dependencies
2634

2735
- cmake
2836
- libssl-dev
37+
- libsfml-dev
2938
- libcsfml-dev
30-
- libsfml-audio2.3v5
31-
- libcsfml-audio2.3
39+
- postgresql (version 9.5 works for sure)
40+
41+
## Setting up the database
42+
43+
Install postgresql
44+
`$ sudo apt install postgres`
45+
46+
Set password of postgres user (can be anything. You won't be able to see the password while you type it)
47+
`$ sudo passwd postgres`
48+
49+
Change to postgres user and start the server
50+
`$ su - postgres`
51+
`$ psql`
52+
53+
Set psql's postgres password (can/should be different than the other password)
54+
`# \password postgres`
55+
56+
Create proton user (password used by cli, so keep the same)
57+
`# CREATE USER proton WITH PASSWORD '1234qwermnbv'`
58+
59+
Create database
60+
`# CREATE DATABASE proton_cli`
61+
62+
Quit psql
63+
`# \q`
64+
65+
Load in database structure
66+
`$ psql proton_cli < /path/to/proton-cli/db_backups/working_xx_p`
67+
68+
Done, so exit su
69+
`$ exit`

0 commit comments

Comments
 (0)