surge icon indicating copy to clipboard operation
surge copied to clipboard

Surge Teardown Not Working

Open febreroinfo opened this issue 7 years ago • 11 comments

I've mistakenly created a project with an invalid domain name. I'm trying to tear it down but was unsuccessful.

The domain name when I ran surge list

sl

The result when I ran surge teardown

st

Is there anyway I can tear down the project with the invalid name? I tried several times but was unsuccessful.

febreroinfo avatar Sep 18 '17 18:09 febreroinfo

@febreroinfo it looks like this is something @sintaxi will have to do in the backend

brandonb927 avatar Nov 02 '17 16:11 brandonb927

Thanks @brandonb927. @sintaxi will you be able to assist regarding this matter? It would be greatly appreciated.

febreroinfo avatar Dec 28 '17 06:12 febreroinfo

I have the same issue, can the cli allow space in the input? \ or quoted by single/double quote

beenotung avatar Mar 17 '18 20:03 beenotung

in the latest version of surge list, I see an id beside the domain name, I tried to teardown the site using the id but it raise an error

surge teardown 1477261572142

assert.js:41
  throw new errors.AssertionError({
  ^

AssertionError [ERR_ASSERTION]: 'number' == 'string'
    at parse (/home/beenotung/.config/yarn/global/node_modules/url-parse-as-address/index.js:9:10)
    at Object.exports.validDomain (/home/beenotung/.config/yarn/global/node_modules/surge/lib/middleware/util/helpers.js:446:56)
    at module.exports (/home/beenotung/.config/yarn/global/node_modules/surge/lib/middleware/domainOrSilent.js:29:15)
    at next (/home/beenotung/.config/yarn/global/node_modules/surge/lib/middleware/util/skin.js:20:11)
    at exports.suggestDomainFromCname (/home/beenotung/.config/yarn/global/node_modules/surge/lib/middleware/discovery.js:20:10)
    at next (/home/beenotung/.config/yarn/global/node_modules/surge/lib/middleware/util/skin.js:20:11)
    at exports.setDomainFromArgs (/home/beenotung/.config/yarn/global/node_modules/surge/lib/middleware/discovery.js:45:10)
    at next (/home/beenotung/.config/yarn/global/node_modules/surge/lib/middleware/util/skin.js:20:11)
    at module.exports (/home/beenotung/.config/yarn/global/node_modules/surge/lib/middleware/shorthand.js:7:3)
    at next (/home/beenotung/.config/yarn/global/node_modules/surge/lib/middleware/util/skin.js:20:11)

beenotung avatar Mar 17 '18 20:03 beenotung

Hello, I have the same problem on this date.

I launch a new surge command by following the video on the surge presentation and I inadvertently create a domain that can not be removed : image

image

I tried to use :

  • ID but we only can use string in the teardown command
  • \ & %20 for the space nothing work

I hope this will help you

Craaftx avatar Feb 26 '19 09:02 Craaftx

I think I found the problem, the Teardown command detects: rich-mass.surge.sh and new-oms-website.surge.sh as two parameters.

For the moment, it's bad, but I deleted the false domain by hard-coding the name in teardown.js on line 45: return remove(parseUrl(req.domain).host) to return remove("rich-mass.surge.sh new-oms-website.surge.sh")

I think to solve this error, we can:

  • Ban spacing in domain name
  • Update teardown to incorporate use of a character string or domain id

👋

Craaftx avatar Feb 26 '19 10:02 Craaftx

I think it's better not to bad domain with space in the teardown command, as there exists such records. It may be better to allow deleting domain with space like surge teardown "a b c.surge"; allowing to delete by ID is also good

beenotung avatar Feb 26 '19 14:02 beenotung

@Craaftx thanks your suggestion, hard-coding works best for me in the one-time situation.

beenotung avatar Feb 26 '19 14:02 beenotung

hey just thought I'd tie a few of these together also discussed: #230

huwd avatar May 14 '19 13:05 huwd

If you typed it in one line like "surge teardown domain.surge.sh", try typing "surge" first and a prompt for the domain name will show.

jwilld avatar Mar 23 '20 21:03 jwilld

I also had this problem of weird domain registered in surge accidentally somehow

1539668485543 document.body.style.visibility = "hidden"; 2 years ago surge surge.sh Standard

Finally, @Craaftx 's solution of hard coding the url worked to remove the weird domain 'document.body.style.visibility = "hidden";'

I URL encoded and hard coded into the teardown.js

return remove("document.body.style.visibility%20%3D%20%22hidden%22%3B")

Now I got rid of that weird domain url and got the Success message for the removal of it. Note: surge teardown url (url doesn't matter as it is hardcoded as long as the function accepts it) Also I immediately reverted the code back to original (return remove(parseUrl(req.domain).host) ) after successful teardown.

`surge teardown "document.body.style.visibility%20%3D%20%22hidden%22%3B"

Success - document.body.style.visibility%20%3D%20%22hidden%22%3B has been removed.`

I also vote for teardown by id:

surge teardown 1539668485543

CharlesKumar avatar Dec 12 '20 05:12 CharlesKumar