Skip to content

Commit

Permalink
Merge branch 'master' into integration
Browse files Browse the repository at this point in the history
* master:
  feat: add register button for Podcast Index
  implement Podcast Index ping function
  chore(deps): add dependency on podcastindex-php
  add Podcast Index settings fields to integrations admin page
  add Podcast Index configuration settings
  add integrations settings page
  show or hide custom tags fields based on config setting
  add config setting for enabling custom tags feature
  Add example nginx config and update install guide (PodcastGenerator#456)
  feat: put feed-level custom tags in RSS feed
  feat: provide configurability for custom feed tags
  feat: add custom feed tag config file
  feat: add Podcast namespace to generated feed
  feat: put custom tags in RSS feed
  feat: add custom tag blocks in episodes
  feat: add XML well-formedness checker function
  • Loading branch information
coldacid committed Feb 18, 2022
2 parents 62d6479 + 1f6ad36 commit 54da0d4
Show file tree
Hide file tree
Showing 9 changed files with 223 additions and 11 deletions.
2 changes: 1 addition & 1 deletion INSTALL
Expand Up @@ -114,4 +114,4 @@ The next steps assume that you will be using the default html folder provided by
17. Select "Begin Installation"

### ALL DONE!
Enjoy your installation of Podcast Generator! Consider spreading the word about the software or [contribute back to the project](https://github.com/PodcastGenerator/PodcastGenerator). If your self-hosted instance gets to be too much to handle or if the installation/maintainance/security seems too intimidating, please consider using our [hosting partner](https://rss.com/blog/how-to-create-an-rss-feed-for-a-podcast/). Free accounts are availble for students and Non-profits and other users start with a free trial and have the option to upgrade to a full featured hosted plan starting at $12.99/month (USD).
Enjoy your installation of Podcast Generator! Consider spreading the word about the software or [contribute back to the project](https://github.com/PodcastGenerator/PodcastGenerator). If your self-hosted instance gets to be too much to handle or if the installation/maintainance/security seems too intimidating, please consider using our [hosting partner](https://rss.com/blog/how-to-create-an-rss-feed-for-a-podcast/). Free accounts are availble for students and Non-profits and other users start with a free trial and have the option to upgrade to a full featured hosted plan starting at $12.99/month (USD).
146 changes: 146 additions & 0 deletions INSTALL.nginx
@@ -0,0 +1,146 @@
INSTALL
====================
Install from scratch - Basic
====================

1. Download the latest version of Podcast Generator;
2. Unzip the zip package containing the script;
3. Upload the resulting files and folders to your web server;
4. Point your web browser to the URL corresponding to the location where Podcast Generator files were uploaded (e.g. http://mypodcastsite.com/podcastgen). You will be redirected automatically to the 3-step setup wizard;
5. Log-in into Podcast Generator administration area and start publishing your podcast.


Upgrade from 2.7
==========
MAKE A BACKUP OF YOUR ENTIRE PODCAST GENERATOR FOLDER BEFORE UPGRADING!!!!!

1. Download the latest version
2. Upload it to your web server, allow to overwrite files.
3. Point your web browser to the URL corresponding to the location where Podcast Generator files were uploaded (e.g. http://mypodcastsite.com/podcastgen). You will be redirected to a password converter;
4. Enjoy!

INSTALL
====================
Install from scratch - Detailed
====================
*******
Install Podcast Generator on Ubuntu 20.04
Please read this through entirely before using.
[//]: https://github.com/PodcastGenerator/PodcastGenerator/issues/272
*******
This guide assumes there is a fresh install of Ubuntu 20.04.3 and that the user initially logs into the server as the root user. The webserver used is nginx.

### Access Your Server
1. Open your local machine or login via ssh:

2. Create a system user:

`adduser replace_with_your_username`

3. Add the new user to the sudo group:

`usermod -aG sudo replace_with_your_username`

4. Login with user:

`su replace_with_your_username`

5. Add port 22 and 80 to the firewall rules and enable:

`sudo ufw allow 80`

`sudo ufw allow 443

`sudo ufw allow 22`

`sudo ufw enable`

`sudo ufw status`

All active rules should then be shown.

6. Update system:

`sudo apt update && sudo apt upgrade`

7. Install PHP, unzip and nginx:

`sudo apt install php php-cli php-fpm php-json php-pdo php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath unzip nginx`

8. Confirm PHP version and configure PHP for file uploads:

`php --version`

Output should look like:

```PHP 7.2.24-0ubuntu0.18.04.6 (cli) (built: May 26 2020 13:09:11) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.24-0ubuntu0.18.04.6, Copyright (c) 1999-2018, by Zend Technologies)
```

Configure your PHP install so file uploads are allowed and working

`sudo nano /etc/php/(version)/fpm/php.ini`

Change the according lines to reflect
`upload_max_filesize = 512M` and `post_max_size = 512M`

### Install Podcast Generator
The next steps assume that you will be using the default html folder provided by the apache install and no other virtual hosts are present.

9. Navigate to the folder where PodcastGenerator will be installed:

`cd /var/www/html`

10. Remove index.html:

`sudo rm -rf index*.html`

11. Download the latest release: (replace url with the current release)

`sudo wget https://github.com/albertobeta/PodcastGenerator/archive/v3.1.1.zip`

12. Unzip PodcastGenerator: Replace with current release version

`sudo unzip v3.1.1.zip`

13. Move PodcastGenerator from the unzipped directory PodcastGenerator-3.1.1 to var/www/html:

`sudo mv /var/www/html/PodcastGenerator-3.1.1/PodcastGenerator/* /var/www/html`

14. Cleanup by removing unneccessary files:
`sudo rm -rf PodcastGenerator-3.1.1/ v3.1.1.zip`

15. Change ownership of the installation files: (NOTE, this is for Ubuntu. If you are using BSD,RHEL,CENTOS,etc. Ownership may be different on different opperating systems.)

`sudo chown -R www-data:www-data /var/www/html`

16. Copy the nginx configuration file to the configuration directory and enable it:

`sudo mv /var/www/html/podcastgenerator-nginx.conf /etc/nginx/sites-available/podcastgenerator-nginx.conf`

You may need to edit the configuration file to fit your environment. The file contains comments to help you through the process. `sudo nano /etc/nginx/sites-available/podcastgenerator-nginx.conf`

Then restart nginx to apply your changes

`sudo systemctl restart nginx`

Create the file link to enable the webserver configuration

`sudo ln -s /etc/nginx/sites-enabled/podcastgenerator-nginx.conf /etc/nginx/sites-available/podcastgenerator-nginx.conf`

17. Optional: Install certbot and obtain a Let's Encrypt certificate:
`sudo apt install certbot python3-certbot-nginx`
`sudo certbot --nginx -d domain.of.your.podcastgenerator`
18. Navigate to the IP, domain or local host address of the machine in a web browser:
`ip.address.in.browser` or `domain.of.your.podcastgenerator`
19. Select "Begin Installation"
### ALL DONE!
Enjoy your installation of Podcast Generator! Consider spreading the word about the software or [contribute back to the project](https://github.com/PodcastGenerator/PodcastGenerator). If your self-hosted instance gets to be too much to handle or if the installation/maintainance/security seems too intimidating, please consider using our [hosting partner](https://rss.com/blog/how-to-create-an-rss-feed-for-a-podcast/). Free accounts are availble for students and Non-profits and other users start with a free trial and have the option to upgrade to a full featured hosted plan starting at $12.99/month (USD).
12 changes: 9 additions & 3 deletions PodcastGenerator/admin/episodes_edit.php
Expand Up @@ -138,8 +138,14 @@
// If we have custom tags, ensure that they're valid XML
$customTags = $_POST['customtags'];
if (!isWellFormedXml($customTags)) {
$error = _('Custom tags are not well-formed');
goto error;
if ($config['customtagsenabled'] == 'yes') {
$error = _('Custom tags are not well-formed');
goto error;
} else {
// if we have custom tags disabled and the POST value is misformed,
// just clear it out.
$customTags = '';
}
}

// Go and actually generate the episode
Expand Down Expand Up @@ -281,7 +287,7 @@
<input type="text" class="form-control" name="authorname" placeholder="Author Name" value="<?= htmlspecialchars($episode->episode->authorPG->namePG) ?>"><br>
<input type="email" class="form-control" name="authoremail" placeholder="Author E-Mail" value="<?= htmlspecialchars($episode->episode->authorPG->emailPG) ?>"><br>
</div>
<div class="form-group">
<div class="form-group" style="display: <?= ($config['customtagsenabled'] != 'yes') ? 'none' : 'block' ?>">
<?= _('Custom Tags') ?><br>
<textarea name="customtags"><?= htmlspecialchars($episode->episode->customTagsPG) ?></textarea><br>
</div>
Expand Down
16 changes: 13 additions & 3 deletions PodcastGenerator/admin/episodes_upload.php
Expand Up @@ -86,8 +86,14 @@
// If we have custom tags, ensure that they're valid XML
$customTags = $_POST['customtags'];
if (!isWellFormedXml($customTags)) {
$error = _('Custom tags are not well-formed');
goto error;
if ($config['customtagsenabled'] == 'yes') {
$error = _('Custom tags are not well-formed');
goto error;
} else {
// if we have custom tags disabled and the POST value is misformed,
// just clear it out.
$customTags = '';
}
}

// Skip files if they are not strictly named
Expand Down Expand Up @@ -214,6 +220,10 @@

$categories = simplexml_load_file('../categories.xml');

if (!isset($customTags)) {
$customTags = '';
}

?>
<!DOCTYPE html>
<html>
Expand Down Expand Up @@ -305,7 +315,7 @@
<input type="text" class="form-control" name="authorname" placeholder="<?= htmlspecialchars($config["author_name"]) ?>"><br>
<input type="email" class="form-control" name="authoremail" placeholder="<?= htmlspecialchars($config["author_email"]) ?>"><br>
</div>
<div class="form-group">
<div class="form-group" style="display: <?= ($config['customtagsenabled'] != 'yes') ? 'none' : 'block' ?>">
<?= _('Custom Tags') ?><br>
<textarea name="customtags"><?= htmlspecialchars($customTags) ?></textarea><br>
</div>
Expand Down
11 changes: 8 additions & 3 deletions PodcastGenerator/admin/pg_config.php
Expand Up @@ -41,19 +41,24 @@
<form action="pg_config.php?edit=1" method="POST">
<?= _('Enable Audio and Video Player') ?>:<br>
<small><?= _('Enable streaming in web browser') ?></small><br>
<input type="radio" name="enablestreaming" value="yes" <?= $config['enablestreaming'] == 'yes' ? 'checked' : '' ?>> <?= _('Yes'); ?>
<input type="radio" name="enablestreaming" value="yes" <?= $config['enablestreaming'] == 'yes' ? 'checked' : '' ?>> <?= _('Yes') ?>
<input type="radio" name="enablestreaming" value="no" <?= $config['enablestreaming'] != 'yes' ? 'checked' : '' ?>> <?= _('No') ?><br>
<hr>
<?= _('Enable Freebox') ?>:<br>
<small><?= _('Freebox allows you to write freely what you wish, add links or text through a visual editor in the admin section.') ?></small><br>
<input type="radio" name="freebox" value="yes" <?= $config['freebox'] == 'yes' ? 'checked' : '' ?>> <?= _('Yes'); ?>
<input type="radio" name="freebox" value="yes" <?= $config['freebox'] == 'yes' ? 'checked' : '' ?>> <?= _('Yes') ?>
<input type="radio" name="freebox" value="no" <?= $config['freebox'] != 'yes' ? 'checked' : '' ?>> <?= _('No') ?><br>
<hr>
<?= _('Enable categories') ?>:<br>
<small><?= _('Enable categories feature to make thematic lists of your podcasts.') ?></small><br>
<input type="radio" name="categoriesenabled" value="yes" <?= $config['categoriesenabled'] == 'yes' ? 'checked' : '' ?>> <?= _('Yes'); ?>
<input type="radio" name="categoriesenabled" value="yes" <?= $config['categoriesenabled'] == 'yes' ? 'checked' : '' ?>> <?= _('Yes') ?>
<input type="radio" name="categoriesenabled" value="no" <?= $config['categoriesenabled'] != 'yes' ? 'checked' : '' ?>> <?= _('No') ?><br>
<hr>
<?= _('Enable custom tag input') ?>:<br>
<small><?= _('Enable the ability to add custom RSS tags to your podcast feed and individual episodes.') ?></small><br>
<input type="radio" name="customtagsenabled" value="yes" <?= $config['customtagsenabled'] == 'yes' ? 'checked' : '' ?>> <?= _('Yes') ?>
<input type="radio" name="customtagsenabled" value="no" <?= $config['customtagsenabled'] != 'yes' ? 'checked' : '' ?>> <?= _('No') ?><br>
<hr>
<?= _('Use cron to regenerate the RSS feed') ?>:<br>
<input type="text" value="<?= htmlspecialchars($config['url']) . "pg-cron.php?key=" . htmlspecialchars($config['installationKey']) ?>" style="width: 100%;" readonly><br>
<hr>
Expand Down
5 changes: 4 additions & 1 deletion PodcastGenerator/admin/podcast_details.php
Expand Up @@ -19,7 +19,8 @@
if (isWellFormedXml($custom_tags)) {
// only set the value if it's well-formed XML
saveCustomFeedTags($custom_tags);
} else {
} elseif ($config['customtagsenabled'] == 'yes') {
// only error if custom tags feature is enabled
$error = _('Custom tags are not well-formed');
}
} else {
Expand Down Expand Up @@ -157,9 +158,11 @@
<?= _('Explicit Podcast') ?>:<br>
<input type="radio" name="explicit_podcast" value="yes" <?= $config['explicit_podcast'] == 'yes' ? 'checked' : '' ?>> <?= _('Yes'); ?> <input type="radio" name="explicit_podcast" value="no" <?= $config['explicit_podcast'] == 'no' ? 'checked' : '' ?>> <?= _('No') ?><br>
<br>
<?php if ($config['customtagsenabled'] == 'yes') { ?>
<?= _('Custom Feed Tags') ?>:<br>
<textarea name="custom_tags" style="width:100%;"><?= htmlspecialchars($custom_tags) ?></textarea>
<br>
<?php } ?>
<input type="hidden" name="token" value="<?= $_SESSION['token'] ?>">
<input type="submit" value="<?= _("Submit") ?>" class="btn btn-success">
</form>
Expand Down
2 changes: 2 additions & 0 deletions PodcastGenerator/core/backwards.php
Expand Up @@ -63,6 +63,8 @@ function backwards_3_1_to_3_2($absoluteurl)
\$podcastPassword = ''; // Password to protect the podcast generator webpages, this will NOT protect the audio or XML files. Leave blank to disable.
\$customtagsenabled = 'no'; // Advanced functionality for custom RSS tag input
#####################
# XML Feed stuff
Expand Down
2 changes: 2 additions & 0 deletions PodcastGenerator/setup/createconf.php
Expand Up @@ -76,6 +76,8 @@ function createconf($username, $password)
\$podcastPassword = ''; // Password to protect the podcast generator webpages, this will NOT protect the audio or XML files. Leave blank to disable.
\$customtagsenabled = 'no'; // Advanced functionality for custom RSS tag input
#####################
# XML Feed stuff
Expand Down
38 changes: 38 additions & 0 deletions podcastgenerator-nginx.conf
@@ -0,0 +1,38 @@
server {
# 301 redirect users to an encrypted version of the page
# Change example.com to the domain where podcast-generator will be running
# You need to disable this and change the line "listen 443 ssl" in the following block to "listen 80" if you wish an unencrypted only page
listen 80;
server_name example.com;
return 301 https://$host$request_uri;
}

server {
# Main server block config
# Change example.com to the domain where podcast-generator will be running
listen 443 ssl;
server_name example.com;

# Set nginx max_body_size attribute to 1 GB to prevent php timeout errors
# This is necessary so the upload in the admin panel works reliably
client_max_body_size 1G;

location / {
# Change your document root accordingly
root /var/www/html;
index index.php;

# Set proxy_read_timeout attribute to 1 hour
# Prevents nginx from reinitiating the server connection because it thinks PHP is timing out
proxy_read_timeout 3600;

# default PHP enable snipped - change according to the configuration your OS uses
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_pass unix:/run/php/php7.3-fpm.sock;
}
}
}

0 comments on commit 54da0d4

Please sign in to comment.