Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish to a hosting directly #691

Closed
3 of 5 tasks
lexoyo opened this issue Feb 17, 2018 · 65 comments
Closed
3 of 5 tasks

Publish to a hosting directly #691

lexoyo opened this issue Feb 17, 2018 · 65 comments

Comments

@lexoyo
Copy link
Member

lexoyo commented Feb 17, 2018

Silex publication is a process to clean up and optimize the site, then it put the result in the target folder chosen in the settings.

We should be able to choose a hosting company directly in silex and publish to a domain name instead of a folder, e.g. choose Gandi.net then one of the user's domain name then publish.

There is also @pierreozoux 's indie hosters, Github pages, Heroku, and others from the Jekyll deployment methods

It would be smart I guess to create a separate project for this

Providers

  • github pages
    • CNAME file contains the domain name, let the user edit it
    • connect with oauth if not connected in CE2
    • maintain a list of websites in a repo (.websites/master/websites.json) or list all repos?
    • choose a site for publish or add one
  • indie hosters
    • CNAME file contains the domain name, let the user edit it
    • connect with webdav (or oauth?) if not connected in CE2
    • only one website, has to have a name or custom domain name in CNAME
    • choose a site for publish or add one
  • netlify or others from this list
    • connect with oauth
    • get the list of websites from the API
    • yet to figure out: attach a domain name to the chosen site
  • folder
    • choose a folder in CE, this is the current behaviour
    • add a "website URL"
  • Jekyll
    • choose a folder in CE with a jekyll site
    • publish the site as multiple jekyll layouts (each silex page = a jekyll layout)

Features offered by providers

  • upload files to the service
  • attach a domain name
  • get the website URL so that Silex can
  • (maybe ?) get a list of "vhosts" or websites to publish to
@lexoyo lexoyo added this to the Better publication milestone Feb 17, 2018
@lexoyo lexoyo added the feature label Feb 17, 2018
@pierreozoux
Copy link
Contributor

Ok, yes, I think it would make sense from a user perspective to have an action "publish" that is straight forward!

In our case, we use Nextcloud/webdav to integrate with silex.

In term of ux, it would be just a bit of cosmetic to improve the user experience from "target folder" to "publish".

To choose the website-name, we have something stupid for now, just a website-name.txt at the root.
You either put a name, and your website get published on https://site.indie.host/myname, or a real domain name, and we take care or wiring it.

So if we think a bit more meta, Indie help people with webdav to publish their website.
If, as a "publisher provider" we could define this for the end user:

  • folder where to publish (in our case, Website)
  • default url (https://site.indie.host)
  • agree on the way to define website url on a default one or a personal domain name

Then we would have a slick "publish" experience!

@lexoyo
Copy link
Member Author

lexoyo commented Feb 19, 2018

Interesting!

I guess the website-name.txt is ok for now

We would then do a "Indie Hosters" publish target, with the hard coded values

Is it possible to access to the user's webdav or FTP with oauth? This would allow the user to connect to indie hosters and not memorize the ftp/webdav login/pass, and also to avoid your users to give Silex the password

@pierreozoux
Copy link
Contributor

Actually, you don't even need to purchase :) We have a free account, and you have 50MB, which should be enough to get started.

Yes, oauth is in Nextcloud now. If you need help on the implementation, I can either help myself, or ask the relevant person on Nextcloud side :)

@lexoyo
Copy link
Member Author

lexoyo commented Feb 19, 2018

Oh wow cool!! Did you hear that @JbIPS ? :D

The credentials would be the same as Indie Hosters account?

@pierreozoux
Copy link
Contributor

I could create the oauth2 creds for you

@lexoyo
Copy link
Member Author

lexoyo commented Feb 20, 2018

👍

@lexoyo
Copy link
Member Author

lexoyo commented Apr 13, 2018

Note for the GitHub pages service: there is an API to monitor progress and get the final URL where the website is accessible
https://developer.github.com/v3/repos/pages/

@lexoyo
Copy link
Member Author

lexoyo commented Apr 27, 2018

Cédric alias arti de Gandi.net me conseille de regarder ca
https://www.domainconnect.org/

It's kind of game changing for how the users can connect their domain name

@JbIPS
Copy link
Contributor

JbIPS commented Apr 27, 2018

That's awesome! It's like the Unifile of DNS! We definitely have to look at that

@lexoyo
Copy link
Member Author

lexoyo commented Jul 24, 2018

Hi guys
@pierreozoux did you play with domain connect? Will you have time this summer? We could set some goals together with you and @JbIPS maybe?

@pierreozoux
Copy link
Contributor

