Commit Graph

10 Commits (main)

Author SHA1 Message Date
ᴜɴᴋɴᴡᴏɴ c6143edb44
osutil: update docstring and tests (#6255) 2020-08-19 21:30:01 +08:00
bibo38 252d0fd977
osutil: use system API to get the username when env vars are empty (#6246)
As Golang supports getting usernames via the standard library, this function
is now used to get the username if the environment variables are empty.
Using the standard library as a fallback is intended to keep compability
to existing implementations that rely on the environment variables dictating
the current username.
2020-08-19 21:17:16 +08:00
ᴜɴᴋɴᴡᴏɴ 41f56ad05d
login_source: migrate to GORM and add tests (#6090)
* Use GORM in all write paths

* Migrate to GORM

* Fix lint errors

* Use GORM  to init table

* dbutil: make writer detect error

* Add more tests

* Rename to clearTables

* db: finish adding tests

* osutil: add tests

* Fix load source files path
2020-04-11 20:18:05 +08:00
ᴜɴᴋɴᴡᴏɴ a4de85dc80
util: add tests (#5989) 2020-03-16 01:54:08 +08:00
ᴜɴᴋɴᴡᴏɴ 9e9ca66467
refactor: unify error handling in routing layer 2020-03-16 01:22:27 +08:00
ᴜɴᴋɴᴡᴏɴ 8796df8218
conf: add unit tests (#5954)
* conf: add tests for utils.go

* conf: add tests for static.go

* mock os/exec

* Run tests on Windows

* appveyor: fix gcc not found

* computed: add unit tests

* log: add unit tests

* log: fix tests on Windows

* conf: add some tests

* Finish adding tests

* Cover more cases

* Add tests for testutil

* Add more tests
2020-02-29 22:24:20 +08:00
ᴜɴᴋɴᴡᴏɴ 0c064b1b79
cmd/web: fix error when Unix socket not exists 2020-02-24 21:13:56 +08:00
ᴜɴᴋɴᴡᴏɴ 286fbc07e9
conf: overhaul security settings 2020-02-22 20:46:16 +08:00
ᴜɴᴋɴᴡᴏɴ 33c6341ccd
osutil: add unit tests 2020-02-19 23:15:57 +08:00
Michael Li 4d83fd4238
Use go-bindata to embed `public` and `templates` files into binary (#5920)
* fixed private repositories are hidden in the organization's view

* use go-bindata integrate public and templates files to gogs binary

* optimize Dockerfile don't COPY public and templates files

* use kevinburke's go-bindata to generate assets code

* reset develepment as default run mode in configure file

* optimize generated assets code relayout and help function

* fixed code format

* Update conf/app.ini

* assets: add LICENSE headers

* Some housekeeping

* assets/public: simplify code logic

* assets/templates: simplify code logic

* cmd/web: more concise variable names

* Minor changes

* Add custom public and templates support back

Co-authored-by: ᴜɴᴋɴᴡᴏɴ <u@gogs.io>
2020-02-17 22:48:24 +08:00