#346  Simple 1dev Pages solution
Closed
Artur opened 3 years ago

I am working on something that would allow me to have "Pages" like feature with 1dev.

There is one, relatively simple way to do this, which should not require any modifications or new code in 1dev.

I use https://nginxproxymanager.com to manage redirections and SSL certificates to various websites. With a simple to use and flexible web interface it allows to quickly setup virtual host and redirection for a website or REST API. With Docker container it is easy to setup and maintain, and self-contained system.

It also allows to setup static websites hosted directly from within the Nginx Proxy Manager folder.

This is all we need to have working "1dev Pages" like feature. It is not fully automated and fully controlled from 1dev but it is good enough for most cases.

This is what we need and how this is supposed to work:

  1. 1dev installation
  2. Project with static website sources configured for one of the generators, like Jekyll for example
  3. Build for the generator to generate final static files for the website
  4. A way to copy generated static files from the 1dev build to the web server (NGinx Proxy Manager) specific website folder
  5. Web server (Nginx Proxy Manager) running and configured to serve the website from a specific folder

Of course, for every new static website, we would have to manually configure Nginx Proxy Manager to add the website. But after that, 1dev can generate new build and update the website automatically from the build process.

The only missing piece is point 4. copying static files from the 1dev build process to Nginx Proxy Manager. I have no idea how to do it. Do you have any suggestions?

Artur commented 3 years ago

A simple solution in this case could be a shared folder between Nginx Proxy Manager Docker container and 1dev build runner. Is there a way to run the build runner with mounted specific folder to which the generated website is copied?

Robin Shen commented 3 years ago

How about copying files with scp if the target machine has ssh service enabled. I do this by publishing onedev.io web site previously (primary running a blog service, but shutdown now as I am moving to medium.com), you may check the build spec:

https://code.onedev.io/projects/onedev-website/blob/main/.onedev-buildspec.yml

Also for some website hosting, they offer their own tools to upload content, for instance Heroku allows to upload website content via git push.

Robin Shen changed state to 'Closed' 3 years ago
Previous Value Current Value
Open
Closed
Robin Shen commented 3 years ago

Feel free to reopen if there are further inputs

issue 1 of 1
Type
Question
Priority
Normal
Assignee
Issue Votes (0)
Watchers (3)
Reference
onedev/server#346
Please wait...
Page is in error, reload to recover