this repo has no description smallweb.run
smallweb
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

add read permission to the global authorized_keys path

pomdtr 804ca38d 4405ac78

+10 -9
+10 -9
worker/worker.go
··· 124 124 args = append(args, "--config", configPath) 125 125 } 126 126 127 + authorizedKeysPath := filepath.Join(me.RootDir, ".smallweb", "authorized_keys") 127 128 npmCache := filepath.Join(xdg.CacheHome, "smallweb", "deno", "npm", "registry.npmjs.org") 128 129 if a.Admin { 129 130 args = append( 130 131 args, 131 - fmt.Sprintf("--allow-read=%s,%s,%s,%s", me.RootDir, sandboxPath, deno, npmCache), 132 + fmt.Sprintf("--allow-read=%s,%s,%s,%s,%s", me.RootDir, sandboxPath, deno, npmCache, authorizedKeysPath), 132 133 fmt.Sprintf("--allow-write=%s", me.RootDir), 133 134 ) 134 135 135 136 return args 136 137 } 137 138 138 - root := a.Root() 139 + appRoot := a.Root() 139 140 // if root is not a symlink 140 - if fi, err := os.Lstat(root); err == nil && fi.Mode()&os.ModeSymlink == 0 { 141 + if fi, err := os.Lstat(appRoot); err == nil && fi.Mode()&os.ModeSymlink == 0 { 141 142 args = append( 142 143 args, 143 - fmt.Sprintf("--allow-read=%s,%s,%s,%s", root, sandboxPath, deno, npmCache), 144 - fmt.Sprintf("--allow-write=%s", filepath.Join(root, "data")), 144 + fmt.Sprintf("--allow-read=%s,%s,%s,%s,%s", appRoot, sandboxPath, deno, npmCache, authorizedKeysPath), 145 + fmt.Sprintf("--allow-write=%s", filepath.Join(appRoot, "data")), 145 146 ) 146 147 147 148 return args 148 149 } 149 150 150 - target, err := os.Readlink(root) 151 + target, err := os.Readlink(appRoot) 151 152 if err != nil { 152 153 log.Printf("could not read symlink: %v", err) 153 154 } 154 155 155 156 if !filepath.IsAbs(target) { 156 - target = filepath.Join(filepath.Dir(root), target) 157 + target = filepath.Join(filepath.Dir(appRoot), target) 157 158 } 158 159 159 160 args = append( 160 161 args, 161 - fmt.Sprintf("--allow-read=%s,%s,%s,%s,%s", root, target, sandboxPath, deno, npmCache), 162 - fmt.Sprintf("--allow-write=%s,%s", filepath.Join(root, "data"), filepath.Join(target, "data")), 162 + fmt.Sprintf("--allow-read=%s,%s,%s,%s,%s,%s", appRoot, target, sandboxPath, deno, npmCache, authorizedKeysPath), 163 + fmt.Sprintf("--allow-write=%s,%s", filepath.Join(appRoot, "data"), filepath.Join(target, "data")), 163 164 ) 164 165 return args 165 166 }