[release] v0.9.0-unstable10
This commit is contained in:
parent
9960a37b03
commit
cb4319bee0
|
@ -30,7 +30,7 @@ const NewRouteCreate = ({ openNewModal, setOpenNewModal, config }) => {
|
||||||
const routes = config.HTTPConfig.ProxyConfig.Routes || [];
|
const routes = config.HTTPConfig.ProxyConfig.Routes || [];
|
||||||
|
|
||||||
return <>
|
return <>
|
||||||
<RestartModal openModal={openRestartModal} setOpenModal={setOpenRestartModal} config={config} />
|
<RestartModal openModal={openRestartModal} setOpenModal={setOpenRestartModal} config={config} newRoute />
|
||||||
<Dialog open={openNewModal} onClose={() => setOpenNewModal(false)}>
|
<Dialog open={openNewModal} onClose={() => setOpenNewModal(false)}>
|
||||||
<DialogTitle>New URL</DialogTitle>
|
<DialogTitle>New URL</DialogTitle>
|
||||||
{openNewModal && <>
|
{openNewModal && <>
|
||||||
|
|
|
@ -34,27 +34,46 @@ function checkIsOnline() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const RestartModal = ({openModal, setOpenModal, config}) => {
|
const RestartModal = ({openModal, setOpenModal, config, newRoute }) => {
|
||||||
const [isRestarting, setIsRestarting] = useState(false);
|
const [isRestarting, setIsRestarting] = useState(false);
|
||||||
const [warn, setWarn] = useState(false);
|
const [warn, setWarn] = useState(false);
|
||||||
const needsRefresh = config && (config.HTTPConfig.HTTPSCertificateMode == "SELFSIGNED" ||
|
const needsRefresh = config && (config.HTTPConfig.HTTPSCertificateMode == "SELFSIGNED" ||
|
||||||
!isDomain(config.HTTPConfig.Hostname))
|
!isDomain(config.HTTPConfig.Hostname))
|
||||||
const isNotDomain = config && !isDomain(config.HTTPConfig.Hostname);
|
const isNotDomain = config && !isDomain(config.HTTPConfig.Hostname);
|
||||||
|
const newRouteWarning = config.HTTPConfig.HTTPSCertificateMode == "LETSENCRYPT" && newRoute &&
|
||||||
|
!config.HTTPConfig.DNSChallengeProvider;
|
||||||
|
|
||||||
return config ? (needsRefresh && <>
|
return config ? (<>
|
||||||
<Dialog open={openModal} onClose={() => setOpenModal(false)}>
|
{needsRefresh && <>
|
||||||
<DialogTitle>Refresh Page</DialogTitle>
|
<Dialog open={openModal} onClose={() => setOpenModal(false)}>
|
||||||
<DialogContent>
|
<DialogTitle>Refresh Page</DialogTitle>
|
||||||
<DialogContentText>
|
<DialogContent>
|
||||||
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>
|
||||||
</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.'}
|
||||||
</DialogContent>
|
</DialogContentText>
|
||||||
<DialogActions>
|
</DialogContent>
|
||||||
<Button onClick={() => {
|
<DialogActions>
|
||||||
window.location.reload(true);
|
<Button onClick={() => {
|
||||||
}}>Refresh</Button>
|
window.location.reload(true);
|
||||||
</DialogActions>
|
}}>Refresh</Button>
|
||||||
</Dialog>
|
</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)}>
|
<Dialog open={openModal} onClose={() => setOpenModal(false)}>
|
||||||
|
|
|
@ -96,7 +96,7 @@ const NewDockerService = ({service, refresh}) => {
|
||||||
|
|
||||||
return <div style={{ maxWidth: '1000px', width: '100%', margin: '', position: 'relative' }}>
|
return <div style={{ maxWidth: '1000px', width: '100%', margin: '', position: 'relative' }}>
|
||||||
<MainCard title="Create Service">
|
<MainCard title="Create Service">
|
||||||
<RestartModal openModal={openModal} setOpenModal={setOpenModal} config={config} />
|
<RestartModal openModal={openModal} setOpenModal={setOpenModal} config={config} newRoute />
|
||||||
<Stack spacing={1}>
|
<Stack spacing={1}>
|
||||||
{!isDone && <LoadingButton
|
{!isDone && <LoadingButton
|
||||||
onClick={create}
|
onClick={create}
|
||||||
|
|
|
@ -127,7 +127,7 @@ const ServApps = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
return <div>
|
return <div>
|
||||||
<RestartModal openModal={openRestartModal} setOpenModal={setOpenRestartModal} config={config} />
|
<RestartModal openModal={openRestartModal} setOpenModal={setOpenRestartModal} config={config} newRoute />
|
||||||
<ExposeModal
|
<ExposeModal
|
||||||
openModal={openModal}
|
openModal={openModal}
|
||||||
setOpenModal={setOpenModal}
|
setOpenModal={setOpenModal}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "cosmos-server",
|
"name": "cosmos-server",
|
||||||
"version": "0.9.0-unstable9",
|
"version": "0.9.0-unstable10",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "test-server.js",
|
"main": "test-server.js",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
|
|
@ -196,7 +196,7 @@ func EnsureHostname(next http.Handler) http.Handler {
|
||||||
if !isOk {
|
if !isOk {
|
||||||
Error("Invalid Hostname " + r.Host + " for request. Expecting one of " + fmt.Sprintf("%v", hostnames), nil)
|
Error("Invalid Hostname " + r.Host + " for request. Expecting one of " + fmt.Sprintf("%v", hostnames), nil)
|
||||||
w.WriteHeader(http.StatusBadRequest)
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue