Skip to content
Snippets Groups Projects
Commit d8710d70 authored by ale's avatar ale
Browse files

Add missing file

parent 63efefed
No related branches found
No related tags found
1 merge request!34V3
Pipeline #57375 passed with warnings
package upload
import (
"context"
"os"
"path/filepath"
"git.autistici.org/ai3/tools/acmeserver/common"
)
type FSStorage struct {
path string
}
func newFS(config *FSConfig) (*FSStorage, error) {
return &FSStorage{
path: config.Path,
}, nil
}
func (s *FSStorage) Upload(_ context.Context, path string, creds *common.Credentials) error {
dir := filepath.Join(s.path, path)
if err := os.MkdirAll(dir, 0700); err != nil {
return err
}
for _, b := range credsToBatch(dir, creds) {
if err := os.WriteFile(b.path, []byte(b.data), 0600); err != nil {
return err
}
}
return nil
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment