Skip to content

Commit 7d49545

Browse files
committed
Release:--: v0.0.13_2026-04-29_12:26:13_UTC
1 parent 3330441 commit 7d49545

4 files changed

Lines changed: 31 additions & 9 deletions

File tree

api/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func StartAPIServices(opts *Options) {
4747

4848
mux := buildMux(opts)
4949
addr := fmt.Sprintf("0.0.0.0:%d", opts.ListenPort)
50-
gtbox_log.LogInfof("[api_show] listening on http://%s (IPv4 only, data=%s)", addr, opts.DataDir)
50+
gtbox_log.LogInfof("[api_show] listening on http://127.0.0.1:%d (IPv4 only, data=%s)", opts.ListenPort, opts.DataDir)
5151

5252
srv := &http.Server{
5353
Addr: addr,

as_config/as_config.go

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616

1717
const (
1818
ProjectName = "api_show"
19-
ProjectVersion = "v0.0.12"
19+
ProjectVersion = "v0.0.13"
2020
ProjectBundleID = "com.0xYeah.api_show"
2121

2222
ListenPort = 12110
@@ -134,11 +134,19 @@ func LoadConfig(path string) error {
134134
}
135135

136136
// SyncConfigFile is the standard config bootstrap helper: if the file
137-
// is missing, write the default TOML there first; then load. This makes the
138-
// first-ever run on any host self-bootstrap a placeholder config file the
139-
// operator can edit in place.
137+
// is missing OR empty (0 bytes), write the default TOML there first;
138+
// then load. This makes the first-ever run on any host self-bootstrap a
139+
// placeholder config file the operator can edit in place.
140140
func SyncConfigFile(path string) error {
141-
if _, err := os.Stat(path); errors.Is(err, os.ErrNotExist) {
141+
info, err := os.Stat(path)
142+
switch {
143+
case errors.Is(err, os.ErrNotExist):
144+
if err := SaveConfig(path, generateDefault()); err != nil {
145+
return err
146+
}
147+
case err != nil:
148+
return fmt.Errorf("as_config: stat %s: %w", path, err)
149+
case info.Size() == 0:
142150
if err := SaveConfig(path, generateDefault()); err != nil {
143151
return err
144152
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
## v0.0.11 ChangeLog
1+
## v0.0.13 ChangeLog
22

3-
- Release:--: v0.0.11_2026-04-28_15:03:36_UTC
4-
- Range: 02664b13cfb2ae43701118a9dfbd696c186ec24e..HEAD
3+
- Release:--: v0.0.13_2026-04-29_12:26:13_UTC
4+
- Range: 3330441eeb1f2159e8afca60c539d26a0eff237d..HEAD
55
- Commits: 0
66

77
### commit infos

example_files/config_local.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# HMAC cookie key + TOTP key derivation salt. >=16 bytes.
2+
secret = 'REPLACE_ME_at_least_16_chars'
3+
# Bearer token /upload accepts.
4+
upload_token = 'REPLACE_ME_bearer_token'
5+
# Root dir for uploaded openapi specs + totp_blobs/. Relative to WorkingDirectory.
6+
data_dir = './data'
7+
# HTTP listen port.
8+
port = 12110
9+
# true = /upload rejects non-private/non-loopback IPs at the app layer.
10+
only_local = true
11+
# pwd | pwd_totp (default) | totp.
12+
auth_mode = 'pwd_totp'
13+
# Account roster. Edit + restart to add users / change permissions.
14+
users = []

0 commit comments

Comments
 (0)