Skip to content

Commit

Permalink
Merge pull request #87 from SamTV12345/develop
Browse files Browse the repository at this point in the history
Added GPodder sync and authentication
  • Loading branch information
SamTV12345 authored Apr 29, 2023
2 parents dc0bcac + 28b3d05 commit 0e0104a
Show file tree
Hide file tree
Showing 44 changed files with 1,731 additions and 58 deletions.
23 changes: 23 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ edition = "2021"

[dependencies]
awc = {version="3.1.1", features = ["rustls"]}
rpassword = "7.2.0"
reqwest = {version="0.11.14", features = ["blocking", "json", "async-compression", "rustls"]}
actix = "0.13.0"
async-recursion = "1.0.2"
Expand All @@ -19,6 +20,7 @@ actix-files = "0.6.2"
actix-web = {version="4.3.0", features=["rustls"]}
jsonwebtoken = {version="8.2.0"}
log = "0.4.17"
futures-util = "0.3.28"
opml = "1.1.5"
rand = "0.8.5"
env_logger = "0.10.0"
Expand Down
14 changes: 7 additions & 7 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
the copyright owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
Other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
Expand All @@ -30,7 +30,7 @@
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
and conversions to Other media types.

"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
Expand All @@ -39,7 +39,7 @@

"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
editorial revisions, annotations, elaborations, or Other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
Expand Down Expand Up @@ -91,7 +91,7 @@
modifications, and in Source or Object form, provided that You
meet the following conditions:

(a) You must give any other recipients of the Work or
(a) You must give any Other recipients of the Work or
Derivative Works a copy of this License; and

(b) You must cause any modified files to carry prominent notices
Expand Down Expand Up @@ -159,16 +159,16 @@
RESULT of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
Other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
or Other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
of any Other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Podfetch is a self-hosted podcast manager.
It is a web app that lets you download podcasts and listen to them online.
It is written in Rust and uses React for the frontend.
It also contains a GPodder integration so you can continue using your current podcast app.

Every time a new commit is pushed to the main branch, a new docker image is built and pushed to docker hub. So it is best to use something like [watchtower](https://github.com/containrrr/watchtower) to automatically update the docker image.

Expand Down Expand Up @@ -65,6 +66,10 @@ Several Auth methods are described here: [AUTH.md](docs/AUTH.md)
Hosting options are described here: [HOSTING.md](docs/HOSTING.md)
# CLI usage
The cli usage is described here: [CLI.md](docs/CLI.md)
# Environment Variables
| Variable | Description | Default |
Expand Down Expand Up @@ -114,6 +119,17 @@ To configure it you need to create an account on that website. After creating an

After successful setup you should see on the settings page a green checkmark next to the Podindex config section.

# GPodder

Podfetch also supports the GPodder api. You can use your current GPodder account to login to Podfetch and continue using your current podcast app.
To do that just go to the settings page and enter your GPodder username and password.

To enable it you need to set the following environment variables:
| Variable | Description | Default |
|---------------------|---------------------------------------|---------|
| GPODDER_INTEGRATION_ENABLED | Activates the GPodder integration via your server url | false|


# Roadmap

- [x] Add podcasts via Itunes api
Expand Down
23 changes: 23 additions & 0 deletions docs/CLI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# CLI usage

The CLI can be used to update, remove, list registered users in PodFetch. You can get help anytime by typing --help/help

# Usage

# Get general help

```bash
podfetch --help
```

# Get help for a specific command

```bash
podfetch <command> --help
```

e.g.

```bash
podfetch users --help
```
5 changes: 5 additions & 0 deletions migrations/2023-04-23-115251_gpodder_api/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- This file should undo anything in `up.sql`
DROP TABLE devices;
DROP TABLE sessions;
DROP TABLE subscriptions;
DROP TABLE episodes;
56 changes: 56 additions & 0 deletions migrations/2023-04-23-115251_gpodder_api/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
-- Your SQL goes here
CREATE TABLE devices(
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
deviceid VARCHAR(255) NOT NULL,
kind TEXT CHECK(kind IN ('desktop', 'laptop', 'server','mobile', 'Other')) NOT NULL,
name VARCHAR(255) NOT NULL,
username VARCHAR(255) NOT NULL,
FOREIGN KEY (username) REFERENCES users(username)
);

CREATE TABLE sessions(
username VARCHAR(255) NOT NULL,
session_id VARCHAR(255) NOT NULL,
expires DATETIME NOT NULL,
PRIMARY KEY (username, session_id)
);

CREATE TABLE subscriptions(
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
username TEXT NOT NULL,
device TEXT NOT NULL,
podcast TEXT NOT NULL,
created Datetime NOT NULL,
deleted Datetime,
UNIQUE (username, device, podcast)
);

CREATE TABLE episodes(
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
username VARCHAR(255) NOT NULL,
device VARCHAR(255) NOT NULL,
podcast VARCHAR(255) NOT NULL,
episode VARCHAR(255) NOT NULL,
timestamp DATETIME NOT NULL,
guid VARCHAR(255),
action VARCHAR(255) NOT NULL,
started INTEGER,
position INTEGER,
total INTEGER,
UNIQUE (username, device, podcast, episode, timestamp)
);


CREATE table if not exists podcast_history_items2 (
id integer primary key not null,
podcast_id integer not null,
episode_id TEXT not null,
watched_time integer not null,
date DATETIME not null,
username text not null,
FOREIGN KEY (podcast_id) REFERENCES podcasts(id));

INSERT INTO podcast_history_items2 SELECT * FROM podcast_history_items;

DROP TABLE podcast_history_items;
ALTER TABLE podcast_history_items2 RENAME TO podcast_history_items;
Loading

0 comments on commit 0e0104a

Please sign in to comment.