Skip to content

Web deployment with static content #21845

Closed
@KB3HNS

Description

@KB3HNS

Description

Hello. I need some clarification.
I've built my own version of gitea for Debian 11 (bullseye) including PAM and excluding the built-ins. I'm currently running a local instance of APACHE 2 with appropriate mod_proxy and mod_proxy_http. I am able to confirm that apache is correctly passing requests to gitea. However, all requests are resulting in a 500 internal server error. Even when manually running gitea with the --verbose option there is very little information to go on as shown below (redacting some potentially sensitive information):

2022/11/17 00:01:12 cmd/web.go:217:listen() [I] [6375c018-5] Listen: http://0.0.0.0:3000/git
2022/11/17 00:01:12 cmd/web.go:221:listen() [I] [6375c018-5] AppURL(ROOT_URL): https://www.XXXXXX.END/git/
2022/11/17 00:01:12 ...s/graceful/server.go:61:NewServer() [I] [6375c018-5] Starting new Web server: tcp:0.0.0.0:3000 on PID: 2274289
2022/11/17 00:01:30 ...s/context/context.go:232:HTML() [E] [6375c02a] Render failed: html/template: "install" is undefined
2022/11/17 00:01:30 ...eb/routing/logger.go:99:func1() [I] [6375c02a] router: completed GET / for xxx.xxx.xxx.xxx, 500 Internal Server Error in 0.5ms @ install/install.go:90(install.Install)

I have copied the contents of ${BUILD_DIR}/"public" to /var/www-ssl/git-static, based on this documentation and the resulting gitea executable to /usr/local/bin. I have also set up an appropriate account to run under and systemd startup script based on these instructions.

My current app.ini:

[server]
STATIC_URL_PREFIX = /git-static
ROOT_URL = https://www.XXXXXX.END/git

If I run the application in the build directory it executes fine. However, the build directory resides on a dedicated build server and the build environment is purposefully not available on the production server (both the build system and the production server are running identically patched versions of Debian 11 - only that the production server does not have the ability to compile software for security reasons).
I desire to avoid building in the static content as this server has a heavy load and is somewhat stretched for resources as it is. PAM authentication is required as I have already implemented a system-wide user database and do not desire to maintain a separate authentication system.

Gitea Version

1.17.3 built with GNU Make 4.3, go1.19.1 : pam

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

Logs inline

Screenshots

-N/A- see logs

Git Version

2.30.2

Operating System

Linux xxxxxx 5.10.0-19-amd64 #1 SMP Debian 5.10.149-2 (2022-10-21) x86_64 GNU/Linux

How are you running Gitea?

See description.

Database

MySQL

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/questionIssue needs no code to be fixed, only a description on how to fix it yourself.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions