Giter Club home page Giter Club logo

gdprshare's People

Contributors

dependabot[bot] avatar lixmal avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

gdprshare's Issues

Cleanup error in MariaDB/MySQL

When -cleanup in using MariaDB/MySQL, a sql error occurred,

2020/11/21 04:51:36 File cleanup errors:
2020/11/21 04:51:36 Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(created_at, expiry || ' days') > datetime('now')))' at line 1

This is fixed by the following patch. I don't know this patch works correctly using SQLite3 or PostgreSQL.

--- main.go.bak	2020-11-21 05:13:06.363601062 -0800
+++ main.go	2020-11-21 05:13:36.371335749 -0800
@@ -741,7 +741,7 @@
     var expired []StoredFile
     var errors []error

-    if errs := db.Where("datetime(created_at, expiry || ' days') > datetime('now')").Find(&expired).GetErrors(); errs != nil {
+    if errs := db.Where("adddate(created_at, expiry || ' days') > current_date()").Find(&expired).GetErrors(); errs != nil {
         for _, err := range errs {
             if !gorm.IsRecordNotFoundError(err) {
                 errors = append(errors, err)

Error parsing config file config.yml: yaml: found character that cannot start any token

What's wrong...? I added _ "github.com/jinzhu/gorm/dialects/mysql" to main.go.
And pass http://www.yamllint.com/

# post size in MiB
maxuploadsize: 1000

idlength: 20

# directory to store uploaded files
storepath: '/srv/gdprshare/files'

# listen address/port
listenaddr: '127.0.0.1:28888'

tls:
  use:  false
  key:  '/etc/ssl/private/ssl-cert-snakeoil.key'
  cert: '/etc/ssl/certs/ssl-cert-snakeoil.pem'

# see https://godoc.org/github.com/jinzhu/gorm#Open
database:
  driver: 'mysql'
  args:   'gdprshare:[email protected]/gdprshare?charset=utf8mb4&parseTime=True&loc=Local'

mail:
  smtphost: 'smtp.example.com'
  smtpport: 587
  smtpuser: '[email protected]'
  smtppass: 'password'
  from:     '[email protected]'
  subject:  'File was downloaded: %s'
  body:     'File with id {{.FileID}} was downloaded.'
# available variables:
#   .FileID
#   .Addr
#   .UserAgent
#   .SrcTLSVersion
#   .SrcTLSCipherSuite
#   .DstTLSVersion
#   .DstTLSCipherSuite

# headers in case app is behind a reverse proxy
header:
  tlsversion:     'X-TLS-Version'
  tlsciphersuite: 'X-TLS-CipherSuite'

# saves receiver IP addr and user agent in database
saveclientinfo: false

# length of password pregenerated on the frontend
passwordlength: 12

# for config via env vars see https://github.com/jinzhu/configor#advanced-usage

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.