@lexoyo I checked quickly this "domain connect" but didn't see big support in the wild.
(And I don't have much time :/ )

@lexoyo
Copy link
Member Author

lexoyo commented Aug 31, 2018

Hello
Here is a WIP for a POC of this feature, it doesn't work yet, just some code to illustrate what I think we should do
https://github.com/lexoyo/Silex/pull/11/files
cc @Godzone

@lexoyo
Copy link
Member Author

lexoyo commented Aug 31, 2018

The idea is to have a route which serves a list of available hosting providers for the Silex instance
When the user start to publish a website, then he should first choose a hosting provider (automatic if there is only one), then a "vhost" (the folder where to publish, automatic if there is only one)

@lexoyo
Copy link
Member Author

lexoyo commented Sep 7, 2018

My proof of concept seems to work, could you try and tell me what you think @pierreozoux @clemos @Godzone ?
https://silex-test-tmp.herokuapp.com/

Here is a test you can do:

  • open a template
  • save the template in a github repo
  • publish the template on github pages, in the same repo or another one

publish-to-hosting

Please tell me if you understand how to publish to an FTP or any folder as it used to be the normal use case?

@ghost
Copy link

ghost commented Sep 7, 2018 via email

@lexoyo
Copy link
Member Author

lexoyo commented Sep 7, 2018

Ok thx for testing!!!

The FTP issue should be fixed, maybe @JbIPS you could check that you fix is live?

Concerning the options and customizations, there are some already which you can check here (the providers will be dynamic at one point just like unifile services and you will provide yours only on the instance you host)
https://github.com/lexoyo/Silex/pull/11/files#diff-2441e71448e68a2711be36675f323e5f

As you can see the hosting providers have the ability to

  • Skip the selection of a provider or vhost or domain
  • Provide a link to buy the domains (I had your use case in mind ;) )
  • Provide text and link to create new vhost

A few questions for you Glen and others maybe

  • Are the concepts of hosting providers and vhost clear and useful?
  • Did you understand the user experience?

@ghost
Copy link

ghost commented Sep 7, 2018 via email

@lexoyo
Copy link
Member Author

lexoyo commented Sep 10, 2018

When we setup a site it gets its own folder and corresponding user and is configured as a vHost on our Apache web servers. Whilst we have several people who have created websites in subfolders, they are accesses via a parent domains URL e.g. http://www.domain/webste1/ etc.

ok, so this is also covered in my opinion but I would consider it an advanced option, one would have to select "use website settings", which would open the publish settings where the user can select a folder with cloud explorer. What do you think?

screenshot from 2018-09-10 13-29-54

@lexoyo
Copy link
Member Author

lexoyo commented Sep 11, 2018

@Godzone I think I will replace "use website settings" by "Choose a folder", and then when the user presses "next" i will display a "browse" button which will open CE

@ghost
Copy link

ghost commented Sep 11, 2018 via email

@lexoyo
Copy link
Member Author

lexoyo commented Sep 11, 2018

There are 2 different branches which concern your use case, I will soon merge them to continue on one of them

Publish to a hosting directly:

  • this is the solution with hosting providers, I started with the more complex case of github pages
  • let the user choose a provider, a vhost and attach a domain name (all this is can be done automatically with config)
  • it is on the branch publish_to_hosting of my repo lexoyo/Silex
  • git remote add lexoyo git@github.com:lexoyo/Silex.git && git fetch && git checkout lexoyo/publish_to_hosting && npm i

Silex config

  • the idea is to have a separate repository, with Silex as a npm dependency
  • discussed here
  • the branch silex_as_a_dependency of my repo lexoyo/Silex

I have started a wiki page with content about these issues
https://github.com/silexlabs/Silex/wiki/Silex-for-hosting-providers

@lexoyo
Copy link
Member Author

lexoyo commented Sep 12, 2018

here is an example of a custom Silex integration
it works with my silex_as_a_dependency branch only (so either change package.json or use npm link to test it for now)

@lexoyo
Copy link
Member Author

lexoyo commented Dec 4, 2018

Hi!
Is there someone who could test the first step of this development?
It is available on preprod now
You need to open a website or a template, save it somewhere and then click publish in the "cloud" menu

@lexoyo
Copy link
Member Author

lexoyo commented Dec 4, 2018

It looks like this, there are several steps and options
screenshot from 2018-12-04 13-43-41

@lexoyo
Copy link
Member Author

lexoyo commented Dec 20, 2018

Hi
Did anyone test how it works? https://preprod.silex.me/
Publication to a folder is the same as publication used to be
Publication to github pages is the first hosting provider, and it handles the build phase by github pages, and custom domains
cc @ceubri @Godzone @BaguetteAgile @David1platt

@lexoyo
Copy link
Member Author

lexoyo commented Feb 24, 2019

@Godzone I took some time to make a complete example with code and documentation

