fix: allow gateway access with open ACL policy
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -73,16 +73,31 @@ export class HeadscaleAdapter {
|
|||||||
unresolved: string[]
|
unresolved: string[]
|
||||||
error?: string
|
error?: string
|
||||||
}> {
|
}> {
|
||||||
|
const gatewaySources = [...new Set(
|
||||||
|
config.headscaleGatewayUsers.map((user) => this.toHeadscaleUserName(user)),
|
||||||
|
)]
|
||||||
const policy: HeadscalePolicy = {
|
const policy: HeadscalePolicy = {
|
||||||
groups: {},
|
groups: {},
|
||||||
tagOwners: {
|
tagOwners: {
|
||||||
'tag:teaching-device': [`${config.headscaleTeachingDeviceOwner}@`],
|
'tag:teaching-device': [`${config.headscaleTeachingDeviceOwner}@`],
|
||||||
},
|
},
|
||||||
acls: [{
|
acls: [
|
||||||
|
{
|
||||||
action: 'accept',
|
action: 'accept',
|
||||||
src: ['*'],
|
src: ['*'],
|
||||||
dst: ['*:*'],
|
dst: ['*:*'],
|
||||||
}],
|
},
|
||||||
|
{
|
||||||
|
action: 'accept',
|
||||||
|
src: gatewaySources,
|
||||||
|
dst: ['*:*'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
action: 'accept',
|
||||||
|
src: ['tag:teaching-device'],
|
||||||
|
dst: ['*:*'],
|
||||||
|
},
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = await this.applyPolicy(policy)
|
const result = await this.applyPolicy(policy)
|
||||||
|
|||||||
Reference in New Issue
Block a user