@@ -13,6 +13,7 @@ import (
1313 "path/filepath"
1414 "runtime"
1515 "strconv"
16+ "syscall"
1617 "time"
1718
1819 "github.com/NYTimes/logrotate"
@@ -103,6 +104,7 @@ func rootCmdRun(cmd *cobra.Command, _ []string) {
103104
104105 if err := config .ConfigureTimezone (); err != nil {
105106 log .WithField ("error" , err ).Fatal ("failed to detect system timezone or use supplied configuration value" )
107+ return
106108 }
107109 log .WithField ("timezone" , config .Get ().System .Timezone ).Info ("configured wings with system timezone" )
108110 if err := config .ConfigureDirectories (); err != nil {
@@ -111,9 +113,11 @@ func rootCmdRun(cmd *cobra.Command, _ []string) {
111113 }
112114 if err := config .EnsurePterodactylUser (); err != nil {
113115 log .WithField ("error" , err ).Fatal ("failed to create pterodactyl system user" )
116+ return
114117 }
115118 if err := config .ConfigurePasswd (); err != nil {
116119 log .WithField ("error" , err ).Fatal ("failed to configure container passwd file" )
120+ return
117121 }
118122 log .WithFields (log.Fields {
119123 "username" : config .Get ().System .Username ,
@@ -125,29 +129,37 @@ func rootCmdRun(cmd *cobra.Command, _ []string) {
125129 return
126130 }
127131
132+ t := config .Get ().Token
128133 pclient := remote .New (
129134 config .Get ().PanelLocation ,
130- remote .WithCredentials (config . Get (). AuthenticationTokenId , config . Get (). AuthenticationToken ),
135+ remote .WithCredentials (t . ID , t . Token ),
131136 remote .WithHttpClient (& http.Client {
132137 Timeout : time .Second * time .Duration (config .Get ().RemoteQuery .Timeout ),
133138 }),
134139 )
135140
136141 if err := database .Initialize (); err != nil {
137142 log .WithField ("error" , err ).Fatal ("failed to initialize database" )
143+ return
138144 }
139145
140146 manager , err := server .NewManager (cmd .Context (), pclient )
141147 if err != nil {
142148 log .WithField ("error" , err ).Fatal ("failed to load server configurations" )
149+ return
143150 }
144151
145152 if err := environment .ConfigureDocker (cmd .Context ()); err != nil {
146153 log .WithField ("error" , err ).Fatal ("failed to configure docker environment" )
154+ return
147155 }
148156
149157 if err := config .WriteToDisk (config .Get ()); err != nil {
150- log .WithField ("error" , err ).Fatal ("failed to write configuration to disk" )
158+ if ! errors .Is (err , syscall .EROFS ) {
159+ log .WithField ("error" , err ).Error ("failed to write configuration to disk" )
160+ } else {
161+ log .WithField ("error" , err ).Debug ("failed to write configuration to disk" )
162+ }
151163 }
152164
153165 // Just for some nice log output.
0 commit comments