diff --git a/LICENSE b/LICENSE index e69de29..f7be8ec 100644 --- a/LICENSE +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 [fullname] + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 3a28f0f..1944b8c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,79 @@ # Listy -A Go application that syncs your liked songs into a monthly playlist. +A web application that syncs your liked songs into a monthly playlist built with Go. + +## Features + +- Spotify OIDC for authentication +- Automatically create a monthly playlist following the naming scheme `YYYY MM` +- Sync songs from your liked playlist to the current monthly playlist +- Reuse playlists following the same naming scheme +- Run the sync script as a one-time command (`listy sync`) or on a time (`listy sync -r 5m`) + +## Deployment + +Listy can be run as a self-hosted application as a Docker container or with Go installed. + +### Create a Spotify application + +Head to the [Spotify API dashboard](https://developer.spotify.com/dashboard) and create your application. Call it "Listy" and take note of the generated client ID and secret. + +Add the following redirect URI to the application to enable OIDC auth: + +http(s)://listy.example.com/auth/oidc/spotify/callback + +### Listy configuration + +Listy can be configured with environment variables or a config file, placed at the location of the binary or in one of the supported locations found in [`main.go`](./main.go). + +The following configuration values are supported: + +```yml +spotify: + # Spotify OIDC client ID + clientId: + # Spotify OIDC client secret + clientSecret: +mongodb: + # MongoDB connection URI + uri: +server: + # session key used for cookie sessions, ideally a random string with at least 32 characters + sessionKey: + # server scheme, either http or https + scheme: + # server host, such as localhost:5001 or listy.example.com + host: +``` + +#### Support for environment variables + +Listy supports environment variables corresponding to the names in the `<>` in the example file above. + +### With Docker Compose + +Listy can be deployed with Docker compose, and simply requires a MongoDB instance and the configuration file to work. + +To deploy your Listy instance, copy the [`docker-compose.yml`](./docker-compose.yml) and optionally create a `.env` file for your sensitive values. The sample config is also provided at [`config.example.yml`](./config.example.yml). + +Finally, run the following in the folder where your `docker-compose.yml` and `config.yml` are: + +```sh +$ docker compose up -d +``` + +## License + +Listy is licensed under the [MIT license](./LICENSE). + +## Contributions + +Contributions are welcome, all code must simply pass CI. Contribution guidelines still WIP. + +## Roadmap + +Some more features are planned, including: + +- [ ] Optionally copying over songs from previous monthly lists +- [ ] Notifications +- [ ] Management UI diff --git a/config.example.yml b/config.example.yml index 680b2ea..3b401ee 100644 --- a/config.example.yml +++ b/config.example.yml @@ -1,8 +1,15 @@ spotify: + # Spotify OIDC client ID clientId: + # Spotify OIDC client secret clientSecret: +mongodb: + # MongoDB connection URI + uri: server: - sessionKey: - # set these values if server is accessed via a domain - # scheme: https - # host: listy.example.com + # session key used for cookie sessions, ideally a random string with at least 32 characters + sessionKey: + # server scheme, either http or https + scheme: + # server host, such as localhost:5001 or listy.example.com + host: