fixes and such

This commit is contained in:
Jon Lundy 2020-11-30 11:53:49 -07:00
parent 8f48e36da8
commit 7878834155
3 changed files with 7 additions and 4 deletions

View File

@ -135,6 +135,8 @@ func run(ctx context.Context) error {
Str("build-hash", cfg.GetString("build-hash")). Str("build-hash", cfg.GetString("build-hash")).
Str("build-date", cfg.GetString("build-date")). Str("build-date", cfg.GetString("build-date")).
Str("listen", listen). Str("listen", listen).
Int("user", os.Geteuid()).
Int("group", os.Getgid()).
Msg("startup") Msg("startup")
err := New(&http.Server{ err := New(&http.Server{

View File

@ -28,7 +28,7 @@ func NewAvatarApp(ctx context.Context, path string) (*avatarApp, error) {
app := &avatarApp{path: path} app := &avatarApp{path: path}
err := app.CheckFiles(ctx) err := app.CheckFiles(ctx)
if err != nil { if err != nil {
return nil, err return nil, fmt.Errorf("check files: %w", err)
} }
watch, err := fsnotify.NewWatcher() watch, err := fsnotify.NewWatcher()
@ -38,7 +38,7 @@ func NewAvatarApp(ctx context.Context, path string) (*avatarApp, error) {
for _, typ := range []string{"avatar", "bg", "cover"} { for _, typ := range []string{"avatar", "bg", "cover"} {
err = watch.Add(filepath.Join(path, typ)) err = watch.Add(filepath.Join(path, typ))
if err != nil { if err != nil {
return nil, err return nil, fmt.Errorf("adding watch: %w", err)
} }
} }
@ -91,7 +91,7 @@ func (app *avatarApp) CheckFiles(ctx context.Context) error {
return filepath.Walk(app.path, func(path string, info os.FileInfo, err error) error { return filepath.Walk(app.path, func(path string, info os.FileInfo, err error) error {
if err != nil { if err != nil {
return err return fmt.Errorf("walk failed: %w", err)
} }
if info.IsDir() { if info.IsDir() {
if info.Name() == ".links" { if info.Name() == ".links" {

View File

@ -1,10 +1,11 @@
[Unit] [Unit]
Description=sour.is paste API Description=sour.is KeyProofs API
After=syslog.target network.target After=syslog.target network.target
[Service] [Service]
Type=simple Type=simple
User=www-data User=www-data
Group=www-data
WorkingDirectory=/var/www WorkingDirectory=/var/www
ExecStart=/usr/local/bin/sour.is-keyproofs ExecStart=/usr/local/bin/sour.is-keyproofs