Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@

A script to search in HMAP (http://hmap.fr/) set of music scores. Basically, a PHP script to search in a CSV.

## Document access token

Tokens are used to regulate access to scores. Nobody can access to scores without it, and it has an expiration date.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Tokens are used to regulate access to scores. Nobody can access to scores without it, and it has an expiration date.
Tokens are used to regulate access to scores. Nobody can access scores without one, and they have an expiration date.


If the used link to the scores is used for malicious purpose, it can be quickly deactivated to stop access from the leaked link. Then a new one can be created to provide a new access to target users.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If the used link to the scores is used for malicious purpose, it can be quickly deactivated to stop access from the leaked link. Then a new one can be created to provide a new access to target users.
If the used link to the scores is used for malicious purpose, it can be quickly deactivated to stop access from the leaked link, by simply removing the token. Then, a new one can be created to provide a new access to target users.


To create a new token, create a file in repository `private/tokens/` in the format `YYYYMMDD-KEY.txt`, by replacing `YYYYMMDD` by a given date (in format year-month-day) which is the limit of activation of the token (passed this date, the token is disabled) and `KEY` by any alphanumeric string of characters (preferably randomly generated).
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To create a new token, create a file in repository `private/tokens/` in the format `YYYYMMDD-KEY.txt`, by replacing `YYYYMMDD` by a given date (in format year-month-day) which is the limit of activation of the token (passed this date, the token is disabled) and `KEY` by any alphanumeric string of characters (preferably randomly generated).
To create a new token, create a file in repository `private/tokens/` in the format `YYYYMMDD-KEY.txt`, by replacing `YYYYMMDD` by a given date (in format year-month-day) which is the date after which the token is disabled, and `KEY` by any alphanumeric string of characters. `KEY` *must be* randomly generated, because anyone that knows can access all scores. All this process can be handled by `/admin/token.php`. This script *MUST* be protected from public access.

The content of this file is ignored.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The content of this file is ignored.
The content of token files is ignored.


To access to the website with the token, the URL shall be: *www.mywebsite.com/?token=KEY* with *KEY* the actual `KEY` used at the end of the created file name.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To access to the website with the token, the URL shall be: *www.mywebsite.com/?token=KEY* with *KEY* the actual `KEY` used at the end of the created file name.
To access to the website with the token, the URL shall be: *www.example.com/?token=KEY* with *KEY* the actual `KEY` used at the end of the created file name.



## Document storage

Scores are stored in subdirectories of `private/docs`.

To add a new set of music scores here, create a new directory with the code of the score in csv (ex: "F058" for "1ere Symphonie en Ut Majeur" described in `Archives_HMAP_140126.csv`.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To add a new set of music scores here, create a new directory with the code of the score in csv (ex: "F058" for "1ere Symphonie en Ut Majeur" described in `Archives_HMAP_140126.csv`.
To add a new set of music scores here, create a new directory with the score reference in csv (ex: "F058" for "1ere Symphonie en Ut Majeur" described in `Archives_HMAP_140126.csv`.


Then in that directory, add all scores.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Then in that directory, add all scores.
Then in that directory (e.g. `private/docs/F058`), add all scores.


## Run in docker

This is for development purposes:
Expand Down