semaphoreui / semaphore

Modern UI and powerful API for Ansible, Terraform, OpenTofu, PowerShell and other DevOps tools.
https://semaphoreui.com
MIT License
10.47k stars 1.06k forks source link

Webserver returns 404 Not Found #895

Open steffenfritz opened 2 years ago

steffenfritz commented 2 years ago

I installed semaphore on FreeBSD 13, version 2.8.53 and configured it using semaphore setup. The database is Postgres, schema and tables are created.

When I start sempahore by semaphore server --config ./config.json the server is listening on 3000/tcp and no errors are shown. There is no reverseproxy between, the server binds to 0.0.0.0 (btw, this is not correct in the documentation).

Problem: semaphore returns a 404 when accessing the web interface:

[user@intern ~/ansible]$ semaphore server --config ./config.json 
Postgres dbuser@intern:5432 dbname
Tmp Path (projects home) /home/user/ansible
Semaphore 2.8.53
Interface 
Port :3000
Server is running
GET : / --> 404 Not Found
GET : /favicon.ico --> 404 Not Found
fiftin commented 2 years ago

Hi @steffenfritz ,

I never use FreeBSD, I will try to install and reproduce.

topical commented 2 years ago

Hi,

I wanted to use the FreeBSD package as well and got the same error messages.

The port's Makefile seems to be rather incomplete: it compiles the backend but completely misses out the frontend. So, the 404 is correct: there are no HTML, JS or CSS files in the port!

This isn't visible in the first place as all static content is compiled into the binary. The binary is just rather small and gives you 404 whatever content you ask for.

So, I tried to compile the project myself under FreeBSD 13. There are some obstacles:

  1. Installation of goreleaser and golint fails

In Taskfile.yml, tar is used in a pipe without "-f -". This option is required under Posix. But this won't save you: there is no FreeBSD binary on github.

Workaround: install them from ports (or just skip these packages - seems to be compilable still).

  1. There is no FreeBSD binary for node-sass 4.12.0

When preparing the frontend, "npm install" tries to install node-sass. Unfortunately, the newest binary on github is for node.js 12. The oldest npm port on FreeBSD is for node.js 14. Argh. So npm tries to compile node-sass itself:

gyp ERR! stack Error: Command failed: /usr/local/bin/python3.8 -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                       ^

Looks like python2. Ugh!

Luckily, "npm install" carries on and finishes at least somehow.

Workaround: ignore the error messages. Compiling the frontend still works.

  1. Current FreeBSD ports include npm 8.5.2

That's a problem. The quartely release 2022Q1 still contains npm 6.14.8 but the quarter ends tomorrow...

When using npm 8.5.2 "npm install" barfs about deprecated modules and is not forgiving anymore about compile errors and aborts.

Effectively, I have the feeling that nobody verified the FreeBSD (the current port even has a broken startup script). Unfortunately, I have no experience how to use npm and stuff in FreeBSD port Makefile.

Further, we really need to update frontend dependencies and move to npm 8. @fiftin is there anything to take care of in terms of compatibility?

cardosocristian commented 1 year ago

Same problem here. I get the 404 Not Found too.

tschettervictor commented 9 months ago

Same issue here. Any fixes planned?

abcd678 commented 8 months ago

bump, almost 2 years and the freebsd port still does not work

tboerger commented 8 months ago

The port is not maintained by this project, so feel free to raise an issue on the freebsd tracker.

tschettervictor commented 1 week ago

Use the binary linked on the releases page for FreeBSD. Works for me.

I installed the pkg version, then just replaced the binary with the one from the releases page.

topical commented 5 days ago

@tschettervictor thanks for the hint!

Actually, I maintain quite a lot of FreeBSD servers, so I really need automatic updates as provided by FreeBSD ports. Unfortunately, the port is still broken, but as tboerger wrote: the port is not maintained by this project.

Apart from that, compiling Semaphore under FreeBSD works now (at least it worked 2 weeks ago).

BTW: is there an official build script or github action for the FreeBSD binary published on the releases page?

tschettervictor commented 5 days ago

I’m wondering the same thing. Would be nice to know how it gets built.