Sign in

Changing server type to Git

  • This topic has 33 replies, 8 voices, and was last updated 1 week, 1 day ago by .
Viewing 34 posts - 1 through 34 (of 34 total)
  • Author
    Posts
  • #10970
    Avatar photoPatrick Strahm

    I was looking forward to that change. My blog is hosted on GitHub Pages, and pushing updates through the API generally took a couple of tries. After entering the repository URL, the access token, and everything else in the new Git server configuration, I click the “Test connection” button. The button changes to a “Checking connection,” and nothing else happens. Using the old GitHub Pages server settings, a “Success” popup appears almost instantly.

    #10974
    Avatar photoTomasz Dziuda

    Hi,

    How did you configured repository URL? It is https://github.com/USERNAME/REPOSITORY_NAME.git?

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #10979
    Avatar photoPatrick Strahm

    Tomasz, yes it is. What scopes need to be set for the access token? I’ve given it full control over the repository.

    #10981
    Avatar photoMathias

    Same problem for me.

    As so far, I have not used Github, I started by following your tutorial on this page:

    https://getpublii.com/docs/host-static-website-github-pages.html

    Subsequently, I configured the GIT repository page as mentioned on this page:

    https://getpublii.com/docs/host-static-website-git-repository.html

    Click “Test connection”. Nothing happens. “Check connection” and that’s it.

    I’m surprised that I don’t need to enter the token anywhere. How is that supposed to work?

    #10983
    Avatar photoTomasz Dziuda

    Could you check if sync is working anyway after saving Git settings?

    Also please make sure that your token has full repository access. I had this issue only in one case – when I have created fine-grained token with too low permissions. For classic token it works correctly for me

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #10984
    Avatar photoMathias

    See screenshot.

    Shouldn’t I have to enter my token code somewhere in the Publii configuration?

    #10986
    Avatar photoMathias

    When I sync, Publii gives me no error message; however, nothing is actually uploaded.

    #10990
    Avatar photoTomasz Dziuda

    Well – I know what you probably did – you have entered your Github password instead of the token 🙂 And probably you have enabled 2FA so it won’t work – you must use the token instead 🙂

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #10991
    Avatar photoTomasz Dziuda

    @Patrick Strahm – are you using password or token in the Git configuration under “Password field”?

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #10992
    Avatar photoPatrick Strahm

    Hi Tomasz, I’m using the token since I have 2FA enabled. I can give it a try to save and sync this evening to see if that works.

    #10993
    Avatar photoMathias

    Hi Tomas,

    You were correct about the password, but entering the token ilo my password doesn’t change anything to the situation.

    2FA is not enabled.

    Not sure if this is an issue, but when I go to another website in Publii, return to my Github website in Publii, click “Show Password”, it’s doesn’t show my token anymore, but the text “publii-git-password olb-sjb-malle”. Maybe this is a way of protecting the password?

    Mathias

    #10999
    Avatar photoAlx

    Hello,

    I also just moved from using the GitHub API to the new Git configuration, and when using the ‘Test Connection’, it gets stuck. Saving the settings and trying to sync however works, showing that the configuration works.

    What however I am experiencing is that for some reason it override the GitHub Pages configuration disconnecting it from the custom URL. I repeated it a few times, same thing.

    It’s worth mentioning that I did no changes on the website, just re-synced to verify the connection, and I am not sure why it’s deleting the custom URL in the GitHub Pages settings.

    Anyone has any idea about it?

    Thanks

    #11000
    Avatar photoPatrick Strahm

    I noticed the same as Mathias. When I save my access token in the password field, save the settings, exit the server settings, go back, and click “Show password” the token is gone. Instead, the password field shows “publii-git-password name-of-my-blog”.

    I also tried to sync my website, but the process stopped after compressing the site.

    #11014
    Avatar photosacacitas

    Same as Mathias.

     

    If I try to sync with the password it gives an authentication error and can’t test the connection (it remains as testing indefinitely)

     

    If I put the token, also I can’t test and when I try to sync, it displays “website synced” when in reality it didn’t commit nothing.

     

    Also as Maathias stated, when I put the token or password refresh the server page, it changes the password input to “publii-git-password….”

    #11018
    Avatar photoTomasz Dziuda

    Hi again,

    I have made few fixes:

    1) In fact – after coming back to server settings the password is not displayed – it is a simple bug, but it won’t affect sync process

    2) You get infinite testing due lack of error message output if the connection code fails. But in most cases it means that your authentication data are invalid or token permissions are too low – it will be fixed too and Publii will display an alert for such case

    3) I have also added few additional message – under website URL notice about CNAME files (which should be placed in Tools -> File Manager -> root files) and also label “Password” has been changed to “Password / Token” – the notice about 2FA has been also added as a note under this field

    This release (v.0.44.1) with fixes will be published on Wednesday

    Regarding permissions on Github:

    1) If you are using classic tokens, you must allow use of the repo permissions
    2) For the fine-grained tokens you must add at least read-write access for the “Contents”

    In other cases I got error 403 Forbidden while trying to test connection

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #11019
    Avatar photoJoeGasper

    I’ve successfully switched from the GitHub connector to Git and pushing into GitHub pages using a classic personal access token. I did get tripped up on the CNAME but found a previous forum post on creating the CNAME file and adding to root files. It will be good to see the additional message about the CNAME file and adding “token” to the password field.

    I would recommend not displaying a full token if revealing the text in the password field. PATs bypass 2FA and GitHub doesn’t allow you to see the PAT after it is created – I don’t think Publii should make it that easy either.

    #11038
    Avatar photoBob

    FYI: the new Publii hotfix release v.0.44.1 is available to download: https://getpublii.com/blog/release-044.html#hotfixes

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #11041
    Avatar photoPatrick Strahm

    Awesome! I’ll test it tonight.

    #11055
    Avatar photoPatrick Strahm

    Bummer 🙁. The “Test connection” still fails, and synchronization doesn’t go further than “Compressing objects.”

    #11060
    Avatar photoTomasz Dziuda

    @Patrick Strahm – did you changed the password/token field and resaved the sync settings after updating the app?

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #11066
    Avatar photoPatrick Strahm

    Tomasz, yes I did. I also quit and relaunched the app. I have two entries in Keychain Access (publii-gh-token and publii-git-password), both with the correct access token. After restarting the app and trying to sync, I had to grant Publii Keychain access.

    #11090
    Avatar photoTomasz Dziuda

    Do you have anything under Tools -> Log viewer -> deployment-process/deployment-errors?

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #11092
    Avatar photoPatrick Strahm

    The deployment-errors log has the following:

    (node:89716) NOTE: We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.

    Please migrate your code to use AWS SDK for JavaScript (v3).
    For more information, check the migration guide at https://a.co/7PzMCcy
    (Use `Publii Helper –trace-warnings …` to show where the warning was created)

     

    #11096
    Avatar photoTomasz Dziuda

    It seems to be old log, because it is not the case on Publii v.0.44 – and what about deployment-process.log?

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #11097
    Avatar photoPatrick Strahm

    A couple of CREATE BLOB entries followed by:

    [Thu, 16 Nov 2023 16:40:32 GMT] (i) TRIED AGAIN: (api) => api.gitdata.createTree – undefined

    I did get such an error message once right after reverting to 0.43.1 from 0.44.0. So this may not be recent.

    #11101
    Avatar photoMathias

    Hi,

    I discovered in the log file that the upload was not even trying to upload my site because it thought there were no changes:

    changes exists = false

    So, I intentionally changed something on a page and redeployed. This triggered an error message that my be interesting to look into:

    Git debug: commit done
    [Mon, 20 Nov 2023 11:00:42 GMT] ERROR: PushRejectedError: Push rejected because it was not a simple fast-forward. Use “force: true” to override.

    #11149
    Avatar photoTomasz Dziuda

    @Mathias – please try to remove “output” catalog and create an empty one. BTW – did you changed something on your repository manually?

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #11151
    Avatar photoMathias

    Dear Tomasz,

    Yes! Deleting the “output” directory solved the problem! I can now upload my files and publish my website on GitHub!

    Mathias

    #11170
    Avatar photoPatrick Strahm

    Still no luck whatsoever with 0.44.1. When using Git, it does not move beyond “Compressing objects.” When I switch the server type in 0.44.1 to use the GitHub Pages API, I get a 422 status error. I am currently stuck using 0.43.1.

    #11183
    Avatar photoroshiyal

    Access Token Scope:

    Check if your access token has the necessary scopes. It should have at least “repo” scope for private repositories and “public_repo” for public repositories.
    Repository URL:

    Double-check the repository URL to make sure it is accurate and follows the correct format. It should be in the format: https://github.com/username/repository.
    Firewall or Network Issues:

    Ensure that there are no firewall or network issues preventing the connection. If you are behind a corporate firewall, check if it is blocking the connection.

    #11202
    Avatar photoPatrick Strahm

    One thing I noticed with the output folder. When syncing, the old 0.43.1 wipes and recreates the contents of the folder almost instantly. Nothing happens in 0.44.1. And if I delete it myself, it stays empty.

    #11211
    Avatar photoTomasz Dziuda

    @Patrick Strahm – could you check the contents of the Tools -> Log Viewer -> deployment-process/deployment-errors log files?

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #11228
    Avatar photoroshiyal

    Self-Hosted Git Server:

      <li style=”list-style-type: none;”>
    • If you prefer to host your Git repositories on your own server, you can set up a self-hosted Git server. Git itself does not provide server functionality; you’ll need to use software like Gitolite, Gitea, or GitLab Community Edition for self-hosting.
    • Gitolite: Simple and lightweight Git server.
    • Gitea: A community-managed lightweight code hosting solution.
    • GitLab Community Edition: A more feature-rich Git repository manager.
    #11233
    Avatar photoPatrick Strahm

    @Tomasz Dziuda – the deployment-errors.log is empty. The deployment-process.log only shows CREATE BLOB entries for the page I changed, feed.json, feed.xml, sitemap.xml, and TRIED AGAIN: (api) => api.gitdata.createTree – undefined. That’s from a sync using the GitHub Pages API.

    I changed a page, switched the server type to Git, and tried to sync. I let Publii stay at “Compressing objects” for some time, and when I canceled, the attached error message popped up.

Viewing 34 posts - 1 through 34 (of 34 total)
  • You must be logged in to reply to this topic.