[release] v0.9.0-unstable10

This commit is contained in:
Yann Stepienik 2023-07-04 11:52:38 +01:00
parent 9960a37b03
commit cb4319bee0
6 changed files with 39 additions and 20 deletions

View file

@ -30,7 +30,7 @@ const NewRouteCreate = ({ openNewModal, setOpenNewModal, config }) => {
const routes = config.HTTPConfig.ProxyConfig.Routes || [];
return <>
<RestartModal openModal={openRestartModal} setOpenModal={setOpenRestartModal} config={config} />
<RestartModal openModal={openRestartModal} setOpenModal={setOpenRestartModal} config={config} newRoute />
<Dialog open={openNewModal} onClose={() => setOpenNewModal(false)}>
<DialogTitle>New URL</DialogTitle>
{openNewModal && <>

View file

@ -34,27 +34,46 @@ function checkIsOnline() {
});
}
const RestartModal = ({openModal, setOpenModal, config}) => {
const RestartModal = ({openModal, setOpenModal, config, newRoute }) => {
const [isRestarting, setIsRestarting] = useState(false);
const [warn, setWarn] = useState(false);
const needsRefresh = config && (config.HTTPConfig.HTTPSCertificateMode == "SELFSIGNED" ||
!isDomain(config.HTTPConfig.Hostname))
const isNotDomain = config && !isDomain(config.HTTPConfig.Hostname);
const newRouteWarning = config.HTTPConfig.HTTPSCertificateMode == "LETSENCRYPT" && newRoute &&
!config.HTTPConfig.DNSChallengeProvider;
return config ? (needsRefresh && <>
<Dialog open={openModal} onClose={() => setOpenModal(false)}>
<DialogTitle>Refresh Page</DialogTitle>
<DialogContent>
<DialogContentText>
You need to refresh the page because you are using a self-signed certificate, in case you have to accept any new certificates. To avoid it in the future, please use Let's Encrypt. {isNotDomain && 'You are also not using a domain name, the server might go offline for a few seconds to remap your docker ports.'}
</DialogContentText>
</DialogContent>
<DialogActions>
<Button onClick={() => {
window.location.reload(true);
}}>Refresh</Button>
</DialogActions>
</Dialog>
return config ? (<>
{needsRefresh && <>
<Dialog open={openModal} onClose={() => setOpenModal(false)}>
<DialogTitle>Refresh Page</DialogTitle>
<DialogContent>
<DialogContentText>
You need to refresh the page because you are using a self-signed certificate, in case you have to accept any new certificates. To avoid it in the future, please use Let's Encrypt. {isNotDomain && 'You are also not using a domain name, the server might go offline for a few seconds to remap your docker ports.'}
</DialogContentText>
</DialogContent>
<DialogActions>
<Button onClick={() => {
window.location.reload(true);
}}>Refresh</Button>
</DialogActions>
</Dialog>
</>}
{newRouteWarning && <>
<Dialog open={openModal} onClose={() => setOpenModal(false)}>
<DialogTitle>Certificate Renewal</DialogTitle>
<DialogContent>
<DialogContentText>
You are using Let's Encrypt but you are not using the DNS Challenge. This means the server has to renew the certificate everytime you add a new hostname, causing a few seconds of downtime. To avoid it in the future, please use the DNS Challenge.
</DialogContentText>
</DialogContent>
<DialogActions>
<Button onClick={() => {
setOpenModal(false);
}}>OK</Button>
</DialogActions>
</Dialog>
</>}
</>)
:(<>
<Dialog open={openModal} onClose={() => setOpenModal(false)}>

View file

@ -96,7 +96,7 @@ const NewDockerService = ({service, refresh}) => {
return <div style={{ maxWidth: '1000px', width: '100%', margin: '', position: 'relative' }}>
<MainCard title="Create Service">
<RestartModal openModal={openModal} setOpenModal={setOpenModal} config={config} />
<RestartModal openModal={openModal} setOpenModal={setOpenModal} config={config} newRoute />
<Stack spacing={1}>
{!isDone && <LoadingButton
onClick={create}

View file

@ -127,7 +127,7 @@ const ServApps = () => {
}
return <div>
<RestartModal openModal={openRestartModal} setOpenModal={setOpenRestartModal} config={config} />
<RestartModal openModal={openRestartModal} setOpenModal={setOpenRestartModal} config={config} newRoute />
<ExposeModal
openModal={openModal}
setOpenModal={setOpenModal}

View file

@ -1,6 +1,6 @@
{
"name": "cosmos-server",
"version": "0.9.0-unstable9",
"version": "0.9.0-unstable10",
"description": "",
"main": "test-server.js",
"bugs": {

View file

@ -196,7 +196,7 @@ func EnsureHostname(next http.Handler) http.Handler {
if !isOk {
Error("Invalid Hostname " + r.Host + " for request. Expecting one of " + fmt.Sprintf("%v", hostnames), nil)
w.WriteHeader(http.StatusBadRequest)
http.Error(w, "Bad Request: Invalid hostname.", http.StatusBadRequest)
http.Error(w, "Bad Request: Invalid hostname. Use your domain instead of your IP to access your server. Check logs if more details are needed.", http.StatusBadRequest)
return
}