Run server on port 3001 (#687)

* Simplify docker compose file

* Run on port 3001
This commit is contained in:
Sung 2025-10-11 12:41:51 -07:00 committed by GitHub
commit ca5af5e34a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 45 additions and 36 deletions

View file

@ -151,8 +151,8 @@ func TestServerStartHelp(t *testing.T) {
func TestServerStartInvalidConfig(t *testing.T) {
cmd := exec.Command(testServerBinary, "start")
// Clear WebURL env var so validation fails
cmd.Env = []string{}
// Set invalid WebURL to trigger validation failure
cmd.Env = []string{"WebURL=not-a-valid-url"}
output, err := cmd.CombinedOutput()

View file

@ -5,5 +5,5 @@ SmtpPassword=mock-SmtpPassword
SmtpHost=mock-SmtpHost
SmtpPort=465
WebURL=http://localhost:3000
WebURL=http://localhost:3001
DisableRegistration=false

View file

@ -5,5 +5,5 @@ SmtpPassword=mock-SmtpPassword
SmtpHost=mock-SmtpHost
SmtpPort=465
WebURL=http://localhost:3000
WebURL=http://localhost:3001
DisableRegistration=false

View file

@ -93,8 +93,8 @@ type Params struct {
func New(p Params) (Config, error) {
c := Config{
AppEnv: getOrEnv(p.AppEnv, "APP_ENV", AppEnvProduction),
Port: getOrEnv(p.Port, "PORT", "3000"),
WebURL: getOrEnv(p.WebURL, "WebURL", ""),
Port: getOrEnv(p.Port, "PORT", "3001"),
WebURL: getOrEnv(p.WebURL, "WebURL", "http://localhost:3001"),
DBPath: getOrEnv(p.DBPath, "DBPath", DefaultDBPath),
DisableRegistration: p.DisableRegistration || readBoolEnv("DisableRegistration"),
LogLevel: getOrEnv(p.LogLevel, "LOG_LEVEL", "info"),

View file

@ -81,8 +81,8 @@ Flags:
}
appEnv := startFlags.String("appEnv", "", "Application environment (env: APP_ENV, default: PRODUCTION)")
port := startFlags.String("port", "", "Server port (env: PORT, default: 3000)")
webURL := startFlags.String("webUrl", "", "Full URL to server without trailing slash (env: WebURL, example: https://example.com)")
port := startFlags.String("port", "", "Server port (env: PORT, default: 3001)")
webURL := startFlags.String("webUrl", "", "Full URL to server without trailing slash (env: WebURL, default: http://localhost:3001)")
dbPath := startFlags.String("dbPath", "", "Path to SQLite database file (env: DBPath, default: $XDG_DATA_HOME/dnote/server.db)")
disableRegistration := startFlags.Bool("disableRegistration", false, "Disable user registration (env: DisableRegistration, default: false)")
logLevel := startFlags.String("logLevel", "", "Log level: debug, info, warn, or error (env: LOG_LEVEL, default: info)")