Docker updates
This commit is contained in:
parent
e556cdceba
commit
bef49705a4
8 changed files with 50 additions and 34 deletions
10
.gitpod.yml
Normal file
10
.gitpod.yml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
# This configuration file was automatically generated by Gitpod.
|
||||
# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml)
|
||||
# and commit this file to your remote git repository to share the goodness with others.
|
||||
|
||||
# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart
|
||||
|
||||
tasks:
|
||||
- init: make
|
||||
|
||||
|
||||
5
Makefile
5
Makefile
|
|
@ -62,9 +62,8 @@ force-run-migrations:
|
|||
docker-compose -p link-docker-compose exec zammad-railsserver bundle exec rails r 'require "/opt/zammad/db/addon/cdr_signal/20210525091356_cdr_signal_channel.rb";require "/opt/zammad/db/addon/cdr_voice/20210525091357_cdr_voice_channel.rb";require "/opt/zammad/db/addon/cdr_whatsapp/20210525091358_cdr_whatsapp_channel.rb"; require "/opt/zammad/db/addon/pgpsupport/20220403000001_pgpsupport.rb";CdrSignalChannel.new.up;CdrVoiceChannel.new.up;CdrWhatsappChannel.new.up;PGPSupport.new.up;'
|
||||
|
||||
sso:
|
||||
docker-compose -p link-docker-compose exec zammad-nginx sed -i '/proxy_pass http:\/\/zammad-railsserver;/a proxy_set_header X-Forwarded-Ssl on;' /opt/zammad/contrib/nginx/zammad.conf;
|
||||
docker-compose -p link-docker-compose exec zammad-nginx sed -i '/proxy_pass http:\/\/zammad-websocket;/a proxy_set_header X-Forwarded-Ssl on;' /opt/zammad/contrib/nginx/zammad.conf;
|
||||
docker-compose -p link-docker-compose exec zammad-nginx service nginx restart;
|
||||
docker-compose -p link-shell exec zammad-nginx sed -i '/proxy_set_header X-Forwarded-User "";/d' /opt/zammad/contrib/nginx/zammad.conf;
|
||||
docker-compose -p link-shell exec zammad-nginx service nginx restart;
|
||||
|
||||
start:
|
||||
CURRENT_UID=$(CURRENT_UID) docker-compose up -d
|
||||
|
|
|
|||
|
|
@ -192,23 +192,23 @@ services:
|
|||
- /var/run/docker.sock:/tmp/docker.sock:ro
|
||||
|
||||
link-shell:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./link/Dockerfile
|
||||
build: ./link
|
||||
expose:
|
||||
- "3000"
|
||||
ports:
|
||||
- "8003:3000"
|
||||
environment:
|
||||
ZAMMAD_PROXY_URL: ${ZAMMAD_PROXY_URL}
|
||||
ZAMMAD_URL: ${ZAMMAD_URL}
|
||||
ZAMMAD_API_TOKEN: ${ZAMMAD_API_TOKEN}
|
||||
ZAMMAD_VIRUAL_HOST: ${ZAMMAD_VIRTUAL_HOST}
|
||||
|
||||
zammad-proxy:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./zammad-proxy/Dockerfile
|
||||
build: ./zammad-proxy
|
||||
expose:
|
||||
- "3000"
|
||||
ports:
|
||||
- "8004:3000"
|
||||
environment:
|
||||
ZAMMAD_URL: ${ZAMMAD_URL}
|
||||
ZAMMAD_API_TOKEN: ${ZAMMAD_API_TOKEN}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ export const ZammadWrapper: FC<ZammadWrapperProps> = ({
|
|||
url,
|
||||
hideSidebar = true,
|
||||
}) => {
|
||||
const [display, setDisplay] = useState("none");
|
||||
const [display, setDisplay] = useState("inherit");
|
||||
|
||||
return (
|
||||
<Iframe
|
||||
|
|
|
|||
|
|
@ -12,12 +12,16 @@ module.exports = {
|
|||
},
|
||||
];
|
||||
},
|
||||
rewrites: async () => ({
|
||||
fallback: [
|
||||
async rewrites() {
|
||||
return [
|
||||
{
|
||||
source: "/:path*",
|
||||
destination: "/zammad/:path*",
|
||||
source: "/zammad",
|
||||
destination: `http://link-shell-zammad-proxy-1:3000`,
|
||||
},
|
||||
{
|
||||
source: "/zammad/:path*",
|
||||
destination: `http://link-shell-zammad-proxy-1:3000/:path*`,
|
||||
},
|
||||
];
|
||||
},
|
||||
],
|
||||
}),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ const Home = () => (
|
|||
width: "100%",
|
||||
}}
|
||||
>
|
||||
<ZammadWrapper url="http://localhost:3000/zammad/#dashboard" />
|
||||
<ZammadWrapper url="https://8003-digiresilienc-linkshell-c2tqwgcccbs.ws-eu86.gitpod.io/zammad/#dashboard" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Layout>
|
||||
|
|
|
|||
7
zammad-proxy/docker-entrypoint.sh
Normal file
7
zammad-proxy/docker-entrypoint.sh
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
cd ${APP_DIR}
|
||||
echo "starting shell app"
|
||||
exec dumb-init npm run start
|
||||
|
|
@ -5,12 +5,12 @@ export function middleware(request: NextRequest) {
|
|||
console.log("INTO middleware")
|
||||
const path = request.nextUrl.pathname
|
||||
console.log({ path })
|
||||
if (path.startsWith('/zammad')) {
|
||||
|
||||
console.log("INTO middleware 2")
|
||||
const finalURL = new URL(path.replace("/zammad", ""), process.env.ZAMMAD_URL)
|
||||
console.log(finalURL.toString())
|
||||
|
||||
const requestHeaders = new Headers()
|
||||
const requestHeaders = new Headers(request.headers)
|
||||
requestHeaders.set('X-Forwarded-User', 'darren@redaranj.com')
|
||||
requestHeaders.set('Host', 'zammad.example.com')
|
||||
|
||||
|
|
@ -20,8 +20,4 @@ export function middleware(request: NextRequest) {
|
|||
headers: requestHeaders
|
||||
}
|
||||
})
|
||||
} else {
|
||||
console.log("INTO middleware 3")
|
||||
return NextResponse.next()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue