enable basic authentication

pull/31/head
Akhil Gupta 4 years ago
parent 92358bd844
commit c67f3118fa

@ -1,3 +1,4 @@
CONFIG=. CONFIG=.
DATA=./assets DATA=./assets
CHECK_FREQUENCY = 10 CHECK_FREQUENCY = 10
PASSWORD=

@ -115,6 +115,7 @@ services:
container_name: podgrab container_name: podgrab
environment: environment:
- CHECK_FREQUENCY=240 - CHECK_FREQUENCY=240
# - PASSWORD=password ## Uncomment to enable basic authentication, username = podgrab
volumes: volumes:
- /path/to/config:/config - /path/to/config:/config
- /path/to/data:/assets - /path/to/data:/assets
@ -132,6 +133,7 @@ services:
| Name | Description | Default | | Name | Description | Default |
| --------------- | ----------------------------------------------------------------------- | ------- | | --------------- | ----------------------------------------------------------------------- | ------- |
| CHECK_FREQUENCY | How frequently to check for new episodes and missing files (in minutes) | 30 | | CHECK_FREQUENCY | How frequently to check for new episodes and missing files (in minutes) | 30 |
| PASSWORD | Set to some no empty value to enable Basic Authentication, username `podgrab`|(empty)|
<!-- LICENSE --> <!-- LICENSE -->
@ -141,11 +143,19 @@ Distributed under the MIT License. See `LICENSE` for more information.
## Roadmap ## Roadmap
Following are the things that I plan to complete in the near future. - [x] Basic Authentication
- [x] Append Date to filename
- [x] iTunes Search
- [x] Existing episodes detection (Will not redownload if files exist even with a fresh install)
- [x] Rudimentary downloading/downloaded indicator
- [x] Played/Unplayed Flag
- [x] OPML import
- [ ] OPML export
- [ ] Set ID3 tags if not set
- [ ] Filtering and Sorting options
- [ ] In built podcast player
- Some more code refactoring.
- API standardisation so that it can be used to build apps on top of it.
- Better search and discovery
<!-- CONTACT --> <!-- CONTACT -->

@ -94,32 +94,42 @@ func main() {
//r.LoadHTMLGlob("client/*") //r.LoadHTMLGlob("client/*")
r.SetHTMLTemplate(tmpl) r.SetHTMLTemplate(tmpl)
r.POST("/podcasts", controllers.AddPodcast) pass := os.Getenv("PASSWORD")
r.GET("/podcasts", controllers.GetAllPodcasts) var router *gin.RouterGroup
r.GET("/podcasts/:id", controllers.GetPodcastById) if pass != "" {
r.DELETE("/podcasts/:id", controllers.DeletePodcastById) router = r.Group("/", gin.BasicAuth(gin.Accounts{
r.GET("/podcasts/:id/items", controllers.GetPodcastItemsByPodcastId) "podgrab": pass,
r.GET("/podcasts/:id/download", controllers.DownloadAllEpisodesByPodcastId) }))
r.DELETE("/podcasts/:id/items", controllers.DeletePodcastEpisodesById) } else {
router = &r.RouterGroup
r.GET("/podcastitems", controllers.GetAllPodcastItems) }
r.GET("/podcastitems/:id", controllers.GetPodcastItemById)
r.GET("/podcastitems/:id/markUnplayed", controllers.MarkPodcastItemAsUnplayed) router.POST("/podcasts", controllers.AddPodcast)
r.GET("/podcastitems/:id/markPlayed", controllers.MarkPodcastItemAsPlayed) router.GET("/podcasts", controllers.GetAllPodcasts)
r.PATCH("/podcastitems/:id", controllers.PatchPodcastItemById) router.GET("/podcasts/:id", controllers.GetPodcastById)
r.GET("/podcastitems/:id/download", controllers.DownloadPodcastItem) router.DELETE("/podcasts/:id", controllers.DeletePodcastById)
r.GET("/podcastitems/:id/delete", controllers.DeletePodcastItem) router.GET("/podcasts/:id/items", controllers.GetPodcastItemsByPodcastId)
router.GET("/podcasts/:id/download", controllers.DownloadAllEpisodesByPodcastId)
r.GET("/add", controllers.AddPage) router.DELETE("/podcasts/:id/items", controllers.DeletePodcastEpisodesById)
r.GET("/search", controllers.Search)
r.GET("/", controllers.HomePage) router.GET("/podcastitems", controllers.GetAllPodcastItems)
r.GET("/podcasts/:id/view", controllers.PodcastPage) router.GET("/podcastitems/:id", controllers.GetPodcastItemById)
r.GET("/episodes", controllers.AllEpisodesPage) router.GET("/podcastitems/:id/markUnplayed", controllers.MarkPodcastItemAsUnplayed)
r.GET("/settings", controllers.SettingsPage) router.GET("/podcastitems/:id/markPlayed", controllers.MarkPodcastItemAsPlayed)
r.POST("/settings", controllers.UpdateSetting) router.PATCH("/podcastitems/:id", controllers.PatchPodcastItemById)
r.GET("/backups", controllers.BackupsPage) router.GET("/podcastitems/:id/download", controllers.DownloadPodcastItem)
r.POST("/opml", controllers.UploadOpml) router.GET("/podcastitems/:id/delete", controllers.DeletePodcastItem)
r.GET("/opml", controllers.GetOmpl)
router.GET("/add", controllers.AddPage)
router.GET("/search", controllers.Search)
router.GET("/", controllers.HomePage)
router.GET("/podcasts/:id/view", controllers.PodcastPage)
router.GET("/episodes", controllers.AllEpisodesPage)
router.GET("/settings", controllers.SettingsPage)
router.POST("/settings", controllers.UpdateSetting)
router.GET("/backups", controllers.BackupsPage)
router.POST("/opml", controllers.UploadOpml)
router.GET("/opml", controllers.GetOmpl)
go assetEnv() go assetEnv()
go intiCron() go intiCron()

Loading…
Cancel
Save