feat: add SSO workspace, named shares and Debian release tooling
This commit is contained in:
1 parent
833d908884
commit
87bc33e675
106 files changed
+4160
-5637
No files matched your search
@@ -0,0 +1,28 @@
|
||||
//go:build ignore
|
||||
|
||||
// Package the release with executable Unix permissions, including on Windows.
|
||||
package main
|
||||
|
||||
import (
|
||||
"archive/tar"
|
||||
"compress/gzip"
|
||||
"crypto/sha256"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
func main(){if err:=run();err!=nil{fmt.Fprintln(os.Stderr,err);os.Exit(1)}}
|
||||
func run()error{
|
||||
if len(os.Args)!=3{return fmt.Errorf("usage: package-release <release-directory> <output.tar.gz>")}
|
||||
dir,out:=os.Args[1],os.Args[2];file,err:=os.Create(out);if err!=nil{return err};defer file.Close()
|
||||
hash:=sha256.New();zip:=gzip.NewWriter(io.MultiWriter(file,hash));archive:=tar.NewWriter(zip)
|
||||
for _,name:=range []string{"filebrowser","LICENSE","README.md","filebrowser.service"}{
|
||||
f,err:=os.Open(filepath.Join(dir,name));if err!=nil{return err};info,err:=f.Stat();if err!=nil{f.Close();return err}
|
||||
h:=&tar.Header{Name:name,Mode:0644,Size:info.Size(),Typeflag:tar.TypeReg};if name=="filebrowser"{h.Mode=0755}
|
||||
if err=archive.WriteHeader(h);err==nil{_,err=io.Copy(archive,f)};f.Close();if err!=nil{return err}
|
||||
}
|
||||
if err=archive.Close();err!=nil{return err};if err=zip.Close();err!=nil{return err};if err=file.Close();err!=nil{return err}
|
||||
line:=fmt.Sprintf("%x %s\n",hash.Sum(nil),filepath.Base(out));return os.WriteFile(filepath.Join(filepath.Dir(out),"SHA256SUMS"),[]byte(line),0644)
|
||||
}
|
||||
Reference in new issue
Block a user