From 4d83fd4238e177d9327c760a5386bc53f25dedbb Mon Sep 17 00:00:00 2001 From: Michael Li Date: Mon, 17 Feb 2020 22:48:24 +0800 Subject: Use go-bindata to embed `public` and `templates` files into binary (#5920) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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: ᴜɴᴋɴᴡᴏɴ --- conf/README.md | 2 +- conf/app.ini | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'conf') diff --git a/conf/README.md b/conf/README.md index 5a7477c9..ed91e400 100644 --- a/conf/README.md +++ b/conf/README.md @@ -1,7 +1,7 @@ After change anything (other than this file) in this directory, a re-run of the following command in the root directory of this repository is required: ``` -$ make bindata +$ make generate ``` To install the `go-bindata`, please see https://github.com/kevinburke/go-bindata#installation. diff --git a/conf/app.ini b/conf/app.ini index 728914b9..28b4485a 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -61,8 +61,9 @@ KEY_FILE = custom/https/key.pem ; Allowed TLS version values: SSL30, TLS10, TLS11, TLS12 TLS_MIN_VERSION = TLS10 -; Upper level of template and static file path -; default is the path where Gogs is executed +; Enable to load assets (i.e. "conf", "templates", "public") from disk instead of embedded bindata. +LOAD_ASSETS_FROM_DISK = false +; The directory that contains "templates" and "public". By default, it is the working directory. STATIC_ROOT_PATH = ; Default path for App data APP_DATA_PATH = data -- cgit v1.2.3