Skip to content

Commit

Permalink
added hide-powered-by option in config
Browse files Browse the repository at this point in the history
  • Loading branch information
LiamPerson committed Mar 24, 2024
1 parent 46c55a0 commit 87f21d1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ maxexpiry = 86400
| `max-duration-size = 4294967296` | Size of file before max-duration-time is used to determine expiry max time. (Default is 4GB) |
| `disable-access-key = true` | Disables access key usage. (Default is false.) |
| `default-random-filename = true` | Makes it so the random filename is not default if set false. (Default is true.) |
| `hide-powered-by = false` | Hides the powered by linx message in the footer. (Default is false.) |

### Cleaning up expired files

Expand Down
3 changes: 2 additions & 1 deletion linx-server.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ allowhotlink = true
remoteuploads = true
nologs = true
force-random-filename = false
cleanup-every-minutes = 5
cleanup-every-minutes = 5
hide-powered-by = false
2 changes: 2 additions & 0 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ var Config struct {
maxDurationSize int64
disableAccessKey bool
defaultRandomFilename bool
hidePoweredBy bool
}

var Templates = make(map[string]*pongo2.Template)
Expand Down Expand Up @@ -320,6 +321,7 @@ func main() {
flag.Int64Var(&Config.maxDurationSize, "max-duration-size", 4*1024*1024*1024, "Size of file before max-duration-time is used to determine expiry max time. (Default is 4GB)")
flag.BoolVar(&Config.disableAccessKey, "disable-access-key", false, "Disables access key usage. (Default is false.)")
flag.BoolVar(&Config.defaultRandomFilename, "default-random-filename", true, "Makes it so the random filename is not default if set false. (Default is true.)")
flag.BoolVar(&Config.hidePoweredBy, "hide-powered-by", false, "Hides the powered by linx-server footer. (Default is false.)")
iniflags.Parse()

mux := setup()
Expand Down
1 change: 1 addition & 0 deletions templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ func renderTemplate(tpl *pongo2.Template, context pongo2.Context, r *http.Reques
// Add the context for Config.disableAccessKey
context["disable_access_key"] = Config.disableAccessKey
context["default_randomize"] = Config.defaultRandomFilename
context["hide_powered_by"] = Config.hidePoweredBy

var a string
if Config.authFile == "" {
Expand Down
4 changes: 3 additions & 1 deletion templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ <h2><a href="{{ sitepath }}" title="{{ sitename }}">{{ sitename }}</a></h2>

{% block content %}{% endblock %}
<div id="footer">
<p>{{ extra_footer_text }} </p><a href="https://github.com/LiamPerson/linx-server-anime">Powered by linx-server-anime</a>
{% if hide_powered_by != true %}
<p>{{ extra_footer_text }} </p><a href="https://github.com/LiamPerson/linx-server-anime">Powered by linx-server-anime</a>
{% endif %}
</div>

</div>
Expand Down

0 comments on commit 87f21d1

Please sign in to comment.