Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

New git sync removes github custom domain

  • #11001
    Avatar photo[anonymous]

    Hi, the new sync method seems to remove custom domains from github pages.

    Your custom domain is stored inside a file called CNAME in the root of the repository. When syncing the site to github, that that file is removed again and the custom domain no longer works. As a workaround, the custom domain can be set again after synchronizing.

    However, publii should either merge, ignore or create that file on it’s own (untested).

    Thank you very much for pulii!!!

    Kind regards, JΓΆrg

    #11004
    Avatar photo[anonymous]

    Hi,

    Did you tried to put CNAME file under Tools -> File Manager -> root files? πŸ™‚

    #11006
    Avatar photo[anonymous]

    Hey Tomasz,

    this works!

    Thanks a lot!

    #11007
    Avatar photo[anonymous]
    Tomasz Dziuda wrote:

    Hi,

    Did you tried to put CNAME file under Tools -> File Manager -> root files? πŸ™‚

    Hello, I tried this and:

    • when looking at the GitHub pages settings, the custom domain is removed, though the CNAME file is there.
    • the first syncing worked, but only for the home page: all other links of the main navigation menu gave a 404 github page error.
    • I reconnected the custom domain, copied the CNAME file again, and tried a second time, but this time did not work altogether.

    Also, before copying the CNAME file, the website was displayed in plain html, completely ignoring any CSS, which instead was restored as soon as the custom domain is reconnected. I also noticed that some elements aren’t visualised properly, like the back-to-top button in the first picture (online home) instead of the back-to-top button in the second picture (local preview), where you can see the little arrow.

    I’m not sure if I am doing something wrong

    Thank you

    Alex

    #11010
    Avatar photo[anonymous]

    … all other links of the main navigation menu gave a 404 github page error…

    …plain html, completely ignoring any CSS…

    This sound a lot like problem with the website-url and or the relative links setting.

    #11011
    Avatar photo[anonymous]

    Yes, but it’s worth to clarify that it happened just when I sync the website through the Git sync, and all URLs are restored as I relink the custom domain to GitHub pages in the repository settings.

    #11016
    Avatar photo[anonymous]

    @Alx – to be honest – I do not understand πŸ™‚ Did you put CNAME file under root files in the Tools -> File Manager?

    Then your custom domain should work without any issues. Previous configuration was working with Github Pages, because Github Pages could ignore some files – now Publii has full control over the repository content so if CNAME file not exists in your Publii files, then it will be removed/not synced

    #11023
    Avatar photo[anonymous]

    Hello Tomasz,

    Tomasz Dziuda wrote:

    @Alx – to be honest – I do not understand πŸ™‚

    Sorry if I haven’t explained myself, I’m puzzled about it too.

    Tomasz Dziuda wrote:

    … Did you put CNAME file under root files in the Tools -> File Manager?

    yes I did. I downloaded the CNAME file from the repo and uploaed in the root file manager in Publii, then I synced it again to see if it was working, but it worked only for the home page. I tried a second sync, and despite the CNAME file being there, when I tried to see the website, it gave me a 404 github error for the whole website.

    For now, I deleted the CNAME file in the file manager and simply relinked on the GitHub pages settings; the website is working fine again (but with some rendering errors like the back to top button in the pictures I shared before)

    I have some content updates to do today, so I can retry putting the current CNAME file in the file manager again and see what happens.

    #11042
    Avatar photo[anonymous]

    Hello,

    I downloaded and installed the new release, but the problem persists. I’m attaching some screenshots. Also the ‘test connection’ still remain stuck. I’m on Windows 11, version 23H2.

    Thank you for your patience.

    Alx

    #11047
    Avatar photo[anonymous]

    @Alx – your issue is connected with fact that the file must be named CNAME not CNAME.txt – you are adding unnecessary *.txt extension what probably causes your issue

    #11050
    Avatar photo[anonymous]

    Yes, I notice it now, though I think the .txt was automatically generated. Unfortunately, now that I’m trying to see if it work, it gives me a push error. I’ll try to reconfigure it, or I might just switch to Netlify.

    #11052
    Avatar photo[anonymous]

    I just want to add that I tried to reconfigure the Git server, generated a new token, and

    • test connection still stuck
    • it says it syncs, but it actually doesn’t.
    #11059
    Avatar photo[anonymous]

    @Alx – are you using v.0.44.1 or v.0.44.0?

    did you renamed CNAME file under File Manager or in the output files?

    #11061
    Avatar photo[anonymous]

    Hello Tomasz,

    are you using v.0.44.1 or v.0.44.0?

    v.0.44.1

    did you renamed CNAME file under File Manager or in the output files?

    I renamed the CNAME (removing the extension .txt) in the download folder when downloading it from GitHub.

    But as I said, I don’t know if the CNAME file has any problem, because at the moment Publii is not updating (though it says it synced successfully, but nothing happens in GitHub).

    I’m sorry for all those messages, and I really appreciate you coming back to me. I’m a bit puzzled.

    #11063
    Avatar photo[anonymous]

    Please try to do as following:

    1) Put CNAME file under My Documents/Publii/sites/YOUR_SITE_NAME/input/root-files/

    2) Please remove totally folder My Documents/Publii/sites/YOUR_SITE_NAME/output

    3) Please create empty folder “output”: My Documents/Publii/sites/YOUR_SITE_NAME/output

    Then please try to resync your website

    #11080
    Avatar photo[anonymous]

    Hello Tomasz,

    thank you for being so helpful, unfortunately I think there is an issue with the sync.

    I followed all your instructions, and synced again. The new “output” folder has been repopulated, and Publii seemed to run the sync successfully (no error message). But when I go to GitHub, no action is performed.

    #11087
    Avatar photo[anonymous]

    @Alx – I suppose that you have some deeper issue with your permissions – do you have anything under Tools -> Log viewer -> deployment-process/deployment-errors?

    #11104
    Avatar photo[anonymous]

    Hello Tomasz,

    deployment-process.log:

    a list of

    Git debug: add =

    for all pages/media/docs/files etc.

    last lines:

     Git debug: git add done 
     Git debug: changes exists = false

    deployment-errors.log

    The log file is empty...

    Thank you,

    Alx

    #11120
    Avatar photo[anonymous]

    Seems the files in root folder are taken as folders

    Rendering process failed
    An error occurred during rendering process:

    ENOTDIR: not a directory, open ‘/Users/lgirardi/Documents/Publii/sites/lab/preview/CNAME/index.html’

    #11123
    Avatar photo[anonymous]

    Hello, Alx again.

    As GitHub doesn’t update and I need to keep going in building this website, I decided to switch to Netlify. I connected the new site (without the custom domain for now as it was a trial) but when I sync the website, at the end of the upload process it says it can’t connect to the server.

    Here what it says in the deployment-prcess.log

    [Thu, 23 Nov 2023 14:43:34 GMT] Netlify ERROR: false

    When I do the test connection with the server the result is successful.

    I’m a bit puzzled at the moment, especially because I also bought a theme and plugins, and I really like Publii, so I am reluctant to switch to other CMS.

    #11124
    Avatar photo[anonymous]

    Alx – I will analyse the issues with Git in nearest days. As a temporary solution you can use manual deployment and upload generated ZIP package to Netlify directly through their UI

    #11125
    Avatar photo[anonymous]

    Hello Tomasz,

    thank you for your swift reply.

    As a trial, I decided to clone the website and try to redeploy with Git and the CNAME file in the root folder. It worked, updated, maintained the custom domain name.

    I’ll keep the Neflify option as a backup plan for now, though.

    Waiting for more updates, and thank you a lot for all the support.