I want to make a general purpose wiki based on stash-box but I’m unable to build it.
I’ve installed go, yarn and postgres
$ yay -S go yarn postgresql
$ sudo -u postgres initdb -D /var/lib/postgres/data
$ sudo systemctl enable --now postgresql.service
$ sudo -u postgres createuser -sW ${USER}
could not change directory to "/home/user": Permission denied
$ createdb stash-box
$ psql stash-box
stash-box=# \du
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------------------+-----------
postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
user | Superuser, Create role, Create DB | {}
Then I’ve followed the given steps
$ make pre-ui
$ make ui
$ make build
$ ./stash-box --host 127.0.0.1 --port 9998
A new config file has been generated at /home/user/code/go/stash-box/stash-box-config.yml.
The database connection string has been defaulted to: postgres@localhost/stash-box?sslmode=disable
Please ensure this database is created and available, or change the connection string in the configuration file, then rerun stash-box.
On stash-box-config.yml
I’ve written database: user:pass@postgres/stash-box?sslmode=disable
and require_activation: false
. Then I’ve executed stash-box for the second time and I get the error
$ ./stash-box --host 127.0.0.1 --port 9998
panic: setting PGSERVICEFILE not supported
goroutine 1 [running]:
github.com/lib/pq.parseEnviron.func2(...)
/home/user/.local/share/go/pkg/mod/github.com/lib/pq@v1.10.5/conn.go:1985
github.com/lib/pq.parseEnviron({0xc00036ca80, 0x99, 0xea83ac?})
/home/user/.local/share/go/pkg/mod/github.com/lib/pq@v1.10.5/conn.go:2008 +0xc4e
github.com/lib/pq.NewConnector({0xc0002d5e80, 0x37})
/home/user/.local/share/go/pkg/mod/github.com/lib/pq@v1.10.5/connector.go:56 +0x12a
github.com/lib/pq.DialOpen({0x16cb8f8?, 0xc00004f0e0}, {0xc0002d5e80?, 0x1cb7400?})
/home/user/.local/share/go/pkg/mod/github.com/lib/pq@v1.10.5/conn.go:321 +0x37
github.com/lib/pq.Open(...)
/home/user/.local/share/go/pkg/mod/github.com/lib/pq@v1.10.5/conn.go:316
github.com/lib/pq.Driver.Open({}, {0xc0002d5e80, 0x37})
/home/user/.local/share/go/pkg/mod/github.com/lib/pq@v1.10.5/conn.go:54 +0x85
database/sql.dsnConnector.Connect(...)
/usr/lib/go/src/database/sql/sql.go:759
database/sql.(*DB).conn(0xc0003a52b0, {0x16cd710, 0xc00003e140}, 0x1)
/usr/lib/go/src/database/sql/sql.go:1393 +0x763
database/sql.(*DB).PingContext(0xc0002d5e80?, {0x16cd710, 0xc00003e140})
/usr/lib/go/src/database/sql/sql.go:851 +0x78
database/sql.(*DB).Ping(...)
/usr/lib/go/src/database/sql/sql.go:873
github.com/golang-migrate/migrate/v4/database/postgres.WithInstance(0xc0003a52b0, 0xc0003ae0c0?)
/home/user/.local/share/go/pkg/mod/github.com/golang-migrate/migrate/v4@v4.15.2/database/postgres/postgres.go:138 +0x3a
github.com/golang-migrate/migrate/v4/database/postgres.(*Postgres).Open(0xd97e80?, {0xc0002d5e40?, 0xc0002d5e40?})
/home/user/.local/share/go/pkg/mod/github.com/golang-migrate/migrate/v4@v4.15.2/database/postgres/postgres.go:206 +0x71b
github.com/golang-migrate/migrate/v4/database.Open({0xc0002d5e40, 0x37})
/home/user/.local/share/go/pkg/mod/github.com/golang-migrate/migrate/v4@v4.15.2/database/driver.go:98 +0xe9
github.com/golang-migrate/migrate/v4.NewWithSourceInstance({0xe873ba, 0x4}, {0x16cfc70?, 0xc000373950}, {0xc0002d5e40, 0x37})
/home/user/.local/share/go/pkg/mod/github.com/golang-migrate/migrate/v4@v4.15.2/migrate.go:158 +0x149
github.com/stashapp/stash-box/pkg/database.(*PostgresProvider).runMigrations(0x474f66?, {0xc000039560, 0x2c})
/home/user/code/go/stash-box/pkg/database/postgres.go:50 +0xe6
github.com/stashapp/stash-box/pkg/database.(*PostgresProvider).Open(0xd982a0?, {0xc000039560, 0x2c})
/home/user/code/go/stash-box/pkg/database/postgres.go:31 +0x27
github.com/stashapp/stash-box/pkg/database.Initialize({0xe9c2e2, 0x8}, {0xc000039560, 0x2c})
/home/user/code/go/stash-box/pkg/database/database.go:22 +0x6a
main.main()
/home/user/code/go/stash-box/main.go:24 +0x3d
What am I doing wrong?