Changing server type to Git
-
November 12, 2023 at 9:31 am #10970[anonymous]
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.
November 12, 2023 at 8:47 pm #10974[anonymous]Hi,
How did you configured repository URL? It is https://github.com/USERNAME/REPOSITORY_NAME.git?
November 13, 2023 at 6:31 am #10979[anonymous]Tomasz, yes it is. What scopes need to be set for the access token? I’ve given it full control over the repository.
November 13, 2023 at 10:27 am #10981[anonymous]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?
November 13, 2023 at 10:35 am #10983[anonymous]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
November 13, 2023 at 10:39 am #10984[anonymous]See screenshot.
Shouldn’t I have to enter my token code somewhere in the Publii configuration?
November 13, 2023 at 10:54 am #10986[anonymous]When I sync, Publii gives me no error message; however, nothing is actually uploaded.
November 13, 2023 at 11:18 am #10990[anonymous]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 🙂
November 13, 2023 at 11:19 am #10991[anonymous]@Patrick Strahm – are you using password or token in the Git configuration under “Password field”?
November 13, 2023 at 11:24 am #10992[anonymous]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.
November 13, 2023 at 11:28 am #10993[anonymous]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
November 13, 2023 at 1:12 pm #10999[anonymous]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
November 13, 2023 at 6:45 pm #11000[anonymous]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.
November 14, 2023 at 5:03 pm #11014[anonymous]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….”
November 15, 2023 at 12:28 am #11018[anonymous]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
November 15, 2023 at 4:09 am #11019[anonymous]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.
November 16, 2023 at 11:41 am #11038BobFYI: the new Publii hotfix release v.0.44.1 is available to download: https://getpublii.com/blog/release-044.html#hotfixes
November 16, 2023 at 1:28 pm #11041[anonymous]Awesome! I’ll test it tonight.
November 16, 2023 at 5:53 pm #11055[anonymous]Bummer 🙁. The “Test connection” still fails, and synchronization doesn’t go further than “Compressing objects.”
November 16, 2023 at 7:32 pm #11060[anonymous]@Patrick Strahm – did you changed the password/token field and resaved the sync settings after updating the app?
November 17, 2023 at 7:01 am #11066[anonymous]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.
November 18, 2023 at 11:57 pm #11090[anonymous]Do you have anything under Tools -> Log viewer -> deployment-process/deployment-errors?
November 19, 2023 at 9:36 am #11092[anonymous]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)November 19, 2023 at 4:04 pm #11096[anonymous]It seems to be old log, because it is not the case on Publii v.0.44 – and what about deployment-process.log?
November 20, 2023 at 7:58 am #11097[anonymous]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.
November 20, 2023 at 12:04 pm #11101[anonymous]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.November 27, 2023 at 10:03 pm #11149[anonymous]@Mathias – please try to remove “output” catalog and create an empty one. BTW – did you changed something on your repository manually?
November 27, 2023 at 10:22 pm #11151[anonymous]Dear Tomasz,
Yes! Deleting the “output” directory solved the problem! I can now upload my files and publish my website on GitHub!
Mathias
November 28, 2023 at 7:49 pm #11170[anonymous]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.
November 29, 2023 at 3:37 pm #11183[anonymous]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.
November 30, 2023 at 9:17 am #11202[anonymous]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.
November 30, 2023 at 10:10 pm #11211[anonymous]@Patrick Strahm – could you check the contents of the Tools -> Log Viewer -> deployment-process/deployment-errors log files?
December 1, 2023 at 4:56 pm #11228[anonymous]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.
December 1, 2023 at 6:04 pm #11233[anonymous]@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.