Exemplo n.º 1
0
        public static ActionResult ExtractInstallDir(Session session)
        {
            string line = session["STORJ_SERVICE_COMMAND"];

            session.Log($"ExtractInstallDir registry value: {line}");

            string path = new CustomActionRunner().ExtractInstallDir(line);

            session.Log($"ExtractInstallDir extracted path: {path}");

            session["STORJ_INSTALLDIR"] = path;
            return(ActionResult.Success);
        }
Exemplo n.º 2
0
        public static ActionResult ValidateWallet(Session session)
        {
            string wallet = session["STORJ_WALLET"];

            try
            {
                CustomActionRunner.ValidateWallet(wallet);
            } catch (ArgumentException e)
            {
                // Wallet is invalid
                session["STORJ_WALLET_VALID"] = e.Message;
                return(ActionResult.Success);
            }

            // Wallet is valid
            session["STORJ_WALLET_VALID"] = "1";
            return(ActionResult.Success);
        }
Exemplo n.º 3
0
        public static ActionResult ValidateBandwidth(Session session)
        {
            string bandwidthStr = session["STORJ_BANDWIDTH"];

            try
            {
                CustomActionRunner.ValidateBandwidth(bandwidthStr);
            }
            catch (ArgumentException e)
            {
                // Allocated Bandwidth is invalid
                session["STORJ_BANDWIDTH_VALID"] = e.Message;
                return(ActionResult.Success);
            }

            // Allocated Bandwidth value is valid
            session["STORJ_BANDWIDTH_VALID"] = "1";
            return(ActionResult.Success);
        }
Exemplo n.º 4
0
        public static ActionResult ValidateStorageDir(Session session)
        {
            string storageDir = session["STORAGEDIR"];

            try
            {
                CustomActionRunner.ValidateStorageDir(storageDir);
            }
            catch (ArgumentException e)
            {
                // Storage dir is invalid
                session["STORJ_STORAGEDIR_VALID"] = e.Message;
                return(ActionResult.Success);
            }

            // Storage dir is valid
            session["STORJ_STORAGEDIR_VALID"] = "1";
            return(ActionResult.Success);
        }
Exemplo n.º 5
0
        public static ActionResult ValidateIdentityDir(Session session)
        {
            string identityDir = session["IDENTITYDIR"];

            try
            {
                CustomActionRunner.ValidateIdentityDir(identityDir);
            }
            catch (ArgumentException e)
            {
                // Identity dir is invalid
                session["STORJ_IDENTITYDIR_VALID"] = e.Message;
                return(ActionResult.Success);
            }

            // Identity dir is valid
            session["STORJ_IDENTITYDIR_VALID"] = "1";
            return(ActionResult.Success);
        }