Allow Apache-friendly fine-tuning (#77)

This PR adds additional parameters to the ImageProxy extension such as to allow easy proxying via Apache mod_rewrite (which: 1. needs a hard-coded absolute path ; 2. can not URL-decode passed URL)

See the updated README.md for further information (and corresponding Apache configuration example).

I've taken care to remain backward-compatible with existing setups; in particular, the (former) force parameter will automatically be migrated to the (new) scheme_https counterpart.
This commit is contained in:
Cédric Dufour 2020-04-05 21:12:08 +02:00 committed by GitHub
parent ade2979857
commit de83a1096c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 182 additions and 27 deletions

View file

@ -5,9 +5,41 @@
<div class="group-controls">
<input type="url" name="image_proxy_url" id="image_proxy_url" value="<?php echo FreshRSS_Context::$user_conf->image_proxy_url; ?>">
</div>
<label class="group-name" for="image_proxy_force"><?php echo _t('ext.imageproxy.force'); ?></label>
</div>
<div class="form-group">
<label class="group-name" for="image_proxy_scheme_http"><?php echo _t('ext.imageproxy.scheme_http'); ?></label>
<div class="group-controls">
<input type="checkbox" name="image_proxy_force" id="image_proxy_force" value="1" <?php echo (FreshRSS_Context::$user_conf->image_proxy_force ? 'checked' : ''); ?>>
<input type="checkbox" name="image_proxy_scheme_http" id="image_proxy_scheme_http" value="1" <?php echo (FreshRSS_Context::$user_conf->image_proxy_scheme_http ? 'checked' : ''); ?>>
</div>
</div>
<div class="form-group">
<label class="group-name" for="image_proxy_scheme_https"><?php echo _t('ext.imageproxy.scheme_https'); ?></label>
<div class="group-controls">
<input type="checkbox" name="image_proxy_scheme_https" id="image_proxy_scheme_https" value="1" <?php echo (FreshRSS_Context::$user_conf->image_proxy_scheme_https ? 'checked' : ''); ?>>
</div>
</div>
<div class="form-group">
<label class="group-name" for="image_proxy_scheme_default"><?php echo _t('ext.imageproxy.scheme_default'); ?></label>
<div class="group-controls">
<select name="image_proxy_scheme_default" id="image_proxy_scheme_default">
<option value="<?php echo htmlentities(FreshRSS_Context::$user_conf->image_proxy_scheme_default); ?>" selected="selected"><?php echo htmlentities(FreshRSS_Context::$user_conf->image_proxy_scheme_default); ?></option>
<option value="-">-</option>
<option value="auto">auto</option>
<option value="http">http</option>
<option value="https">https</option>
</select>
</div>
</div>
<div class="form-group">
<label class="group-name" for="image_proxy_scheme_include"><?php echo _t('ext.imageproxy.scheme_include'); ?></label>
<div class="group-controls">
<input type="checkbox" name="image_proxy_scheme_include" id="image_proxy_scheme_include" value="1" <?php echo (FreshRSS_Context::$user_conf->image_proxy_scheme_include ? 'checked' : ''); ?>>
</div>
</div>
<div class="form-group">
<label class="group-name" for="image_proxy_url_encode"><?php echo _t('ext.imageproxy.url_encode'); ?></label>
<div class="group-controls">
<input type="checkbox" name="image_proxy_url_encode" id="image_proxy_url_encode" value="1" <?php echo (FreshRSS_Context::$user_conf->image_proxy_url_encode ? 'checked' : ''); ?>>
</div>
</div>