fixes and such
This commit is contained in:
parent
8f48e36da8
commit
7878834155
2
main.go
2
main.go
|
@ -135,6 +135,8 @@ func run(ctx context.Context) error {
|
|||
Str("build-hash", cfg.GetString("build-hash")).
|
||||
Str("build-date", cfg.GetString("build-date")).
|
||||
Str("listen", listen).
|
||||
Int("user", os.Geteuid()).
|
||||
Int("group", os.Getgid()).
|
||||
Msg("startup")
|
||||
|
||||
err := New(&http.Server{
|
||||
|
|
|
@ -28,7 +28,7 @@ func NewAvatarApp(ctx context.Context, path string) (*avatarApp, error) {
|
|||
app := &avatarApp{path: path}
|
||||
err := app.CheckFiles(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, fmt.Errorf("check files: %w", err)
|
||||
}
|
||||
|
||||
watch, err := fsnotify.NewWatcher()
|
||||
|
@ -38,7 +38,7 @@ func NewAvatarApp(ctx context.Context, path string) (*avatarApp, error) {
|
|||
for _, typ := range []string{"avatar", "bg", "cover"} {
|
||||
err = watch.Add(filepath.Join(path, typ))
|
||||
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 {
|
||||
if err != nil {
|
||||
return err
|
||||
return fmt.Errorf("walk failed: %w", err)
|
||||
}
|
||||
if info.IsDir() {
|
||||
if info.Name() == ".links" {
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
[Unit]
|
||||
Description=sour.is paste API
|
||||
Description=sour.is KeyProofs API
|
||||
After=syslog.target network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=www-data
|
||||
Group=www-data
|
||||
WorkingDirectory=/var/www
|
||||
ExecStart=/usr/local/bin/sour.is-keyproofs
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user