mirror of
https://github.com/danpros/htmly.git
synced 2026-04-19 20:16:22 +05:30
Added option to hide HTMLy version publicly and added version to admin layout
A configuration setting has been added to allow users to hide the version of HTMLy from the source code publicly as a security precaution. The version has been added to the admin layout for easier visibility for admins.
This commit is contained in:
parent
b16423fbc1
commit
a35e503fbf
5 changed files with 30 additions and 4 deletions
|
|
@ -301,4 +301,6 @@ login_protect_system = "Login protection system"
|
||||||
cloudflare_info = "Review Cloudflare's Turnstile documentation: "
|
cloudflare_info = "Review Cloudflare's Turnstile documentation: "
|
||||||
mfa_config = "Multi Factor Authentication (MFA)"
|
mfa_config = "Multi Factor Authentication (MFA)"
|
||||||
set_mfa_globally = "Set the status of MFA"
|
set_mfa_globally = "Set the status of MFA"
|
||||||
explain_mfa = "When enabled, MFA is optional for all users. When disabled, no users can use it and it hides the field on the login page."
|
explain_mfa = "When enabled, MFA is optional for all users. When disabled, no users can use it and it hides the field on the login page."
|
||||||
|
set_version_publicly = "HTMLy Version Visibility"
|
||||||
|
explain_version = "By default the version of HTMLy is visible publicly in the source code, some bots and bad actors can use this information for bad reasons so some admins may prefer to hide this."
|
||||||
|
|
@ -140,6 +140,27 @@ Please install and enable the INTL extension to format the date format to your l
|
||||||
<input type="text" name="-config-blog.copyright" class="form-control" id="blog.copyright" value="<?php echo valueMaker(config('blog.copyright'));?>" placeholder="<?php echo i18n('Copyright_Line_Placeholder');?>">
|
<input type="text" name="-config-blog.copyright" class="form-control" id="blog.copyright" value="<?php echo valueMaker(config('blog.copyright'));?>" placeholder="<?php echo i18n('Copyright_Line_Placeholder');?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group row">
|
||||||
|
<label class="col-sm-2 col-form-label"><?php echo i18n('set_version_publicly');?></label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="radio" name="-config-show.version" id="show.version1" value="true" <?php if (config('show.version') === 'true'):?>checked<?php endif;?>>
|
||||||
|
<label class="form-check-label" for="show.version1">
|
||||||
|
<?php echo i18n('Enable');?>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="radio" name="-config-show.version" id="show.version2" value="false" <?php if (config('show.version') === 'false'):?>checked<?php endif;?>>
|
||||||
|
<label class="form-check-label" for="show.version2">
|
||||||
|
<?php echo i18n('Disable');?>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<small><em><?php echo i18n('explain_version');?></em></small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<hr />
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<button type="submit" class="btn btn-primary"><?php echo i18n('Save_Config');?></button>
|
<button type="submit" class="btn btn-primary"><?php echo i18n('Save_Config');?></button>
|
||||||
|
|
|
||||||
|
|
@ -328,7 +328,7 @@ if (isset($_GET['search'])) {
|
||||||
<small><?php echo i18n('Admin_panel_style_based_on');?> <a rel="nofollow" target="_blank" href="https://github.com/ColorlibHQ/AdminLTE">AdminLTE</a></small>
|
<small><?php echo i18n('Admin_panel_style_based_on');?> <a rel="nofollow" target="_blank" href="https://github.com/ColorlibHQ/AdminLTE">AdminLTE</a></small>
|
||||||
</div>
|
</div>
|
||||||
<!-- Default to the left -->
|
<!-- Default to the left -->
|
||||||
<?php echo i18n('Proudly_powered_by');?> <a href="https://www.htmly.com" target="_blank">HTMLy</a>
|
<?php echo i18n('Proudly_powered_by');?> <a href="https://www.htmly.com" target="_blank"><?php echo 'HTMLy ' . constant('HTMLY_VERSION'); ?></a>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
<!-- ./wrapper -->
|
<!-- ./wrapper -->
|
||||||
|
|
|
||||||
|
|
@ -88,5 +88,6 @@
|
||||||
"views.root",
|
"views.root",
|
||||||
"views.layout",
|
"views.layout",
|
||||||
"autosave.enable",
|
"autosave.enable",
|
||||||
"mfa.state"
|
"mfa.state",
|
||||||
|
"show.version"
|
||||||
]
|
]
|
||||||
|
|
@ -3440,7 +3440,9 @@ function head_contents()
|
||||||
$output .= '<meta charset="utf-8" />' . "\n";
|
$output .= '<meta charset="utf-8" />' . "\n";
|
||||||
$output .= '<meta http-equiv="X-UA-Compatible" content="IE=edge" />' . "\n";
|
$output .= '<meta http-equiv="X-UA-Compatible" content="IE=edge" />' . "\n";
|
||||||
$output .= '<meta name="viewport" content="width=device-width, initial-scale=1" />' . "\n";
|
$output .= '<meta name="viewport" content="width=device-width, initial-scale=1" />' . "\n";
|
||||||
$output .= '<meta name="generator" content="' . $version . '" />' . "\n";
|
if (config('show.version') == 'true') {
|
||||||
|
$output .= '<meta name="generator" content="' . $version . '" />' . "\n";
|
||||||
|
}
|
||||||
$output .= $favicon;
|
$output .= $favicon;
|
||||||
$output .= '<link rel="sitemap" href="' . site_url() . 'sitemap.xml" />' . "\n";
|
$output .= '<link rel="sitemap" href="' . site_url() . 'sitemap.xml" />' . "\n";
|
||||||
$output .= '<link rel="alternate" type="application/rss+xml" title="' . blog_title() . ' Feed" href="' . site_url() . 'feed/rss" />' . "\n";
|
$output .= '<link rel="alternate" type="application/rss+xml" title="' . blog_title() . ' Feed" href="' . site_url() . 'feed/rss" />' . "\n";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue