Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
07d0882c65 | ||
|
|
016ffd9fa4 | ||
|
|
95c3ac899f | ||
|
|
3bc8446a6d | ||
|
|
aabe581148 |
@@ -245,6 +245,7 @@ server {
|
||||
}
|
||||
|
||||
root /home/prosody-filer;
|
||||
autoindex off;
|
||||
client_max_body_size 51m;
|
||||
client_body_buffer_size 51m;
|
||||
try_files $uri $uri/ @prosodyfiler;
|
||||
@@ -308,7 +309,7 @@ server {
|
||||
|
||||
Prosody Filer has no immediate knowlegde over all the stored files and the time they were uploaded, since no database exists for that. Also Prosody is not capable to do auto deletion if *mod_http_upload_external* is used. Therefore the suggested way of purging the uploads directory is to execute a purge command via a cron job:
|
||||
|
||||
@daily find /home/prosody-filer/upload/* -maxdepth 0 -type d -mtime +28 | xargs rm -rf
|
||||
@daily find /home/prosody-filer/upload/ -type d -mtime +28 | xargs rm -rf
|
||||
|
||||
This will delete uploads older than 28 days.
|
||||
|
||||
|
||||
13
build.sh
13
build.sh
@@ -1,7 +1,10 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
##
|
||||
## Builds static prosody-filer binary
|
||||
##
|
||||
### get VERSIONSTRING
|
||||
VERSIONSTRING="$(git describe --tags --exact-match || git rev-parse --short HEAD)"
|
||||
|
||||
echo "Building version ${VERSIONSTRING} of Prosody-Filer ..."
|
||||
|
||||
### Compile and link statically
|
||||
CGO_ENABLED=0 GOOS=linux go build -a -ldflags "-extldflags '-static' -w -s -X main.versionString=${VERSIONSTRING}" prosody-filer.go
|
||||
|
||||
CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' .
|
||||
|
||||
@@ -36,6 +36,7 @@ type Config struct {
|
||||
}
|
||||
|
||||
var conf Config
|
||||
var versionString string = "0.0.0"
|
||||
|
||||
/*
|
||||
* Sets CORS headers
|
||||
@@ -113,6 +114,7 @@ func handleRequest(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
log.Println("Successfully written", n, "bytes to file", fileStorePath)
|
||||
w.WriteHeader(http.StatusCreated)
|
||||
} else {
|
||||
log.Println("Invalid MAC.")
|
||||
http.Error(w, "403 Forbidden", 403)
|
||||
@@ -191,7 +193,7 @@ func main() {
|
||||
/*
|
||||
* Start HTTP server
|
||||
*/
|
||||
log.Println("Starting up XMPP HTTP upload server ...")
|
||||
log.Println("Starting Prosody-Filer", versionString, "...")
|
||||
http.HandleFunc("/"+conf.UploadSubDir, handleRequest)
|
||||
log.Printf("Server started on port %s. Waiting for requests.\n", conf.Listenport)
|
||||
http.ListenAndServe(conf.Listenport, nil)
|
||||
Reference in New Issue
Block a user