Giter Club home page Giter Club logo

ghost-ssg's People

Contributors

rija avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ghost-ssg's Issues

Add integration tests for the backup and restore process

  • Add a new tests/integration directory and move existing tests to a new `tests/units directory
  • Write a test for the backup process that output a backup with just test data (using the test-server)
  • Write a test that restore the test backup above and assert the content output

Push gssg image from Dockerfile to Docker hub and use that remote image in docker-compose

To reduce our exposure to some types of supply-chain attack on NPM, we won't to freeze the versions of gssg and its dependencies used in our docker compose's gssg container service.
We don't want the Docker image for gssg built from Dockefile to build from whatever is latest verions in NPM.
Similarly, we want to make sure wget is not potentially updated everytime this project is cloned or re-installed.

Therefore, we need to build the Docker image once and push it to Docker hub using a time-based tag.
Then, we use the Docker hub image name and tag in the docker-compose file.

Tasks:

  • Create a public repo on Docker Hub
  • Build from the local Dockerfile and push it to Docker Hub
  • Update Docker compose file to use the remote image

Move Dockerfile out of project root

Dockerfile in root of project repository is a convention for dockerised single command/service and a hint to Github build toolset.
Since we are integration project, and the Dockerfile is just for the dependencies, it's preferable to have it inside a directory.

Add bash scripts to operate the workflow: setup

Create a ./setup bash script to:

  • make an .env file if it does not exist
  • make config file for Ghost if it does not exist
  • create site
  • and stage directories if they do not exist,
  • create directory for git repo of staticpages-hosting forges

Scenarios for creating the git repo that host pages:

  • repo exists remotely, not locally -> create dir, cd and clone remote repo
  • repo exists remotely and locally -> noop
    * [ ] repo doesn't exist remotely, nor locally -> create dir, cd, git init, git commit and git push (see last point)
  • repo doesn't exist remotely, exists locally -> noop
  • Update README.md to indicate that the remote repo needs to have been created beforehand

Link to homepage on posts is incorrect when previewed locally

Describe the bug

When navigating to localhost:9999 after running preview, the link to the thomepage on top of each post is incorrect

To Reproduce
Steps to reproduce the behavior:

  1. run the ./preview command to generate static web pages for local preview
  2. Navigate to any post on localhost:9999
  3. Click on the logo on the top-left corner (Pomme::TAB)

Expected behavior

The browser takes you to the home page at localhost:9999

Actual behavior

The click reload the current page, and the url associated with the logo is the post's URL

Screenshots
If applicable, add screenshots to help explain your problem.

Your environment (please complete the following information):

  • OS and version
  • Version of Docker
  • Version of Bash
  • macOS Ventura 13.2
  • Docker version 20.10.14, build a224086
  • GNU bash, version 3.2.57(1)-release (arm64-apple-darwin22)

Output of diagnostics scripts

./whatsup
./versions
>./whatsup                                                                                                                                                                                                         0.649s (main) 15:52
       Name                      Command               State           Ports         
-------------------------------------------------------------------------------------
ghost-ssg_editor_1    docker-entrypoint.sh node  ...   Up      0.0.0.0:2368->2368/tcp
ghost-ssg_preview_1   /docker-entrypoint.sh ngin ...   Up      0.0.0.0:9999->80/tcp  
~/c/ghost-ssg>./versions                                                                                                                                                                                                        0.579s (main) 15:53
Creating ghost-ssg_version_run ... done
gssg:
1.1.4
wget:
GNU Wget 1.21.3 built on linux-musl.
Node:
v19.4.0
NPM:
9.2.0
     Container        Repository        Tag          Image Id       Size  
--------------------------------------------------------------------------
ghost-ssg_editor_1    ghost        4.48.8-alpine   3a38d695a154   481.5 MB
ghost-ssg_preview_1   nginx        1.23.3-alpine   0a36350238fb   40.28 MB

Additional context
Add any other context about the problem here.

Make a first release

Now that the backup/restore is operational, we can tag a new release: v1.0.0:

  • tag a release in git
  • add a CHANGELOG.md

Setup a test server

  • Add a test-server container service in docker-compose.yml, identical to editor but without volume mount
  • update the test bug-19-homepage-link-empty.bats to switch from editor to test-server before and after the test

Add a security policy

Add a SECURITY.md document to inform security researchers what to do with issues they find

Update CONTRIBUTING.md to encourage use of commit template and editorconfig

  • Commit Template:
<type>[optional scope]: <description> (What?, must start with present tense verb)

[begin optional body]
Why?

How?

Dependencies?
(If this commit is part of a bigger change that required multiple commits, specify the commit hash of the previous commit for that change)

[end optional body]

[optional footer(s)]
  • .editorconfig
# EditorConfig is awesome: https://EditorConfig.org
root = true

[*]
end_of_line = lf
insert_final_newline = true
charset  = utf-8

[{**.*sh,setup,preview,publish,up,down,versions,log,test,whatsup,**.bats}]
indent_size = tab
indent_style = tab
trim_trailing_whitespace = true


[**.bats]
indent_size = tab
indent_style = tab
trim_trailing_whitespace = true

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.