No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Roshless 133e36ebc4 documentation for isDBFileTooLarge function 1 week ago
assets Initial public commit 1 month ago
various_old Initial public commit 1 month ago
.gitignore Initial public commit 1 month ago
LICENSE Initial public commit 1 month ago
README.md be consistent in server_name 1 month ago
data_types.go Initial public commit 1 month ago
database_operations.go documentation for isDBFileTooLarge function 1 week ago
database_operations_test.go typo in test 3 weeks ago
gopaste.go make database functions unexported 3 weeks ago
ip_operations.go Initial public commit 1 month ago
logging.go use joinstring function instead of chaining interfaces 3 weeks ago
string_operations.go change database file directory 4 weeks ago
string_operations_test.go Initial public commit 1 month ago
template.go Initial public commit 1 month ago
template.html Initial public commit 1 month ago
ticker.go make database functions unexported 3 weeks ago
upload_paste.go make database functions unexported 3 weeks ago
view_paste.go make database functions unexported 3 weeks ago

README.md

goPaste

simple paste sever in golang

test only with nginx proxy (because I run it anyway)

nginx example config:

limit_req_zone $binary_remote_addr zone=limits:10m rate=10r/s;

upstream paste {
    server 127.0.0.1:9090;
}

server {
  listen 80;
  listen [::]:80;
  server_name paste.domain.tld;
  return 301 https://$server_name$request_uri;
}

server {
  listen 443 ssl http2;
  listen [::]:443 ssl http2;
  server_name paste.domain.tld;

  client_max_body_size 35M; # set desired max file size
  limit_req zone=limits burst=20 nodelay;
  limit_req_log_level warn;

  ssl_certificate /etc/letsencrypt/live/paste.domain.tld/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/paste.domain.tld/privkey.pem;
  
  location / {
    proxy_pass http://paste;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-Proto $scheme;
    #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    #proxy_set_header Host $http_host;
  }
}