Browse Source

Fix: Template path

master
Siroco 3 months ago
parent
commit
06344e3c2e
Signed by: siroco GPG Key ID: 1324098302A514B0
  1. 1
      .env.sample
  2. 4
      Dockerfile
  3. 4
      entrypoint.sh
  4. 7
      installer/main.go

1
.env.sample

@ -1,4 +1,3 @@
GANCIO_DATA_PATH="./data"
GANCIO_PORT=13120
GANCIO_USER_GROUP="1000:1000"
GANCIO_ADMIN_EMAIL="gancio@localhost"

4
Dockerfile

@ -56,7 +56,9 @@ WORKDIR /gancio
RUN npm install --production && \
ln -s /gancio/server/cli.js /usr/bin/gancio
COPY --from=builder /tmp/installer/gancio-installer /usr/bin/gancio-installer
COPY --from=builder /tmp/installer /usr/local/bin/gancio-installer
RUN cp /usr/local/bin/gancio-installer/gancio-installer /usr/bin/gancio-installer
ADD entrypoint.sh /

4
entrypoint.sh

@ -9,9 +9,7 @@ mkdir -p /data/uploads
[ -f /data/config.json ] || touch /data/config.json
# crear una configuracion por defecto
# TODO: arranca el web installer - #goforms?
/usr/bin/gancio-installer
TEMPLATE="/usr/share/local/gancio-installer" gancio-installer
[ -s /data/config.json ] || cp /gancio/config.json.example /data/config.json
# Admin Email Configuration
[ -n $GANCIO_ADMIN_EMAIL ] && sed -i "s/\"admin_email\".*/\"admin_email\": \"$GANCIO_ADMIN_EMAIL\"/g" /data/config.json
exec $@

7
installer/main.go

@ -49,10 +49,15 @@ var DB_PATH = "/data/db.sqlite"
var UPLOADS_PATH = "/data/uploads"
var LOGS_PATH = "/data/logs"
var LISTEN_PORT = ":13120"
var TEMPLATE_PATH = "."
func main() {
if os.Getenv("TEMPLATE") != "" {
TEMPLATE_PATH = os.Getenv("TEMPLATE")
}
fmt.Println("Gancio Installer")
tmpl := template.Must(template.ParseFiles("templates/_base.html","templates/install.html"))
tmpl := template.Must(template.ParseFiles(TEMPLATE_PATH+"/templates/_base.html",TEMPLATE_PATH+"templates/install.html"))
http.Handle("/css/", http.StripPrefix("/css/", http.FileServer(http.Dir("./css"))))
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {

Loading…
Cancel
Save