Compare commits

..

1 Commits

Author SHA1 Message Date
Fijxu bebb0b18d3
Add actions support for 4get docker image builds 2025-02-04 18:50:05 -03:00
5 changed files with 113 additions and 73 deletions

48
.gitea/workflows/ci.yml Normal file
View File

@ -0,0 +1,48 @@
name: '4get CI'
on:
workflow_dispatch:
push:
branches:
- 'master'
paths-ignore:
- 'README.md'
- 'docker-compose.yaml'
- '.gitignore'
- 'docs/**'
jobs:
build:
runs-on: docker
steps:
- uses: actions/checkout@v4
name: Checkout 4get repository
- uses: docker/setup-buildx-action@v3
name: Setup Docker BuildX system
- name: Login to Docker Container Registry
uses: docker/login-action@v3
with:
registry: git.lolcat.ca
username: ${{ secrets.USERNAME }}
password: ${{ secrets.TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: git.lolcat.ca/lolcat/4get
tags: |
type=sha,format=short,prefix={{date 'YYYY.MM.DD'}}-,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
- uses: docker/build-push-action@v6
name: Build images
with:
context: .
file: Dockerfile
tags: ${{ steps.meta.outputs.tags }}
platforms: linux/amd64
push: true

View File

@ -15,12 +15,7 @@ class favicon{
header("Content-Type: image/png");
if(
preg_match(
'/^https?:\/\/[A-Za-z0-9.-]+$/',
$url
) === 0
){
if(substr_count($url, "/") !== 2){
header("X-Error: Only provide the protocol and domain");
$this->defaulticon();

View File

@ -285,7 +285,6 @@ class ddg{
"display" => "NSFW",
"option" => [
"yes" => "Yes",
"maybe" => "Maybe",
"no" => "No"
]
],
@ -1346,7 +1345,7 @@ class ddg{
$get_filters["iaf"] = $filters;
}
$nsfw = $get["nsfw"] == "yes" ? "-1" : "1";
$nsfw = $get["nsfw"] == "yes" ? "-2" : "-1";
$get_filters["kp"] = $nsfw;
try{
@ -1499,12 +1498,8 @@ class ddg{
"ia" => "videos"
];
switch($get["nsfw"]){
case "yes": $nsfw = "-2"; break;
case "maybe": $nsfw = "-1"; break;
case "no": $nsfw = "1"; break;
}
$nsfw = $get["nsfw"] == "yes" ? "-2" : "-1";
$get_filters["kp"] = $nsfw;
$filters = [];

View File

@ -37,7 +37,7 @@ class yandex{
"Accept-Encoding: gzip",
"Accept-Language: en-US,en;q=0.5",
"DNT: 1",
"Cookie: yp=" . (time() - 4000033) . ".szm.1:1920x1080:876x1000#" . time() . ".sp.family:" . $nsfw,
"Cookie: yp=1716337604.sp.family%3A{$nsfw}#1685406411.szm.1:1920x1080:1920x999",
"Referer: https://yandex.com/images/search",
"Connection: keep-alive",
"Upgrade-Insecure-Requests: 1",
@ -668,6 +668,7 @@ class yandex{
foreach($json["blocks"] as $block){
$html .= $block["html"];
// get next page
if(
isset($block["params"]["nextPageUrl"]) &&

View File

@ -1,45 +1,48 @@
:root{
--1d2021:#1d2021;
--282828:#282828;
--3c3836:#3c3836;
--504945:#504945;
--1d2021: #1d2021;
--282828: #282828;
--3c3836: #3c3836;
--504945: #504945;
/* font */
--928374:#928374;
--a89984:#c9c5bf;
--bdae93:#bdae93;
--8ec07c:#8ec07c;
--ebdbb2:#ebdbb2;
--928374: #928374;
--a89984: #c9c5bf;
--bdae93: #bdae93;
--8ec07c: #8ec07c;
--ebdbb2: #ebdbb2;
}
body{
padding:15px 4% 40px;
margin:unset;
}
h1, h2, h3, h4, h5, h6{
h1,h2,h3,h4,h5,h6{
padding:0;
margin:0 0 7px 0;
line-height:initial;
color:var(--bdae93);
}
h3, h4, h5, h6{
h3,h4,h5,h6{
margin-bottom:14px;
}
/*
Web styles
Web styles
*/
.searchbox input[type="submit"]{
float:right;
cursor:pointer;
padding:0 10px;
border-left:1px solid var(--504945);
background:#723c0b;
border-left: 1px solid var(--504945);
background: #723c0b;
}
.searchbox input{
all:unset;
line-height:36px;
@ -94,6 +97,7 @@ h3, h4, h5, h6{
display:inline-block;
}
.tabs .tab.selected{
border-bottom:2px solid #fc92a5;
}
@ -103,7 +107,7 @@ h3, h4, h5, h6{
padding-bottom:12px;
padding-top:7px;
margin-bottom:7px;
background-color:#232525;
background-color:#232525
}
.filters .filter{
@ -166,6 +170,7 @@ h3, h4, h5, h6{
font-size:12px;
}
.web .hover{
display:block;
text-decoration:none;
@ -189,13 +194,16 @@ h3, h4, h5, h6{
color:#9760b1 !important;
}
.web .text-result .greentext{
font-size:14px;
color:var(--bdae93);
}
/* favicon */
.favicon-dropdown a{
text-decoration:none;
color:#d3d0c1;
@ -204,33 +212,39 @@ h3, h4, h5, h6{
font-size:13px;
}
.web .favicon img, .favicon-dropdown img{
.web .favicon img,
.favicon-dropdown img{
margin:3px 7px 0 0;
height:16px;
font-size:12px;
line-height:16px;
line-height:16px;;
display:block;
text-align:left;
}
.web .sublinks{
padding:17px 10px;
font-size:15px;
color:var(--#928374);
}
.web .text-result .sublinks:last-child{
padding-bottom:0;
}
/* Wikipedia head */
.wiki-head{
padding:5px;
background-color:#322f2b;
background-color: #322f2b
}
/*
Images tab
Images tab
*/
#images{
@ -244,14 +258,17 @@ h3, h4, h5, h6{
float:left;
}
#images .image .title{
white-space:nowrap;
overflow:hidden;
margin-bottom:7px;
font-weight:bold;
color:var(--bdae93);
color:var(--bdae93);
}
#popup-status{
display:none;
position:fixed;
@ -264,59 +281,43 @@ h3, h4, h5, h6{
}
/*
Settings page
Settings page
*/
.web .settings-submit a{
margin-right:17px;
color:#bdae93;
}
/*
Responsive image
*/
@media only screen and (max-width:1454px){
#images .image-wrapper{
width:25%;
}
}
@media only screen and (max-width:1161px){
#images .image-wrapper{
width:25%;
}
}
@media only screen and (max-width:750px){
#images .image-wrapper{
width:50%;
}
}
@media only screen and (max-width:450px){
#images .image-wrapper{
width:100%;
}
}
/*
Responsive design
Responsive image
*/
@media only screen and (max-width: 1454px){ #images .image-wrapper{ width:25%; } }
@media only screen and (max-width: 1161px){ #images .image-wrapper{ width:25%; } }
@media only screen and (max-width: 750px){ #images .image-wrapper{ width:50%; } }
@media only screen and (max-width: 450px){ #images .image-wrapper{ width:100%; } }
@media only screen and (max-width:1550px){
.web .left,
/*
Responsive design
*/
@media only screen and (max-width: 1550px){
.web .left,
.searchbox{
width:60%;
}
}
@media only screen and (max-width:1100px){
.web .left,
.searchbox{
width:100%;
}
@media only screen and (max-width: 1000px){
}
.type{
color:var(--bdae93);
.type{
color:var(--bdae93);
}
}