Here it is, in the same repo as before: https://github.com/lexoyo/silex-for-hosting-company

Could you read the readme and tell me what you think? Feel free to fork it and propose changes

First you will need implement a custom authentication strategy here

Also I remember you have a notion of multiple accounts for each user, so I would suggest that you do this

  • add a level to the custom service so that your users can choose to which account they want to save/load website
  • change the hosting provider so that it asks the user to which account he wants to publish (use vhosts)

We still need to figure out (cc @JbIPS )

  • where to add the logic of user ownership

@lexoyo
Copy link
Member Author

lexoyo commented Feb 24, 2019

Oh and could you open a new issue for your specif case please

@ghost
Copy link

ghost commented Mar 6, 2019 via email

@lexoyo
Copy link
Member Author

lexoyo commented Mar 6, 2019

I have got the service side sort of working

great! is it based on my my example? on fs service?

but when I try to publish, I get this error. I haven’t modified your custom-provider.js code as I assumed it would at least do something albeit not what I want.

It is strange, it is defined here

I just tried with your fork and it works, it does publish to /Website

I am not using vHosts so that part needs to be a null op in my case.

you need to publish somewhere, where do you want to publish?

@ghost
Copy link

ghost commented Mar 6, 2019 via email

@lexoyo
Copy link
Member Author

lexoyo commented Mar 9, 2019

Glen could you make it?
Can you try and see if the project works without your modifications?

@ghost
Copy link

ghost commented Mar 9, 2019 via email

@lexoyo
Copy link
Member Author

lexoyo commented Mar 9, 2019 via email

@ghost
Copy link

ghost commented Mar 9, 2019 via email

@lexoyo
Copy link
Member Author

lexoyo commented Mar 10, 2019

did you delete "node_modules" and do "npm install" again?
because i just tried with 8.15 and it works

@ghost
Copy link

ghost commented Mar 10, 2019 via email

@lexoyo
Copy link
Member Author

lexoyo commented Mar 10, 2019 via email

@lexoyo
Copy link
Member Author

lexoyo commented Mar 10, 2019 via email

@ghost
Copy link

ghost commented Mar 10, 2019 via email

@ghost
Copy link

ghost commented Mar 24, 2019 via email

@lexoyo
Copy link
Member Author

lexoyo commented Mar 24, 2019

Hi
Can you describe the steps you want the user to take when publishing?
Even if it is
1- click publish
2- publish to ~/
3- display the URL of the website

@lexoyo
Copy link
Member Author

lexoyo commented Mar 24, 2019

Or maybe one more step after 1- could be "let the user choose a directory with ~/ as root in the file explorer"

Or "display a list of accounts in a drop-down list"

@ghost
Copy link

ghost commented Mar 24, 2019 via email

@lexoyo
Copy link
Member Author

lexoyo commented Mar 24, 2019

Ok this is possible by changing the config and hosting provider, I'll explain soon how

The websites made with a previous version are upgraded and the user is warned. Nothing is permanent until the website is saved. This is handled by the BackwardCompat class

@lexoyo
Copy link
Member Author

lexoyo commented Mar 25, 2019

Ok, is this how you want it?

1st click on publish:

custom silex publish

2nd click on publish:

custom silex publish 2nd time

This is what I changed to the custom hosting provider code:
https://github.com/godzone/silex-for-hosting-company/pull/1/files

@lexoyo
Copy link
Member Author

lexoyo commented Mar 25, 2019

explanation for these changes:

  • skipFolderSelection: false=> let the user choose a folder (root is decided by the custom unifile service)
  • afterPublishMessage => custom message for after publication
  • skipDomainSelection: true => do not ask for a domain name
  • skipVhostSelection: true => do not ask the user to shoose a "vhost" or "account" or what you want in a dropdown list

@ghost
Copy link

ghost commented Mar 25, 2019 via email

@lexoyo
Copy link
Member Author

lexoyo commented Mar 25, 2019 via email

@ghost
Copy link

ghost commented Mar 26, 2019 via email

@ghost
Copy link

ghost commented Mar 26, 2019 via email

@lexoyo
Copy link
Member Author

lexoyo commented Mar 26, 2019

Here in your code (comes from mine) it is creating the folder named Website when you login
https://github.com/godzone/silex-for-hosting-company/blob/master/custom-service.js#L55

And here it is forcing the publish process to publish in Website
https://github.com/godzone/silex-for-hosting-company/blob/master/custom-provider.js#L32

@ghost
Copy link

ghost commented Mar 26, 2019 via email

@silexlabs silexlabs locked and limited conversation to collaborators Nov 30, 2022
@lexoyo lexoyo converted this issue into discussion #1256 Nov 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants