Use public URL instead of URL in configuration

Change the name of the `url` config key to `public_url` to be more clear
about what it is for.
This commit is contained in:
Paul van Tilburg 2022-10-17 19:47:29 +02:00
parent fa8fc40b58
commit bde6135f70
Signed by: paul
GPG key ID: C6DE073EDA9EEC4D
5 changed files with 9 additions and 9 deletions

View file

@ -25,7 +25,7 @@ builds when you don't add `--release`.)
### Configuration
For now, you will need to provide Rocket with configuration to tell it at which
URL Podbringer is hosted. This needs to be done even if you are not using a
public URL Podbringer is hosted. This needs to be done even if you are not using a
reverse proxy, in which case you need to provide it with the proxied URL. You
can also use the configuration to configure a different address and/or port.
Just create a `Rocket.toml` file that contains (or copy `Rocket.toml.example`):
@ -34,7 +34,7 @@ Just create a `Rocket.toml` file that contains (or copy `Rocket.toml.example`):
[default]
address = "0.0.0.0"
port = 7062
url = "https://my.domain.tld/podbringer"
public_url = "https://my.domain.tld/podbringer"
```
This will work independent of the type of build. For more about Rocket's
@ -52,7 +52,7 @@ need to use for Podbringer is comprised of the following parts:
```text
https://my.domain.tld/podbringer/feed/mixcloud/myfavouriteband
|------------------------------| |-------||--------------|
The Podbringer location URL Service User @ service
The Podbringer public URL Service User @ service
```
### Feed item limit

View file

@ -1,4 +1,4 @@
[default]
address = "0.0.0.0"
port = 7062
url = "https://my.domain.tld/podbringer"
public_url = "https://my.domain.tld/podbringer"

View file

@ -92,7 +92,7 @@ fn construct_item(
})
.collect::<Vec<_>>();
let url = uri!(
Absolute::parse(&config.url).expect("valid URL"),
Absolute::parse(&config.public_url).expect("valid URL"),
crate::get_download(backend_id = backend_id, file = item.enclosure.file)
);
let enclosure = EnclosureBuilder::default()

View file

@ -69,9 +69,9 @@ pub(crate) type Result<T, E = Error> = std::result::Result<T, E>;
#[derive(Debug, Deserialize, Serialize)]
#[serde(crate = "rocket::serde")]
pub(crate) struct Config {
/// The URL at which the application is hosted or proxied from.
/// The public URL at which the application is hosted or proxied from.
#[serde(default)]
url: String,
public_url: String,
}
/// A Rocket responder wrapper type for RSS feeds.
@ -107,7 +107,7 @@ async fn get_feed(
/// Returns a simple index page that explains the usage.
#[get("/")]
pub(crate) async fn get_index(config: &State<Config>) -> Template {
Template::render("index", context! { url: &config.url })
Template::render("index", context! { url: &config.public_url })
}
/// Sets up Rocket.

View file

@ -11,7 +11,7 @@
<pre>
https://my.domain.tld/podbringer/feed/mixcloud/myfavouriteband
|------------------------------| |-------||--------------|
The Podbringer location URL Service User @ service
The Podbringer public URL Service User @ service
</pre>
</p>
<p>