1
0
Fork 0
Commit Graph

86 Commits

Author SHA1 Message Date
Alexander Andreev 7915091b96
Defer srv.Stop after successful call of srv.Start. 2023-08-06 03:00:31 +04:00
Alexander Andreev 4048390bfb
Changed handlers.Error() signature to be like http.Error()'s one. 2023-08-06 02:02:58 +04:00
Alexander Andreev 3b15052330
Setup upload dir watcher at the last step. 2023-08-06 01:34:55 +04:00
Alexander Andreev 271c27f4ad
In dwelling-upload's main changed aliases for imports. 2023-08-06 01:28:55 +04:00
Alexander Andreev 532e8d9da6
Code for determining of network type was moved to HttpServer's Start() func. 2023-08-06 01:26:41 +04:00
Alexander Andreev 72d3104150
Explicit check for address type, now check if an addr passed is IPv6. Otherwise, network var will remain empty. 2023-08-06 01:21:14 +04:00
Alexander Andreev 5bd6120ae5
In var () section removed unnecessary type declarations. 2023-08-06 01:18:41 +04:00
Alexander Andreev d919d00cc0
In dwelling-upload-clean converted an expiry var to time.Duration. Added an 'h' unit in a .service to represent hours. 2023-08-05 19:28:05 +04:00
Alexander Andreev e7e45259ba
Oh, in os.Stat() path.Join() is needed, since DirEntry.Name() contains only name of a file itself, not a full path. 2023-08-05 05:07:59 +04:00
Alexander Andreev 5590b0ad71
In upload service flags was renamed. 2023-08-01 16:43:41 +04:00
Alexander Andreev e430f0bfc9
ioutil package is deprecated, so its ReadDir() was replaced by os. ReadDir() and os.Stat(). Also fixed existing error messages a little. 2023-08-01 16:42:39 +04:00
Alexander Andreev 1c7f03053f
In clean service: args are renamed: upload-dir -> dir, keep-for -> expiry. 2023-08-01 16:40:31 +04:00
Alexander Andreev 2d4169245c
Reorginised the main()'s code a little. 2023-05-27 19:51:29 +04:00
Alexander Andreev e695becbcd
Actually, ParseAddrPort is needed, since we give ip:port. 2023-05-27 19:30:28 +04:00
Alexander Andreev 345869608e
ParseAddrPort replaced with ParseAddr. Removed !ap.IsValid() since it is already done in ParseAddr. Also there is no need to additionally check if an address is IPv6. If address is neither v4 or v6, then ParseAddr will return an error. 2023-05-26 17:25:36 +04:00
Alexander Andreev 92710f7f5a
Cosmetic changes in flags. 2023-05-26 13:01:15 +04:00
Alexander Andreev 2abf5a9d7f
Fixed default upload dir path in progs as well. 2023-05-26 12:51:32 +04:00
Alexander Andreev 38e6813d11
Made use of my own httpr router in main. 2023-05-26 04:30:29 +04:00
Alexander Andreev 5101a892de
Made AssetsFS() a standalone func. 2023-05-25 02:31:21 +04:00
Alexander Andreev afbaad971a
Instantiate log file handle and an instance of log.Logger. Also remove reopen SIGHUP handler. Log file will be truncated with logrotate instead of recreating. 2023-05-25 02:25:43 +04:00
Alexander Andreev 59544da625
Removed configPath flag from main. 2023-05-25 02:17:27 +04:00
Alexander Andreev 85529890a5
Oh, code for deletion statistics also should be purged. 2023-05-25 02:13:33 +04:00
Alexander Andreev 55ba1fd67d
Do not log how much files was deleted. Useless info, keep only error logs.
And removed configPath flag as well.
2023-05-25 02:10:35 +04:00
Alexander Andreev dab675474a
Set default NotFound handler. 2023-05-25 00:47:32 +04:00
Alexander Andreev 931f98d12e
Made use of cmd arguments. 2023-05-24 22:19:41 +04:00
Alexander Andreev 11dfbfbc23
Added flags that replace config file. 2023-05-24 22:11:28 +04:00
Alexander Andreev 470bbb04ee
Get file.log path as join of its name and LOGS_DIRECTORY env var. 2023-05-24 22:10:57 +04:00
Alexander Andreev deed268b4f
Get config passed as cmd args instead. 2023-05-24 22:09:41 +04:00
Alexander Andreev 33f69eaf44
Changed error logging for upload-clean as well. 2023-05-24 22:09:04 +04:00
Alexander Andreev c85c6555e2
Log errors to stdout (systemd-journal) instead of a separate file. Also updated error messages. And since journal already puts a date, use only a Llongfile flag to print a place where an error occured. 2023-05-24 21:45:46 +04:00
Alexander Andreev c43c314a78
Pass listen address as a -listen argument. Use the new code to parse a parameter. 2023-05-24 21:26:48 +04:00
Alexander Andreev 33ec19647b
Reworked logging. Store all actions in one file.log. 2023-05-21 21:27:44 +04:00
Alexander Andreev 31d2c4fd21
Let's, actually, directly assign to uploadDirSize. 2023-05-21 21:12:23 +04:00
Alexander Andreev 50ca035a1f
Uhm... Don't recall why, but nonetheless, this is why size wasn't being updated when there were no files left. 2023-05-21 20:53:03 +04:00
Alexander Andreev cb1dd51750
Let's reorginise endpoints a little. 2023-05-21 20:14:01 +04:00
Alexander Andreev d7191d0fbd
Added /favicon.svg endpoint. 2023-05-21 20:13:15 +04:00
Alexander Andreev 472ebf5891
Made NtFound and RobotsTxt handlers a standalone funcs. 2023-05-13 16:29:32 +04:00
Alexander Andreev 8925f2ce24
Added robots.txt file and its handler. 2023-05-13 16:00:38 +04:00
Alexander Andreev 23d7fd882c
Added version var to clean util as well. 2023-04-24 01:05:07 +04:00
Alexander Andreev d5aa919a37
Moved http server to internal. 2023-04-24 00:49:53 +04:00
Alexander Andreev 36ecd3cf10
Removed everything related to logToStdout. 2023-04-24 00:43:43 +04:00
Alexander Andreev 17ebe18b8b
Store version in a var that is being passed as an arg of a compiler. 2023-04-24 00:32:30 +04:00
Alexander Andreev e09203ae6d
Version updated to 23.10.0. 2023-03-12 00:15:25 +04:00
Alexander Andreev 4a49bf30a3
Version up to 23.8.0. Changed arav.top to arav.su. Fixed templates. Deleted pre-compiled ones. 2023-02-23 18:16:06 +04:00
Alexander Andreev 3a106371fe
Incremented version. 2022-07-01 04:01:43 +04:00
Alexander Andreev 20702fa97e
Uhm, no, hash should be passed in POST body. 2022-07-01 03:43:00 +04:00
Alexander Andreev 5218e427d5
Added POST and DELETE methods handlers for file deletion in main. 2022-07-01 03:32:53 +04:00
Alexander Andreev 2cf7e80480
Instantiate a logDelete in main. 2022-07-01 03:32:12 +04:00
Alexander Andreev 2713464449
Incremented version number. 2022-06-13 22:34:15 +04:00
Alexander Andreev 27ec17c9b8
Updated program version. 2022-06-13 20:25:22 +04:00