Configure the project #

The project can be configured in the uberfx.hcl file, which is created by the init command. The following example shows the basic configuration:

 1# An input variable, which can be set with the
 2# --var flag, e.g. uberfx deploy --var 'password=1234567890'
 3# or by setting the environment variable UBERFX_VAR_password
 4var secret password {
 5  name = "password"
 6}
 7
 8service uberspace_mysql mysql {
 9  username = "fx"
10  password = var.secret.password.value
11  address  = "atlas.uberspace.de:22"
12}
13
14# A build step, which builds the go binary as a wasm module
15build go www {
16  path = "."
17}
18
19# A deploy step, which deploys the binary to an uberspace
20deploy uberspace www {
21  source   = build.go.www.output
22  username = "fx"
23  password = var.secret.password.value
24  address  = "atlas.uberspace.de:22"
25  port     = 8080
26  domain   = "www.fx.uber.space"
27  env      = {
28    "MYSQL_PASSWORD" = service.uberspace_mysql.mysql.password
29  }
30}

This configuration will build the go binary in the server directory and deploy it to the uberspace atlas.uberspace.de with the username fx and the password from the password variable. The binary will be deployed to the domain www.fx.uber.space.